/* Solaris Studios · app UI system, shared by the studio hub and every tool page.
   Brand Guidelines 1.0: black, white, warm grey, Solaris red #E62419 (used sparingly: primary actions and
   the few things that need attention). Satoshi throughout. Quiet surfaces, hairline borders, one radius. */

:root {
  color-scheme: light dark;
  --bg: #F7F7F7; --surface: #FFFFFF; --surface-2: #FAFAFA; --sunken: #F2F2F2;
  --border: #E6E6E6; --border-strong: #D2D2D2;
  --ink: #111111; --ink-2: #3A3A3A; --muted: #6A6A6A; --faint: #9B9B9B;
  --red: #E62419; --red-hover: #CC1E14; --red-ink: #C41E14; --red-soft: #FDEDEB;
  --green: #17804A; --green-soft: #E6F4EC; --amber: #9A5800; --amber-soft: #FFF3DF;
  --li: #0A66C2;
  --r: 8px; --r-sm: 6px;
  --shadow-pop: 0 12px 40px -12px rgb(0 0 0 / .28), 0 2px 6px rgb(0 0 0 / .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --page: 1200px; --gut: clamp(16px, 3.5vw, 32px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0B; --surface: #141414; --surface-2: #181818; --sunken: #1B1B1B;
    --border: #262626; --border-strong: #363636;
    --ink: #F2F2F2; --ink-2: #D2D2D2; --muted: #A1A1A1; --faint: #6F6F6F;
    --red-hover: #F0392E; --red-ink: #FF6B61; --red-soft: #2A1311;
    --green: #4CC38A; --green-soft: #11261B; --amber: #F0B04A; --amber-soft: #2A2010;
    --li: #5AA9F5;
    --shadow-pop: 0 16px 48px -12px rgb(0 0 0 / .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font: 500 15px/1.55 "Satoshi", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gut); }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; }

/* ── Top bar: the same on every page ── */
.topbar { position: sticky; top: 0; z-index: 20; background: #000; color: #fff; border-bottom: 1px solid #1c1c1c; }
.topbar .page { display: flex; align-items: center; gap: 28px; height: 56px; }
.tb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
.tb-brand img { width: 24px; height: 24px; }
.tb-brand span { font-weight: 700; font-size: 15px; letter-spacing: .005em; }
.tb-nav { display: flex; align-items: stretch; gap: 22px; height: 100%; min-width: 0; }
.tb-nav a { display: flex; align-items: center; text-decoration: none; color: rgb(255 255 255 / .62); font-size: 14px; font-weight: 600;
  border-bottom: 2px solid transparent; padding-top: 2px; white-space: nowrap; transition: color .15s var(--ease); }
.tb-nav a:hover { color: #fff; }
.tb-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--red); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #262626; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: #333; }
.account[open] summary { box-shadow: 0 0 0 2px #000, 0 0 0 4px #444; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; }
.account-menu .who { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-menu .who small { display: block; color: var(--muted); font-size: 12px; }
.account-menu .who b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.account-menu button, .account-menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: left; }
.account-menu button:hover, .account-menu a:hover { background: var(--sunken); }

/* ── Page header ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 32px 0 24px; }
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.005em; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover { background: var(--sunken); }
.btn > svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-danger { background: none; border-color: transparent; color: var(--red-ink); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-color: transparent; background: none; color: var(--muted); }
.btn-icon:hover { color: var(--ink); background: var(--sunken); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--red-ink); font-weight: 600; font-size: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Fields ── */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small, .hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.input, select, textarea, input[type=text], input[type=url], input[type=email], input[type=password], input[type=search] {
  width: 100%; min-height: 38px; padding: 8px 11px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); font-size: 14.5px; line-height: 1.5; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
select { padding-right: 32px; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { resize: vertical; }
.input:focus, select:focus, textarea:focus, input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
::placeholder { color: var(--faint); }

/* ── Surfaces ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.badge.red { background: var(--red-soft); color: var(--red-ink); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.outline { background: none; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5;
  background: var(--sunken); color: var(--ink-2); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.notice.bad { background: var(--red-soft); color: var(--red-ink); }
.notice.ok { background: var(--green-soft); color: var(--green); }
.notice a { font-weight: 600; }

/* ── Tabs ── */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0; border: 0; background: none;
  color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); }
.tabs .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--muted);
  font-size: 12px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] .count { background: var(--ink); color: var(--bg); }

/* ── Dialog ── */
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog[open] { animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.dialog-body { display: grid; gap: 16px; padding: 22px; }
.dialog-body h2 { font-size: 18px; font-weight: 700; }
.dialog-body > p { color: var(--muted); font-size: 14px; margin-top: -10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 12px 12px; }

/* ── Feedback ── */
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); translate: -50% 8px; max-width: calc(100% - 32px);
  background: #111; color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop);
  opacity: 0; transition: opacity .2s var(--ease), translate .2s var(--ease); pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast.bad { background: var(--red); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { rotate: 360deg; } }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.site-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 0 max(18px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); }
.site-foot .page { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot a { text-decoration: none; } .site-foot a:hover { color: var(--ink); }

/* ── Small screens and touch ── */
@media (max-width: 900px) {
  .input, select, textarea, input[type=text], input[type=url], input[type=email], input[type=password], input[type=search] { font-size: 16px; }
}
@media (max-width: 640px) {
  .topbar .page { gap: 18px; }
  .tb-brand span { display: none; }
  .tb-nav { gap: 14px; }
  .tb-nav a { font-size: 13px; }
  .page-head { padding: 22px 0 18px; }
  .page-head h1 { font-size: 22px; }
  .tabs { gap: 0; }
  .tabs button { flex: 1 1 0; justify-content: center; gap: 6px; font-size: 13px; }
  .dialog-body { padding: 18px; }
  .dialog-actions { padding: 12px 18px; }
}
@media (pointer: coarse) {
  .btn { height: 44px; } .btn-sm { height: 38px; } .btn-icon { width: 44px; height: 44px; }
  .input, select, input[type=text], input[type=url], input[type=email], input[type=password], input[type=search] { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Activity feed ── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 12px; padding: 12px 16px; }
.feed-item + .feed-item { border-top: 1px solid var(--border); }
.feed-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase; flex: none; margin-top: 1px; }
.feed-avatar.sys { background: var(--ink); color: var(--bg); }
.feed-body { min-width: 0; }
.feed-body p { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.feed-body b { font-weight: 700; }
.feed-subject { color: var(--ink-2); }
.feed-body .feed-meta { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.feed .empty { padding: 28px 16px; }
