.cch-v4, .cch-v4 * { box-sizing: border-box; }
.cch-v4 :where(button, input, select, textarea) { font: inherit; }
.cch-v4 :where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cch-v4-focus) 64%, transparent);
  outline-offset: 2px;
}
.cch-v4 .cch-v4-shell { min-height: 100vh; background: var(--cch-v4-bg-primary); }
.cch-v4 .cch-v4-container { width: min(100% - 32px, var(--cch-v4-content-max)); margin-inline: auto; }
.cch-v4 .cch-v4-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: var(--cch-v4-space-3);
}
.cch-v4 .cch-v4-tile {
  position: relative;
  min-height: var(--cch-v4-tile-small);
  display: flex;
  align-items: flex-end;
  gap: var(--cch-v4-space-4);
  padding: var(--cch-v4-space-5);
  border: 1px solid var(--cch-v4-border);
  border-radius: var(--cch-v4-radius-card);
  background: var(--cch-v4-surface);
  color: var(--cch-v4-text-primary);
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--cch-v4-motion-fast) var(--cch-v4-ease), border-color var(--cch-v4-motion-fast), background var(--cch-v4-motion-fast);
}
.cch-v4 .cch-v4-tile:hover { transform: translateY(-2px); border-color: var(--cch-v4-border-strong); background: var(--cch-v4-surface-raised); }
.cch-v4 .cch-v4-tile:active { transform: translateY(1px) scale(.995); }
.cch-v4 .cch-v4-tile[aria-current="page"], .cch-v4 .cch-v4-tile.is-active { border-color: var(--cch-v4-accent-soft); background: var(--cch-v4-surface-active); }
.cch-v4 .cch-v4-tile:disabled, .cch-v4 .cch-v4-tile.is-disabled { opacity: .46; cursor: not-allowed; transform: none; }
.cch-v4 .cch-v4-tile--small { grid-column: span 1; }
.cch-v4 .cch-v4-tile--medium { grid-column: span 2; }
.cch-v4 .cch-v4-tile--wide { grid-column: span 3; }
.cch-v4 .cch-v4-tile--large { grid-column: span 2; grid-row: span 2; min-height: var(--cch-v4-tile-large); }
.cch-v4 .cch-v4-tile--primary { border-color: #238ee0; background: var(--cch-v4-accent); }
.cch-v4 .cch-v4-tile--primary:hover { border-color: #8dd5ff; background: var(--cch-v4-accent-strong); }
.cch-v4 .cch-v4-tile__icon { width: 58px; height: 58px; flex: 0 0 auto; color: var(--cch-v4-accent-soft); }
.cch-v4 .cch-v4-tile--primary .cch-v4-tile__icon { color: #fff; width: 82px; height: 82px; }
.cch-v4 .cch-v4-tile__copy { min-width: 0; display: grid; gap: var(--cch-v4-space-1); }
.cch-v4 .cch-v4-tile__copy strong { font-size: var(--cch-v4-font-lg); line-height: 1.2; }
.cch-v4 .cch-v4-tile__copy small { color: var(--cch-v4-text-secondary); font-size: var(--cch-v4-font-sm); line-height: 1.35; }
.cch-v4 .cch-v4-tile--primary .cch-v4-tile__copy small { color: #e8f6ff; }

.cch-v4 .cch-v4-button {
  min-width: 44px; min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--cch-v4-border); border-radius: var(--cch-v4-radius-control);
  background: var(--cch-v4-surface-raised); color: var(--cch-v4-text-primary);
  font-size: var(--cch-v4-font-sm); font-weight: 700; cursor: pointer;
  transition: background var(--cch-v4-motion-fast), border-color var(--cch-v4-motion-fast), transform var(--cch-v4-motion-fast);
}
.cch-v4 .cch-v4-button:hover { border-color: var(--cch-v4-border-strong); background: var(--cch-v4-surface-active); }
.cch-v4 .cch-v4-button:active { transform: translateY(1px); }
.cch-v4 .cch-v4-button--primary { border-color: var(--cch-v4-accent); background: var(--cch-v4-accent); color: #fff; }
.cch-v4 .cch-v4-button--danger { border-color: color-mix(in srgb, var(--cch-v4-danger) 65%, var(--cch-v4-border)); color: #ffabb4; }
.cch-v4 .cch-v4-button:disabled { opacity: .46; cursor: not-allowed; }
.cch-v4 .cch-v4-field { display: grid; gap: 7px; color: var(--cch-v4-text-secondary); font-size: var(--cch-v4-font-sm); font-weight: 650; }
.cch-v4 :where(.cch-v4-input, .cch-v4-select, .cch-v4-textarea) {
  width: 100%; min-height: 46px; padding: 0 13px;
  border: 1px solid var(--cch-v4-border); border-radius: var(--cch-v4-radius-control);
  background: var(--cch-v4-input); color: var(--cch-v4-text-primary); outline: 0;
}
.cch-v4 .cch-v4-textarea { min-height: 104px; padding-block: 12px; resize: vertical; }
.cch-v4 :where(.cch-v4-input, .cch-v4-select, .cch-v4-textarea):focus { border-color: var(--cch-v4-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cch-v4-focus) 18%, transparent); }
.cch-v4 .cch-v4-card { border: 1px solid var(--cch-v4-border); border-radius: var(--cch-v4-radius-card); background: var(--cch-v4-surface); box-shadow: var(--cch-v4-shadow-sm); }
.cch-v4 .cch-v4-list { display: grid; gap: var(--cch-v4-space-2); }
.cch-v4 .cch-v4-list-row { min-height: 68px; padding: var(--cch-v4-space-3) var(--cch-v4-space-4); display: flex; align-items: center; gap: var(--cch-v4-space-4); border: 1px solid var(--cch-v4-border); border-radius: var(--cch-v4-radius-card); background: var(--cch-v4-surface); }
.cch-v4 .cch-v4-status { display: inline-flex; align-items: center; gap: 8px; color: var(--cch-v4-text-secondary); }
.cch-v4 .cch-v4-status::before { width: 9px; height: 9px; border-radius: 50%; background: currentColor; content: ""; }
.cch-v4 .cch-v4-status--success { color: var(--cch-v4-success); }
.cch-v4 .cch-v4-status--warning { color: var(--cch-v4-warning); }
.cch-v4 .cch-v4-status--danger { color: var(--cch-v4-danger); }
.cch-v4 .cch-v4-dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .72); }
.cch-v4 .cch-v4-dialog { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: var(--cch-v4-space-5); border: 1px solid var(--cch-v4-border-strong); border-radius: var(--cch-v4-radius-dialog); background: var(--cch-v4-bg-secondary); box-shadow: var(--cch-v4-shadow-lg); }
.cch-v4 .cch-v4-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--cch-v4-border); }
.cch-v4 .cch-v4-toast { position: fixed; right: 20px; bottom: 20px; z-index: 140; max-width: min(420px, calc(100vw - 40px)); padding: 14px 16px; border: 1px solid var(--cch-v4-border-strong); border-radius: var(--cch-v4-radius-control); background: var(--cch-v4-surface-raised); box-shadow: var(--cch-v4-shadow-lg); }
.cch-v4 .cch-v4-spinner { width: 28px; height: 28px; border: 3px solid var(--cch-v4-border); border-top-color: var(--cch-v4-accent); border-radius: 50%; animation: cch-v4-spin .8s linear infinite; }
@keyframes cch-v4-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cch-v4 *, .cch-v4 *::before, .cch-v4 *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  .cch-v4 .cch-v4-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cch-v4 .cch-v4-tile--wide { grid-column: span 4; }
}
@media (max-width: 640px) {
  .cch-v4 .cch-v4-container { width: min(100% - 24px, var(--cch-v4-content-max)); }
  .cch-v4 .cch-v4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cch-v4 .cch-v4-tile { min-height: 118px; padding: 14px; align-items: flex-start; flex-direction: column; justify-content: space-between; }
  .cch-v4 .cch-v4-tile--wide { grid-column: span 2; min-height: 132px; flex-direction: row; align-items: center; }
  .cch-v4 .cch-v4-tile--medium, .cch-v4 .cch-v4-tile--large { grid-column: span 1; grid-row: span 1; }
  .cch-v4 .cch-v4-tile__icon { width: 42px; height: 42px; }
  .cch-v4 .cch-v4-tile--primary .cch-v4-tile__icon { width: 64px; height: 64px; }
  .cch-v4 .cch-v4-tile__copy strong { font-size: .94rem; }
  .cch-v4 .cch-v4-tile__copy small { display: none; }
  .cch-v4 .cch-v4-dialog-backdrop { align-items: end; padding: 0; }
  .cch-v4 .cch-v4-dialog { width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
}
