:root{color-scheme:light;--bg:#f3f5f3;--card:#fff;--text:#22352f;--muted:#708078;--border:#dfe7e1;--accent:#21745a;--danger:#b74444;--ok:#21745a;--radius:18px}
*{box-sizing:border-box} [hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.65 -apple-system,BlinkMacSystemFont,'Malgun Gothic','Apple SD Gothic Neo',sans-serif;word-break:keep-all;overflow-wrap:anywhere}
main{max-width:1080px;margin:0 auto;padding:0 32px 64px}.gate{max-width:460px;margin:0 auto;padding:24px;display:flex;min-height:100vh;align-items:center}.gate>.card{width:100%}
header{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:104px;border-bottom:1px solid var(--border);margin-bottom:34px}
.brand{display:flex;align-items:center;gap:12px}.brand-mark{display:grid;place-items:center;width:42px;height:42px;background:var(--accent);color:white;border-radius:14px;font:italic 700 25px Georgia,serif}.brand h1{font-size:18px;margin:0;letter-spacing:-.6px}.brand span:not(.brand-mark){font-size:11px;color:var(--muted)}
nav{display:flex;gap:4px;flex-wrap:wrap}button{font:inherit;font-size:13px;font-weight:600;min-height:42px;padding:10px 16px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--text);cursor:pointer;transition:background .15s,border-color .15s}button:hover:not(:disabled){border-color:#9ebcad;background:#f4f8f5}button:disabled{opacity:.5;cursor:wait}button:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #7ebfa1;outline-offset:3px}button.primary{background:var(--accent);border-color:var(--accent);color:white}button.primary:hover:not(:disabled){background:#185c47;border-color:#185c47}button.danger{color:var(--danger);border-color:#e8c9c9;background:#fff7f7}nav button{border:0;background:transparent;font-size:13px;padding:9px 16px}nav button.active{background:#e3ede6;color:#185c47}#logout-btn{color:var(--muted);font-weight:400}
h1,h2,h3{line-height:1.35;letter-spacing:-.6px}h2{font-size:21px;margin:0 0 12px}h3{font-size:16px;margin:22px 0 12px}p{margin:10px 0 18px}.page-heading{margin:0 0 26px}.page-heading h2{font-size:30px;font-weight:700;letter-spacing:-1.1px;margin-bottom:8px}.page-heading>p:last-child{color:var(--muted);font-size:14px;margin:0}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--accent);margin:0 0 10px}
#write-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 24px}#write-choices button{position:relative;display:grid;text-align:left;padding:20px 22px;gap:3px;border-radius:16px;background:#fff;min-width:0}#write-choices .choice-number{font-size:11px;color:#93a399;margin-bottom:9px;font-weight:500}#write-choices strong{font-size:16px;letter-spacing:-.4px}#write-choices small{font-size:12px;color:var(--muted);font-weight:400}#write-choices button[aria-pressed=true]{border-color:var(--accent);background:#edf5ef;box-shadow:inset 0 0 0 1px var(--accent)}#write-choices button[aria-pressed=true] .choice-number{color:var(--accent)}#write-choices button[aria-pressed=true]::after{content:'✓';position:absolute;top:17px;right:18px;color:var(--accent)}
.card{border:1px solid var(--border);border-radius:var(--radius);padding:28px 32px;margin-bottom:22px;background:var(--card);width:100%}.composer{box-shadow:0 8px 30px #233b2d04}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:26px}.section-heading h2{margin:0}.section-heading .eyebrow{margin-bottom:6px}.step-label{font-size:10px;white-space:nowrap;letter-spacing:1.3px;color:#92a096}
label{display:block;margin-bottom:20px;font-size:13px;font-weight:600}input:not([type=checkbox]):not([type=file]),select,textarea{display:block;width:100%;margin-top:8px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:#fbfcfa;color:var(--text);font:inherit;font-size:14px;font-weight:400;min-width:0}textarea{resize:vertical;line-height:1.85;min-height:100px}input:focus,select:focus,textarea:focus{outline:2px solid #acd1bb;outline-offset:1px;border-color:#5d9f7c}input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent);flex:none;margin:0}label.check{display:flex;align-items:center;gap:10px;font-weight:400}input[type=file]{width:100%;font-size:13px;color:var(--muted);margin-top:10px}input[type=file]::file-selector-button{padding:10px 14px;background:#f0f5f1;border:1px solid var(--border);border-radius:8px;margin-right:12px;color:var(--text);cursor:pointer}
#topic{max-width:480px}#manual-text{min-height:220px}#build-btn{min-width:230px;margin-top:18px}#build-help{margin:12px 0 0;font-size:12px}#authoring-help{max-width:650px;margin:0 0 20px;line-height:1.8}.source-note{padding:14px 18px;background:#f1f6f1;color:#4d685a;border-radius:10px;font-size:13px;margin:12px 0}.text-button{display:block;border:0;padding:5px 0;background:none!important;min-height:30px;font-size:12px;color:var(--accent)}
summary{cursor:pointer;list-style:none;font-size:14px;font-weight:600;display:flex;align-items:center;justify-content:space-between;gap:10px}summary::-webkit-details-marker{display:none}summary::after{content:'+';font:400 20px/1 sans-serif;color:#81998a;flex:none}details[open]>summary::after{content:'−'}details[open]>summary{margin-bottom:20px}.inline-options{margin:20px 0;padding:16px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.inline-options summary{font-size:13px}.optional{font-size:11px;font-weight:400;color:var(--muted);margin-left:auto}.inbox>summary{font-size:21px}.inbox>.actions{margin:20px 0}.inbox .card{padding:20px;margin-bottom:12px;border-radius:12px}.press-detail{margin-top:22px;border-top:1px solid var(--border);padding-top:20px}.press-detail>button{margin:8px 8px 8px 0}.press-detail label{margin-top:14px}.press-detail textarea{font-size:13px;background:#f8faf7}
.settings-section{background:white;border:1px solid var(--border);border-radius:14px;margin:12px 0;overflow:hidden}.settings-section>summary{padding:20px 24px;margin:0!important;font-size:16px}.settings-section>summary small{display:block;color:var(--muted);font-size:12px;font-weight:400;margin-top:5px}.settings-section[open]>summary{border-bottom:1px solid var(--border);background:#f9fbf8}.settings-body{padding:24px}.settings-body>details{margin:22px 0 0}.settings-footer{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:24px 0}.settings-footer>p{margin:0;flex:1}.settings-footer button{margin-left:auto}#settings-result{flex-basis:100%}.settings-body .primary{margin-top:10px}.settings-body h2{font-size:17px}
#topic-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.topic-row{display:grid;gap:14px;padding:20px;border:1px solid var(--border);border-radius:12px;background:#f9fbf8;min-width:0}.topic-card-header{display:flex;align-items:center;justify-content:space-between;gap:10px}.topic-row label{margin:0}.topic-row .field-label{font-size:11px;color:var(--muted);display:block;margin-bottom:5px}.topic-row .remove{color:var(--danger);font-size:12px;padding:6px 10px;min-height:32px}.topic-row textarea{min-height:90px}.topic-presets,.topic-actions{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}.topic-presets button{font-size:12px;padding:7px 12px;min-height:32px;border-radius:18px}.topic-advanced summary{color:var(--muted);font-size:12px}.topic-advanced-fields{display:grid;gap:12px;margin-top:15px}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 10px}.actions button{flex:0 1 auto}.muted{color:var(--muted)}.small{font-size:12px}.error{color:var(--danger);font-size:13px;white-space:pre-wrap;padding:12px 16px;border-radius:10px;background:#fff4f2}.ok{color:var(--ok);font-size:13px;overflow-wrap:anywhere}a{color:#267357;text-underline-offset:3px}a:hover{color:#124b38}.log,.list{list-style:none;margin:0;padding:0;font-size:14px}.log li{padding:6px 0 6px 20px;position:relative;color:var(--muted)}.log li::before{content:'·';position:absolute;left:4px}.log li:last-child{color:var(--text);font-weight:600}.list li{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);padding:20px 0}#draft-list li>div:first-child{flex:1 1 260px;overflow-wrap:anywhere}.list li:last-child{border:0}#automatic-post-status{max-height:150px;overflow:auto;font-size:12px}
.thumbs{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}.thumbs>div{display:grid;width:100px;gap:6px}.thumbs img{width:100px;height:90px;object-fit:cover;border-radius:10px;border:1px solid var(--border)}.thumbs button{font-size:11px;padding:4px 8px;min-height:28px}.block{margin-bottom:16px;padding:20px;border:1px solid var(--border);border-radius:12px;background:#fafbf9}.block .kind{display:block;font-size:11px;font-weight:600;color:var(--muted);margin-bottom:10px}.block textarea{background:white}.block.quote{border-left:3px solid #68a78b}.block img{max-width:100%;max-height:360px;border-radius:10px}.block a{overflow-wrap:anywhere}.block .actions{margin:10px 0 0;gap:6px}.block .actions button{font-size:11px;padding:6px 10px;min-height:30px}.draft-options{padding:16px 20px;background:#f8faf7;border:1px solid var(--border);border-radius:12px;margin:24px 0}#draft-source{line-height:1.8}#draft-blocks{margin-top:22px}#newspaper-articles>.card{padding:20px;border-radius:10px}#newspaper-articles a{display:block;font-size:14px;font-weight:600;text-decoration:none}#newspaper-articles button{margin-top:12px}.article-date{font-size:12px;color:var(--muted);margin:6px 0}
@media(max-width:720px){main{padding:0 18px 40px}header{align-items:flex-start;flex-direction:column;padding:20px 0;gap:16px;margin-bottom:26px}nav{width:100%}nav button{flex:1;padding:9px 8px}.page-heading h2{font-size:24px}.page-heading>p:last-child{font-size:13px}#write-choices{gap:7px}#write-choices button{padding:14px 10px;border-radius:12px}#write-choices strong{font-size:13px}#write-choices small{display:none}#write-choices .choice-number{margin-bottom:5px;font-size:10px}#write-choices button[aria-pressed=true]::after{top:12px;right:10px;font-size:11px}.card{padding:22px 18px;border-radius:14px}.section-heading{gap:10px;margin-bottom:20px}.section-heading h2{font-size:19px}.step-label{font-size:8px}.settings-section>summary{padding:18px}.settings-body{padding:18px}.settings-footer{display:block}.settings-footer button{width:100%;margin-top:12px}#topic-list{grid-template-columns:1fr}#build-btn{width:100%}.actions button{flex:1 1 130px}.block{padding:14px}.block .actions button{flex:0 1 auto}#topic{max-width:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.article-frame{border:1px solid var(--border);border-radius:12px;overflow:hidden;margin:18px 0;background:white}
.article-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:#f5f8f4;border-bottom:1px solid var(--border)}
.article-toolbar button{padding:7px 10px;min-height:32px;font-size:12px;background:white}
#draft-blocks.article-editor{margin:0;height:clamp(360px,65vh,760px);overflow-y:auto;overflow-x:hidden;padding:28px 32px;font-size:16px;line-height:1.9;outline:none;scrollbar-gutter:stable;overflow-anchor:none;overscroll-behavior:contain;white-space:pre-wrap;word-break:break-word}
.article-editor:focus{box-shadow:inset 0 0 0 2px #acd1bb}
.article-editor>p{margin:0 0 18px;min-height:1.9em}
.article-editor figure{margin:22px 0;white-space:normal;cursor:pointer}
.article-editor figure img{display:block;max-width:100%;max-height:500px;margin:auto;border-radius:6px}
.article-editor figcaption input,.article-editor footer input{font-size:12px!important;background:#fafcf9!important;margin:8px 0!important;white-space:normal}
.article-editor blockquote{margin:20px 0;padding:8px 18px;border-left:3px solid #68a78b;background:#f8faf7}
.article-editor blockquote p{margin:0}
.article-editor hr{margin:28px 0;border:0;border-top:1px solid var(--border);cursor:pointer}
.article-reference{margin:18px 0;padding:12px;background:#f8faf7;white-space:normal;font-size:13px}
.article-editor>.editor-selected{outline:none}
@media(max-width:720px){#draft-blocks.article-editor{padding:20px 16px;height:60vh;min-height:320px}.article-toolbar button{font-size:11px}}

/* Studio layout */
:root {
  --bg: #f3f5f1;
  --text: #20332b;
  --muted: #53665d;
  --border: #d8e1d9;
  --accent: #205f48;
  --radius: 14px;
}

header { min-height: 78px; margin-bottom: 30px; }
.brand-mark { border-radius: 10px; }
.page-heading { margin-bottom: 18px; }
.page-heading h2 { font-size: clamp(26px, 3vw, 34px); }
.page-heading .eyebrow, .section-heading .eyebrow, .step-label { display: none; }

#write-choices {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #e9eee8;
}
#write-choices button {
  align-content: center;
  min-height: 64px;
  padding: 9px 13px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
}
#write-choices button:hover:not(:disabled) { background: #f4f7f3; }
#write-choices button[aria-pressed=true] {
  border-color: #719582;
  color: var(--accent);
  background: #fff;
  box-shadow: none;
}
#write-choices button[aria-pressed=true]::after { content: none; }
#write-choices strong { font-size: 14px; }
#write-choices small { display: block; font-size: 12px; line-height: 1.45; }

.composer { box-shadow: none; }
.section-heading { margin-bottom: 20px; }
.compose-submit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 20px;
  padding-top: 16px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}
.compose-submit .check { margin: 0 0 4px; }
.compose-submit p { margin: 0; }
.compose-submit #build-help { grid-column: 2; text-align: right; }
.article-toolbar { background: #eff3ef; }
.article-editor:focus { box-shadow: inset 0 0 0 2px #719582; }
#draft-list li { padding: 16px 0; }

@media (max-width: 720px) {
  header { gap: 10px; padding: 14px 0 10px; margin-bottom: 20px; }
  nav button { min-height: 44px; }
  #write-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #write-choices button { padding-inline: 10px; }
  .compose-submit { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .compose-submit #build-help { grid-column: 1; text-align: left; }
  .article-toolbar button { min-height: 44px; }
}

/* Warm workspace */
:root {
  --bg: #eee8dc;
  --card: #faf6ed;
  --well: #f1eadf;
  --paper: #fffdf8;
  --text: #242e2a;
  --muted: #585c53;
  --border: #cfc6b7;
  --accent: #07565d;
  --accent-hover: #06434a;
  --accent-soft: #e3efeb;
  --focus: #087783;
  --danger: #963c34;
  --ok: #1b6254;
  --radius: 16px;
  --raised: 0 8px 18px #6b56321b, -1px -2px 6px #fffdfa;
  --recessed: inset 0 2px 4px #5b472317, inset 0 -1px 0 #fff9ec;
}
body {
  font-family: "DM Sans", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  accent-color: var(--accent);
  caret-color: var(--accent);
}
::selection { background: #c6e4dd; color: #153d3d; }
main { max-width: 1080px; }
header { min-height: 86px; }
.brand-mark { background: var(--accent); box-shadow: 0 3px 8px #073d4428; }
.brand h1 { color: #173f42; }
nav { gap: 6px; }
nav button { border-radius: 8px; }
nav button.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.page-heading { margin-bottom: 22px; }
.page-heading h2 { font-size: clamp(28px, 4vw, 40px); color: #193a39; letter-spacing: -.035em; text-wrap: balance; }
.page-heading > p:last-child { max-width: 64ch; }

button { background: var(--card); transition: background-color .16s, border-color .16s, box-shadow .16s; }
button:hover:not(:disabled) { background: var(--paper); border-color: #9d9d89; }
button.primary { border-radius: 100px; padding-inline: 22px; box-shadow: 0 3px 8px #073d4428; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:active:not(:disabled) { box-shadow: inset 0 2px 4px #03373b; }
button:disabled,button.primary:disabled { opacity: 1; color: #59594f; background: #ded7ca; border-color: #cfc5b5; box-shadow: none; cursor: not-allowed; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button.danger { background: #fbede8; border-color: #dbb3a9; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.card,.settings-section { background: var(--card); }
.composer,.gate>.card { border-color: transparent; box-shadow: var(--raised); }
#write-choices {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px; padding: 6px; margin-bottom: 23px;
  background: var(--well); box-shadow: var(--recessed);
}
#write-choices button { align-content: center; min-height: 64px; padding: 10px 16px; }
#write-choices button:hover:not(:disabled) { background: #f8f3e8; }
#write-choices button[aria-pressed=true] {
  color: var(--accent); background: var(--paper); border-color: transparent;
  box-shadow: inset 0 -2px var(--accent), 0 2px 6px #57462622;
}
input:not([type=checkbox]):not([type=file]),select,textarea {
  background: var(--paper); border-color: var(--border); box-shadow: var(--recessed);
}
input::placeholder,textarea::placeholder { color: #696b5e; opacity: 1; }
input:focus,select:focus,textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
input[type=file]::file-selector-button { background: var(--well); }
summary::after { color: var(--accent); }
.settings-section[open]>summary,.topic-row,.press-detail textarea,.block,.draft-options,.source-note,.article-reference {
  background: var(--well); color: var(--text);
}
.article-frame,.article-toolbar button,.block textarea { background: var(--paper); }
.article-toolbar { background: var(--well); }
.article-editor:focus { box-shadow: inset 0 0 0 2px var(--focus); }
.article-editor blockquote { border-left: 1px solid var(--accent); background: var(--well); }
.error { background: #faede6; }
#draft-search-plan { padding: 16px 20px; background: var(--well); border-radius: 12px; }
#draft-search-plan-items { max-width: 72ch; }
#draft-search-plan-items strong { color: var(--accent); }
#draft-search-plan-items ul { padding-inline-start: 1.35em; }
#draft-search-plan-items p { margin-block: 7px 14px; }
@media (max-width: 720px) {
  header { min-height: 0; }
  #write-choices { gap: 4px; padding: 4px; }
  #write-choices button { padding: 8px; min-height: 62px; }
  #write-choices strong { font-size: 13px; }
  #write-choices small { display: none; }
  .compose-submit #build-btn { min-width: 0; }
  #draft-search-plan { padding-inline: 14px; }
}

.issue-categories { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; padding:5px; border-radius:10px; background:var(--well); box-shadow:var(--recessed); }
.issue-categories button { background:transparent; border-color:transparent; padding-inline:8px; }
.issue-categories button[aria-pressed=true] { color:white; background:var(--accent); border-color:var(--accent); }
.issue-categories button[aria-pressed=true]:hover:not(:disabled) { background:var(--accent-hover); color:white; }
.issue-tools { display:flex; flex-wrap:wrap; align-items:end; gap:8px 12px; margin-top:14px; }
.issue-tools label { margin:0; flex:1 1 190px; }
.issue-tools button { flex:0 0 auto; }
#trend-candidates article { box-shadow:none; border-radius:10px; padding:18px 20px; margin-bottom:10px; }
#trend-candidates h3 { margin-top:0; }
#trend-candidates article button { margin:0 8px 4px 0; }
#trend-candidates article a { display:inline-block; margin-block:6px; }
@media (max-width: 720px) {
  #write-choices { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .issue-categories { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .issue-categories button { min-height:44px; }
  .issue-tools button { min-height:44px; }
  #trend-candidates article { padding:14px; }
}
