:root {
  --primary: #8601da;
  --primary-700: #6a00ae;
  --primary-800: #520087;
  --primary-500: #9a2be6;
  --primary-300: #c78bf0;
  --primary-100: #f1e3ff;
  --primary-50: #faf5ff;
  --ink: #1a1025;
  --ink-soft: #382d44;
  --muted: #6b6475;
  --muted-2: #8d8697;
  --surface: #ffffff;
  --canvas: #faf8fc;
  --canvas-2: #f4eff9;
  --border: #e7dff0;
  --border-strong: #d7cbe4;
  --success: #0f766e;
  --success-bg: #e7f6f3;
  --warning: #b45309;
  --warning-bg: #fff5e6;
  --danger: #b42318;
  --danger-bg: #fef1f0;
  --info: #1d4ed8;
  --info-bg: #eef3ff;
  --gold: #c98a12;
  --gold-bg: #fff8e6;

  --shadow-xs: 0 1px 2px rgba(26, 16, 37, 0.05);
  --shadow-sm: 0 2px 8px rgba(26, 16, 37, 0.06);
  --shadow-md: 0 12px 28px rgba(26, 16, 37, 0.09);
  --shadow-lg: 0 24px 60px rgba(26, 16, 37, 0.14);
  --shadow-primary: 0 12px 28px rgba(134, 1, 218, 0.24);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 999px;

  --header-h: 76px;
  --bottom-nav-h: 68px;
  --sidebar-w: 264px;
  --container: 1240px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.15rem, 6vw, 4.1rem);
}

h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.65rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

h4 {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

p {
  color: var(--ink-soft);
}

small {
  font-size: 0.78rem;
}

strong {
  font-weight: 700;
}

::selection {
  background: var(--primary);
  color: #fff;
}

:focus-visible {
  outline: 3px solid rgba(134, 1, 218, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

.container-narrow {
  width: min(860px, calc(100% - 32px));
  margin-inline: auto;
}

.section {
  padding: clamp(52px, 8vw, 96px) 0;
}

.section-sm {
  padding: clamp(36px, 5vw, 56px) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.section-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}

.section-head p {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--primary-700);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.eyebrow-plain::before {
  display: none;
}

.font-display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.text-muted {
  color: var(--muted);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: 0.86rem;
}

.text-xs {
  font-size: 0.76rem;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mt-6 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

.grid {
  display: grid;
}

.w-full {
  width: 100%;
}

.relative {
  position: relative;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s, border-color 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  box-shadow: 0 8px 18px rgba(134, 1, 218, 0.2);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  --btn-bg: var(--primary-100);
  --btn-color: var(--primary-700);
}

.btn-secondary:hover {
  --btn-bg: #e8d2fb;
}

.btn-outline {
  --btn-bg: transparent;
  --btn-color: var(--ink);
  --btn-border: var(--border-strong);
}

.btn-outline:hover {
  --btn-border: var(--primary);
  --btn-color: var(--primary-700);
  background: var(--primary-50);
}

.btn-white {
  --btn-bg: #fff;
  --btn-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-white:hover {
  --btn-color: var(--primary-700);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--canvas-2);
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-color: #fff;
}

.btn-danger:hover {
  --btn-bg: #931c13;
}

.btn-success {
  --btn-bg: var(--success);
  --btn-color: #fff;
}

.btn-sm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 0.8rem;
  gap: 7px;
}

.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 0.98rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}

.btn-icon:hover {
  background: var(--canvas-2);
  transform: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--ink-soft);
  transition: background 0.18s, color 0.18s;
}

.icon-btn:hover {
  background: var(--canvas-2);
  color: var(--primary-700);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn .icon {
  flex: none;
}

/* Badges and chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--canvas-2);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-gold {
  background: var(--gold-bg);
  color: var(--gold);
}

.badge-dark {
  background: rgba(26, 16, 37, 0.82);
  color: #fff;
  backdrop-filter: blur(8px);
}

.badge-soft {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.18s;
}

.chip:hover {
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--canvas-2);
  color: var(--muted);
  font-size: 0.68rem;
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-pad {
  padding: clamp(18px, 3vw, 26px);
}

.card-hover {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-body {
  padding: 20px;
}

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 0.78rem;
  font-weight: 800;
  flex: none;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 0.62rem;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 1rem;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 1.5rem;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -10px;
  border: 2px solid #fff;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar-success { background: var(--success-bg); color: var(--success); }
.avatar-warning { background: var(--warning-bg); color: var(--warning); }
.avatar-danger { background: var(--danger-bg); color: var(--danger); }
.avatar-gold { background: var(--gold-bg); color: var(--gold); }
.avatar-dark { background: var(--ink); color: #fff; }

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label,
.label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field label .req {
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #aaa2b3;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c2b0d6;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(134, 1, 218, 0.1);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.field-hint {
  font-size: 0.74rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.74rem;
  color: var(--danger);
  font-weight: 600;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.input-icon-wrap .input {
  padding-left: 42px;
}

.input-group {
  display: flex;
}

.input-group .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex: none;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
}

.radio-card:hover {
  border-color: var(--primary-300);
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary);
}

.radio-card input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: var(--primary-50);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.cell-title {
  font-weight: 700;
  color: var(--ink);
}

.cell-sub {
  font-size: 0.73rem;
  color: var(--muted);
}

.cell-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.thumb-sm {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  object-fit: cover;
}

.cell-main {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

/* Progress */
.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--canvas-2);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.6s var(--ease);
}

.progress-success > span { background: var(--success); }
.progress-warning > span { background: var(--warning); }
.progress-danger > span { background: var(--danger); }

.progress-lg {
  height: 10px;
}

.progress-sm {
  height: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--primary-700);
}

.tab.active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.segmented button,
.segmented a {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.segmented .active {
  background: var(--ink);
  color: #fff;
}

/* Empty, loading, divider */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: var(--primary-50);
  color: var(--primary);
}

.empty-state h4 {
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.86rem;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 20px 0;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--canvas-2);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Boot */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100vh;
  color: var(--muted);
  font-size: 0.86rem;
}

.boot-mark {
  animation: bootPulse 1.6s ease-in-out infinite;
}

@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* Toast */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--ink-soft);
  font-size: 0.82rem;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease);
}

.toast .icon {
  flex: none;
  margin-top: 1px;
}

.toast-success .icon { color: var(--success); }
.toast-danger .icon { color: var(--danger); }
.toast-info .icon { color: var(--info); }
.toast-warning .icon { color: var(--warning); }

.toast strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
  margin-bottom: 1px;
}

.toast.is-out {
  animation: toastOut 0.25s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* Overlay, modal, drawer, sheet */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  background: rgba(26, 16, 37, 0.48);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

.overlay.is-closing {
  animation: fadeOut 0.2s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

@keyframes fadeOut {
  to { opacity: 0; }
}

.modal {
  position: relative;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s var(--ease);
}

.modal-lg {
  width: min(760px, calc(100% - 32px));
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.modal-head h3 {
  font-size: 1.1rem;
}

.modal-body {
  padding: 22px;
}

.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: flex-end;
  background: rgba(26, 16, 37, 0.44);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}

.drawer {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: drawerIn 0.3s var(--ease);
}

.drawer-wide {
  width: min(720px, 100%);
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h3 {
  font-size: 1.15rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  overscroll-behavior: contain;
}

.drawer-foot {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.drawer-foot .btn {
  flex: 1;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  background: rgba(26, 16, 37, 0.46);
  animation: fadeIn 0.2s;
}

.sheet {
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  animation: sheetIn 0.3s var(--ease);
}

@keyframes sheetIn {
  from { transform: translateY(100%); }
}

.sheet-grip {
  width: 40px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: var(--border-strong);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
}

.sheet-body {
  padding: 12px 20px 20px;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 220px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: dropdownIn 0.18s var(--ease);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-5px); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--canvas-2);
  color: var(--ink);
}

.dropdown-item .icon {
  color: var(--muted);
}

.dropdown-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.dropdown-label {
  padding: 8px 11px 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tooltip-ish */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Utilities */
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-1-1 { aspect-ratio: 1 / 1; }
.cover { width: 100%; height: 100%; object-fit: cover; }
.round { border-radius: var(--radius-md); overflow: hidden; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.bg-primary { background: var(--primary); color: #fff; }
.bg-primary-50 { background: var(--primary-50); }
.bg-canvas { background: var(--canvas); }
.bg-ink { background: var(--ink); color: #fff; }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.no-border { border: 0; }
.pointer { cursor: pointer; }

/* Responsive base */
@media (max-width: 639px) {
  .container {
    width: calc(100% - 28px);
  }

  .section {
    padding: 44px 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
  }

  h1 {
    font-size: clamp(2rem, 9.5vw, 2.7rem);
  }

  h2 {
    font-size: clamp(1.55rem, 6.4vw, 2rem);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .toast-root {
    right: 16px;
    bottom: 82px;
    left: 16px;
    width: auto;
  }

  .drawer {
    width: 100%;
  }

  .modal {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
  }

  .modal-foot {
    flex-direction: column-reverse;
  }

  .modal-foot .btn {
    width: 100%;
  }

  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .mobile-only {
    display: none !important;
  }
}

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