/* Note20 Voice: shared design for every page.
   A personal voice booth. Mist-white ground, plum-graphite ink for "where you are",
   raspberry only for voice and action. Flat sheets, no drop shadows. */
@import url("https://cdn.jsdelivr.net/gh/wanteddev/wanted-sans@v1.0.3/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css");

:root {
  color-scheme: light;
  --ground: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink: #23202b;
  --ink-2: #5a5866;
  --ink-3: #6c6a78;
  --line: #e4e5eb;
  --line-strong: #cfd0da;
  --solid: #23202b;           /* current tab, your own messages */
  --solid-ink: #ffffff;
  --accent: #d62a66;          /* raspberry: voice and action */
  --accent-hover: #bc1f57;
  --accent-ink: #ffffff;
  --accent-soft: #fce8ef;
  --accent-soft-ink: #a1184b;
  --danger: #c4302b;
  --danger-soft: #fdecea;
  --ok: #1f7a52;
  --rec: #d62a66;
  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace, var(--font);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #15141a;
    --surface: #1d1c24;
    --surface-2: #27262f;
    --ink: #f1eff6;
    --ink-2: #b6b3c3;
    --ink-3: #9a97a9;
    --line: #2e2c38;
    --line-strong: #403d4d;
    --solid: #f1eff6;
    --solid-ink: #1d1c24;
    --accent: #ff6b9c;
    --accent-hover: #ff89b1;
    --accent-ink: #2a0716;
    --accent-soft: #3a1a28;
    --accent-soft-ink: #ffb3cc;
    --danger: #ff8a80;
    --danger-soft: #3b1c1a;
    --ok: #6fd3a3;
    --rec: #ff6b9c;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 450 16px/1.6 var(--font); letter-spacing: -0.012em; word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; accent-color: var(--accent); caret-color: var(--accent);
  scrollbar-color: var(--line-strong) transparent;
}
::selection { background: var(--accent-soft); color: var(--accent-soft-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
h3 { letter-spacing: -0.02em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 0 16px; height: 64px; display: grid;
  grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800;
  font-size: 16px; letter-spacing: -0.035em; white-space: nowrap; justify-self: start; }
.brand svg { width: 26px; height: 26px; flex: none; }
/* segmented control: the current page is a solid ink pill */
.nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.nav a { padding: 7px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none;
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--solid); color: var(--solid-ink); }
.icon-btn { justify-self: end; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: none; color: var(--ink-2); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
@media (max-width: 680px) {
  .topbar-in { grid-template-columns: 1fr auto; height: auto; padding: 8px 12px 10px; row-gap: 8px; }
  .brand { height: 40px; padding-left: 4px; }
  .nav { grid-column: 1 / -1; grid-row: 2; }
  .nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 14px; }
}

.page { max-width: 1040px; margin: 0 auto; padding: 32px 16px 72px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 220px; }
.page-head p { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
@media (max-width: 680px) { .page { padding-top: 22px; } h1 { font-size: 26px; } }

/* ---------- surfaces: flat sheets ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.panel-head h2 { flex: 1; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px;
  font-weight: 800; background: var(--solid); color: var(--solid-ink); flex: none; }
.hint { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.muted { color: var(--ink-3); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
@media (max-width: 680px) { .panel { padding: 20px 18px; border-radius: 20px; } }

/* ---------- controls ---------- */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
input[type=text], input:not([type]), select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); width: 100%; min-width: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 14px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c6a78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
textarea { resize: vertical; line-height: 1.7; }
::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 15px;
  font-weight: 650; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  letter-spacing: -0.02em; transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.rec { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); }
.btn.sm { font-size: 13px; padding: 6px 12px; gap: 4px; }
.btn.block { width: 100%; padding: 13px 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; transform: none; }
.btn.primary:disabled:hover { background: var(--accent); }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--accent-ink); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:not(.primary).busy::after { border-color: var(--ink-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-btn { position: relative; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 3px 11px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; flex: none; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.status.running::before { background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.status.done::before { background: var(--ok); }
.status.failed::before { background: var(--danger); }
.status.failed { color: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }

.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.level { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.level > div { height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }

.notice { font-size: 14px; min-height: 22px; color: var(--ink-2); }
.notice.err { color: var(--danger); }
.notice.ok { color: var(--ok); }

audio { width: 100%; height: 40px; display: block; }

/* list of records (jobs, voices) */
.records { list-style: none; margin: 0; padding: 0; }
.records > li { padding: 18px 0; border-top: 1px solid var(--line); min-width: 0; }
.records > li:first-child { border-top: 0; padding-top: 2px; }
.records > li:last-child { padding-bottom: 2px; }
.record-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record-text { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; word-break: keep-all;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.record-text.open { -webkit-line-clamp: unset; }
.record-text.quiet { color: var(--ink-2); font-size: 14px; }
.record-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.record > audio, .record audio { margin-top: 12px; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); font-size: 14px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; font-weight: 750; letter-spacing: -0.03em; margin-bottom: 4px; }

/* two-column work area */
.work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.work .panel + .panel { margin-top: 0; }
@media (max-width: 860px) { .work { grid-template-columns: minmax(0, 1fr); } }
.sticky { position: sticky; top: 80px; }
@media (max-width: 860px) { .sticky { position: static; } }
