:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #f7f8f7;
  --ink: #18201d;
  --muted: #68736e;
  --line: #dde3df;
  --green: #196b50;
  --green-strong: #0e573f;
  --green-soft: #e7f2ed;
  --coral: #c6533f;
  --coral-soft: #f9ebe8;
  --amber: #98681c;
  --amber-soft: #fbf1df;
  --blue: #356c8c;
  --blue-soft: #e9f1f6;
  --shadow: 0 10px 30px rgba(21, 38, 31, 0.06);
  --sidebar: 248px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(25, 107, 80, 0.18); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.3; }
a { color: var(--green); }

.login-screen { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: #15211d; }
.login-screen[hidden] { display: none; }
.login-panel { width: min(400px, 100%); padding: 30px; background: white; border: 1px solid #33463e; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 19px; }
.login-brand span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.login-copy { padding: 26px 0 20px; }
.login-copy h1 { font-size: 25px; }
.login-field span { display: block; margin-bottom: 7px; color: #48534e; font-size: 11px; font-weight: 700; }
.login-field input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; }
.login-error { min-height: 30px; padding-top: 8px; color: var(--coral); font-size: 10px; }
.login-button { width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #15211d; color: #eef4f1; padding: 26px 16px 18px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: #e8f4ef; color: var(--green-strong); font-family: SimSun, serif; font-weight: 800; font-size: 21px; }
.brand strong { display: block; font-size: 19px; }
.brand span { display: block; margin-top: 3px; font-size: 11px; color: #93a29c; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; color: #aebbb6; background: transparent; text-align: left; }
.nav-item > span { width: 20px; font-size: 18px; text-align: center; color: #83928c; }
.nav-item b { min-width: 20px; margin-left: auto; padding: 2px 6px; border-radius: 10px; background: #2a3933; color: #d9e4df; font-size: 11px; text-align: center; }
.nav-item:hover { color: #fff; background: #1d2d27; }
.nav-item.active { color: #fff; background: var(--green); }
.nav-item.active > span { color: #fff; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #2b3934; padding-top: 12px; }
.privacy-note { padding: 15px 12px 0; font-size: 10px; color: #7f918a; display: flex; gap: 7px; align-items: center; }
.privacy-note i { font-style: normal; }
.privacy-note span { width: 7px; height: 7px; border-radius: 50%; background: #4baf83; box-shadow: 0 0 0 3px rgba(75, 175, 131, .12); }

.main { min-width: 0; }
.topbar { height: 94px; padding: 0 34px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(243, 245, 244, .94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }
.file-button { position: relative; }
.panel-head-actions { display: flex; align-items: center; gap: 12px; }
.compact-file { min-height: 32px; padding: 0 10px; font-size: 11px; }
.eyebrow { margin-bottom: 4px; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.content { max-width: 1500px; margin: 0 auto; padding: 28px 34px 48px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.menu-button { display: none !important; }

.button, .icon-button, .text-button { border: 0; }
.button { min-height: 40px; padding: 0 15px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-strong); }
.button.secondary { background: var(--surface); color: #33413b; border: 1px solid var(--line); }
.button.secondary:hover { border-color: #abb9b2; background: #fafcfb; }
.button.danger { background: var(--coral); color: white; }
.button.danger.ghost { color: var(--coral); background: var(--coral-soft); }
.icon-button { width: 40px; height: 40px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 22px; display: grid; place-items: center; }
.icon-button:hover { background: var(--surface-soft); color: var(--ink); }
.text-button { padding: 5px 0; color: var(--green); background: transparent; font-weight: 700; font-size: 12px; }

.notice-bar { min-height: 54px; padding: 0 18px; display: flex; align-items: center; gap: 12px; justify-content: space-between; background: #e5eee9; border-left: 3px solid var(--green); }
.notice-bar div { display: flex; align-items: center; gap: 12px; }
.notice-bar strong { font-size: 12px; color: var(--green-strong); }
.notice-bar span { color: #47564f; font-size: 13px; }
.metric-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { min-height: 132px; padding: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 13px 0 8px; font-size: 29px; line-height: 1; }
.metric small { color: #8a948f; font-size: 11px; }

.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-head { min-height: 72px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 18px; }
.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .7fr); gap: 18px; }
.record-list { min-height: 290px; }
.record-row { min-height: 72px; padding: 12px 20px; display: grid; grid-template-columns: 36px minmax(130px, 1fr) minmax(110px, .8fr) 90px; gap: 12px; align-items: center; border-bottom: 1px solid #edf0ee; }
.record-row:last-child { border-bottom: 0; }
.record-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.record-icon.sale { background: var(--blue-soft); color: var(--blue); }
.record-main strong, .record-info strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.record-main span, .record-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.record-amount { font-weight: 800; text-align: right; font-size: 13px; }
.empty-state { min-height: 250px; padding: 30px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 7px; }
.task-list { padding: 10px 20px 16px; }
.task { padding: 15px 0; display: grid; grid-template-columns: 22px 1fr; gap: 10px; border-bottom: 1px solid #edf0ee; }
.task:last-child { border-bottom: 0; }
.task i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-style: normal; }
.task strong { display: block; font-size: 12px; }
.task span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.flow-panel { margin-top: 18px; }
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.flow-steps > div { min-height: 126px; padding: 20px; border-right: 1px solid var(--line); }
.flow-steps > div:last-child { border-right: 0; }
.flow-steps b { color: var(--coral); font-size: 11px; }
.flow-steps strong, .flow-steps span { display: block; }
.flow-steps strong { margin: 10px 0 8px; font-size: 13px; }
.flow-steps span { color: var(--muted); font-size: 11px; line-height: 1.5; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: 18px; align-items: start; }
.pending-panel { margin-bottom: 18px; }
.pending-tip { color: var(--muted); font-size: 10px; }
.count-badge { display: inline-grid; min-width: 23px; height: 23px; margin-left: 5px; padding: 0 6px; place-items: center; border-radius: 12px; background: var(--coral-soft); color: var(--coral); font-size: 11px; vertical-align: 2px; }
.pending-row { min-height: 78px; padding: 12px 20px; display: grid; grid-template-columns: 150px minmax(120px, .75fr) minmax(160px, 1fr) 150px auto; gap: 14px; align-items: center; border-bottom: 1px solid #edf0ee; }
.pending-row:last-child { border-bottom: 0; }
.pending-type small, .pending-person span, .pending-detail span, .pending-money span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.pending-person strong, .pending-detail strong, .pending-money strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.pending-actions { display: flex; align-items: center; gap: 6px; }
.small-button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.small-icon { width: 32px; height: 32px; color: var(--coral); }
.paste-panel, .result-panel { min-height: 650px; }
.textarea-label { display: block; padding: 18px 20px 9px; font-size: 12px; font-weight: 700; }
#rawInput { width: calc(100% - 40px); min-height: 430px; margin: 0 20px; padding: 16px; resize: vertical; border: 1px solid var(--line); background: #fbfcfb; color: var(--ink); line-height: 1.75; border-radius: 4px; }
.paste-footer { padding: 14px 20px 20px; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.paste-footer span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.confidence { padding: 5px 9px; border-radius: 4px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.confidence.good { background: var(--green-soft); color: var(--green); }
.confidence.warn { background: var(--amber-soft); color: var(--amber); }
.segmented { margin: 18px 20px 4px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #eef1ef; border-radius: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 34px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { background: white; color: var(--green); box-shadow: 0 1px 5px rgba(0,0,0,.07); }
.form-grid { padding: 14px 20px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { min-width: 0; display: block; }
.field.full { grid-column: 1 / -1; padding: 0 20px; margin-top: 13px; }
.field > span { display: block; margin-bottom: 6px; color: #48534e; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea, .search-input, .filters select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); }
.field textarea { resize: vertical; }
.field .hint { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.form-actions { padding: 18px 20px 20px; display: flex; justify-content: flex-end; gap: 9px; align-items: center; }
.spacer { flex: 1; }

.table-panel { min-height: 620px; }
.table-toolbar { min-height: 86px; padding: 16px 20px; display: flex; justify-content: space-between; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); }
.table-toolbar-right { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.search-input { width: 230px; }
.filters select { width: 130px; }
.table-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 10px; }
.table-stats strong { color: var(--green-strong); font-size: 11px; }
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th { padding: 12px 16px; background: #f7f9f8; color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; border-bottom: 1px solid var(--line); }
td { padding: 15px 16px; border-bottom: 1px solid #edf0ee; font-size: 12px; vertical-align: middle; }
td strong, td span { display: block; }
td span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.status-pill.success { background: var(--green-soft); color: var(--green); }
.status-pill.wait { background: var(--amber-soft); color: var(--amber); }
.status-pill.info { background: var(--blue-soft); color: var(--blue); }
.table-action { width: 30px; height: 30px; border: 0; background: transparent; color: var(--green); font-weight: 800; border-radius: 4px; }
.table-action:hover { background: var(--green-soft); }
.table-empty { padding: 80px 20px; text-align: center; color: var(--muted); }

.scripts-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.script-tabs { padding: 8px; position: sticky; top: 122px; }
.script-tab { width: 100%; padding: 13px 12px; display: block; border: 0; border-radius: 4px; background: transparent; text-align: left; color: #4f5c56; font-size: 12px; }
.script-tab strong, .script-tab span { display: block; }
.script-tab span { margin-top: 4px; color: #8b9691; font-size: 10px; }
.script-tab:hover, .script-tab.active { background: var(--green-soft); color: var(--green-strong); }
.script-reader { min-height: 700px; }
.script-intro { padding: 24px; border-bottom: 1px solid var(--line); }
.script-intro p { max-width: 750px; margin-top: 9px; color: var(--muted); line-height: 1.7; font-size: 12px; }
.script-section { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.script-section:last-child { border-bottom: 0; }
.script-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.script-section h3 { font-size: 14px; }
.script-copy { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.message-bubble { max-width: 760px; margin-top: 12px; padding: 14px 16px; background: #f1f5f3; border-left: 3px solid #91b6a7; color: #2c3833; line-height: 1.75; white-space: pre-wrap; font-size: 13px; }
.coach-note { max-width: 760px; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.risk-box { margin: 20px 24px; padding: 16px; background: var(--coral-soft); border: 1px solid #efd3cd; }
.risk-box strong { color: #8f3f30; font-size: 12px; }
.risk-box p { margin-top: 8px; color: #744d46; font-size: 11px; line-height: 1.7; }

.channel-hero { min-height: 190px; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 30px; background: #1d3029; color: white; }
.channel-hero .eyebrow { color: #8ec6ae; }
.channel-hero h2 { font-size: 27px; }
.channel-hero p:not(.eyebrow) { max-width: 680px; margin-top: 14px; color: #b9c8c2; font-size: 12px; line-height: 1.7; }
.channel-score { width: 140px; min-width: 140px; height: 120px; display: grid; align-content: center; justify-items: center; border-left: 1px solid #43564f; }
.channel-score span, .channel-score small { color: #9eb0a9; font-size: 10px; }
.channel-score strong { margin: 5px 0; font-size: 37px; }
.channel-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.channel-card { min-height: 235px; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.channel-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.channel-rank { color: var(--coral); font-size: 10px; font-weight: 800; }
.channel-card h3 { margin-top: 10px; font-size: 16px; }
.channel-tag { padding: 4px 7px; border-radius: 3px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.channel-card p { margin-top: 13px; min-height: 48px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.channel-meta { margin-top: 16px; padding-top: 13px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.channel-meta div { font-size: 10px; color: var(--muted); }
.channel-meta strong { display: block; margin-top: 4px; color: var(--ink); font-size: 11px; }
.channel-link { display: inline-block; margin-top: 14px; color: var(--green); font-size: 11px; font-weight: 800; text-decoration: none; }
.calendar-panel { margin-top: 18px; }
.week-plan { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-plan { min-height: 155px; padding: 16px; border-right: 1px solid var(--line); }
.day-plan:last-child { border-right: 0; }
.day-plan b { color: var(--coral); font-size: 10px; }
.day-plan strong { display: block; margin: 10px 0 7px; font-size: 12px; }
.day-plan span { color: var(--muted); font-size: 10px; line-height: 1.6; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-form { padding: 18px 20px 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.settings-form .form-actions { grid-column: 1 / -1; padding: 6px 0 0; }
.backup-actions { padding: 20px; display: grid; gap: 10px; align-items: start; }
.backup-actions .button { justify-content: flex-start; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.data-note { margin: 0 20px 20px; padding: 16px; background: var(--amber-soft); color: #665233; }
.data-note strong { font-size: 12px; }
.data-note p { margin-top: 8px; font-size: 10px; line-height: 1.7; }
.password-form { padding: 20px; display: grid; gap: 14px; }
.password-form .form-actions { padding: 4px 0 0; }

.summary-intro { min-height: 150px; padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #1d3029; color: white; }
.summary-intro .eyebrow { color: #8ec6ae; }
.summary-intro h2 { font-size: 27px; }
.summary-intro p:not(.eyebrow) { max-width: 680px; margin-top: 12px; color: #b9c8c2; font-size: 11px; line-height: 1.7; }
.summary-filter-panel { margin-top: 18px; }
.summary-filters { min-height: 76px; padding: 14px 18px; display: flex; align-items: flex-end; gap: 12px; }
.summary-filters label { min-width: 160px; color: var(--muted); font-size: 10px; font-weight: 700; }
.summary-filters input, .summary-filters select { width: 100%; min-height: 38px; margin-top: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); }
.summary-metric-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.summary-metric { min-height: 126px; padding: 19px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.summary-metric.primary-metric { background: var(--green); border-color: var(--green); color: white; }
.summary-metric span { color: var(--muted); font-size: 11px; }
.summary-metric.primary-metric span, .summary-metric.primary-metric small { color: #c5e1d5; }
.summary-metric strong { display: block; margin: 14px 0 8px; font-size: 25px; }
.summary-metric small { color: #8a948f; font-size: 9px; line-height: 1.5; }
.summary-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.breakdown-panel table { min-width: 660px; }
.summary-notes { padding: 8px 20px 18px; }
.summary-notes p { padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-notes p:last-child { border-bottom: 0; }
.summary-notes b, .summary-notes span { display: block; }
.summary-notes b { font-size: 11px; }
.summary-notes span { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.6; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(12, 22, 18, .56); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.modal-head { min-height: 66px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 5px; color: white; background: #1d2d27; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout { grid-template-columns: 1fr; }
  .paste-panel, .result-panel { min-height: auto; }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-metric-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-grid { grid-template-columns: 1fr; }
  .pending-row { grid-template-columns: 120px 1fr 1fr; }
  .pending-money { display: none; }
  .pending-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .week-plan { grid-template-columns: repeat(4, 1fr); }
  .day-plan { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: min(280px, 86vw); transition: transform .2s ease; box-shadow: 12px 0 30px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 78px; padding: 0 16px; }
  .topbar > div:not(.topbar-actions) { min-width: 0; padding-right: 48px; }
  .topbar h1 { font-size: 20px; }
  .topbar-actions { position: absolute; right: 16px; }
  .topbar-actions .secondary { display: none; }
  .menu-button { display: grid !important; margin-left: -8px; }
  .content { padding: 18px 14px 34px; }
  .notice-bar { align-items: flex-start; padding: 13px 14px; }
  .notice-bar div { display: block; }
  .notice-bar span { display: block; margin-top: 4px; }
  .dashboard-grid, .settings-grid, .scripts-layout { grid-template-columns: 1fr; }
  .script-tabs { position: static; display: flex; overflow: auto; }
  .script-tab { min-width: 160px; }
  .flow-steps { grid-template-columns: repeat(2, 1fr); }
  .flow-steps > div:nth-child(2) { border-right: 0; }
  .flow-steps > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-toolbar-right { width: 100%; align-items: stretch; }
  .filters { width: 100%; justify-content: flex-start; }
  .search-input { flex: 1; min-width: 0; }
  .filters select { flex: 1; min-width: 140px; }
  .table-stats { justify-content: flex-start; }
  .channel-grid { grid-template-columns: 1fr; }
  .summary-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-filters { align-items: stretch; flex-direction: column; }
  .summary-filters label { width: 100%; }
  .pending-tip { display: none; }
  .pending-row { grid-template-columns: 1fr 1fr; }
  .pending-type { grid-column: 1 / -1; }
  .pending-detail { display: none; }
  .pending-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .week-plan { grid-template-columns: repeat(2, 1fr); }
  .channel-hero { align-items: flex-start; padding: 24px 20px; }
  .channel-score { display: none; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 112px; padding: 16px; }
  .metric strong { font-size: 24px; }
  .topbar-actions .button { width: 42px; padding: 0; font-size: 0; }
  .topbar-actions .button span { font-size: 19px; }
  .record-row { grid-template-columns: 32px minmax(0, 1fr) 70px; }
  .record-info { display: none; }
  .form-grid, .settings-form { grid-template-columns: 1fr; }
  .field.full { padding: 0 20px; }
  .settings-form .form-actions { grid-column: 1; }
  .paste-footer { align-items: stretch; flex-direction: column; }
  #rawInput { min-height: 350px; }
  .flow-steps, .week-plan { grid-template-columns: 1fr; }
  .flow-steps > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-steps > div:last-child { border-bottom: 0; }
  .day-plan { min-height: 125px; border-right: 0; }
  .filters { flex-direction: column; }
  .filters select, .search-input { width: 100%; }
  .summary-intro { align-items: flex-start; padding: 24px 20px; }
  .summary-intro .button { display: none; }
  .summary-metric-grid { grid-template-columns: 1fr 1fr; }
  .summary-metric { min-height: 112px; padding: 15px; }
}
