/* =========================================================
   SINAL — design tokens
   ========================================================= */
:root{
  --bg:            #0A0E1B;
  --bg-soft:       #0D1224;
  --surface:       #121834;
  --surface-2:     #1A2140;
  --surface-3:     #232B52;
  --border:        #2A3260;
  --border-soft:   #1E2547;

  --text:          #F3F5FC;
  --text-dim:      #B7BEDC;
  --text-mute:     #7C84AC;

  --blue:          #5B7CFF;
  --violet:        #9B6BF2;
  --pink:          #F0568C;
  --grad: linear-gradient(115deg, var(--blue) 0%, var(--violet) 55%, var(--pink) 100%);
  --grad-soft: linear-gradient(115deg, rgba(91,124,255,.16) 0%, rgba(155,107,242,.16) 55%, rgba(240,86,140,.16) 100%);

  --green:         #34D399;
  --amber:         #FBBF24;
  --red:           #F26D6D;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.6);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height:1.55;
  -webkit-font-smoothing: antialiased;
  min-height:100dvh;
  position:relative;
}
h1,h2,h3,h4{ font-family: var(--font-display); margin:0 0 .4em; letter-spacing:-.01em; }
p{ margin:0 0 1em; }
p:last-child{ margin-bottom:0; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family:inherit; }
textarea,input,select{ font-family:inherit; font-size:16px; }
:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; border-radius:6px; }
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

.bg-noise{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(circle at 15% -10%, rgba(91,124,255,.18), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(240,86,140,.13), transparent 40%),
    radial-gradient(circle at 50% 120%, rgba(155,107,242,.14), transparent 50%);
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar{
  position:sticky; top:0; z-index:40;
  background: rgba(10,14,27,.82);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border-soft);
}
.topbar-inner{
  max-width:1180px; margin:0 auto;
  padding: 14px 18px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ display:flex; width:34px; height:34px; align-items:center; justify-content:center; border-radius:10px; background: var(--surface-2); border:1px solid var(--border); }
.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-name{ font-family:var(--font-display); font-weight:700; font-size:17px; }
.brand-sub{ font-size:11px; color:var(--text-mute); letter-spacing:.02em; }
.topbar-link{ font-size:12.5px; color:var(--text-dim); text-decoration:none; border-bottom:1px dashed var(--border); white-space:nowrap; }
.topbar-link:hover{ color:var(--text); }

/* =========================================================
   SHELL / HERO
   ========================================================= */
.shell{ position:relative; z-index:1; max-width:1180px; margin:0 auto; padding: 28px 18px 60px; }

.hero{ padding: 10px 0 26px; max-width:760px; }
.eyebrow{
  font-family:var(--font-mono); font-size:11.5px; text-transform:uppercase; letter-spacing:.14em;
  color:var(--text-mute); margin-bottom:14px;
}
.hero h1{ font-size: clamp(26px, 5vw, 40px); font-weight:700; line-height:1.12; }
.hero-lede{ color:var(--text-dim); font-size:15.5px; max-width:58ch; }

.hero-meter{ margin-top:22px; max-width:420px; }
.hero-meter-track{
  height:8px; border-radius:99px; background: var(--surface-2); border:1px solid var(--border-soft);
  overflow:hidden;
}
.hero-meter-fill{
  height:100%; width:0%; border-radius:99px; background: var(--grad);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.hero-meter-label{
  display:flex; align-items:baseline; gap:8px; margin-top:8px;
  font-family:var(--font-mono); font-size:12.5px; color:var(--text-mute);
}
.hero-meter-label #readinessPct{ color:var(--text); font-weight:600; }

/* =========================================================
   TABS (mobile)
   ========================================================= */
.tabs{
  display:flex; gap:6px; background:var(--surface); border:1px solid var(--border-soft);
  padding:5px; border-radius:14px; margin-bottom:18px;
}
.tab{
  flex:1; border:none; background:transparent; color:var(--text-mute);
  padding:10px 8px; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer;
  transition: color .15s, background .15s;
}
.tab.is-active{ background: var(--surface-3); color:var(--text); }
@media (min-width: 900px){ .tabs{ display:none; } }

/* =========================================================
   WORKSPACE LAYOUT
   ========================================================= */
.workspace{ display:block; }
@media (min-width: 900px){
  .workspace{
    display:grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
    gap: 22px;
    align-items:start;
  }
  .panel-form{ position:sticky; top:80px; max-height: calc(100dvh - 100px); overflow:auto; }
}

.panel{ min-width:0; }
.panel-form[hidden], .panel-result[hidden]{ display:none; }
@media (min-width:900px){
  .panel-form, .panel-result{ display:block !important; }
}

/* =========================================================
   FORM
   ========================================================= */
#briefForm{
  background: var(--surface);
  border:1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.field-group{
  border:none; margin:0 0 26px; padding:0;
}
.field-group + .field-group{
  border-top:1px solid var(--border-soft);
  padding-top:22px;
}
.field-group legend{
  display:flex; align-items:center; gap:8px;
  font-family:var(--font-display); font-size:14.5px; font-weight:600;
  color:var(--text); padding:0; margin-bottom:14px;
}
.legend-index{
  font-family:var(--font-mono); font-size:11px; color:var(--bg);
  background:var(--grad); width:20px; height:20px; border-radius:6px;
  display:inline-flex; align-items:center; justify-content:center; flex:none;
}
.field{ display:block; margin-bottom:14px; }
.field:last-child{ margin-bottom:0; }
.field-label{ display:block; font-size:12.5px; color:var(--text-dim); margin-bottom:6px; }
.field-label em{ color:var(--pink); font-style:normal; }

input[type="text"], input[type="number"], textarea, select{
  width:100%; background:var(--bg-soft); border:1px solid var(--border);
  color:var(--text); border-radius: var(--radius-sm); padding:11px 12px;
  resize:vertical; transition:border-color .15s, background .15s;
}
input::placeholder, textarea::placeholder{ color:var(--text-mute); }
input:focus, textarea:focus, select:focus{ border-color: var(--blue); background:#0E1430; }
select{ appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C84AC' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat; background-position: right 12px center; background-size:16px; padding-right:36px;
}
.field-half{ max-width:220px; }

.input-voice{ position:relative; display:flex; align-items:flex-start; }
.input-voice input, .input-voice textarea{ padding-right:44px; }
.voice-btn{
  position:absolute; right:6px; top:6px;
  width:32px; height:32px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface-2); color:var(--text-dim); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background .15s, color .15s, transform .15s;
}
.voice-btn:hover{ color:var(--text); background:var(--surface-3); }
.voice-btn.is-listening{
  color:#fff; background: var(--grad); border-color:transparent;
  animation: pulse 1.1s ease-in-out infinite;
}
.voice-btn[disabled]{ opacity:.35; cursor:not-allowed; }
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(155,107,242,.5);} 50%{ box-shadow:0 0 0 6px rgba(155,107,242,0);} }

.voice-note{ font-size:11.5px; color:var(--text-mute); margin-top:12px; text-align:center; }

.form-actions{ display:flex; gap:10px; margin-top:22px; flex-wrap:wrap; }
.btn-primary{
  flex:1; min-width:180px; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background: var(--grad); color:#fff; border:none; border-radius:12px;
  padding:13px 18px; font-weight:600; font-size:14.5px; cursor:pointer;
  box-shadow: 0 12px 24px -12px rgba(155,107,242,.55);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 16px 28px -12px rgba(155,107,242,.65); }
.btn-primary:active{ transform: translateY(0); }
.btn-ghost{
  background:transparent; border:1px solid var(--border); color:var(--text-dim);
  border-radius:12px; padding:13px 16px; font-size:13.5px; cursor:pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover{ border-color:var(--text-mute); color:var(--text); }

/* =========================================================
   RESULT PANEL — empty state
   ========================================================= */
.empty-state{
  border:1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 60px 24px; text-align:center; color:var(--text-mute);
  display:flex; flex-direction:column; align-items:center; gap:6px;
  min-height: 320px; justify-content:center;
}
.empty-state h2{ color:var(--text); font-size:18px; }
.empty-state p{ max-width:36ch; font-size:13.5px; }

.results[hidden]{ display:none; }
.results{ display:flex; flex-direction:column; gap:16px; }

.result-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  padding: 4px 2px 2px;
}
.result-toolbar-title{ display:flex; align-items:center; gap:10px; min-width:0; }
.result-toolbar-name{ font-family:var(--font-display); font-weight:600; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pill{
  font-family:var(--font-mono); font-size:10.5px; text-transform:uppercase; letter-spacing:.06em;
  padding:4px 9px; border-radius:99px; border:1px solid var(--border); color:var(--text-mute); flex:none;
}
.pill-live{ color:var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.btn-copy-all{
  display:inline-flex; align-items:center; gap:7px; background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:10px; padding:9px 13px; font-size:13px; font-weight:600;
  cursor:pointer; transition: background .15s, border-color .15s;
}
.btn-copy-all:hover{ background:var(--surface-3); border-color:var(--text-mute); }

/* =========================================================
   CARDS
   ========================================================= */
.card{
  background: var(--surface); border:1px solid var(--border-soft); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); overflow:hidden;
}
.card-head{
  display:flex; align-items:center; gap:10px; padding: 16px 18px 0;
}
.card-head h3{ font-size:14.5px; font-weight:600; }
.card-index{
  font-family:var(--font-mono); font-size:11px; color:var(--text-mute);
  width:24px; height:24px; border-radius:7px; border:1px solid var(--border);
  display:inline-flex; align-items:center; justify-content:center; flex:none;
}
.card-body{ padding: 12px 18px 18px; }
.muted{ color:var(--text-mute); }
.small{ font-size:12.5px; }

.card-alert{ border-color: rgba(251,191,36,.28); }
.card-alert .card-index{ color:var(--amber); border-color: rgba(251,191,36,.4); }
.card-integration{ border-color: rgba(91,124,255,.3); background: linear-gradient(180deg, rgba(91,124,255,.06), transparent 40%); }
.card-integration .card-index{ background: var(--grad); color:#fff; border:none; }

/* objective */
.objective-chip{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--font-display); font-weight:600; font-size:15px;
  padding: 9px 14px; border-radius:10px; background: var(--grad-soft);
  border:1px solid rgba(155,107,242,.35); color:var(--text); margin-bottom:10px;
}

/* structure tree */
.structure-tree{ font-family:var(--font-mono); font-size:13px; }
.tree-level{ display:flex; align-items:flex-start; gap:10px; padding:8px 0; }
.tree-level + .tree-level{ border-top:1px dashed var(--border-soft); }
.tree-tag{
  flex:none; width:74px; padding:3px 0; text-align:center; border-radius:6px;
  font-size:10.5px; letter-spacing:.04em; text-transform:uppercase;
  background:var(--surface-2); border:1px solid var(--border); color:var(--text-dim);
}
.tree-l1 .tree-tag{ color:var(--blue); border-color: rgba(91,124,255,.4); }
.tree-l2 .tree-tag{ color:var(--violet); border-color: rgba(155,107,242,.4); margin-left:16px; }
.tree-l3 .tree-tag{ color:var(--pink); border-color: rgba(240,86,140,.4); margin-left:32px; }
.tree-l2{ margin-left:0; }
.tree-l3{ margin-left:0; }
.tree-text{ color:var(--text-dim); padding-top:2px; font-family:var(--font-body); font-size:13px; }
.tree-text strong{ color:var(--text); font-weight:600; }

/* spec list (audience) */
.spec-list{ display:grid; grid-template-columns: 1fr; gap:0; margin:0; }
.spec-list div.spec-row{
  display:grid; grid-template-columns: 108px 1fr; gap:10px; padding:9px 0;
  border-top:1px solid var(--border-soft); align-items:baseline;
}
.spec-list div.spec-row:first-child{ border-top:none; }
.spec-key{ font-family:var(--font-mono); font-size:11px; color:var(--text-mute); text-transform:uppercase; letter-spacing:.04em; }
.spec-val{ font-size:13.5px; color:var(--text); }

/* budget */
.budget-grid{ display:grid; grid-template-columns: repeat(2,1fr); gap:10px; margin-bottom:10px; }
@media (min-width:520px){ .budget-grid{ grid-template-columns: repeat(3,1fr); } }
.budget-item{
  background:var(--surface-2); border:1px solid var(--border-soft); border-radius:12px; padding:12px;
}
.budget-item .b-label{ font-size:11px; color:var(--text-mute); margin-bottom:4px; }
.budget-item .b-value{ font-family:var(--font-mono); font-weight:600; font-size:16px; color:var(--text); }
.budget-item .b-value.accent{ background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; }

/* ad preview mock (generic social card, no real logos) */
.ad-preview{
  max-width:380px; margin:0 auto; background:#fff; color:#1c1e21; border-radius:14px; overflow:hidden;
  border:1px solid #e4e6eb; font-family: var(--font-body);
}
.ad-preview-head{ display:flex; align-items:center; gap:9px; padding:12px 14px 8px; }
.ad-preview-avatar{
  width:36px; height:36px; border-radius:50%; background: var(--grad); flex:none;
}
.ad-preview-meta{ line-height:1.2; }
.ad-preview-name{ font-size:13.5px; font-weight:700; color:#050505; }
.ad-preview-sponsored{ font-size:11.5px; color:#65676b; display:flex; align-items:center; gap:4px; }
.ad-preview-body{ padding:0 14px 10px; font-size:13.5px; color:#050505; white-space:pre-wrap; }
.ad-preview-media{
  height:190px; background: var(--grad-soft), linear-gradient(160deg,#eef0f5,#e4e7ef);
  background-blend-mode: overlay;
  display:flex; align-items:center; justify-content:center; position:relative;
  border-top:1px solid #eee; border-bottom:1px solid #eee;
}
.ad-preview-media span{
  font-family:var(--font-mono); font-size:11px; color:#8b8f9c; letter-spacing:.05em; text-transform:uppercase;
  background:rgba(255,255,255,.75); padding:5px 10px; border-radius:99px;
}
.ad-preview-footer{ padding:10px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.ad-preview-domain{ line-height:1.25; min-width:0; }
.ad-preview-domain .d-url{ font-size:10.5px; color:#65676b; text-transform:uppercase; letter-spacing:.03em; }
.ad-preview-domain .d-title{ font-size:13px; font-weight:700; color:#050505; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ad-preview-cta{
  flex:none; background:#e4e6eb; color:#050505; font-size:12.5px; font-weight:700;
  padding:8px 12px; border-radius:7px; white-space:nowrap;
}

/* copy list (texts / headlines) */
.copy-list{ display:flex; flex-direction:column; gap:10px; }
.copy-item{
  background:var(--surface-2); border:1px solid var(--border-soft); border-radius:12px;
  padding:12px 14px; display:flex; gap:10px; align-items:flex-start; justify-content:space-between;
}
.copy-item .copy-body{ min-width:0; }
.copy-item .copy-tag{
  font-family:var(--font-mono); font-size:10px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-mute); margin-bottom:5px; display:block;
}
.copy-item .copy-text{ font-size:13.5px; color:var(--text); white-space:pre-wrap; }
.copy-btn{
  flex:none; width:30px; height:30px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface-3); color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover{ color:var(--text); border-color:var(--text-mute); }
.copy-btn.is-copied{ color:var(--green); border-color: rgba(52,211,153,.4); }

/* CTA */
.cta-suggestion{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.cta-pill{
  font-family:var(--font-display); font-weight:600; font-size:14px;
  background:#e4e6eb; color:#050505; padding:9px 16px; border-radius:8px;
}
.cta-context{ font-size:12.5px; color:var(--text-mute); flex:1; min-width:180px; }

/* checklist */
.checklist{ display:flex; flex-direction:column; gap:9px; }
.checklist li{ display:flex; gap:10px; align-items:flex-start; font-size:13.5px; color:var(--text-dim); }
.checklist li::before{
  content:''; flex:none; width:16px; height:16px; margin-top:2px; border-radius:5px;
  background: var(--grad-soft); border:1px solid rgba(91,124,255,.4);
}

/* compliance */
.compliance-list{ display:flex; flex-direction:column; gap:10px; }
.compliance-list li{
  display:flex; gap:10px; font-size:13px; color:var(--text-dim); align-items:flex-start;
  padding-left:2px;
}
.compliance-list li::before{
  content:'!'; flex:none; width:18px; height:18px; border-radius:5px; font-size:11px; font-weight:700;
  display:flex; align-items:center; justify-content:center; color:#151a2e;
  background:var(--amber); margin-top:1px;
}

/* final textarea */
.final-textarea{
  width:100%; background:var(--bg-soft); border:1px solid var(--border); border-radius:12px;
  color:var(--text-dim); font-family:var(--font-mono); font-size:12px; padding:14px; line-height:1.6;
}

/* toast */
.toast{
  position:fixed; left:50%; bottom:22px; transform: translateX(-50%) translateY(120%);
  background: var(--surface-3); border:1px solid var(--border); color:var(--text);
  padding:11px 18px; border-radius:99px; font-size:13px; z-index:100;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.6);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  pointer-events:none;
}
.toast.is-visible{ transform: translateX(-50%) translateY(0); }

/* footer */
.site-footer{
  max-width:1180px; margin:40px auto 0; padding: 22px 18px 40px;
  border-top:1px solid var(--border-soft);
  color:var(--text-mute); font-size:12px; line-height:1.6;
}
