:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #6b746f;
  --line: #dfe4e0;
  --paper: #f4f5f1;
  --card: #fff;
  --forest: #1d4936;
  --forest-2: #286348;
  --lime: #d7f47c;
  --orange: #e87843;
  --danger: #a83c36;
  --shadow: 0 18px 48px rgba(33, 47, 39, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background:
  radial-gradient(circle at 80% -10%, rgba(215, 244, 124, .17), transparent 32rem),
  var(--paper); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: #173b2d; color: #f8faf7; display: flex; flex-direction: column; }
.brand, .login-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--lime); color: #173b2d; font: 800 22px Georgia, serif; box-shadow: inset 0 0 0 1px rgba(23, 59, 45, .13); }
.brand strong, .login-brand strong { display: block; font: 700 21px Georgia, serif; letter-spacing: -.02em; }
.brand small, .login-brand small { display: block; margin-top: 2px; color: #aebdb5; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.sidebar nav { margin-top: 50px; display: grid; gap: 8px; }
.sidebar nav a { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; border-radius: 11px; color: #bccac3; font-size: 14px; text-decoration: none; transition: .16s ease; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255, 255, 255, .09); }
.sidebar nav a.active { box-shadow: inset 3px 0 var(--lime); }
.sidebar nav small { opacity: .5; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.sidebar-footer small { color: #95a89f; display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #9de65c; box-shadow: 0 0 0 4px rgba(157, 230, 92, .12); display: inline-block; }
.link-button { padding: 0; border: 0; color: #aebdb5; background: none; cursor: pointer; }
.link-button:hover { color: white; }
.main { min-width: 0; padding: 54px clamp(28px, 5vw, 76px) 72px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 34px; }
.page-header h1, .login-card h1 { margin: 3px 0 7px; font: 600 clamp(34px, 4vw, 52px)/1.05 Georgia, serif; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--forest-2); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { margin: 0; color: var(--muted); line-height: 1.6; }
.small { font-size: 12px; }
.live-pill { white-space: nowrap; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 28px; }
.metric { min-height: 164px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 28px rgba(33,47,39,.035); display: flex; flex-direction: column; }
.metric.featured { color: white; background: var(--forest); border-color: var(--forest); }
.metric span { color: var(--muted); font-size: 12px; }
.metric.featured span, .metric.featured small { color: #bed0c7; }
.metric strong { margin: auto 0 2px; font: 600 45px Georgia, serif; letter-spacing: -.04em; }
.metric small { color: var(--muted); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.panel-card, .table-card { padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.panel-card + .panel-card { margin-top: 20px; }
.split .panel-card + .panel-card { margin-top: 0; }
.card-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.card-heading h2 { margin: 4px 0 0; font: 600 23px Georgia, serif; letter-spacing: -.02em; }
.badge { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.badge.success { color: #28613e; background: #e3f4e7; }
.badge.warning { color: #7c5314; background: #fff0c8; }
.badge.danger { color: #943b35; background: #fbe1de; }
.badge.neutral { color: #59635d; background: #edf0ed; }
.cost-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 20px; }
.cost-row div { padding: 16px; border-radius: 13px; background: #f5f7f3; }
.cost-row strong { display: block; font-size: 22px; letter-spacing: -.03em; }
.cost-row span { color: var(--muted); font-size: 11px; }
.activity-list { display: grid; }
.activity { padding: 11px 0; border-bottom: 1px solid #edf0ed; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.activity:last-child { border-bottom: 0; }
.activity-icon { width: 8px; height: 8px; border-radius: 50%; }
.activity-icon.ok { background: #59a870; }
.activity-icon.warn { background: var(--orange); }
.activity strong, .activity small { display: block; }
.activity strong { font-size: 13px; }
.activity small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity code { color: var(--muted); font-size: 10px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.site-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 30px rgba(33,47,39,.035); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.site-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.site-card-top { display: flex; justify-content: space-between; align-items: center; }
.site-initial { width: 45px; height: 45px; border-radius: 14px; display: grid; place-items: center; background: #e9f0eb; color: var(--forest); font: 700 20px Georgia, serif; }
.site-card h2 { margin: 24px 0 5px; font: 600 23px Georgia, serif; }
.site-card p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 24px 0; }
.site-card dl div { min-width: 0; }
.site-card dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.site-card dd { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.card-link, .back-link { color: var(--forest-2); font-size: 12px; font-weight: 700; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 22px; }
.content-link { color: var(--forest); text-decoration: none; }
.content-link:hover { text-decoration: underline; }
.affiliate-list { display: grid; gap: 11px; margin-bottom: 18px; }
.affiliate-suggestion { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.affiliate-suggestion strong, .affiliate-suggestion small { display: block; }
.affiliate-suggestion small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.affiliate-suggestion code { grid-column: 1 / -1; padding: 9px; border-radius: 8px; overflow-wrap: anywhere; color: #4d5b53; background: white; font-size: 10px; }
.detail-list { margin: 0; display: grid; gap: 13px; }
.detail-list div { padding-bottom: 12px; border-bottom: 1px solid #edf0ed; }
.detail-list dt { color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.detail-list dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.content-source { margin-top: 20px; }
.content-source pre { max-height: 700px; margin: 0; padding: 18px; border-radius: 12px; overflow: auto; color: #d8e5dc; background: #16382b; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.content-cover { margin-top: 20px; }
.content-cover img { display: block; width: 100%; max-height: 680px; object-fit: contain; border-radius: 14px; background: #0b1730; }
.content-tab-list { margin-bottom: 12px; display: flex; gap: 7px; border-bottom: 1px solid var(--line); }
.content-tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.content-tab.is-active { color: var(--forest); border-bottom-color: var(--forest); }
.content-tabs [hidden] { display: none !important; }
.content-preview-frame { display: block; width: 100%; min-height: 760px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.editorial-alerts { margin-bottom: 20px; border-color: #e5c77a; background: #fffcf3; }
.agent-list, .dead-list { display: grid; }
.agent-row { padding: 15px 0; border-bottom: 1px solid #edf0ed; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.agent-state { width: 10px; height: 10px; border-radius: 50%; background: #bdc3bf; }
.agent-state.online { background: #65b67b; box-shadow: 0 0 0 4px #e5f4e9; }
.agent-copy strong, .agent-copy small { display: block; }
.agent-copy strong { font-size: 13px; }
.agent-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.button { min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; justify-content: center; align-items: center; color: var(--ink); background: white; font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--forest); border-color: var(--forest); }
.button.primary:hover { background: var(--forest-2); }
.button.subtle { border-color: var(--line); background: #fafbf9; }
.button.danger { color: var(--danger); border-color: #f0d2cf; background: #fff8f7; }
.button.compact { min-height: 31px; padding: 6px 10px; font-size: 10px; }
.button.wide { width: 100%; margin-top: 8px; }
.inline-form { margin-top: 20px; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #d5dcd7; border-radius: 10px; outline: none; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(40,99,72,.09); }
label { display: grid; gap: 7px; color: #465049; font-size: 12px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .button, .form-grid details { grid-column: 1 / -1; }
label.check { display: flex; align-items: center; gap: 9px; }
label.check input { width: auto; accent-color: var(--forest); }
.json-settings { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.json-settings summary { cursor: pointer; color: var(--forest-2); font-size: 12px; font-weight: 750; }
.json-settings[open] summary { margin-bottom: 15px; }
.json-settings label + label { margin-top: 12px; }
textarea { resize: vertical; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-reveal { margin-bottom: 20px; padding: 22px; border: 1px solid #dcb85c; border-radius: 16px; background: #fff9e7; }
.token-reveal h2 { margin: 5px 0 13px; font: 600 22px Georgia, serif; }
.token-reveal code { padding: 13px; border-radius: 9px; display: block; overflow-wrap: anywhere; color: #513f13; background: white; }
.token-reveal p:last-child { margin: 12px 0 0; color: #7d6a39; font-size: 12px; }
.notice { margin: 0 0 20px; padding: 13px 15px; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.notice:empty, .validation-summary-valid { display: none; }
.notice.success { color: #28613e; background: #e4f3e8; }
.notice.warning { color: #72501d; background: #fff2ce; }
.notice.error { color: #8e3530; background: #fae2df; }
.notice ul { margin: 0; padding-left: 18px; }
.filters { margin-bottom: 16px; display: flex; gap: 8px; }
.filters select { width: min(300px, 100%); }
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 16px 18px; border-bottom: 1px solid #e9ede9; text-align: left; vertical-align: middle; font-size: 12px; }
th { color: var(--muted); background: #fafbf9; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { max-width: 330px; margin-top: 4px; color: var(--muted); }
.error-text { color: var(--danger); }
.empty { padding: 30px; color: var(--muted); text-align: center; }
dialog { width: min(570px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 19px; box-shadow: 0 30px 90px rgba(20,31,25,.25); }
dialog::backdrop { background: rgba(17, 31, 24, .56); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; display: grid; gap: 15px; }
.dialog-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: #edf0ed; cursor: pointer; font-size: 20px; }
.confirm { margin: 5px 0; padding: 13px; border-radius: 10px; background: #f3f5f2; }
.dead-row { padding: 17px 0; border-top: 1px solid #e9ede9; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center; }
.dead-row strong, .dead-row small { display: block; }
.dead-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.dead-row p { margin: 9px 0 0; color: var(--danger); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background:
  linear-gradient(130deg, rgba(18,55,40,.97), rgba(22,69,49,.91)),
  radial-gradient(circle at 20% 20%, var(--lime), transparent 35%); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.4); border-radius: 23px; background: rgba(251,253,249,.97); box-shadow: 0 35px 100px rgba(5,20,13,.3); }
.login-brand { margin-bottom: 44px; }
.login-brand small { color: var(--muted); }
.login-card h1 { font-size: 38px; }
.login-card form { margin-top: 27px; display: grid; gap: 11px; }
.security-note { margin: 24px 0 0; color: #8b948f; font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .07em; }
.schedule-site + .schedule-site { margin-top: 32px; }
.schedule-filters { margin-bottom: 20px; display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.schedule-filters label { width: min(390px, 100%); }
.schedule-summary { margin-bottom: 16px; }
.schedule-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.schedule-metrics div { padding: 14px; border-radius: 12px; background: #f5f7f3; }
.schedule-metrics strong, .schedule-metrics span { display: block; }
.schedule-metrics strong { font: 600 24px Georgia, serif; }
.schedule-metrics span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.schedule-mode { margin-bottom: 16px; }
.schedule-help { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.schedule-swap-form { display: none; }
.schedule-table table { min-width: 1120px; }
.schedule-row { transition: opacity .14s ease, background-color .14s ease; }
.schedule-row.is-dragging { opacity: .45; }
.schedule-row.is-drop-target td { background: #edf6e9; }
.schedule-drag-cell { width: 48px; padding-right: 4px; }
.schedule-drag-handle { width: 30px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fafbf9; cursor: grab; font-weight: 900; letter-spacing: -3px; }
.schedule-drag-handle:hover { color: var(--forest); border-color: #b9c9be; background: #f3f8f1; }
.schedule-drag-handle:active { cursor: grabbing; }
.schedule-date-cell { min-width: 270px; }
.schedule-time-form { display: grid; grid-template-columns: minmax(175px, 1fr) auto; gap: 7px; align-items: center; }
.schedule-time-form input { min-width: 175px; padding: 7px 9px; font-size: 11px; }
.proposal-request { margin-bottom: 24px; }
.proposal-focus { grid-column: 1 / -1; }
.proposal-batch + .proposal-batch { margin-top: 20px; }
.proposal-list { display: grid; gap: 0; border-top: 1px solid #edf0ed; }
.proposal-row { padding: 18px 0; border-bottom: 1px solid #edf0ed; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.proposal-select input { width: auto; margin-top: 3px; accent-color: var(--forest); }
.proposal-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.proposal-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.proposal-row p { margin: 9px 0 0; color: #465049; font-size: 12px; line-height: 1.55; }
.proposal-approve { margin-top: 18px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .split { grid-template-columns: 1fr; }
  .split .panel-card + .panel-card { margin-top: 0; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px; }
  .sidebar .brand, .sidebar-footer { display: none; }
  .sidebar nav { margin: 0; grid-template-columns: repeat(6,1fr); gap: 4px; }
  .sidebar nav a { justify-content: center; padding: 10px 4px; text-align: center; font-size: 10px; }
  .sidebar nav small { display: none; }
  .main { padding: 30px 16px 55px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header h1 { font-size: 38px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { min-height: 135px; padding: 16px; }
  .metric strong { font-size: 36px; }
  .cost-row, .form-grid { grid-template-columns: 1fr; }
  .agent-row { grid-template-columns: auto 1fr; }
  .agent-row .row-actions, .agent-row > .badge { grid-column: 2; justify-content: flex-start; }
  .schedule-metrics { grid-template-columns: 1fr 1fr; }
  .content-preview-frame { min-height: 600px; }
  .proposal-row { grid-template-columns: auto minmax(0, 1fr); }
  .proposal-row > .button { grid-column: 2; justify-self: start; }
  .sidebar nav { overflow-x: auto; }
}
