/* ==========================================================================
   Components — shared across marketing, portal and admin
   ========================================================================== */

/* --- Buttons ------------------------------------------------------------- */
.btn {
  --bh: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--bh);
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-weight: 650;
  font-size: .9375rem;
  letter-spacing: -.005em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  background: var(--bone-4);
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
  transition: background var(--t) var(--ease-out), border-color var(--t) var(--ease-out), color var(--t) var(--ease-out), transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.btn:hover { background: var(--bone-8); border-color: var(--bone-20); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-accent);
}
.btn--primary::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--bone);
  transform: translateY(101%);
  border-radius: inherit;
  transition: transform .5s var(--ease-out);
  z-index: -1;
}
.btn--primary:hover { background: var(--amber); border-color: var(--bone); box-shadow: var(--glow-amber); }
.btn--primary:hover::before { transform: translateY(0); }
.btn--bone { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn--bone:hover { background: var(--amber); border-color: var(--amber); color: var(--on-accent); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--bone-8); border-color: transparent; }
.btn--outline { background: transparent; }
.btn--danger { color: var(--ember-hi); border-color: rgba(200, 85, 61, .35); background: var(--ember-15); }
.btn--danger:hover { background: rgba(200, 85, 61, .25); border-color: var(--ember); }
.btn--sm { --bh: 36px; padding: 0 14px; font-size: .8125rem; gap: 8px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { --bh: 58px; padding: 0 30px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--icon { width: var(--bh); padding: 0; }
.btn--sm.btn--icon { width: 36px; }
.btn .btn__label { position: relative; display: inline-block; }
.btn.is-loading { pointer-events: none; color: transparent !important; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--on-accent) transparent var(--on-accent) transparent;
  animation: spin .8s linear infinite;
}
.btn:not(.btn--primary).is-loading::after { border-color: var(--bone) transparent var(--bone) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 650; color: var(--text);
  border-bottom: 1px solid var(--bone-20);
  padding-bottom: 3px;
  transition: border-color var(--t), color var(--t), gap var(--t) var(--ease-out);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--t) var(--ease-out); }
.link-arrow:hover { color: var(--amber); border-color: var(--amber); gap: 12px; }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* --- Tags, chips, badges ------------------------------------------------- */
.tag {
  --tc: var(--bone-60);
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px;
  border-radius: var(--r-pill);
  font-size: .75rem; font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--tc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 28%, transparent);
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tc); flex: none; }
.tag--plain::before { display: none; }
.tag svg { width: 13px; height: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: transparent;
  font-size: .875rem; font-weight: 600; color: var(--text-2);
  transition: all var(--t) var(--ease-out);
  cursor: pointer;
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { color: var(--text); border-color: var(--bone-20); background: var(--bone-4); }
.chip[aria-pressed="true"], .chip.is-active {
  background: var(--bone); color: var(--ink); border-color: var(--bone);
}
.chip .chip__count { font-family: var(--mono); font-size: .7rem; opacity: .6; }

.badge {
  --bc: var(--bone-60);
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .6875rem; font-weight: 500;
  letter-spacing: .02em;
  color: var(--bc);
  background: color-mix(in srgb, var(--bc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc) 22%, transparent);
  white-space: nowrap;
  text-transform: lowercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--dotless::before { display: none; }
.badge--pulse::before { animation: pulse 1.6s var(--ease-out) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* state colours */
.st-ready, .st-approved_shared, .st-trainer_confirmed, .st-accepted, .st-active, .st-completed, .st-assigned, .st-published, .st-ok { --bc: var(--moss-hi); }
.st-needs_review, .st-prepared, .st-pending, .st-processing, .st-uploaded, .st-scheduled, .st-handoff_opened, .st-draft-guide { --bc: var(--amber); }
.st-uploading, .st-created, .st-approved_private, .st-unassigned { --bc: var(--sky); }
.st-failed, .st-cancelled, .st-expired, .st-withdrawn, .st-too_large, .st-quarantined, .st-inactive, .st-error { --bc: var(--ember-hi); }
.st-published_public { --bc: #B497E6; }
.st-draft, .st-archived { --bc: var(--bone-60); }

/* --- Cards & panels ------------------------------------------------------ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
}
.panel { padding: clamp(18px, 2vw, 28px); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* --- Avatars ------------------------------------------------------------- */
.avatar {
  --size: 40px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: calc(var(--size) * .32); font-weight: 600;
  color: var(--ink);
  background: linear-gradient(135deg, var(--amber-hi), var(--amber));
  overflow: hidden;
  border: 1px solid var(--bone-12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { --size: 28px; }
.avatar--lg { --size: 64px; }
.avatar--xl { --size: 96px; }
.avatar--alt { background: linear-gradient(135deg, #CFC6B4, #8F8676); }
.avatar--moss { background: linear-gradient(135deg, var(--moss-hi), #61735A); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* --- Forms --------------------------------------------------------------- */
.field { display: grid; gap: 8px; }
.field__label { font-size: .8125rem; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.field__hint { font-size: .75rem; color: var(--text-3); }
.field__error { font-size: .75rem; color: var(--ember-hi); display: none; align-items: center; gap: 6px; }
.field.is-invalid .field__error { display: flex; }
.field.is-invalid .input, .field.is-invalid .textarea, .field.is-invalid .select { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-15); }
.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--bone-4);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--bone-20); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-20); background: var(--bone-8); outline: none; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23F2EBDD' stroke-opacity='.6' stroke-width='1.6'><path d='M1 1.5l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.select option { background: var(--char); }
.input--sm, .select--sm { min-height: 38px; padding: 7px 12px; font-size: .875rem; border-radius: var(--r-sm); }
.select--sm { padding-right: 34px; background-position: right 12px center; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 42px; }

/* Checkbox */
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: 44px; padding: 10px 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 22px; height: 22px; flex: none; margin-top: 1px;
  border-radius: 7px;
  border: 1.5px solid var(--bone-40);
  display: grid; place-items: center;
  transition: all var(--t) var(--ease-out);
}
.check__box svg { width: 14px; height: 14px; stroke: var(--on-accent); stroke-width: 3; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .4s var(--ease-out) .05s; }
.check input:checked + .check__box { background: var(--amber); border-color: var(--amber); transform: scale(1.05); }
.check input:checked + .check__box svg { stroke-dashoffset: 0; }
.check input:focus-visible + .check__box { outline: 2px solid var(--amber); outline-offset: 3px; }
.check__text { transition: color var(--t), opacity var(--t); }
.check input:checked ~ .check__text { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; }
.check--nostrike input:checked ~ .check__text { text-decoration: none; color: var(--text); }

/* Radio card */
.radio-card {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--bone-4);
  cursor: pointer;
  transition: all var(--t) var(--ease-out);
}
.radio-card:hover { border-color: var(--bone-20); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card__dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--bone-40); flex: none; margin-top: 2px; display: grid; place-items: center; transition: all var(--t); }
.radio-card__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); transform: scale(0); transition: transform var(--t) var(--ease-spring); }
.radio-card:has(input:checked) { border-color: var(--amber); background: var(--amber-12); box-shadow: 0 0 0 3px var(--amber-12); }
.radio-card:has(input:checked) .radio-card__dot { background: var(--amber); border-color: var(--amber); }
.radio-card:has(input:checked) .radio-card__dot::after { transform: scale(1); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 2px; }
.radio-card.is-disabled { opacity: .5; cursor: not-allowed; }
.radio-card__title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.radio-card__desc { font-size: .8125rem; color: var(--text-2); margin-top: 2px; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 46px; height: 28px; border-radius: 99px; background: var(--bone-12); border: 1px solid var(--line-2); position: relative; transition: background var(--t); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--bone); transition: transform var(--t) var(--ease-spring); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + .switch__track { background: var(--amber); border-color: var(--amber); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: var(--ink); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--amber); outline-offset: 3px; }

/* Segmented */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bone-4);
  border: 1px solid var(--line);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  position: relative; z-index: 1;
  min-height: 38px; padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: .8125rem; font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--t);
  display: inline-flex; align-items: center; gap: 7px;
}
.segmented button svg { width: 15px; height: 15px; }
.segmented button[aria-pressed="true"] { color: var(--ink); background: var(--bone); }
.segmented button:not([aria-pressed="true"]):hover { color: var(--text); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  position: relative; min-height: 46px; padding: 0 14px;
  font-weight: 650; font-size: .875rem; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button::after, .tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--amber); transform: scaleX(0); transition: transform var(--t) var(--ease-out); border-radius: 2px; }
.tabs [aria-selected="true"] { color: var(--text); }
.tabs [aria-selected="true"]::after { transform: scaleX(1); }

/* --- Progress ------------------------------------------------------------ */
.progress { height: 6px; border-radius: 99px; background: var(--bone-8); overflow: hidden; position: relative; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--amber), var(--amber-hi)); border-radius: inherit; transition: width .4s var(--ease-out); }
.progress--thin { height: 3px; }
.progress--ember .progress__bar { background: var(--ember); }
.progress--moss .progress__bar { background: var(--moss-hi); }
.progress--striped .progress__bar { background-image: linear-gradient(90deg, var(--amber), var(--amber-hi)), repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,.15) 8px 16px); background-blend-mode: multiply; animation: stripes 1s linear infinite; background-size: 100% 100%, 22px 22px; }
@keyframes stripes { to { background-position: 0 0, 22px 0; } }

.ring { --p: 0; --size: 64px; --stroke: 5px; width: var(--size); height: var(--size); position: relative; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring .ring__bg { stroke: var(--bone-8); }
.ring .ring__fg { stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset 1.2s var(--ease-out); }
.ring__label { font-family: var(--mono); font-size: calc(var(--size) * .22); font-weight: 600; }

/* Confidence bar */
.conf { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.conf__bar { grid-column: 1 / -1; height: 4px; background: var(--bone-8); border-radius: 4px; overflow: hidden; }
.conf__bar span { display: block; height: 100%; width: calc(var(--c) * 100%); background: var(--tc, var(--amber)); border-radius: inherit; transform-origin: left; animation: growX 1s var(--ease-out) both; }
.conf__val { font-family: var(--mono); font-size: .75rem; color: var(--text-2); }
@keyframes growX { from { transform: scaleX(0); } }

/* --- Skeleton / shimmer -------------------------------------------------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bone-8);
  border-radius: 8px;
  min-height: 14px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(232, 163, 61, .14), rgba(242, 235, 221, .1), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.shimmer-text {
  background: linear-gradient(90deg, var(--bone-40) 0%, var(--amber-hi) 40%, var(--bone-40) 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerText 1.6s linear infinite;
}
@keyframes shimmerText { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* --- Toasts -------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 9500;
  right: 16px; bottom: calc(16px + var(--safe-b));
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  background: rgba(30, 27, 21, .92);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  font-size: .875rem; font-weight: 550;
  max-width: 420px;
  animation: toastIn .5s var(--ease-out) both;
}
.toast.is-leaving { animation: toastOut .35s var(--ease-in-out) both; }
.toast__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-20); color: var(--amber); flex: none; }
.toast__icon svg { width: 16px; height: 16px; }
.toast--success .toast__icon { background: var(--moss-20); color: var(--moss-hi); }
.toast--error .toast__icon { background: var(--ember-15); color: var(--ember-hi); }
.toast__action { margin-left: 4px; color: var(--amber); font-weight: 700; min-height: 32px; padding: 0 8px; border-radius: 8px; }
.toast__action:hover { background: var(--amber-12); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@media (max-width: 767px) {
  .toasts { left: 16px; right: 16px; align-items: stretch; bottom: calc(var(--toast-offset, 16px) + var(--safe-b)); }
  .toast { max-width: none; }
}

/* --- Modal / sheet ------------------------------------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 9200; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 7, 5, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .3s ease both; }
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  display: flex; flex-direction: column;
  background: var(--char);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(0,0,0,.4);
  animation: modalIn .5s var(--ease-out) both;
  overflow: hidden;
}
.modal--wide { width: min(860px, 100%); }
.modal--xl { width: min(1100px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 8px; }
.modal__title { font-family: var(--serif); font-size: 2rem; line-height: 1; letter-spacing: -.01em; }
.modal__sub { color: var(--text-2); font-size: .875rem; margin-top: 6px; }
.modal__body { padding: 16px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--bone-4); flex-wrap: wrap; }
.modal-root.is-leaving .modal { animation: modalOut .3s var(--ease-in-out) both; }
.modal-root.is-leaving .modal-backdrop { animation: fadeOut .3s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 640px) {
  .modal-root { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; animation-name: sheetIn; padding-bottom: var(--safe-b); }
  .modal-root.is-leaving .modal { animation-name: sheetOut; }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--bone-20); }
  .modal__title { font-size: 1.75rem; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* Drawer */
.drawer-root { position: fixed; inset: 0; z-index: 9100; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: var(--char);
  border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  animation: drawerIn .5s var(--ease-out) both;
  box-shadow: var(--shadow-2);
}
.drawer-root.is-leaving .drawer { animation: drawerOut .3s var(--ease-in-out) both; }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerOut { to { transform: translateX(100%); } }

/* --- Accordion ----------------------------------------------------------- */
.accordion { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  text-align: left; padding: 26px 0; min-height: 60px;
  font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.15;
  transition: color var(--t);
}
.acc-trigger:hover { color: var(--amber); }
.acc-icon { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; transition: all var(--t) var(--ease-out); }
.acc-icon::before, .acc-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); transition: transform var(--t) var(--ease-out); }
.acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc-item.is-open .acc-icon { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.acc-item.is-open .acc-icon::after { transform: translate(-50%, -50%) rotate(0); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.acc-panel > div { overflow: hidden; }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel p { color: var(--text-2); padding-bottom: 28px; max-width: 62ch; font-size: 1.0625rem; }

/* --- Placeholder (to be supplied) --------------------------------------- */
.placeholder {
  position: relative;
  border: 1px dashed rgba(232, 163, 61, .45);
  border-radius: var(--r);
  padding: 18px 20px 18px 20px;
  background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(232, 163, 61, .035) 12px 24px);
  color: var(--text-2);
  font-style: italic;
}
.placeholder::before {
  content: "Placeholder";
  display: inline-block;
  font-family: var(--mono); font-style: normal; font-size: .625rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
  display: block;
}
.ph-inline { color: var(--amber); font-style: italic; border-bottom: 1px dashed rgba(232,163,61,.5); }

/* --- Empty state --------------------------------------------------------- */
.empty {
  display: grid; justify-items: center; text-align: center; gap: 12px;
  padding: 48px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--text-2);
}
.empty__icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bone-4); border: 1px solid var(--line); color: var(--amber); }
.empty__icon svg { width: 24px; height: 24px; }
.empty__title { font-family: var(--serif); font-size: 1.75rem; color: var(--text); line-height: 1.1; }
.empty p { max-width: 40ch; font-size: .9375rem; }

/* --- Callout ------------------------------------------------------------- */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--amber-12); border: 1px solid rgba(232, 163, 61, .25); font-size: .9rem; }
.callout > svg { width: 20px; height: 20px; color: var(--amber); flex: none; margin-top: 2px; }
.callout--ember { background: var(--ember-15); border-color: rgba(200, 85, 61, .35); }
.callout--ember > svg { color: var(--ember-hi); }
.callout--moss { background: var(--moss-20); border-color: rgba(157, 179, 142, .3); }
.callout--moss > svg { color: var(--moss-hi); }
.callout--sky { background: var(--sky-15); border-color: rgba(143, 176, 204, .3); }
.callout--sky > svg { color: var(--sky); }
.callout strong { color: var(--text); }

/* --- Table --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.table th { text-align: left; font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .875rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr:hover { background: var(--bone-4); }

/* --- Kbd ----------------------------------------------------------------- */
kbd, .kbd { font-family: var(--mono); font-size: .6875rem; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bone-4); color: var(--text-2); }

/* --- Video player -------------------------------------------------------- */
.player {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  isolation: isolate;
}
.player--vertical { aspect-ratio: 9 / 16; }
.player video { width: 100%; height: 100%; object-fit: cover; }
.player__shade { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none; transition: opacity var(--t); }
.player__big {
  position: absolute; left: 50%; top: 50%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(14, 13, 11, .4);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--bone-20);
  display: grid; place-items: center;
  color: var(--bone);
  transition: transform var(--t) var(--ease-out), opacity var(--t), background var(--t);
}
.player__big svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.player__big:hover { transform: scale(1.08); background: var(--amber); color: var(--ink); }
.player.is-playing .player__big { opacity: 0; pointer-events: none; transform: scale(.8); }
.player__bar {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(14, 13, 11, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--bone-12);
  transition: opacity var(--t), transform var(--t) var(--ease-out);
}
.player.is-playing.is-idle .player__bar { opacity: 0; transform: translateY(8px); }
.player.is-playing.is-idle .player__shade { opacity: 0; }
.player__btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--bone); flex: none; }
.player__btn:hover { background: var(--bone-12); }
.player__btn svg { width: 18px; height: 18px; }
.player__time { font-family: var(--mono); font-size: .75rem; color: var(--bone-80); min-width: 84px; text-align: center; flex: none; }
.player__track { position: relative; flex: 1; height: 40px; cursor: pointer; display: flex; align-items: center; touch-action: none; }
.player__rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--bone-20); overflow: hidden; }
.player__buf { position: absolute; inset: 0 auto 0 0; background: var(--bone-20); }
.player__fill { position: absolute; inset: 0 auto 0 0; background: var(--amber); }
.player__knob { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--bone); margin-left: -7px; box-shadow: 0 0 0 4px rgba(232,163,61,.35); transform: scale(0); transition: transform var(--t) var(--ease-spring); }
.player__track:hover .player__knob, .player__track.is-drag .player__knob { transform: scale(1); }
.player__marker { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--bone); border: 2px solid var(--ink); z-index: 1; }
.player__marker:hover::after { content: attr(data-label); position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); border: 1px solid var(--line-2); padding: 4px 8px; border-radius: 6px; font-size: .7rem; font-family: var(--sans); }
.player__rate { font-family: var(--mono); font-size: .75rem; width: auto; padding: 0 8px; }
.player__badge { position: absolute; top: 14px; left: 14px; z-index: 3; }
.player__big, .player__bar { z-index: 3; }
@media (max-width: 520px) {
  .player__bar { left: 8px; right: 8px; bottom: 8px; gap: 2px; padding: 4px; }
  .player__time { min-width: 0; font-size: .6875rem; }
  .player__rate { display: none; }
}

/* --- Custom cursor ------------------------------------------------------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 9800; pointer-events: none; mix-blend-mode: normal; }
.cursor__dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--amber); }
.cursor__ring {
  position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%;
  border: 1px solid rgba(232, 163, 61, .6);
  display: grid; place-items: center;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background .35s, border-color .35s;
}
.cursor__label { font-family: var(--mono); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .4s var(--ease-out); font-weight: 600; }
.cursor.is-hover .cursor__ring { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-color: var(--amber); background: rgba(232, 163, 61, .08); }
.cursor.is-label .cursor__ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--amber); border-color: var(--amber); }
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__ring { transform: scale(.85); }
.cursor.is-hidden { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor [data-cursor] { cursor: none; }
html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto; }

/* --- Page curtain -------------------------------------------------------- */
.curtain { position: fixed; inset: 0; z-index: 9700; pointer-events: none; }
.curtain__panel { position: absolute; inset: 0; transform: translateY(100%); }
.curtain__panel--amber { background: var(--amber); }
.curtain__panel--ink { background: var(--ink); display: grid; place-items: center; }
.curtain__mark { font-family: var(--serif); font-style: italic; font-size: clamp(2.5rem, 7vw, 6rem); color: var(--bone); opacity: 0; }
.curtain.is-covering { pointer-events: auto; }

/* Lucide sizing default */
[data-lucide] { width: 18px; height: 18px; }
svg.lucide { stroke-width: 1.75; }

/* Arrival curtain (apps) */
.curtain--arrive .curtain__panel { transform: translateY(0); animation: curtainUp .5s var(--ease-in-out) forwards; }
.curtain--arrive .curtain__panel--amber { animation-delay: .06s; }
.curtain--arrive .curtain__mark { opacity: 1; animation: fadeOut .2s ease forwards; }
@keyframes curtainUp { to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) { .curtain--arrive { display: none; } }
