:root {
  --ink: #20241f;
  --muted: #787d75;
  --paper: #f3f0e8;
  --card: #fbfaf6;
  --line: #dfddd4;
  --line-soft: #ebe9e2;
  --coral: #b74f3b;
  --coral-soft: #f3e3dd;
  --green: #447361;
  --green-soft: #e0ece6;
  --blue: #3d6078;
  --blue-soft: #e0e9ee;
  --gold: #9f7842;
  --gold-soft: #f1e8d8;
  --danger: #9c3d35;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --shadow: 0 16px 42px rgba(36,35,29,.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0,1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 232px; padding: 24px 16px 18px; display: flex; flex-direction: column; color: #ecece5; background: radial-gradient(circle at 25% 3%, rgba(185,79,60,.17), transparent 29%), linear-gradient(180deg,#202520,#171b18); }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 7px 22px; color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-seal { width: 39px; height: 39px; display: grid; place-items: center; color: #fff3ea; background: linear-gradient(145deg,#c45d47,#8c3329); border-radius: 10px 10px 14px 10px; font: 600 22px/1 var(--serif); }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 17px/1.2 var(--serif); letter-spacing: .06em; }
.brand small { margin-top: 3px; color: rgba(255,255,255,.4); font-size: 8px; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 5px; margin-top: 20px; }
.nav { height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; color: rgba(245,245,238,.6); background: transparent; text-align: left; }
.nav svg { width: 17px; height: 17px; }
.nav span { flex: 1; }
.nav b { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 12px; color: #f2d9d0; background: rgba(185,79,60,.35); font-size: 8px; }
.nav:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav.active { color: #fff; background: linear-gradient(90deg,rgba(185,79,60,.26),rgba(255,255,255,.04)); box-shadow: inset 2px 0 0 #d2735f; }
.side-state { margin-top: auto; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: rgba(255,255,255,.035); }
.side-state > div { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.side-state i { width: 6px; height: 6px; border-radius: 50%; background: #d2905c; }
.side-state i.ok { background: #82b398; box-shadow: 0 0 0 4px rgba(130,179,152,.1); }
.side-state p { margin: 7px 0 11px; color: rgba(255,255,255,.38); font-size: 8px; line-height: 1.65; }
.side-state a { color: rgba(255,255,255,.62); text-decoration: none; font-size: 8px; }
.profile { display: flex; align-items: center; gap: 9px; padding: 17px 3px 0; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #faece3; background: #a64a39; font: 600 13px/1 var(--serif); }
.profile > div { min-width: 0; flex: 1; }
.profile strong, .profile small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile strong { font-size: 10px; font-weight: 500; }
.profile small { margin-top: 2px; color: rgba(255,255,255,.35); font-size: 8px; }
.profile button { width: 29px; height: 29px; display: grid; place-items: center; color: rgba(255,255,255,.42); background: transparent; border: 0; }
.profile button svg { width: 15px; height: 15px; }
.main { grid-column: 2; min-width: 0; padding: 0 30px 70px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 86px; margin: 0 -30px; padding: 17px 30px 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(243,240,232,.9); backdrop-filter: blur(14px); }
.crumb { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.topbar h1 { margin: 3px 0 0; font: 600 23px/1.2 var(--serif); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live-pill { height: 31px; padding: 0 11px; display: flex; align-items: center; gap: 6px; border-radius: 20px; color: var(--green); background: var(--green-soft); font-size: 9px; }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.icon-button { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.5); }
.icon-button svg { width: 16px; height: 16px; }
.button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: 10px; font-weight: 600; transition: .18s ease; }
.button svg { width: 14px; height: 14px; }
.button.primary { color: #fff; background: linear-gradient(135deg,#bd5945,#9b3b30); box-shadow: 0 7px 18px rgba(151,57,45,.15); }
.button.primary:hover { transform: translateY(-1px); }
.button.secondary { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.55); }
.button.danger { color: var(--danger); border-color: #e2cbc6; background: #f8ece9; }
.button:disabled { opacity: .5; cursor: wait; transform: none; }
.notice { margin-top: 8px; padding: 10px 12px; border: 1px solid #e2cfbd; border-radius: 8px; color: #7f5b3c; background: #f4eadf; font-size: 9px; }
.notice.error { color: #8f3d33; border-color: #e5c6bf; background: #f8eae6; }
.page { display: none; animation: enter .25s ease both; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.page-head { margin: 18px 0 23px; display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; }
.page-head.compact { align-items: center; }
.page-head h2 { margin: 8px 0 6px; font: 500 30px/1.35 var(--serif); }
.page-head p { margin: 0; max-width: 700px; color: var(--muted); font-size: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--coral); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.eyebrow i { width: 17px; height: 1px; background: currentColor; }
.readiness { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.readiness-item { padding: 8px 10px; display: flex; align-items: center; gap: 6px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.48); color: var(--muted); font-size: 8px; }
.readiness-item i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.readiness-item.ok i { background: var(--green); }
.readiness-item.warn { color: #8b623f; border-color: #e4d1bd; background: #f5ebdf; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.stat-card, .panel { border: 1px solid var(--line-soft); background: rgba(251,250,246,.84); box-shadow: var(--shadow); }
.stat-card { padding: 17px 18px; border-radius: 13px; }
.stat-card span { color: var(--muted); font-size: 8px; }
.stat-card strong { display: block; margin-top: 9px; font: 600 27px/1 var(--serif); }
.stat-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.panel { border-radius: 15px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.panel-head { padding: 18px 19px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head span { color: var(--muted); font-size: 8px; letter-spacing: .09em; }
.panel-head h3 { margin: 4px 0 0; font: 600 15px/1.35 var(--serif); }
.text-button { padding: 4px 0; border: 0; color: var(--coral); background: transparent; font-size: 8px; }
.compact-list { padding: 0 19px 14px; }
.compact-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.compact-row:hover { opacity: .76; }
.compact-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.compact-icon svg { width: 15px; height: 15px; }
.compact-main { min-width: 0; flex: 1; }
.compact-main strong, .compact-main p { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-main strong { font-size: 9px; }
.compact-main p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.compact-side { text-align: right; }
.compact-side b { display: block; color: var(--coral); font-size: 9px; }
.compact-side small { color: var(--muted); font-size: 7px; }
.loading-block, .empty-state { color: var(--muted); font-size: 9px; }
.empty-state { min-height: 390px; display: grid; place-content: center; text-align: center; padding: 30px; }
.empty-state > span { width: 42px; height: 42px; margin: 0 auto 11px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--coral); font: 600 17px/1 var(--serif); }
.empty-state h3 { margin: 0; font: 500 18px/1.4 var(--serif); }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.empty-state.small { min-height: 160px; }

.search { width: 230px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.55); }
.search input { width: 100%; border: 0; outline: none; background: transparent; font-size: 9px; }
.inbox { min-height: 660px; display: grid; grid-template-columns: 285px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line-soft); border-radius: 15px; background: var(--card); box-shadow: var(--shadow); }
.conversation-pane { border-right: 1px solid var(--line-soft); background: #f7f4ed; }
.pane-title { height: 50px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); font-size: 9px; font-weight: 600; }
.pane-title button { width: 27px; height: 27px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); }
.pane-title svg { width: 14px; height: 14px; }
.conversation { position: relative; padding: 13px 14px; display: flex; gap: 9px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.conversation:hover { background: #f0ede5; }
.conversation.active { background: #fff; box-shadow: inset 2px 0 0 var(--coral); }
.conversation .avatar { width: 31px; height: 31px; font-size: 11px; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-top { display: flex; gap: 5px; align-items: center; }
.conversation-top strong { flex: 1; font-size: 9px; }
.conversation-top small { color: var(--muted); font-size: 7px; }
.conversation-copy > p { margin: 4px 0 0; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-meta { margin-top: 7px; display: flex; gap: 4px; }
.conversation-meta span { padding: 3px 5px; border-radius: 4px; color: var(--muted); background: #ebe8e0; font-size: 6px; }
.conversation-meta .draft { color: var(--coral); background: var(--coral-soft); }
.chat-pane { min-width: 0; display: flex; flex-direction: column; background: #fcfbf7; }
.chat-head { min-height: 64px; padding: 12px 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.chat-person { display: flex; align-items: center; gap: 9px; }
.chat-person strong, .chat-person small { display: block; }
.chat-person strong { font-size: 10px; }
.chat-person small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; }
.chat-score { padding: 5px 8px; border-radius: 20px; color: var(--coral); background: var(--coral-soft); font-size: 8px; }
.chat-topic { padding: 8px 16px; color: var(--muted); background: #f2efe8; border-bottom: 1px solid var(--line-soft); font-size: 7px; }
.messages { flex: 1; min-height: 360px; max-height: 480px; overflow-y: auto; padding: 20px; }
.message-date { color: #a6a198; font-size: 7px; text-align: center; }
.message { display: flex; margin-top: 12px; }
.message.out { justify-content: flex-end; }
.bubble { max-width: 76%; padding: 9px 11px; border-radius: 4px 11px 11px 11px; color: #42453f; background: #eeebe3; font-size: 9px; line-height: 1.7; white-space: pre-wrap; }
.message.out .bubble { border-radius: 11px 4px 11px 11px; color: #fff; background: #516f62; }
.message.draft .bubble { color: #3f5f51; border: 1px dashed #a9c3b6; background: #eff6f2; }
.bubble small { display: block; margin-top: 5px; color: rgba(255,255,255,.5); font-size: 6px; text-align: right; }
.message:not(.out) .bubble small { color: var(--muted); }
.chat-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 11px 16px; border-top: 1px solid var(--line-soft); background: #f7f5ef; }
.chat-lead div { min-width: 0; }
.chat-lead span { display: block; color: var(--muted); font-size: 7px; }
.chat-lead strong { display: block; margin-top: 2px; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer { padding: 11px 16px 14px; border-top: 1px solid var(--line-soft); background: #fff; }
.composer textarea { width: 100%; min-height: 72px; padding: 10px; resize: vertical; outline: none; border: 1px solid var(--line); border-radius: 9px; background: #fcfbf8; font-size: 9px; line-height: 1.65; }
.composer-actions { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.composer-actions .button:first-child { margin-left: auto; }
.composer-note { margin: 6px 0 0; color: var(--muted); font-size: 6px; }

.lead-toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.45); }
.segmented button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 8px; }
.segmented button.active { color: #fff; background: var(--ink); }
.table-panel { overflow: hidden; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th { padding: 10px 13px; color: var(--muted); background: #f4f1e9; text-align: left; font-size: 7px; font-weight: 500; }
td { padding: 12px 13px; border-top: 1px solid var(--line-soft); font-size: 8px; }
tr { transition: background .15s; }
tbody tr:hover { background: #f8f5ee; }
.cell-person { display: flex; align-items: center; gap: 8px; }
.cell-person .avatar { width: 28px; height: 28px; font-size: 10px; }
.cell-person strong, .cell-person small { display: block; }
.cell-person small { color: var(--muted); font-size: 7px; }
.pill { display: inline-flex; padding: 4px 6px; border-radius: 20px; font-size: 7px; white-space: nowrap; }
.pill.high { color: var(--danger); background: var(--coral-soft); }
.pill.follow, .pill.new { color: var(--gold); background: var(--gold-soft); }
.pill.contacted { color: var(--blue); background: var(--blue-soft); }
.pill.won { color: var(--green); background: var(--green-soft); }
.pill.lost { color: var(--muted); background: #e8e7e2; }
.table-actions { display: flex; gap: 5px; }
.mini-button { min-height: 25px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 7px; }

.generator { padding: 15px; display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.generator label { flex: 1; color: var(--muted); font-size: 8px; }
input, select, textarea { width: 100%; margin-top: 5px; padding: 9px 10px; outline: none; border: 1px solid var(--line); border-radius: 7px; background: #fcfbf7; font-size: 9px; }
input:focus, select:focus, textarea:focus { border-color: #9baa9e; }
textarea { resize: vertical; line-height: 1.65; }
.content-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.content-card { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--card); box-shadow: var(--shadow); }
.content-card-image { height: 145px; overflow: hidden; background: #e1ddd4; }
.content-card-image img { width: 100%; height: 100%; object-fit: cover; }
.content-card-body { padding: 13px; }
.content-card-head { display: flex; justify-content: space-between; gap: 8px; }
.content-card-head span { color: var(--muted); font-size: 7px; }
.content-card h3 { margin: 9px 0 5px; font: 600 14px/1.5 var(--serif); }
.content-card p { margin: 0; min-height: 66px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.content-actions { display: flex; gap: 5px; margin-top: 11px; }

.artwork-form { padding: 16px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1.2fr .8fr .8fr .7fr; gap: 9px; }
.artwork-form > label { display: block; margin-top: 9px; color: var(--muted); font-size: 8px; }
.form-actions { display: flex; gap: 7px; margin-top: 10px; }
.artwork-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.artwork-card { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.artwork-image { height: 180px; background: #e2ddd3; overflow: hidden; }
.artwork-image img { width: 100%; height: 100%; object-fit: cover; }
.artwork-body { padding: 12px 13px; }
.artwork-body h3 { margin: 0; font: 600 14px/1.4 var(--serif); }
.artwork-body p { margin: 5px 0 0; color: var(--muted); font-size: 8px; }
.artwork-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.artwork-tags span { padding: 3px 5px; border-radius: 4px; color: var(--green); background: var(--green-soft); font-size: 6px; }

.channel-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.ai-settings-panel { margin-top: 14px; padding: 18px 20px; }
.ai-settings-panel .panel-head { padding: 0 0 12px; }
.ai-form-grid { display: grid; grid-template-columns: 1.2fr .8fr 1.2fr; gap: 9px; }
.ai-form-grid label { color: var(--muted); font-size: 8px; }
.ai-config-help { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.7; }
.channel-card { padding: 17px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.channel-card-head { display: flex; align-items: center; justify-content: space-between; }
.channel-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 700; }
.channel-card-head .pill { font-size: 7px; }
.channel-card h3 { margin: 13px 0 5px; font: 600 16px/1.4 var(--serif); }
.channel-card p { min-height: 48px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.65; }
.endpoint { margin-top: 12px; padding: 8px; border-radius: 7px; background: #f2efe7; color: #676b63; font: 7px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
.copy-button { width: 100%; margin-top: 8px; }
.instruction-panel { margin-top: 14px; padding: 18px 20px; }
.instruction-panel h3 { margin: 0; font: 600 16px/1.4 var(--serif); }
.instruction-panel ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 9px; line-height: 1.9; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setting-block { padding: 19px; }
.setting-block h3 { margin: 0 0 13px; font: 600 15px/1.4 var(--serif); }
.setting-block label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 8px; }
.check-row { display: flex !important; align-items: center; gap: 7px; padding: 7px 0; }
.check-row input { width: 14px; height: 14px; margin: 0; accent-color: var(--green); }

.toast-stack { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 7px; }
.toast { min-width: 230px; padding: 11px 13px; border-radius: 8px; color: #fff; background: #242a26; box-shadow: 0 13px 34px rgba(0,0,0,.18); font-size: 9px; animation: toast .22s ease both; }
@keyframes toast { from { opacity: 0; transform: translateY(6px); } }
.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--paper); }
.auth-art { position: relative; min-height: 100vh; overflow: hidden; color: #fff; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(14,20,16,.06),rgba(14,19,16,.78)); }
.auth-art img { width: 100%; height: 100%; object-fit: cover; }
.auth-art > div { position: absolute; z-index: 1; left: 8vw; right: 7vw; bottom: 8vh; }
.auth-art span { color: #e2a58f; font-size: 9px; letter-spacing: .2em; }
.auth-art h1 { margin: 13px 0 0; font: 500 clamp(30px,4vw,56px)/1.35 var(--serif); }
.auth-panel { min-height: 100vh; padding: 7vh 10vw; display: flex; flex-direction: column; justify-content: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font: 600 13px/1.3 var(--serif); }
.auth-brand span { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--coral); border-radius: 9px 9px 12px 9px; }
.auth-copy { margin-top: 42px; }
.auth-copy > span { color: var(--coral); font-size: 8px; letter-spacing: .17em; }
.auth-copy h2 { margin: 9px 0 8px; font: 500 30px/1.3 var(--serif); }
.auth-copy p { max-width: 430px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.auth-panel form { max-width: 420px; margin-top: 25px; }
.auth-panel form label { display: block; margin-bottom: 13px; color: var(--muted); font-size: 8px; }
.auth-panel form input { padding: 11px; }
.auth-error { min-height: 18px; margin: 5px 0; color: var(--danger); font-size: 8px; }
.auth-submit { width: 100%; height: 42px; margin-top: 7px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 8px; color: #fff; background: var(--ink); font-size: 10px; }
.auth-foot { max-width: 420px; margin-top: 27px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 7px; }
.auth-foot a { color: var(--coral); text-decoration: none; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 205px minmax(0,1fr); }
  .sidebar { width: 205px; }
  .main { padding-inline: 22px; }
  .topbar { margin-inline: -22px; padding-inline: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .artwork-grid, .channel-grid { grid-template-columns: 1fr 1fr; }
  .ai-form-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { inset: auto 0 0; width: 100%; height: 64px; padding: 6px 8px; display: block; background: rgba(24,28,25,.97); backdrop-filter: blur(12px); }
  .brand, .side-state, .profile { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; margin: 0; }
  .nav { height: 51px; padding: 3px; flex-direction: column; justify-content: center; gap: 2px; font-size: 7px; }
  .nav span { flex: none; }
  .nav b { display: none; }
  .main { padding: 0 14px 90px; }
  .topbar { margin-inline: -14px; padding-inline: 14px; min-height: 74px; }
  .topbar .button { display: none; }
  .topbar h1 { font-size: 20px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head.compact { align-items: flex-start; }
  .page-head h2 { font-size: 26px; }
  .two-col, .settings-grid { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 220px minmax(0,1fr); }
  .content-grid, .artwork-grid, .channel-grid { grid-template-columns: 1fr; }
  .ai-form-grid { grid-template-columns: 1fr; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 7vh 8vw; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head h2 { font-size: 23px; }
  .search { width: 100%; }
  .inbox { display: block; }
  .conversation-pane { display: none; }
  .chat-pane { min-height: 680px; }
  .messages { max-height: 420px; }
  .lead-toolbar { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
  .generator { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }
  .page-head .button { width: 100%; }
}
