/* L.H BRIEF — L.H Group design system · single font (Heebo) · mobile-first */
:root {
  --ink: #0A0A0F;
  --paper: #FAFAF7;
  --gold: #9C7C38;
  --gold-soft: #C9A961;
  --line: #E4E1D8;
  --muted: #6B6B66;
  --red: #B3402E;
  --rec: #F5372B;          /* real record-button red */
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  font-size: 17px; line-height: 1.6;
}

/* one uniform type scale — all Heebo */
.display { font-weight: 800; font-size: 40px; line-height: 1.15; letter-spacing: -0.5px; }
.display.sm { font-size: 28px; }
h1, h2, h3 { font-weight: 700; }
h2 { font-size: 21px; }

.topbar {
  display: flex; align-items: baseline; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: var(--paper); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: 1.5px; }
.brand-lh { color: var(--gold); }
.topbar-sub { color: var(--muted); font-size: 14px; font-weight: 300; }

.view { width: 100%; max-width: 760px; margin: 0 auto; padding: 30px 18px 60px; flex: 1; }
.hidden { display: none !important; }
.muted-sm { color: var(--muted); font-size: 14px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* login */
.login-card { max-width: 460px; margin: 5vh auto 0; }
.lead { color: var(--muted); margin: 12px 0 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
input, textarea {
  width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--paper); color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }

.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none; text-align: center;
  font: inherit; font-weight: 600; padding: 13px 24px; border-radius: 999px;
  transition: transform .06s, opacity .15s; min-height: 46px;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { opacity: .92; }
.btn-ink { background: var(--gold); color: #fff; font-size: 18px; padding: 15px 32px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost.danger:hover { border-color: var(--red); color: var(--red); }
.sm-btn { padding: 9px 16px; font-size: 14px; min-height: 40px; }
#btn-login { width: 100%; margin-top: 4px; }

.err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 20px; }
.row-btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.back { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 15px; margin-bottom: 14px; padding: 6px 0; }
.back:hover { color: var(--gold); }
.meta { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ============ CLIENT record screen (mobile-first) ============ */
.rec-project { text-align: center; margin: 10px 0 8px; }
.rec-project-label { color: var(--gold); font-weight: 600; font-size: 13px; letter-spacing: 1px; }
.rec-project .display.sm { margin-top: 2px; }
.rec-project .meta { justify-content: center; }

.stage { text-align: center; padding: 24px 8px 8px; }

/* the record button — a real round red record button */
.rec {
  width: 108px; height: 108px; border-radius: 50%;
  background: #fff; border: 5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, transform .06s;
  box-shadow: 0 6px 20px rgba(245,55,43,.14);
}
.rec:active { transform: scale(.96); }
.rec:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 4px; }
.rec-dot {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--rec); transition: width .22s, height .22s, border-radius .22s;
}
.rec.live { border-color: var(--rec); animation: recpulse 1.3s ease-in-out infinite; }
.rec.live .rec-dot { width: 36px; height: 36px; border-radius: 9px; } /* → stop square */
@keyframes recpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,55,43,.45); }
  50%     { box-shadow: 0 0 0 16px rgba(245,55,43,0); }
}
@media (prefers-reduced-motion: reduce) { .rec.live { animation: none; } }

.rec-timer { font-weight: 700; font-size: 34px; color: var(--ink); margin: 16px 0 4px; direction: ltr; font-variant-numeric: tabular-nums; }
.rec-status { font-weight: 500; font-size: 17px; color: var(--muted); }
#wave { width: 100%; max-width: 460px; height: 60px; display: block; margin: 14px auto 0; }
.upload-row { margin-top: 16px; }
.upload-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--gold); font-size: 15px; font-weight: 500; border: 1px dashed var(--gold-soft); border-radius: 999px; padding: 9px 18px; }
.upload-btn:hover { background: #F3EDE0; }
.stage-hint { color: var(--muted); font-size: 14px; margin: 18px auto 0; max-width: 460px; }

.done-note { text-align: center; color: var(--muted); font-size: 15px; margin-top: 24px; background: #F3EDE0; border-color: #E7DcC4; }
.done-note strong { color: var(--ink); }

/* segments (both client + admin) */
.segs-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; gap: 10px; flex-wrap: wrap; }
.segments { display: grid; gap: 10px; }
.seg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; }
.seg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seg-kind { font-size: 14px; color: var(--ink); font-weight: 600; }
.seg-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px; }
.seg-del:hover { color: var(--red); }
.seg-edit { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--gold); cursor: pointer; font: inherit; font-size: 13px; padding: 4px 12px; }
.seg-edit:hover { border-color: var(--gold); }
.seg-status { font-size: 12px; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.st-sent  { background: #E7F3EA; color: #2E7D46; }
.st-proc  { background: #FBF3E0; color: #A67C1A; }
.st-err   { background: #FBE6E2; color: var(--red); }
.seg-text { font-size: 15px; color: #333; white-space: pre-wrap; margin-top: 10px; max-height: 160px; overflow: auto; line-height: 1.55; }
.seg audio { width: 100%; margin-top: 10px; height: 38px; }
.seg-retry { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--gold); cursor: pointer; font: inherit; font-size: 13px; padding: 5px 12px; margin-top: 10px; }

/* ============ MANAGER panel ============ */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.briefs { display: grid; gap: 12px; margin-top: 16px; }
.brief-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; cursor: pointer; transition: border-color .15s;
}
.brief-row:hover { border-color: var(--gold); }
.brief-main { flex: 1; min-width: 0; cursor: pointer; }
.brief-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.row-del { background: none; border: 1px solid var(--line); border-radius: 999px; width: 30px; height: 30px; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; flex: 0 0 auto; }
.row-del:hover { border-color: var(--red); color: var(--red); }
.brief-row .t { font-weight: 700; font-size: 17px; }
.brief-row .s { color: var(--muted); font-size: 14px; margin-top: 2px; }
.badge { font-size: 12px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.badge.rec { background: #F3EDE0; color: var(--gold); }
.badge.done { background: var(--ink); color: var(--paper); }
.badge.warn { background: #FBF3E0; color: #A67C1A; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* share box (new project) */
.share-box { background: #F3EDE0; border-color: #E7DcC4; margin-bottom: 16px; }
.share-title { font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.share-k { color: var(--muted); font-size: 13px; min-width: 44px; }
.share-code { font-weight: 800; font-size: 22px; letter-spacing: 3px; color: var(--gold); direction: ltr; }
.share-link { direction: ltr; font-size: 13px; }
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.proj-share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 8px; }

/* generate */
.gen { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; flex-wrap: wrap; background: var(--ink); color: var(--paper); border: none; }
.gen p { color: #BDBDB6; font-size: 15px; margin-top: 4px; }

/* result */
.result-head { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 14px; gap: 12px; flex-wrap: wrap; }
.brief-doc { padding: 28px 26px; }
.brief-doc h2 { color: var(--gold); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 24px 0 12px; }
.brief-doc h2:first-child { margin-top: 0; }
.brief-doc h3 { font-size: 17px; margin: 18px 0 8px; }
.brief-doc ul { padding-right: 22px; margin: 8px 0; }
.brief-doc li { margin-bottom: 5px; }
.brief-doc p { margin-bottom: 10px; }
.brief-doc table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; display: block; overflow-x: auto; }
.brief-doc th, .brief-doc td { border: 1px solid var(--line); padding: 8px 12px; text-align: right; }
.brief-doc th { background: var(--paper); }

/* busy overlay */
.busy { position: fixed; inset: 0; background: rgba(10,10,15,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.busy-box { background: var(--paper); border-radius: var(--radius); padding: 28px 40px; text-align: center; font-weight: 500; }
.spin { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 14px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; border-top: 1px solid var(--line); }

/* ---- mobile tuning (primary target) ---- */
@media (max-width: 560px) {
  .topbar { padding: 14px 18px; }
  .topbar-sub { display: none; }
  .view { padding: 22px 16px 50px; }
  .display { font-size: 30px; }
  .display.sm { font-size: 25px; }
  .rec { width: 128px; height: 128px; }        /* bigger thumb target on phones */
  .rec-dot { width: 74px; height: 74px; }
  .rec.live .rec-dot { width: 42px; height: 42px; }
  .rec-timer { font-size: 38px; }
  .gen { justify-content: center; text-align: center; }
  .gen .btn { width: 100%; }
  .proj-head { flex-direction: column; }
}
