/* ---------- buttons ---------- */
.btn {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 9px 17px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur-quick), background-color var(--dur-quick), transform var(--dur-quick), filter var(--dur-quick);
}

.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; transform: none; }

/* Primary: solid Solar Flare with Dark Matter text, no outline. */
.btn--primary {
  background: var(--solar);
  border-color: transparent;
  color: var(--dark-matter);
}

/* Hover: solid primary teal, Interstellar Deep, still no outline. */
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--interstellar);
  border-color: transparent;
  color: var(--nebula);
}

.btn--quiet { border-color: transparent; color: var(--dim); }
.btn--quiet:hover { border-color: transparent; color: var(--ink); background: var(--panel-2); }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn--danger:hover { border-color: var(--danger); }

.btn--small { min-height: 32px; padding: 5px 12px; font-size: var(--t-xs); }

/* Outline at rest; hover, focus and "you are here" fill with Solar Flare. */
.btn--outline { border-color: var(--line-2); color: var(--ink); }
.btn--outline:hover,
.btn--outline:focus-visible,
.btn--outline[aria-current="page"] { background: var(--solar); border-color: var(--solar); color: var(--dark-matter); }

.actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

/* ---------- surfaces ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.tag, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 600;
  line-height: 1.5;
  background: var(--panel-2);
  color: var(--dim);
  white-space: nowrap;
}

.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--faint)); }

.tag--rock { background: var(--brass-soft); color: var(--brass); }
.tag--team { background: var(--tide-soft); color: var(--tide); }
.tag--ok { background: var(--tide-soft); color: var(--tide); }
.tag--warn { background: var(--flare-soft); color: var(--flare); }

.dot--now { --dot: var(--flare); }
.dot--next { --dot: var(--mist); }
.dot--waiting { --dot: var(--brass); }
.dot--done { --dot: var(--done); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--t-xs); color: var(--dim); font-weight: 500; }
.field .hint { font-size: var(--t-xs); color: var(--faint); }

.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--dur-quick), box-shadow var(--dur-quick);
}

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

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--tide);
  box-shadow: 0 0 0 3px var(--tide-soft);
}

.input::placeholder, .textarea::placeholder { color: var(--faint); }

.field-error { color: var(--danger); font-size: var(--t-xs); }

/* ---------- empty state ---------- */
.empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-8) var(--s-6);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--dim);
}

.empty .moon-phase { width: 44px; height: 44px; }
.empty h2, .empty h3 { font-size: var(--t-lg); color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 56ch; font-size: var(--t-sm); }
.empty .actions { margin-top: var(--s-3); }

.empty--compact {
  display: block;
  padding: var(--s-4);
  font-size: var(--t-xs);
  color: var(--faint);
  text-align: center;
  border-radius: var(--r-md);
}

/* ---------- moon phase glyph ---------- */
.moon-phase { width: 14px; height: 14px; flex-shrink: 0; }
.moon-phase .disc { fill: var(--panel-3); stroke: var(--line-2); stroke-width: 1; }
.moon-phase .lit { fill: var(--ink); }

/* ---------- drawer ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(8 5 7 / 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-move) var(--ease-out);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(104%);
  transition: transform var(--dur-move) var(--ease-out);
}

.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: none; }

.drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--t-sm);
}

.drawer__body { padding: var(--s-6); overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.drawer__body h2 { font-size: var(--t-2xl); line-height: 1.12; margin: var(--s-3) 0 var(--s-4); overflow-wrap: anywhere; }
.drawer__body .desc { color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; }

.close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.close:hover { background: var(--panel-3); }

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-2) var(--s-5);
  margin: var(--s-5) 0;
  font-size: var(--t-sm);
}

.facts dt { color: var(--faint); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.drawer-section {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--s-3);
}

/* ---------- toast / flash ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translateX(-50%);
  display: grid;
  gap: var(--s-2);
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--t-sm);
  font-weight: 500;
  box-shadow: var(--shadow-float);
  animation: toast-in var(--dur-move) var(--ease-out), toast-out 300ms ease-in 4s forwards;
}

.toast--alert { background: var(--danger); color: #1b0b09; }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- avatar ---------- */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ---------- brand mark (moon + brand star) ---------- */
.brand-mark { flex-shrink: 0; overflow: visible; }
.brand-mark__moon { fill: var(--moon); }
.brand-mark__star { fill: var(--star); overflow: visible; }

/* Hand-written accents (MM Hand), the way the brand book overlays words on
   bold type: white, tilted, slightly overlapping. Words only (no numerals). */
.hand-accent {
  font-family: var(--hand);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--nebula);
  transform: rotate(-6deg);
  display: inline-block;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- team accents ----------
   One colour per team so labels scan at a glance. The team name is always
   shown, so colour is a second cue: it sits on a dot and a soft tint while
   the text keeps the ink colour. Six hues, the best-separated set the
   dataviz validator found (no 6-hue set passes every all-pairs check;
   labels carry identity, so that is acceptable here). */
.team--leadership { --team: #e39324; }
.team--marketing { --team: #8c78dc; }
.team--creative { --team: #da5fa8; }
.team--web { --team: #1a9cc0; }
.team--ops { --team: #57a84a; }
.team--podcast { --team: #c72a2a; }

.tag--team {
  background: color-mix(in srgb, var(--team, var(--cosmic)) 18%, transparent);
  color: var(--ink);
}
.tag--team::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--team, var(--cosmic));
  flex-shrink: 0;
}

/* ---------- status chips (Wrike style) ----------
   Colours follow MM's Wrike workflows so statuses read the same in both
   tools: New gray, TBA turquoise, To Do dark red, In Progress yellow,
   Client Review purple, Completed green. Solid chip, small radius. */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-transform: none;
  white-space: nowrap;
  background: var(--chip-bg);
  color: var(--chip-ink, #fff);
}
.status--now, .stage--building { --chip-bg: #f9c02d; --chip-ink: #1a1318; }      /* In Progress: yellow */
.status--next, .stage--planned { --chip-bg: #b8282c; }                          /* To Do: dark red */
.status--waiting { --chip-bg: #8e3fb0; }                                        /* Client Review: purple */
.status--done, .stage--shipped { --chip-bg: #3f9b4b; }                          /* Completed: green */
.stage--new { --chip-bg: #6e6a6c; }                                             /* New: gray */
.stage--review { --chip-bg: #1fb5b0; --chip-ink: #0f1a1a; }                     /* TBA: turquoise */
