:root {
  --ink: #172033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --paper: #ffffff;
  --wash: #f7f8fb;
  --blue: #2e6af2;
  --blue-dark: #1f4fd0;
  --blue-soft: #eef4ff;
  --purple: #8d45ff;
  --gold: #f2a900;
  --danger: #c4320a;
  --danger-soft: #fff1ed;
  --success: #027a48;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(23, 32, 51, .08);
  font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--wash); }
body { margin: 0; min-height: 100vh; background: var(--wash); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(46, 106, 242, .28); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-page { padding-left: 236px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 236px; padding: 28px 18px 20px; border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.brand img { display: block; width: 128px; max-height: 42px; object-fit: contain; object-position: left center; }
.brand span { display: none; }
.side-nav { display: grid; gap: 5px; margin-top: 46px; }
.side-nav a { min-height: 44px; padding: 0 12px; border-radius: 9px; display: flex; align-items: center; gap: 12px; color: #475467; text-decoration: none; font-size: 14px; font-weight: 550; }
.side-nav a > span { width: 21px; color: var(--subtle); font-size: 10px; font-weight: 700; }
.side-nav a small { margin-left: auto; padding: 2px 6px; border-radius: 99px; background: #f2f4f7; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.side-nav a:hover { background: var(--wash); color: var(--ink); }
.side-nav a.is-active { background: var(--blue-soft); color: var(--blue-dark); }
.side-nav a.is-active > span { color: var(--blue); }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.sidebar-foot small { color: var(--subtle); font-size: 10px; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); text-align: left; font-size: 13px; }
.text-button:hover { color: var(--danger); }

.app-main { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 64px; }
.mobile-header { display: none; }
.hero-row { min-height: 150px; margin-bottom: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.hero-row.compact { min-height: auto; margin-bottom: 30px; }
.hero-row h1 { max-width: 780px; margin: 8px 0 10px; color: #101828; font-size: clamp(32px, 4vw, 50px); line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; }
.hero-row.compact h1 { font-size: clamp(30px, 3.3vw, 43px); }
.hero-row > .button, .hero-row > .status-badge, .hero-row > .text-link { flex: 0 0 auto; margin-top: 18px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.lede { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.quiet-note { color: var(--subtle); font-size: 11px; line-height: 1.55; }

.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 13px; font-weight: 650; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 8px rgba(46,106,242,.18); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--paper); color: #344054; }
.button-secondary:hover { border-color: #aeb4bf; background: #fafafa; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--wash); color: var(--ink); }
.button-danger { background: var(--danger); color: #fff; }
.button-full { width: 100%; }
.button-small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.danger-text { color: var(--danger); }
.text-link, .section-title a { color: var(--blue-dark); text-decoration: none; font-size: 13px; font-weight: 650; }
.text-link:hover, .section-title a:hover { text-decoration: underline; }

.start-grid { margin-bottom: 34px; display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; }
.start-option { min-height: 220px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); display: flex; flex-direction: column; text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.start-option:hover { transform: translateY(-3px); border-color: #bcc9ea; box-shadow: var(--shadow); }
.start-option.start-primary { background: linear-gradient(145deg, #1d4fd7 0%, #2e6af2 70%, #4a74e8 100%); color: #fff; border-color: transparent; }
.option-number { color: var(--subtle); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.start-primary .option-number { color: rgba(255,255,255,.65); }
.start-option div { margin: auto 0; }
.start-option h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.start-option p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.start-primary p { color: rgba(255,255,255,.76); }
.start-option strong { margin-top: 16px; color: var(--blue-dark); font-size: 12px; }
.start-primary strong { color: #fff; }

.metric-strip { margin-bottom: 34px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.metric-strip article { padding: 2px 24px; border-right: 1px solid var(--line); display: grid; gap: 3px; }
.metric-strip article:first-child { padding-left: 0; }
.metric-strip article:last-child { border-right: 0; }
.metric-strip span, .metric-strip small { color: var(--muted); font-size: 11px; }
.metric-strip strong { color: #101828; font-size: 28px; letter-spacing: -.04em; }

.content-grid { display: grid; grid-template-columns: 1.65fr .85fr; gap: 18px; }
.panel, .editor-surface, .media-surface, .setup-panel, .trend-seed, .readiness-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel { padding: 24px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-title h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.025em; }
.recent-list { margin-top: 18px; }
.recent-item { min-height: 68px; padding: 13px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; }
.recent-item:first-child { border-top: 0; }
.recent-item a { min-width: 0; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 650; }
.recent-item a small { margin-top: 4px; display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.recent-date { color: var(--subtle); font-size: 10px; }
.operations-panel > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.operations-panel .button { margin-top: 8px; }
.loading-line, .empty-state { padding: 30px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0; }

.status-badge { min-height: 24px; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #f2f4f7; color: #475467; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-draft { background: #edf2f8; color: #4b5f78; }
.status-approved, .status-posted { background: var(--success-soft); color: var(--success); }
.status-failed, .status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-in-progress { background: var(--blue-soft); color: var(--blue-dark); }
.form-message { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-message.is-error { color: var(--danger); }
.form-message.is-success { color: var(--success); }
.form-message.is-warning { color: #915500; }
.version-warning { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 390px; padding: 14px 18px; border-radius: 10px; background: #101828; color: #fff; box-shadow: var(--shadow); font-size: 12px; }

label { display: grid; gap: 7px; color: #344054; font-size: 11px; font-weight: 650; }
label span { color: var(--subtle); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); }
input, select { min-height: 42px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b7bec8; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(46,106,242,.1); }

.library-tools { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); display: grid; grid-template-columns: minmax(230px, 1fr) 155px 185px 155px auto; gap: 10px; }
.library-tools label { display: block; }
.library-summary { min-height: 62px; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.library-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.visual-summary { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.visual-count, .visual-badge { border-radius: 999px; display: inline-flex; align-items: center; white-space: nowrap; font-weight: 700; }
.visual-count { min-height: 23px; padding: 3px 8px; font-size: 9px; }
.visual-count-ready, .visual-ready { background: var(--success-soft); color: var(--success); }
.visual-count-prompt, .visual-prompt { background: #fff4d6; color: #7a4b00; }
.visual-count-none, .visual-none { background: #eef1f5; color: #526174; }
.library-list { border-top: 1px solid var(--line); }
.library-row { padding: 18px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) 125px 90px 125px auto; align-items: center; gap: 14px; }
.library-copy { min-width: 0; }
.library-copy h2 { margin: 0 0 5px; overflow: hidden; font-size: 15px; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.library-copy p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.library-meta { color: var(--muted); font-size: 10px; line-height: 1.55; }
.library-meta strong { display: block; color: var(--ink); font-size: 11px; }
.library-created { margin-top: 2px; display: block; color: var(--muted); font-size: 9px; line-height: 1.45; white-space: normal; }
.library-ai-tool { margin-top: 3px; display: block; overflow: hidden; color: #40566f; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.library-visual { min-width: 0; }
.visual-badge { min-height: 24px; padding: 3px 8px; font-size: 9px; }
.library-visual small { margin-top: 4px; display: block; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-actions .button { min-height: 34px; padding: 0 11px; font-size: 11px; }
.delete-inline { grid-column: 1 / -1; margin: 2px 0 4px; padding: 13px 14px; border: 1px solid #fecdca; border-radius: 9px; background: var(--danger-soft); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.delete-inline p { margin: 0; color: #912018; font-size: 11px; }

.mode-switch { width: fit-content; margin-bottom: 20px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #eef0f4; display: flex; }
.mode-switch button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.mode-switch button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.is-role-disabled { opacity: .5; filter: grayscale(1); cursor: not-allowed !important; pointer-events: none; }
.is-role-disabled::after { content: 'Admin only'; margin-left: 7px; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.setup-panel { margin-bottom: 20px; padding: 24px; }
.provider-note { color: var(--muted); font-size: 10px; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: 1.2fr 1fr .8fr; }
.setup-panel .field-grid { margin-top: 18px; }
.setup-panel > label { margin-top: 14px; }
.setup-actions { margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.trend-seed { margin-bottom: 20px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.trend-seed h2 { margin: 5px 0 6px; font-size: 17px; }
.trend-seed p:not(.eyebrow) { max-width: 760px; margin: 0 0 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.trend-seed a { color: var(--blue); font-size: 11px; text-decoration: none; }

.composer { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 18px; }
.editor-surface, .media-surface { padding: 24px; }
.editor-surface { display: grid; gap: 17px; }
.post-copy { min-height: 340px; font-size: 14px; }
.content-check { display: block; }
.content-check.is-ready { color: var(--success); }
.content-check.is-warning { color: #915500; }
.field-help { color: var(--subtle); font-size: 10px; font-weight: 400; }
.identity-line { padding-top: 13px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; line-height: 1.6; }
.media-surface { align-self: start; }
.image-dropzone { min-height: 230px; margin-top: 18px; border: 1px dashed #b9c2d0; border-radius: 11px; background: #fafbfc; display: grid; place-items: center; overflow: hidden; text-align: center; }
.image-dropzone.is-dragging { border-color: var(--blue); background: var(--blue-soft); }
.image-dropzone img { width: 100%; height: 230px; object-fit: cover; }
.image-dropzone strong { display: block; margin-bottom: 5px; font-size: 12px; }
.image-dropzone span { color: var(--subtle); font-size: 9px; }
.media-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.media-actions .button { min-height: 35px; padding: 0 10px; font-size: 10px; }
.url-attach { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.url-attach input { min-width: 0; }
.ai-image-box { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.ai-image-box > label + label { margin-top: 10px; }
.model-choice { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); }
.model-note { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.model-note.is-warning { color: var(--danger); }
.image-provider-actions { margin-top: 10px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 7px; }
.provider-disclosure { margin: 8px 0 0; color: var(--subtle); font-size: 9px; line-height: 1.55; }
.pipeline-action { padding: 12px 0; border-top: 1px solid var(--line); }
.pipeline-action:first-of-type { border-top: 0; }
.pipeline-action strong { display: block; margin-bottom: 4px; font-size: 12px; }
.pipeline-action p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.puter-page { min-height: 100vh; padding: 34px 18px; background: var(--wash); }
.puter-shell { width: min(680px, 100%); margin: 0 auto; padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.puter-logo { width: 150px; margin-bottom: 24px; }
.puter-shell h1 { margin: 6px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.puter-shell .lede { margin-bottom: 22px; }
.puter-shell > .button { margin-top: 14px; }
.puter-result { margin-top: 20px; }
.puter-result img { width: 100%; max-height: 430px; margin-bottom: 10px; border-radius: 11px; object-fit: cover; }
.composer-footer { grid-column: 1 / -1; padding-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.composer-footer > div { display: flex; gap: 8px; }
.composer-footer .form-message { max-width: 680px; margin: 0; }

.trend-search { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: end; gap: 18px; }
.trend-search fieldset { margin: 0; padding: 0; border: 0; display: flex; gap: 6px; }
.trend-search legend { margin-bottom: 7px; color: #344054; font-size: 11px; font-weight: 650; }
.trend-search fieldset label { display: block; cursor: pointer; }
.trend-search fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.trend-search fieldset span { min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; display: grid; place-content: center; color: #344054; font-size: 10px; font-weight: 650; text-align: center; }
.trend-search fieldset small { display: block; color: var(--subtle); font-size: 8px; font-weight: 400; }
.trend-search fieldset input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.trend-meta { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.trend-meta span { color: var(--subtle); font-size: 10px; }
.trend-results { display: grid; gap: 10px; }
.trend-result { padding: 19px 21px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
.trend-result-content { min-width: 0; }
.trend-source-line { margin-bottom: 7px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.source-type { padding: 2px 6px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 750; }
.trend-result h2 { margin: 0 0 7px; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.trend-result p { max-width: 75ch; margin: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.6; }
.trend-result footer { margin-top: 10px; display: flex; gap: 14px; }
.trend-result footer a, .trend-result footer span { color: var(--blue-dark); font-size: 10px; text-decoration: none; }
.trend-result .button { align-self: center; }

.ads-roadmap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.roadmap-stage { min-height: 310px; padding: 28px; border-radius: var(--radius); background: #172b59; color: #fff; }
.roadmap-stage.muted { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.roadmap-stage > span { color: #b5c9ff; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.roadmap-stage.muted > span { color: var(--purple); }
.roadmap-stage h2 { margin: 26px 0 12px; font-size: 24px; letter-spacing: -.035em; }
.roadmap-stage p { color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.7; }
.roadmap-stage.muted p { color: var(--muted); }
.roadmap-stage ul { margin: 24px 0 0; padding-left: 18px; color: rgba(255,255,255,.72); font-size: 11px; line-height: 2; }
.roadmap-stage.muted ul { color: var(--muted); }
.readiness-panel { margin-top: 18px; padding: 24px; }
.readiness-panel h2 { margin: 5px 0 8px; font-size: 18px; }
.readiness-panel p:last-child { max-width: 850px; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.login-page { display: grid; place-items: center; padding: 24px; background: #f5f7fb; }
.login-shell { width: 100%; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.login-logo { width: 165px; margin-bottom: 24px; }
.login-card h1 { margin: 7px 0 9px; font-size: 30px; letter-spacing: -.04em; }
.login-description { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.otp-form { display: grid; gap: 12px; }
.otp-form input { font-size: 22px; letter-spacing: .28em; text-align: center; }
.security-note { margin: 20px 0 0; color: var(--subtle); font-size: 10px; text-align: center; }
.auth-form { display: grid; gap: 14px; }
.auth-divider { margin: 16px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.button-coming-soon:disabled { border-color: #d8dde7; background: #eef0f4; color: #8b93a3; cursor: not-allowed; box-shadow: none; }
.auth-links { margin-top: 18px; display: flex; justify-content: space-between; gap: 14px; font-size: 11px; }
.auth-links a { color: var(--blue-dark); }
.auth-links.single { justify-content: center; margin-top: 10px; }
.viewing-banner { margin: -8px 0 18px; padding: 10px 14px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-dark); font-size: 11px; }
.viewing-banner a { float: right; color: inherit; font-weight: 700; }
.user-list { display: grid; gap: 8px; }
.user-row { padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--paper); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; }
.user-identity { display: grid; gap: 3px; }
.user-identity strong { font-size: 14px; }.user-identity span,.user-identity small { color: var(--muted); font-size: 10px; }
.user-actions { display: flex; gap: 6px; }.user-manage { grid-column: 1/-1; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }.user-manage[hidden] { display: none; }
.role-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }.role-checks label { display: flex; align-items: center; gap: 6px; }
.team-create { margin-bottom: 22px; padding: 22px; }
.team-create .section-title { margin-bottom: 16px; }
.team-form { display: grid; gap: 14px; }
.team-form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.user-security-note { padding: 10px 12px; border-radius: 8px; background: #fff8e6; color: #7b5200; font-size: 10px; line-height: 1.5; }

.research-layout { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .75fr); align-items: start; gap: 18px; }
body[data-page-min-role]:not(.is-authorized) .app-main { visibility: hidden; }
.research-primary, .research-secondary { display: grid; gap: 18px; }
.research-builder, .voice-form { display: grid; gap: 16px; }
.research-builder .section-title, .voice-form .section-title { margin-bottom: 2px; }
.voice-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.voice-picker legend { margin-bottom: 8px; color: #344054; font-size: 11px; font-weight: 650; }
.voice-picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.voice-choice { min-width: 0; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; grid-template-columns: none; align-items: center; gap: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.voice-choice:hover { border-color: #b8c4d7; background: #fafcff; }
.voice-choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.voice-choice input { width: 16px; min-height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.voice-choice-copy { min-width: 0; display: grid; gap: 3px; }
.voice-choice-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.voice-choice-copy small { color: var(--muted); font-size: 9px; }
.research-run-list { margin-top: 14px; }
.research-run { min-height: 66px; padding: 13px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.research-run:first-child { border-top: 0; }
.research-run-copy { min-width: 0; }
.research-run h3 { margin: 0 0 4px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.research-run p { margin: 0; color: var(--muted); font-size: 9px; }
.setup-readout h2 { margin: 0 0 12px; font-size: 16px; }
.setup-readout > p { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.config-list { border-top: 1px solid var(--line); }
.config-item { min-height: 38px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; }
.config-item span { color: var(--muted); }
.config-item strong { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.config-ready { color: var(--success); }
.config-missing { color: var(--warning); }
.research-results-panel { margin-top: 18px; }
.research-result-list { margin-top: 14px; }
.voice-post { padding: 20px 0; border-top: 1px solid var(--line); }
.voice-post:first-child { border-top: 0; }
.voice-post header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.voice-post header div { display: grid; gap: 3px; }
.voice-post header strong { font-size: 13px; }
.voice-post header span, .engagement-line { color: var(--muted); font-size: 9px; }
.voice-post-copy { max-width: 75ch; margin: 14px 0; color: #344054; font-size: 11px; line-height: 1.7; white-space: pre-line; text-wrap: pretty; }
.voice-analysis { max-width: 900px; padding: 14px 16px; border-radius: 9px; background: var(--wash); display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 14px; }
.voice-analysis strong { color: #344054; font-size: 9px; }
.voice-analysis p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.voice-transcript, .transcript-status { grid-column: 1 / -1; }
.voice-transcript summary { cursor: pointer; color: #344054; font-size: 10px; font-weight: 700; }
.voice-transcript p { max-height: 320px; margin-top: 10px; overflow: auto; white-space: pre-wrap; }
.voice-post footer { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; }

.settings-metrics { grid-template-columns: repeat(3, 1fr); }
.settings-notice { margin-bottom: 18px; background: var(--warning-soft); }
.settings-notice.settings-notice-ready { background: var(--success-soft); }
.settings-notice h2 { margin: 0 0 5px; font-size: 16px; }
.settings-notice p { max-width: 78ch; margin: 0; color: #475467; font-size: 11px; line-height: 1.6; }
.settings-groups { display: grid; gap: 18px; }
.settings-group { padding-bottom: 8px; }
.settings-group .section-title { align-items: center; padding-bottom: 14px; }
.settings-group .section-title h2 { margin: 0; }
.settings-group-count { color: var(--muted); font-size: 10px; }
.settings-list { border-top: 1px solid var(--line); }
.setting-row { min-height: 112px; padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr); align-items: center; gap: 28px; }
.workflow-row { min-height: 92px; }
.workflow-action { justify-content: flex-end; }
.setting-copy { min-width: 0; }
.setting-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.setting-title h3 { margin: 0; font-size: 13px; }
.setting-title code { color: var(--blue-dark); font-size: 9px; overflow-wrap: anywhere; }
.setting-copy > p { max-width: 62ch; margin: 7px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.setting-meta { display: flex; align-items: center; gap: 8px; }
.setting-meta small { color: var(--subtle); font-size: 9px; }
.setting-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 8px; }
.setting-form input { min-width: 0; }
.setting-remove { color: var(--danger); }
.bootstrap-panel { margin-top: 18px; }
.bootstrap-panel .section-title p { max-width: 70ch; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.bootstrap-status { margin-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0 28px; }
.bootstrap-item { min-width: 150px; min-height: 42px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.bootstrap-item strong { color: #475467; font-size: 9px; text-transform: uppercase; }
.bootstrap-item .config-ready { color: var(--success); }
.bootstrap-item .config-missing { color: var(--warning); }
.setup-steps { margin: 18px 0 0; padding-left: 22px; color: #344054; font-size: 11px; line-height: 1.9; }
.setup-steps code { color: var(--blue-dark); font-size: 10px; }
.settings-footnote { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }

@media (max-width: 1050px) {
  .app-page { padding-left: 0; }
  .sidebar { display: none; }
  .app-main { width: min(100% - 32px, 900px); padding-top: 20px; }
  .mobile-header { height: 55px; margin-bottom: 34px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
  .mobile-header .brand img { width: 115px; }
  .start-grid { grid-template-columns: 1fr 1fr; }
  .start-primary { grid-row: span 2; }
  .content-grid { grid-template-columns: 1fr; }
  .research-layout { grid-template-columns: 1fr; }
  .research-secondary { grid-template-columns: 1fr 1fr; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; }
  .composer { grid-template-columns: 1fr; }
  .composer-footer { grid-column: 1; }
  .media-surface { order: 2; }
  .trend-search { grid-template-columns: 1fr; align-items: stretch; }
  .trend-search .button { width: 100%; }
  .library-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-tools .search-box { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .app-main { width: min(100% - 24px, 620px); padding-bottom: 38px; }
  .hero-row { display: block; }
  .hero-row > .button { margin-top: 20px; }
  .hero-row h1 { font-size: 34px; }
  .start-grid, .metric-strip, .field-grid.two, .field-grid.three, .ads-roadmap { grid-template-columns: 1fr; }
  .start-option { min-height: 185px; }
  .start-primary { grid-row: auto; }
  .metric-strip article { padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto; align-items: center; }
  .metric-strip article:last-child { border-bottom: 0; }
  .metric-strip article small { grid-column: 1; }
  .metric-strip article strong { grid-column: 2; grid-row: 1 / span 2; }
  .setting-form { grid-template-columns: 1fr auto; }
  .setting-form .setting-remove { grid-column: 1 / -1; justify-self: start; }
  .library-tools { grid-template-columns: 1fr; }
  .library-tools .search-box { grid-column: auto; }
  .library-row { grid-template-columns: 1fr auto; gap: 10px; }
  .library-copy { grid-column: 1 / -1; }
  .library-meta:nth-of-type(2) { display: none; }
  .library-visual { justify-self: end; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .delete-inline { display: block; }
  .delete-inline .row-actions { margin-top: 10px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; padding: 0 8px; font-size: 10px; }
  .setup-panel, .editor-surface, .media-surface { padding: 18px; }
  .setup-actions, .composer-footer, .trend-seed { display: block; }
  .setup-actions .form-message { margin-top: 10px; }
  .composer-footer > div { margin-top: 12px; justify-content: flex-end; }
  .trend-seed .button { margin-top: 14px; width: 100%; }
  .image-provider-actions { grid-template-columns: 1fr; }
  .trend-search fieldset { display: grid; grid-template-columns: repeat(3, 1fr); }
  .trend-result { grid-template-columns: 1fr; }
  .trend-result .button { width: 100%; }
  .recent-item { grid-template-columns: 1fr auto; }
  .research-secondary, .voice-picker-list { grid-template-columns: 1fr; }
  .research-run { grid-template-columns: 1fr auto; }
  .research-run .button { grid-column: 1 / -1; width: 100%; }
  .voice-post header { display: grid; }
  .voice-analysis { grid-template-columns: 1fr; }
  .recent-date { display: none; }
  .login-card { padding: 28px 22px; }
}
