/* Colours and spacing copied from the design canvas "SEO Copywriter Studio". */
:root {
  --bg: #1c1b1a; --panel: #201f1d; --card: #242321; --card2: #232220; --input: #262523;
  --line: #2f2d2a; --line2: #302e2b; --line3: #3a3835; --hover: #302e2b;
  --text: #ece9e4; --text2: #e2ded8; --muted: #c9c4bc; --dim: #a8a39b; --faint: #8f8a82;
  --pub-bg: #1f3a2c; --pub-line: #2f5e45; --pub: #8fe0b4; --pub-dot: #5dbb8a;
  --draft-bg: #3a3020; --draft-line: #5c4a2a; --draft: #f0c78a; --draft-dot: #e3a35a;
  --serif: 'Source Serif 4', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px Inter, system-ui, sans-serif; }
a { color: var(--text); text-decoration: none; } a:hover { color: #fff; }
button, select, textarea, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
textarea::placeholder, input::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid #6aa6f0; outline-offset: 2px; }
.sr { position: absolute; left: -9999px; }
.serif { font-family: var(--serif); }
.upper { font-size: 12px; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.dim { color: var(--dim); } .faint { color: var(--faint); } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.screen { min-height: 100vh; display: flex; flex-wrap: wrap; }

/* buttons */
.btn-primary { min-height: 38px; padding: 0 16px; border-radius: 10px; border: none; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; }
.btn-ghost { border: none; background: transparent; color: var(--text); font-size: 14px; min-height: 44px; padding: 0 4px; }
.btn-icon { width: 36px; height: 36px; border-radius: 8px; border: none; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.bordered { border: 1px solid var(--line3); }
.send { width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }
.pill { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line3); background: transparent; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 8px; }
.pill.on { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 500; }
.seg { display: flex; gap: 4px; background: var(--card2); border: 1px solid #33312e; border-radius: 10px; padding: 3px; }
.seg button { border: none; border-radius: 7px; padding: 6px 12px; min-height: 30px; background: transparent; color: var(--dim); font-size: 13px; }
.seg button.on { background: var(--line3); color: #fff; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status.pub { border: 1px solid var(--pub-line); background: var(--pub-bg); color: var(--pub); } .status.pub::before { background: var(--pub-dot); }
.status.draft { border: 1px solid var(--draft-line); background: var(--draft-bg); color: var(--draft); } .status.draft::before { background: var(--draft-dot); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* sidebar */
.side { flex: 1 1 250px; max-width: 270px; min-width: 230px; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font-size: 14px; text-align: left; width: 100%; }
.nav-item.on { background: var(--hover); color: #fff; }
.nav-item .swatch { width: 9px; height: 9px; border-radius: 3px; }
.sub { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; border-left: 1px solid #33312e; margin-left: 16px; }
.sub-item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; font-size: 13px; color: var(--muted); border: none; background: transparent; text-align: left; }
.sub-item.muted { color: var(--dim); }

/* main page */
.main { flex: 999 1 560px; min-width: 0; padding: 40px 48px 56px; }
.main-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 48px; }
.col { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--input); border: 1px solid var(--line3); color: var(--muted); margin-bottom: 10px; }
h1.page { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 34px; }
.lead { margin: 8px 0 0; color: var(--dim); font-size: 15px; line-height: 1.5; }
.composer { background: var(--input); border: 1px solid var(--line3); border-radius: 16px; padding: 16px 18px 12px; }
.composer textarea { width: 100%; background: transparent; border: none; outline: none; resize: none; color: var(--text); font-size: 15px; line-height: 1.5; max-height: 40vh; overflow-y: auto; }
.box { padding: 18px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line3); display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--dim); }
.field input, .field select, .field textarea { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line3); background: var(--bg); color: var(--text); font-size: 14px; outline: none; }
.field textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; }
.art-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; }
.art-row a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.empty { padding: 24px; text-align: center; color: var(--dim); border: 1px dashed var(--line3); border-radius: 12px; }
.aside { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; }
.kn { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.site-stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line2); }
.dashed { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border-radius: 10px; border: 1px dashed var(--line3); background: transparent; color: var(--dim); font-size: 13px; }

/* chat */
.convo { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 100vh; }
.bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.msgs { flex: 1; padding: 28px 28px 16px; display: flex; flex-direction: column; gap: 22px; }
.msg-user { align-self: flex-end; max-width: 80%; background: var(--hover); border-radius: 14px; padding: 12px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.msg-ai { display: flex; flex-direction: column; gap: 12px; max-width: 92%; font-size: 15px; line-height: 1.6; color: var(--text2); }
.route { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #17302c; border: 1px solid #285a52; color: #8fded1; }
.art-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line3); background: var(--card); color: var(--text); text-align: left; width: 100%; }
.art-card .ico { width: 40px; height: 40px; border-radius: 8px; background: var(--hover); display: flex; align-items: center; justify-content: center; flex: none; }
.reply { padding: 0 20px 20px; }
.reply-box { background: var(--input); border: 1px solid var(--line3); border-radius: 16px; padding: 12px 14px; display: flex; align-items: flex-end; gap: 10px; }
.reply-box textarea { flex: 1; background: transparent; border: none; outline: none; resize: none; color: var(--text); font-size: 14px; line-height: 1.5; max-height: 40vh; overflow-y: auto; }
.panel { flex: 1.3 1 580px; min-width: 0; background: var(--panel); display: flex; flex-direction: column; max-height: 100vh; position: sticky; top: 0; }
.tabs { display: flex; gap: 2px; background: #2a2926; border-radius: 8px; padding: 3px; }
.tabs button { border: none; border-radius: 6px; padding: 5px 12px; min-height: 30px; background: transparent; color: var(--dim); font-size: 12px; }
.tabs button.on { background: #3d3b37; color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 32px 44px 48px; }
.seo-card { padding: 14px 16px; border-radius: 12px; background: var(--input); border: 1px solid #33312e; }
.seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.article { max-width: 680px; font-size: 16px; line-height: 1.75; color: var(--text2); }
.article h1 { margin: 0 0 16px; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.2; color: #fff; }
.article h2 { margin: 28px 0 10px; font-family: var(--serif); font-weight: 600; font-size: 24px; color: #fff; }
.article h3 { margin: 18px 0 6px; font-size: 18px; color: #fff; }
.article p, .article ul, .article ol { margin: 0 0 16px; }
.article strong { color: #fff; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line3); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--pub-line); background: var(--pub-bg); color: var(--pub); }
.chip.off { border-color: var(--line3); background: transparent; color: var(--faint); }
.learned { padding: 10px 12px; border-radius: 10px; border: 1px solid #285a52; background: #17302c; color: #8fded1; font-size: 13px; line-height: 1.6; }
.caret { display: inline-block; width: 8px; height: 18px; margin-left: 2px; vertical-align: text-bottom; background: var(--text); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.think { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; background: var(--card2); }
.think summary { cursor: pointer; }
.think div { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--dim); white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.err { padding: 10px 12px; border-radius: 10px; background: #3a2020; border: 1px solid #5c2a2a; color: #f0a0a0; font-size: 13px; }

/* articles table */
.page-wrap { width: 100%; padding: 32px 48px 56px; }
.page-inner { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 330px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.table-box { overflow-x: auto; border: 1px solid var(--line2); border-radius: 14px; }
table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
th { padding: 12px 16px; font-weight: 500; background: var(--card2); text-align: left; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.search { min-height: 38px; width: 240px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line3); background: var(--card2); color: var(--text); font-size: 13px; outline: none; }

/* Claude Max limits */
.limits { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); }
.limits.inline { flex-direction: row; align-items: center; gap: 14px; padding: 6px 10px; border-radius: 10px; }
.lim-bar { height: 6px; border-radius: 999px; background: var(--line3); overflow: hidden; }
.lim-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.inline .lim { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.inline .lim-bar { width: 54px; }
.ok { color: #8fe0b4; } .warn { color: #f0c78a; } .crit { color: #f08a8a; }
.ok-bg { background: #5dbb8a; } .warn-bg { background: #e3a35a; } .crit-bg { background: #e06060; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.dialog { width: min(620px, 100%); max-height: 90vh; overflow-y: auto; }
.mem-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2); font-size: 13px; line-height: 1.5; }

@media (max-width: 700px) {
  .main, .page-wrap { padding: 24px 16px 40px; }
  .side { max-width: none; border-right: none; border-bottom: 1px solid var(--line); }
  .panel { position: static; max-height: none; }
  .panel-body { padding: 24px 18px 40px; }
  .stats { min-width: 0; width: 100%; }
  .search { width: 100%; }
}
