﻿:root{
  --bg:#eef2ef;
  --bg-strong:#e6ebe7;
  --surface:#ffffff;
  --surface-soft:#f5f8f6;
  --surface-muted:#edf2ee;
  --text:#172119;
  --muted:#5f6e63;
  --muted-2:#7a867d;
  --line:rgba(23,33,25,.10);
  --line-strong:rgba(23,33,25,.16);
  --accent:#205d3a;
  --accent-soft:#dbeadf;
  --blue-soft:#e8f1f8;
  --amber-soft:#fff4dd;
  --red-soft:#fbe8e6;
  --shadow:0 18px 42px rgba(16,28,20,.08);
  --radius:18px;
  --sidebar:288px;
  --max:1320px;
  --font:"Segoe UI","IBM Plex Sans",system-ui,-apple-system,sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(32,93,58,.08), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-strong));
}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit;color:inherit}

.media-shell{display:flex;min-height:100vh}
.sidebar{
  width:var(--sidebar);
  padding:18px;
  border-right:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(244,248,245,.98));
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  background:rgba(238,242,239,.88);
  backdrop-filter:blur(12px);
}
.content{padding:22px 20px 30px}
.content-wrap{max-width:var(--max);margin:0 auto;width:100%}

.brand-card,.sidebar-card,.panel,.hero-panel,.stat-card,.signal-card,.connection-card,.detail-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
}
.brand-card{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,246,242,.96));
}
.brand-mark{
  width:48px;
  height:48px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg, #205d3a, #173f29);
  color:#fff;
  font-weight:800;
  letter-spacing:.04em;
}
.brand-title{font-size:14px;font-weight:800;letter-spacing:.04em}
.brand-sub{font-size:12px;line-height:1.5;color:var(--muted)}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
}
.sidebar-nav a{
  padding:12px 14px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
  font-weight:600;
}
.sidebar-nav a:hover{background:var(--surface-soft);border-color:var(--line)}
.sidebar-nav a.active{background:var(--accent-soft);border-color:rgba(32,93,58,.18);color:var(--text)}

.sidebar-card{padding:14px}
.sidebar-card-label,.eyebrow,.detail-kicker,.stat-label,.signal-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted-2);
  font-weight:700;
}
.sidebar-list,.check-list{display:grid;gap:8px;margin-top:10px}
.sidebar-list span,.check-list span{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface-soft);
  color:var(--muted);
}
.sidebar-user{margin-top:8px;font-size:16px;font-weight:700}
.sidebar-note{margin-top:4px;color:var(--muted);line-height:1.5}

.topbar-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted-2);font-weight:700}
.topbar-title{margin-top:4px;font-size:28px;font-weight:800;letter-spacing:-.03em}
.topbar-subtitle{margin-top:6px;color:var(--muted);max-width:780px;line-height:1.5}
.topbar-actions,.panel-actions,.button-row,.table-actions,.status-group,.tag-row{display:flex;gap:10px;flex-wrap:wrap}

.button,.mini-button{
  border:1px solid var(--line);
  background:var(--surface);
  border-radius:12px;
  padding:11px 14px;
  cursor:pointer;
  font-weight:700;
}
.button:hover,.mini-button:hover{background:var(--surface-soft);border-color:var(--line-strong)}
.button-primary{
  background:var(--accent);
  color:#fff;
  border-color:rgba(32,93,58,.18);
}
.button-primary:hover{background:#18492d}
.mini-button{padding:8px 12px;font-size:13px}

.page-stack{display:grid;gap:16px}
.hero-panel{
  display:grid;
  grid-template-columns:minmax(0, 1.2fr) minmax(280px, .8fr);
  gap:16px;
  padding:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,247,244,.98));
}
.hero-copy h1{
  margin:10px 0 12px;
  font-size:clamp(32px, 5vw, 56px);
  line-height:1.02;
  letter-spacing:-.04em;
}
.hero-copy p{margin:0;color:var(--muted);font-size:16px;line-height:1.7;max-width:780px}
.hero-rail{display:grid;gap:12px}
.signal-card{padding:16px;background:linear-gradient(180deg, #1f3f2e, #244d38);color:#f4faf6}
.signal-title{margin-top:8px;font-size:24px;font-weight:800}
.signal-note{margin-top:8px;color:rgba(244,250,246,.78);line-height:1.6}

.stats-grid,.grid-2,.connection-grid,.meta-grid{
  display:grid;
  gap:16px;
}
.stats-grid{grid-template-columns:repeat(4, minmax(0, 1fr))}
.grid-2{grid-template-columns:repeat(2, minmax(0, 1fr))}
.connection-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}
.meta-grid{grid-template-columns:repeat(2, minmax(0, 1fr));margin-top:14px}

.stat-card{padding:16px;background:var(--surface)}
.stat-value{margin-top:8px;font-size:34px;font-weight:800;letter-spacing:-.04em}
.stat-note{margin-top:8px;color:var(--muted);line-height:1.5}

.panel{overflow:hidden}
.panel-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding:16px;
  border-bottom:1px solid var(--line);
  background:var(--surface-soft);
}
.panel-title{font-size:18px;font-weight:800}
.panel-sub{margin-top:4px;font-size:13px;color:var(--muted-2);line-height:1.5}
.panel-body{padding:16px}

.toolbar-strip{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}
.inline-note{font-size:13px;color:var(--muted)}
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
.data-table{width:100%;border-collapse:collapse;min-width:920px}
.data-table th,.data-table td{
  padding:12px 10px;
  text-align:left;
  border-bottom:1px solid rgba(23,33,25,.06);
  vertical-align:top;
}
.data-table th{
  font-size:12px;
  color:var(--muted-2);
  text-transform:uppercase;
  letter-spacing:.08em;
  background:var(--surface-soft);
}
.data-table tbody tr{cursor:pointer}
.data-table tbody tr:hover{background:var(--surface-soft)}
.data-table tbody tr.active{background:var(--accent-soft)}
.row-title{font-weight:700;color:var(--text)}
.row-sub{margin-top:4px;font-size:13px;color:var(--muted);line-height:1.5}

.status-pill,.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:12px;
  font-weight:700;
}
.tag{background:var(--surface-soft)}
.status-draft{background:var(--amber-soft);border-color:rgba(196,155,62,.22)}
.status-ready{background:var(--accent-soft);border-color:rgba(32,93,58,.18)}
.status-published,.status-connected{background:#e8f4ed;border-color:rgba(32,93,58,.18)}
.status-queued,.status-connecting{background:var(--blue-soft);border-color:rgba(72,112,156,.18)}
.status-failed,.status-error,.status-token-expired,.status-blocked{background:var(--red-soft);border-color:rgba(157,72,58,.18)}
.status-not-connected{background:#f3f4f3}
.status-manual{background:var(--surface-soft);border-color:rgba(23,33,25,.10)}

.empty-state{
  display:grid;
  gap:8px;
  padding:18px;
  border:1px dashed var(--line-strong);
  border-radius:14px;
  background:var(--surface-soft);
}
.empty-state strong{font-size:16px}
.empty-state span{color:var(--muted);line-height:1.6}
.empty-state.compact{padding:16px}

.mini-list{display:grid;gap:10px}
.list-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
}
.list-title{font-weight:700}
.list-sub{margin-top:4px;color:var(--muted);font-size:13px;line-height:1.5}

.detail-card h3{margin:8px 0 10px;font-size:24px;line-height:1.15;letter-spacing:-.03em}
.detail-card p{margin:0;color:var(--muted);line-height:1.7}
.meta-box{
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
}
.meta-box span{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted-2);
  font-weight:700;
}
.meta-box strong{display:block;margin-top:6px;font-size:15px;line-height:1.4}

.composer-shell,.cta-panel .panel-body{height:100%}
.composer-card,.connection-card,.cta-copy{height:100%}
.field{display:grid;gap:8px;margin-top:14px}
.field span{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted-2);font-weight:700}
.text-area{
  width:100%;
  min-height:140px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
  resize:vertical;
}
.cta-copy{display:grid;gap:8px;margin-bottom:16px}
.cta-copy strong{font-size:18px}
.cta-copy span{color:var(--muted);line-height:1.6}
.connection-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.toast{
  position:fixed;
  right:20px;
  bottom:20px;
  min-width:260px;
  max-width:380px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.96);
  box-shadow:var(--shadow);
  display:none;
  z-index:100;
}
.toast.show{display:block}
.toast strong{display:block;margin-bottom:4px}
.toast span{font-size:13px;color:var(--muted)}
.error-block{
  margin:0;
  white-space:pre-wrap;
  padding:14px;
  border-radius:14px;
  background:var(--surface-soft);
  border:1px solid var(--line);
}

@media (max-width: 1180px){
  .hero-panel,.grid-2,.connection-grid{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:repeat(2, minmax(0, 1fr))}
}

@media (max-width: 980px){
  .media-shell{display:block}
  .sidebar{
    position:static;
    width:auto;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .topbar{position:static}
}

@media (max-width: 720px){
  .content{padding:16px}
  .topbar{padding:14px 16px;flex-direction:column;align-items:flex-start}
  .toolbar-strip,.panel-head,.list-row{flex-direction:column;align-items:flex-start}
  .stats-grid,.meta-grid{grid-template-columns:1fr}
  .data-table{min-width:760px}
}

.detail-card,.connection-card{padding:16px}

.article-workbench{align-items:start}
.editor-form{display:grid;gap:14px}
.text-input-cockpit,.select-input-cockpit{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.text-input-cockpit:focus,.select-input-cockpit:focus,.text-area:focus{
  outline:none;
  border-color:var(--line-strong);
}
.text-area-lg{min-height:240px}
.preview-body-block{
  margin-top:14px;
  padding:14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--surface-soft);
  white-space:pre-wrap;
  line-height:1.75;
  color:var(--text);
}
.article-preview-card,.composer-card{display:grid;gap:12px}
.compact-grid{gap:12px}
.social-workbench-grid{align-items:start}
.template-stack,.handoff-stack,.template-list{display:grid;gap:12px}
.template-card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-soft);
}
.template-card h3{margin:4px 0 0;font-size:20px}
.template-block{
  margin-top:10px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  white-space:pre-wrap;
  line-height:1.65;
  color:var(--text);
}
.template-slide{
  display:grid;
  gap:6px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}
.template-slide strong{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted-2)}
.template-slide span{line-height:1.6;color:var(--text)}
.template-json{font-size:12px;line-height:1.6}
.compact-list span{padding:9px 11px}
.template-builder-form{display:grid;gap:14px}
.template-builder-form .button-row{margin-top:2px}
.social-workbench-grid .template-card .field{margin-top:0}
.template-card h3{margin:4px 0 8px}
@media (max-width: 720px){
  .social-workbench-grid{grid-template-columns:1fr}
}
.wizard-stack,.wizard-steps,.proposal-stack,.proposal-list,.timeline-list{display:grid;gap:12px}
.wizard-step,.proposal-row,.timeline-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
}
.wizard-step strong{font-size:14px;min-width:20px}
.wizard-step span{line-height:1.6;color:var(--text)}
.wizard-pack-grid{display:grid;gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.wizard-pack-card,.proposal-card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-soft);
}
.compact-meta-grid{margin-top:12px}
.timeline-dot{
  width:12px;
  height:12px;
  margin-top:5px;
  border-radius:999px;
  background:var(--accent);
  border:2px solid rgba(32,93,58,.18);
}
.timeline-copy{display:grid;gap:4px}
.timeline-title{font-weight:700;color:var(--text)}
.timeline-sub{font-size:13px;color:var(--muted);line-height:1.5}
.proposal-row{display:grid;gap:6px}
.proposal-row code{
  display:inline-block;
  padding:6px 8px;
  border-radius:10px;
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
}
@media (max-width: 720px){
  .wizard-pack-grid,.proposal-stack{grid-template-columns:1fr}
}
.operator-table-wrap{background:linear-gradient(180deg,#ffffff,#fbfcfb)}
.operator-table .row-title{font-size:14px}
.operator-table .row-sub{max-width:520px}
.compact-stack{gap:10px}
.compact-card{padding:14px}
.connection-card p{margin-top:12px}
.panel-head{align-items:flex-start}
.stat-card{min-height:150px;display:flex;flex-direction:column;justify-content:space-between}
.status-manual{background:var(--surface-soft);border-color:var(--line)}
.toolbar-strip .inline-note{max-width:720px}
.proposal-card h3{margin:6px 0 10px;font-size:22px;line-height:1.2;letter-spacing:-.03em}
.proposal-list{display:grid;gap:10px}
.operator-table tbody tr td{padding-top:14px;padding-bottom:14px}
.table-wrap.operator-table-wrap{box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
@media (max-width: 980px){
  .operator-table .row-sub{max-width:none}
}
