/* Studio + client gallery shared primitives (docs/studio/design.md). Tokens only: no hex, no font names.
   Loaded after /assets/css/tokens.css and /assets/css/base.css; track CSS (admin.css, gallery.css) comes after. */

:root { --tap: 44px; --tap-phone: 50px; --dur-state: .18s; }
@media (prefers-reduced-motion: reduce) {
  :root { --dur-state: 0s; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* labels and eyebrows */
.label { font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); font-weight: var(--body-weight-strong); }
.eyebrow { font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: "[ "; }
.eyebrow::after { content: " ]"; }
.card-title { font-family: var(--font-display); font-weight: var(--display-weight-strong); font-size: 1.375rem; line-height: 1.2; color: var(--ink); margin: 0; }
.hand { font-family: var(--font-hand); font-size: var(--fs-hand); color: var(--olive); line-height: 1; }

/* buttons: pills, uppercase, tracked */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: 0 1.25rem; border-radius: var(--radius-pill);
  font-size: var(--fs-btn); letter-spacing: var(--track-btn); text-transform: uppercase; font-weight: var(--body-weight-strong);
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-state), color var(--dur-state), border-color var(--dur-state), opacity var(--dur-state);
}
.btn-primary { background: var(--brown); color: var(--paper-white); }
.btn-primary:hover { background: var(--ink); }
.btn-quiet { background: var(--cream-2); color: var(--brown); border-color: var(--cream-3); }
.btn-quiet:hover { border-color: var(--brown); }
.btn-ghost { background: transparent; color: var(--brown); border-color: var(--cream-3); }
.btn-ghost:hover { border-color: var(--brown); }
.btn-link { background: none; border: 0; padding: 0 .25rem; min-height: var(--tap); color: var(--brown); text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-small); text-transform: none; letter-spacing: 0; font-weight: var(--body-weight); }
.btn-block { width: 100%; }
.btn-lg { min-height: var(--tap-phone); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: var(--radius-pill); color: inherit; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--cream-2); }

/* chips: filters (tabs) and choices (radio) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: 0 1rem;
  border-radius: var(--radius-pill); border: 1px solid var(--cream-3); background: var(--cream-2); color: var(--brown);
  font-size: .8125rem; cursor: pointer; text-decoration: none; transition: background-color var(--dur-state), color var(--dur-state);
}
.chip[aria-selected="true"], .chip[aria-checked="true"], .chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--paper-white); border-color: var(--ink); }
.chip .count { font-size: var(--fs-label); opacity: .75; }

/* status pills */
.pill { display: inline-flex; align-items: center; flex: none; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; line-height: 1.6; font-weight: var(--body-weight-strong); }
.status-new { background: var(--brown); color: var(--paper-white); }
.status-replied { background: var(--sage-2); color: var(--ink); }
.status-booked { background: var(--olive-2); color: var(--ink); }
.status-shot, .status-delivered { background: var(--cream-3); color: var(--ink); }
.status-lost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--cream-3); }
.status-live { background: var(--sage); color: var(--ink); }
.status-draft, .status-offline { background: var(--cream-3); color: var(--ink); }
.status-expired, .status-archived, .status-restoring { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--cream-3); }

/* cards and panes */
.card { background: var(--paper-white); border-radius: var(--radius-lg); padding: var(--space-3); }
.inset { background: var(--cream-2); border-radius: var(--radius-md); padding: var(--space-2); }

/* fields: underline inputs (olive), as on the site form */
.field { display: grid; gap: .35rem; }
.field > span, .field > label { font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: .5rem 0; background: transparent; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--olive); border-radius: 0; font-size: var(--fs-small);
}
.field textarea { min-height: 6rem; resize: vertical; line-height: var(--lh-body); }
.select { min-height: var(--tap); padding: 0 2rem 0 1rem; border-radius: var(--radius-pill); border: 1px solid var(--cream-3); background: var(--cream-2); color: var(--brown); font-size: .8125rem; }
.field-error { color: var(--brown); font-size: .8125rem; }

/* switch: <input type="checkbox" role="switch" class="switch"> */
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: var(--radius-pill); background: var(--cream-3); position: relative; cursor: pointer; flex: none; margin: 8px 0; transition: background-color var(--dur-state); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-white); transition: transform var(--dur-state); }
.switch:checked { background: var(--brown); }
.switch:checked::after { transform: translateX(18px); }
.check { display: inline-flex; align-items: center; gap: .6rem; min-height: var(--tap); cursor: pointer; font-size: var(--fs-small); }
.check input { width: 18px; height: 18px; accent-color: var(--brown); }

/* bottom sheet + dialog */
.scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--paper-white); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--cream-3); margin: -8px auto var(--space-2); }
.dialog { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; background: var(--paper-white); border-radius: var(--radius-lg); padding: var(--space-4); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper-white); border-radius: var(--radius-pill); padding: .7rem 1.2rem; font-size: var(--fs-small); display: flex; gap: 1rem; align-items: center; max-width: calc(100vw - 32px); }
.toast button { color: var(--olive-2); text-transform: uppercase; letter-spacing: var(--track-btn); font-size: var(--fs-btn); min-height: 32px; }

/* progress */
.progress { height: 4px; border-radius: 2px; background: var(--cream-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brown); transition: width var(--dur-state); }

/* misc */
.muted { color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--cream-3); border-top-color: var(--brown); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: var(--space-5) var(--space-2); }
