/* Postane studio. Tokens first, then layout, then components. */

:root {
  --bg: #f5f4f0;
  --panel: #ffffff;
  --sunken: #efede8;
  --ink: #18171c;
  --ink-2: #3d3c43;
  --muted: #74727b;
  --line: #e4e1da;
  --line-strong: #d3cfc6;
  --accent: #e2502c;
  --accent-hover: #cc4422;
  --accent-soft: #fbe6df;
  --accent-ink: #ffffff;
  --tag: #2f5fd0;
  --focus: #3b6cf6;
  --ok: #1f9d55;
  --warn: #b7791f;
  --danger: #d23b3b;
  --shadow-sm: 0 1px 2px rgb(24 23 28 / 0.06);
  --shadow: 0 1px 2px rgb(24 23 28 / 0.05), 0 8px 24px -8px rgb(24 23 28 / 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e11;
    --panel: #16161a;
    --sunken: #1d1d22;
    --ink: #ececef;
    --ink-2: #c7c6cd;
    --muted: #8f8e98;
    --line: #26262c;
    --line-strong: #34343c;
    --accent: #ff6a40;
    --accent-hover: #ff7f5a;
    --accent-soft: #3a1f17;
    --accent-ink: #1a0d08;
    --tag: #86a8ff;
    --focus: #7c9cff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; } /* clear the sticky topbar on scrollIntoView */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; }
.logo { width: 26px; height: 26px; }
.logo-fill { fill: var(--accent); }
.logo-perf { fill: none; stroke: var(--bg); stroke-width: 1.6; stroke-dasharray: 1.6 2.4; }
.logo-env { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linejoin: round; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand-tag {
  font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 5px;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* TR / EN switch */
.lang-switch {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel);
}
.lang-switch button {
  height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: none; cursor: pointer;
  font: 600 12px/1 var(--font); letter-spacing: 0.04em; color: var(--muted);
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--sunken); color: var(--ink); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 28px 24px 22px;
}
.login-title { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 2px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error { color: var(--danger); font-size: 13px; }
.login-error:empty { display: none; }
.login-card .lang-switch { align-self: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; cursor: pointer;
  font-weight: 550; text-decoration: none; color: var(--ink); white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn svg, .icon-btn svg, .when svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn.ghost { border-color: var(--line-strong); background: var(--panel); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--sunken); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgb(255 255 255 / 0.2) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.primary:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.big { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.btn kbd { font: 500 11px var(--mono); opacity: 0.7; padding: 2px 5px; border-radius: 5px; background: rgb(0 0 0 / 0.12); }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px;
  border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-2);
  font-size: 13px; font-weight: 550; text-decoration: none;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }

/* Layout */
.layout {
  display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px;
  max-width: 1440px; margin: 0 auto; padding: 24px 20px 64px;
}
.brief {
  position: sticky; top: 72px; align-self: start;
  max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 20px 20px 0;
  display: flex; flex-direction: column; gap: 18px;
}
.panel-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }

/* Form */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; padding: 0; }
.hint { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input:not([type]), input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, .chips, .prefixed {
  width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); transition: border-color 0.15s, box-shadow 0.15s;
}
input:not([type]), input[type="text"], input[type="password"], input[type="email"], input[type="number"], select { padding: 0 10px; }
textarea {
  width: 100%; min-height: 84px; padding: 8px 10px; resize: vertical; font: inherit; line-height: 1.45;
  color: inherit; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus,
input:not([type]):focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="number"]:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
select {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2374727b' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px; cursor: text; }
.chips:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.chips input { flex: 1 1 90px; min-width: 90px; border: 0; min-height: 28px; padding: 0 5px; background: none; box-shadow: none !important; }
.chips input:focus { outline: none; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 10px;
  background: var(--accent-soft); color: var(--ink); border-radius: 7px; font-weight: 550; max-width: 100%;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 5px;
  background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1;
}
.chip-x:hover { background: rgb(0 0 0 / 0.08); color: var(--ink); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 36px; height: 34px; border: 0; background: var(--panel); cursor: pointer; font-size: 17px; }
.stepper button:hover:not(:disabled) { background: var(--sunken); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; border-inline: 1px solid var(--line); line-height: 34px; }

.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-card {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); transition: border-color 0.15s, box-shadow 0.15s;
}
.style-card:hover { border-color: var(--line-strong); }
.swatch { display: block; aspect-ratio: 16 / 10; border-radius: 7px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06); position: relative; overflow: hidden; }
.swatch::after { content: ""; position: absolute; inset: auto 8px 8px 8px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 0.55); width: 45%; }
.style-name { font-size: 12.5px; font-weight: 550; padding: 0 2px 2px; }
.style-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.style-card:has(input:focus-visible), .seg:has(input:focus-visible),
.file-btn:has(input:focus-visible), .pos:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 11px; }
.seg {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px;
  border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.seg:hover { color: var(--ink); }
.aspect { display: block; height: 18px; border: 1.6px solid currentColor; border-radius: 3px; }
.seg:has(input:checked) { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg:has(input:checked) .aspect { border-color: var(--accent); background: var(--accent-soft); }

.prefixed { display: flex; align-items: center; padding-left: 10px; }
.prefixed span { color: var(--muted); }
.prefixed input { border: 0; background: none; padding-left: 3px; min-height: 36px; }
.prefixed:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.prefixed input:focus { box-shadow: none; }

.switch {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 99px; border: 0; cursor: pointer;
  background: var(--line-strong); transition: background 0.18s;
}
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.18s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(16px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }

.advanced { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px; }
.advanced[open] summary::before { transform: rotate(45deg); }
.advanced summary .muted { font-weight: 450; }
.advanced .grid2 { margin-top: 12px; }

.generate-bar {
  position: sticky; bottom: 0; margin: 0 -20px; padding: 14px 20px 20px;
  background: var(--panel); border-top: 1px solid var(--line);
}

/* Results */
.results { min-width: 0; }
.results:focus { outline: none; }
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 72px 24px; border: 1px dashed var(--line-strong); border-radius: 18px; min-height: 540px; justify-content: center;
}
.empty h3 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-top: 12px; }
.empty p { color: var(--muted); max-width: 420px; margin-bottom: 8px; }
.empty-art { position: relative; width: 260px; height: 170px; }
.mini-post {
  position: absolute; top: 10px; width: 108px; padding: 6px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.mini-post i { display: block; aspect-ratio: 4 / 5; border-radius: 7px; }
.mini-post b { display: block; height: 6px; width: 70%; margin: 7px 2px 2px; border-radius: 3px; background: var(--line-strong); }
.mini-post.p1 { left: 8px; transform: rotate(-8deg); }
.mini-post.p1 i { background: linear-gradient(135deg, #1f2937, #4f46e5); }
.mini-post.p2 { left: 76px; top: 0; z-index: 2; }
.mini-post.p2 i { background: linear-gradient(135deg, #db2777, #f59e0b); }
.mini-post.p3 { left: 144px; transform: rotate(8deg); }
.mini-post.p3 i { background: linear-gradient(135deg, #78350f, #d6a35c); }

.run-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.run-title { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.progress { height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; margin-bottom: 18px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s ease; }

.reels { margin-bottom: 22px; }
.reel-row { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 4px; }
.item-reel { width: min(260px, 100%); aspect-ratio: 9 / 16; border-radius: 12px; background: #000; display: block; margin: 12px 0; }
.reel-item { display: flex; flex-direction: column; gap: 6px; flex: none; }
.reel-row video { width: 200px; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; flex: none; object-fit: cover; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; align-items: start; }

.post {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.post-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  font-weight: 650; font-size: 13px; color: var(--accent-ink);
  background: var(--accent); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--accent);
}
.handle { font-weight: 650; font-size: 13px; }
.post-head .handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-pill { margin-left: auto; font-size: 11.5px; color: var(--muted); background: var(--sunken); padding: 2px 8px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.post-img { width: 100%; object-fit: cover; background: var(--sunken); }
.post-actions { display: flex; justify-content: space-between; padding: 6px 6px 0; }
.caption { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; overflow-wrap: anywhere; }
.caption .handle { margin-right: 2px; }
.caption .body { white-space: pre-line; color: var(--ink-2); }
.more { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font-size: 13.5px; }
.more:hover { color: var(--ink); }
.tags { color: var(--tag); }
.when { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.when svg { width: 14px; height: 14px; }
.alt summary { cursor: pointer; font-size: 12px; color: var(--muted); width: fit-content; }
.alt p { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); padding: 8px 10px; background: var(--sunken); border-radius: 8px; }

.skeleton { animation: none; }
.skeleton .avatar { background: var(--sunken); box-shadow: none; }
.skeleton .post-img, .skeleton .line, .skeleton .avatar {
  background: linear-gradient(90deg, var(--sunken) 25%, var(--line) 50%, var(--sunken) 75%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton .caption { padding-top: 12px; gap: 8px; }
.line { display: block; height: 9px; border-radius: 5px; }
.w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* History drawer */
.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(400px, 100vw);
  padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow);
}
.drawer[open] { animation: slide 0.22s ease; }
.drawer::backdrop { background: rgb(10 10 14 / 0.35); backdrop-filter: blur(2px); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-inner { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.history-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; text-align: left;
  border: 1px solid transparent; border-radius: 11px; background: none; cursor: pointer;
}
.history-item:hover { background: var(--sunken); }
.history-item[aria-current="true"] { border-color: var(--line-strong); background: var(--sunken); }
.thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--sunken); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-text { display: flex; flex-direction: column; min-width: 0; }
.history-topics { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toasts */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 8px 10px 14px; border-radius: 11px; background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow); font-size: 13px; animation: rise 0.2s ease; border-left: 3px solid transparent;
}
.toast .chip-x { color: inherit; opacity: 0.7; }
.toast.success { border-left-color: var(--ok); }
.toast.warning { border-left-color: var(--warn); }
.toast.error { border-left-color: var(--danger); }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 48px; gap: 20px; }
  .brief { position: static; max-height: none; overflow: visible; }
  .generate-bar { position: static; border-top: 0; padding-top: 0; }
  .btn kbd { display: none; }
  .empty { min-height: 0; padding: 48px 20px; }
}
@media (max-width: 520px) {
  .topbar { padding: 10px 16px; }
  .topbar .btn span, .brand-tag { display: none; }
  .topbar .btn { width: 36px; padding: 0; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .run-head { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Templates and themes */
.templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.templates .swatch { aspect-ratio: 3 / 4; }
.templates .swatch::after { display: none; }
.templates .swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.theme-chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 99px;
  padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.theme-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.quote-block { white-space: pre-line; border-left: 2px solid var(--accent); padding-left: 10px; margin: 6px 0; }
.badge-review {
  display: inline-block; margin: 6px 0 0; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309;
}

/* Background prompt */
.bgprompt .themes { align-items: center; }
.preset-label { font-size: 11.5px; color: var(--muted); min-width: 64px; }
.theme-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggestion { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--sunken); }
.diff { font-size: 13px; line-height: 1.55; }
.diff .add { background: color-mix(in srgb, #16a34a 18%, transparent); border-radius: 3px; }
.diff .del { text-decoration: line-through; color: var(--muted); }
.hint.warn { color: #b45309; }

/* Series */
.series-row { display: flex; gap: 8px; }
.series-row input:first-child { flex: 1; min-width: 0; }
.series-no { width: 84px; flex: none; }

/* Logo: upload, 6-spot picker that previews the logo in place, opacity and size */
.logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.logo-thumb, .pos-grid {
  background-color: var(--panel);
  background-image: conic-gradient(var(--sunken) 25%, transparent 0 50%, var(--sunken) 0 75%, transparent 0);
  background-size: 12px 12px;
}
.logo-thumb { display: inline-grid; place-items: center; height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.logo-thumb img { max-height: 30px; max-width: 120px; }
.logo-options { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; margin-top: 10px; }
.pos-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto 1fr auto; gap: 4px;
  aspect-ratio: 3 / 4; padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px;
}
.pos {
  display: grid; height: 30px; border-radius: 5px; cursor: pointer; border: 1px dashed var(--line-strong);
  place-items: center; background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.pos.top-left { justify-items: start; } .pos.top-right, .pos.bottom-right { justify-items: end; }
.pos.bottom-left { justify-items: start; }
.pos[class*="bottom"] { grid-row: 3; }
.pos:hover { border-color: var(--accent); }
.pos:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.pos img { max-height: 20px; max-width: 30px; padding: 0 3px; }
.logo-controls { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.logo-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.logo-controls .segmented .seg { height: 32px; }

/* Carousel slides in a post card */
.post-media { position: relative; }
.stamp { position: relative; container-type: inline-size; }  /* the image plus the logo it downloads with */
.stamp .post-img { display: block; }
.logo-mark { position: absolute; object-fit: contain; pointer-events: none; }
.slide-count {
  position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 99px;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.slide-nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 0.9); color: #222; box-shadow: var(--shadow-sm); cursor: pointer; font-size: 20px; line-height: 1;
}
.slide-nav.prev { left: 8px; } .slide-nav.next { right: 8px; }
.dots { display: flex; justify-content: center; gap: 5px; padding-top: 10px; }  /* under the image, as on Instagram */
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.dots i.on { background: var(--accent); }

/* Top navigation: Create · Usage · Settings */
.tabs { display: flex; gap: 2px; margin-right: auto; margin-left: 18px; overflow-x: auto; }
.tabs a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 13.5px;
  text-decoration: none; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); background: var(--sunken); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--panel); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.me { color: var(--muted); font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-note { margin-top: -6px; }
.brand-note a { color: var(--accent); }

/* Usage and Settings pages */
.page { max-width: 960px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
}
.card h2 { font-size: 14px; font-weight: 650; }
.usage-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.usage-controls .segmented { flex: 0 1 auto; }
.usage-controls .seg { height: 34px; padding: 0 12px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--sunken); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.off td { color: var(--muted); text-decoration: line-through; }
.table tr.off td.actions, .table tr.off td:nth-child(3) { text-decoration: none; }
.table .actions { text-align: right; }
.table select { min-height: 30px; padding-block: 2px; }
.callout {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--accent-soft);
}
.callout code { font: 600 14px/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--panel); user-select: all; }
.add-user { display: grid; grid-template-columns: 2fr 1.5fr 1fr auto; gap: 8px; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0; }  /* its own row under the logo */
  .me { display: none; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-user { grid-template-columns: 1fr; }
}

/* Gallery */
.page.wide { max-width: 1280px; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gallery-filters .segmented { flex: 0 1 auto; }
.gallery-filters .seg { height: 34px; padding: 0 12px; }
.gallery-filters input[type="search"] { flex: 1 1 200px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); }
.gallery-filters select { width: auto; flex: 0 1 auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: none; text-align: left;
  cursor: pointer; color: inherit; font: inherit; min-width: 0;
}
.tile-img { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--sunken); box-shadow: var(--shadow-sm); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.tile:hover .tile-img img { transform: scale(1.03); }
.tile:focus-visible .tile-img { outline: 2px solid var(--focus); outline-offset: 2px; }
.tile-badge {
  position: absolute; top: 7px; right: 7px; padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: rgb(0 0 0 / 0.6); color: #fff;
}
.tile-badge-reel { right: auto; left: 7px; }
.tile-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; }
.more-row { display: flex; justify-content: center; }
.item-dialog { width: min(520px, 100vw); }
.item-body { display: flex; flex-direction: column; gap: 12px; }
.item-body .post-img { width: 100%; border-radius: 10px; display: block; }
.item-actions { display: flex; flex-direction: column; gap: 8px; }
.caption-text { white-space: pre-wrap; }

/* Create: three numbered steps */
.step { display: flex; flex-direction: column; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.step-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.step-h i {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 700 12px/1 var(--sans, inherit); font-style: normal;
}
.step-h small { margin-left: auto; font-size: 12px; font-weight: 450; color: var(--muted); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.step > summary { cursor: pointer; list-style: none; }
details.step > summary::-webkit-details-marker { display: none; }
details.step:not([open]) { gap: 0; }
.photo-options { display: flex; flex-direction: column; gap: 16px; padding: 14px; border-radius: 12px; background: var(--sunken); }
.suggestions { display: flex; flex-direction: column; gap: 6px; }
.sug {
  display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; font: inherit;
}
.sug:hover { border-color: var(--line-strong); }
.sug[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.sug-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.sug-used { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.sug-used.fresh { color: var(--success, #15803d); }
.sug-text { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brief-summary { font-size: 12.5px; color: var(--ink-2); text-align: center; margin-bottom: -6px; }

/* Voice-over settings */
.voice-settings { display: flex; flex-direction: column; gap: 12px; }
.voice-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 320px; overflow-y: auto; }
.voice-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.voice-row:last-child { border-bottom: 0; }
.voice-row:has(input:checked) { background: var(--accent-soft); }
.voice-row input { accent-color: var(--accent); }
.voice-name { font-weight: 600; }
.voice-row .btn { margin-left: auto; height: 30px; }
.occasion small { color: var(--muted); font-weight: 450; margin-left: 2px; }
.situation { display: flex; gap: 6px; }
.situation input { flex: 1; min-width: 0; }
.sug-for { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
