:root {
  --ink: #17211c;
  --muted: #68736d;
  --paper: #f5f5ef;
  --panel: #fffef9;
  --line: #dfe2d9;
  --green: #185b3d;
  --green-2: #247a52;
  --mint: #dcefe3;
  --lime: #d9f27c;
  --amber: #9a5b0b;
  --red: #a43d35;
  --shadow: 0 18px 55px rgba(23, 33, 28, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 85% 0, #e9f3df 0, transparent 28rem), var(--paper); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgba(23,33,28,.1); background: rgba(245,245,239,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 780; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.brand small { font-size: 11px; color: var(--muted); font-weight: 500; border-left: 1px solid var(--line); padding-left: 10px; letter-spacing: .02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--green); color: white; }
.topnav { display: flex; align-items: center; gap: 24px; }
.topnav a { text-decoration: none; color: var(--muted); }
.topnav form { margin: 0; }
.signed-in-user { color: var(--muted); font-size: 12px; }
.shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-head.compact { align-items: center; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(34px, 4vw, 52px); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 22px; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; }
.page-head p, .muted { color: var(--muted); }
.eyebrow { color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 9px; }
.button { border: 1px solid transparent; border-radius: 11px; padding: 11px 16px; font-weight: 720; display: inline-flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; text-decoration: none; transition: .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 9px 22px rgba(24,91,61,.18); }
.button.primary:hover:not(:disabled) { background: #10482f; }
.button.secondary { background: var(--panel); border-color: var(--line); color: var(--ink); }
.button.small { padding: 8px 12px; font-size: 13px; }
.button.tiny { padding: 6px 10px; font-size: 12px; }
.button.wide { width: 100%; }
.link-button { border: 0; padding: 0; color: var(--green-2); background: transparent; font-weight: 700; cursor: pointer; }
.link-button.danger { color: var(--red); }
.users-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 18px; align-items: start; }
.row-action { text-align: right; }
.row-action form { margin: 0; }
.head-actions { display: flex; gap: 10px; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { min-height: 245px; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,249,.86); box-shadow: 0 3px 0 rgba(23,33,28,.02); text-decoration: none; transition: .2s ease; }
.project-card:hover { transform: translateY(-3px); border-color: #aabcae; box-shadow: var(--shadow); }
.project-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; font-size: 13px; }
.project-card-top .arrow { margin-left: auto; font-size: 20px; }
.domain-dot { width: 8px; height: 8px; border-radius: 50%; background: #62b77e; box-shadow: 0 0 0 4px #e6f4e8; }
.project-card h2 { font-size: 25px; }
.project-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.project-metrics div { display: flex; flex-direction: column; }
.project-metrics strong { font-size: 21px; }
.project-metrics span, .sync-line { color: var(--muted); font-size: 12px; }
.sync-line { margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--line); }
.empty-state { border: 1px dashed #bdc6bb; border-radius: 20px; min-height: 390px; display: grid; place-items: center; align-content: center; text-align: center; background: rgba(255,255,255,.35); }
.empty-state p { color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; color: var(--green); background: var(--mint); font-size: 25px; margin-bottom: 18px; }
.notice { border: 1px solid var(--line); background: var(--panel); padding: 14px 16px; border-radius: 12px; margin-bottom: 22px; }
.notice.warning { border-color: #e6c987; background: #fff9e9; color: #66430f; }
.dialog { width: min(520px, calc(100% - 32px)); border: 0; border-radius: 18px; padding: 0; background: var(--panel); box-shadow: 0 28px 100px rgba(18,25,21,.24); }
.dialog::backdrop { background: rgba(14,23,18,.5); backdrop-filter: blur(4px); }
.dialog form { padding: 27px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.stack-form { display: grid; gap: 17px; }
label, .field-label { display: grid; gap: 7px; font-weight: 700; font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid #cfd5cc; background: #fff; color: var(--ink); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(36,122,82,.12); }
textarea { resize: vertical; }
.optional { color: var(--muted); font-weight: 500; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; display: inline-grid; place-items: center; }
.flash-stack { position: fixed; right: 22px; top: 88px; z-index: 50; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); border: 1px solid var(--line); }
.flash-error { border-color: #e2aaa4; color: var(--red); }
.flash-success { border-color: #9bc6a8; color: var(--green); }
.auth-shell { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,254,249,.92); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 34px; }
.auth-card p { color: var(--muted); margin-bottom: 28px; }
.back-link { display: inline-block; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 12px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 25px; }
.stat.good strong { color: var(--green-2); }
.stat.bad strong { color: var(--red); }
.job-panel { border: 1px solid #b7d5bf; background: #f3fbf3; padding: 15px 17px; border-radius: 14px; margin-bottom: 18px; display: grid; grid-template-columns: minmax(230px, .8fr) 1fr auto; gap: 18px; align-items: center; }
.job-panel.is-quiet { display: none; }
.job-copy { display: flex; flex-direction: column; }
.job-copy span { color: var(--muted); font-size: 12px; }
.progress { height: 7px; overflow: hidden; border-radius: 20px; background: #dce8dd; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-2); transition: width .25s; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.panel, .editor-column { border: 1px solid var(--line); background: rgba(255,254,249,.9); border-radius: 16px; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.filters { display: grid; grid-template-columns: 1fr 150px auto; gap: 9px; margin-bottom: 16px; }
.filters input, .filters select { padding: 9px 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid #eceee8; vertical-align: middle; }
td:first-child { max-width: 540px; }
td strong, td a, td small { display: block; }
td a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; text-decoration: none; }
td small { color: var(--muted); margin-top: 3px; }
.error-text { color: var(--red) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-pill, .status { display: inline-flex; border-radius: 99px; padding: 3px 8px; font-size: 11px; font-weight: 720; }
.source-pill { background: #eef0ea; color: var(--muted); }
.status-active { background: #def2e3; color: #1f6a42; }
.status-excluded, .status-inactive { background: #eceee9; color: #6e746f; }
.status-error { background: #f9dfdc; color: var(--red); }
.status-pending { background: #fff0c9; color: var(--amber); }
.empty-cell { text-align: center; color: var(--muted); padding: 40px; }
.table-note, .field-help { color: var(--muted); font-size: 12px; }
.rules-panel { position: sticky; top: 92px; }
.rules-panel > p { font-size: 13px; }
.rules-list { display: grid; gap: 8px; margin-top: 20px; }
.rule-row { display: flex; justify-content: space-between; gap: 8px; padding: 11px; border-radius: 10px; background: #f2f3ed; }
.rule-row strong, .rule-row small { display: block; }
.rule-row strong { font-size: 12px; }
.rule-row small { color: var(--muted); font-size: 10px; }
.mini-empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }
.editor-shell { width: min(1500px, calc(100% - 36px)); }
.editor-head h1 { font-size: 38px; }
.quality-badge { border: 1px solid #b9d3be; background: #eff8ee; border-radius: 99px; padding: 8px 12px; color: var(--green); font-size: 12px; font-weight: 750; }
.quality-badge span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #50a96d; margin-right: 5px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1.03fr 1fr; gap: 13px; align-items: stretch; min-height: 690px; }
.editor-column { padding: 19px; display: flex; flex-direction: column; min-width: 0; }
.step { color: var(--green-2); font-size: 10px; font-weight: 850; letter-spacing: .12em; margin-bottom: 3px; }
.input-column .grow { flex: 1; margin: 16px 0; }
#article-html, #output-html { flex: 1; min-height: 500px; resize: none; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.suggestions-empty { margin: auto; text-align: center; color: var(--muted); max-width: 250px; }
.suggestions-empty > span { font-size: 35px; color: #99a39d; }
.suggestions-list { display: grid; gap: 10px; overflow-y: auto; padding-right: 3px; flex: 1; max-height: 545px; }
.suggestion-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #fff; }
.suggestion-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.suggestion-top input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); }
.confidence { margin-left: auto; padding: 3px 7px; border-radius: 99px; background: var(--mint); color: var(--green); font-size: 10px; font-weight: 800; }
.suggestion-fields { display: grid; gap: 8px; }
.suggestion-fields label { font-size: 10px; color: var(--muted); }
.suggestion-fields input { padding: 8px 9px; font-size: 12px; }
.suggestion-reason { font-size: 11px; color: var(--green-2); margin: 9px 0 0; }
.suggestion-context { font-size: 11px; color: var(--muted); margin: 5px 0 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.suggestion-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.suggestion-column > .button { margin-top: 10px; }
.view-tabs { background: #eff0eb; padding: 3px; border-radius: 8px; display: flex; }
.view-tabs button { border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.view-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.output-code, .output-preview { width: 100%; flex: 1; min-height: 530px; border: 1px solid #cfd5cc; border-radius: 10px; background: #fff; margin-bottom: 12px; }
.output-preview { padding: 0; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #17211c; color: #fff; padding: 10px 15px; border-radius: 10px; box-shadow: var(--shadow); transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
code { background: rgba(0,0,0,.06); border-radius: 5px; padding: 2px 5px; }
@media (max-width: 1100px) { .project-grid { grid-template-columns: repeat(2, 1fr); } .editor-grid { grid-template-columns: 1fr 1fr; } .output-column { grid-column: 1 / -1; } .project-layout { grid-template-columns: 1fr; } .rules-panel { position: static; } }
@media (max-width: 720px) { .shell, .editor-shell { width: min(100% - 24px, 1320px); padding-top: 30px; } .topbar { padding: 0 12px; } .brand small, .signed-in-user { display: none; } .topnav { gap: 10px; font-size: 13px; } .topnav > a:first-child { display: none; } .page-head { align-items: stretch; flex-direction: column; } .head-actions { flex-wrap: wrap; } .project-grid, .stats-row, .editor-grid, .users-layout { grid-template-columns: 1fr; } .output-column { grid-column: auto; } .filters { grid-template-columns: 1fr; } .project-metrics { grid-template-columns: repeat(3, 1fr); } .job-panel { grid-template-columns: 1fr; } }
