:root {
  --ink: #18201d;
  --muted: #6b746f;
  --line: #dfe5e1;
  --paper: #f4f6f3;
  --card: #ffffff;
  --accent: #ff5c35;
  --accent-dark: #d83f1b;
  --green: #166b50;
  --green-soft: #e5f0eb;
  --shadow: 0 18px 60px rgba(28, 43, 36, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", "Noto Sans SC", sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 34px 24px 24px; background: #17211e; color: #f6f8f5; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 21px; letter-spacing: -0.5px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 12px 4px 12px 4px; font-weight: 700; }
.brand b { font-weight: 700; }
.side-nav { margin-top: 64px; display: grid; gap: 8px; }
.side-nav a, .side-nav button { border: 0; width: 100%; display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 10px; color: #aeb9b4; background: transparent; text-decoration: none; text-align: left; }
.side-nav a:hover, .side-nav button:hover, .side-nav .active { color: white; background: rgba(255,255,255,.08); }
.nav-icon { width: 20px; font-size: 19px; text-align: center; }
.sidebar-note { margin-top: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 16px; display: flex; gap: 10px; color: #b7c1bd; font-size: 12px; line-height: 1.6; }
.sidebar-note p { margin: 0; }
.sidebar-note b { color: white; font-size: 13px; }
.pulse-dot { margin-top: 5px; width: 8px; height: 8px; flex: 0 0 auto; background: #50d493; border-radius: 50%; box-shadow: 0 0 0 5px rgba(80,212,147,.1); }
.sidebar-footer { margin-top: 19px; color: #63716b; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }

.main-content { min-width: 0; padding: 34px clamp(26px, 4vw, 70px) 80px; }
.topbar, .results-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 52px); letter-spacing: -2.5px; line-height: 1; }
h2 { margin: 0; font-size: 26px; letter-spacing: -1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; background: white; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }
.status-badge i { width: 7px; height: 7px; border-radius: 50%; background: #aeb6b2; }
.status-badge.ready { color: var(--green); }
.status-badge.ready i { background: #2bb179; }
.icon-button, .close-button { width: 38px; height: 38px; border: 1px solid var(--line); background: white; border-radius: 10px; }

.query-card { margin-top: 42px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; padding: 28px 30px; border-bottom: 1px solid var(--line); }
.section-heading > div { display: flex; gap: 18px; align-items: center; }
.section-heading p { margin: 0; max-width: 420px; color: var(--muted); font-size: 13px; }
.section-index { color: var(--accent); font-size: 12px; font-weight: 700; }
#queryForm { padding: 28px 30px 30px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend, .field > span { display: block; margin-bottom: 9px; color: #414a46; font-size: 12px; font-weight: 700; }
.platform-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.platform-button { min-width: 0; min-height: 66px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; color: var(--muted); display: flex; align-items: center; gap: 12px; text-align: left; transition: .2s ease; }
.platform-button > span:last-child { min-width: 0; overflow: hidden; }
.platform-button b, .platform-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-button:hover { border-color: #b7c4be; transform: translateY(-1px); }
.platform-button.active { color: var(--ink); border-color: var(--ink); background: white; box-shadow: inset 0 -3px 0 var(--accent); }
.platform-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #edf0ed; font-weight: 700; color: var(--ink); }
.platform-button.active .platform-logo { background: var(--green-soft); color: var(--green); }
.platform-button small { display: block; margin-top: 3px; font-size: 10px; color: #8a938f; }
.form-grid { display: grid; gap: 18px; margin-top: 24px; }
.primary-grid { grid-template-columns: minmax(190px, .8fr) minmax(300px, 2fr); }
.field input, .field select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #ccd4cf; border-radius: 9px; background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,107,80,.09); }
.field select:disabled { cursor: not-allowed; color: #939b97; background: #f0f2f0; }
.field small { display: block; margin-top: 6px; min-height: 15px; color: #89918d; font-size: 11px; line-height: 1.45; }
.filter-panel { position: relative; margin-top: 25px; padding-top: 24px; border-top: 1px solid var(--line); }
.filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.filter-toolbar b, .filter-toolbar small { display: block; }
.filter-toolbar b { font-size: 13px; }
.filter-toolbar small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.quick-range { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.quick-range button, .page-presets button { min-width: 50px; height: 30px; padding: 0 10px; border: 1px solid #d3dad6; border-radius: 7px; background: #f7f9f7; color: #5e6863; font-size: 10px; }
.quick-range button:hover, .page-presets button:hover, .page-presets button.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.date-grid { display: grid; grid-template-columns: minmax(210px, 1fr) 28px minmax(210px, 1fr) minmax(220px, .85fr); align-items: center; gap: 12px; margin-top: 17px; }
.date-arrow { margin-top: -19px; color: #9aa39f; text-align: center; }
.date-trigger { width: 100%; height: 46px; padding: 0 13px 0 15px; border: 1px solid #ccd4cf; border-radius: 9px; background: white; color: var(--ink); display: flex; align-items: center; justify-content: space-between; text-align: left; }
.date-trigger:hover, .date-trigger[aria-expanded="true"] { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,107,80,.09); }
.date-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-trigger > b { color: var(--green); font-size: 16px; }
.date-picker { position: absolute; z-index: 40; top: 175px; right: 0; width: min(790px, 100%); overflow: hidden; border: 1px solid #c8d5cf; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(24,42,34,.18); user-select: none; }
.date-picker-head { min-height: 72px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #f7faf8; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.calendar-heading { text-align: center; }
.calendar-heading b, .calendar-heading small { display: block; }
.calendar-heading b { font-size: 14px; }
.calendar-heading small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.calendar-nav, .calendar-actions { display: flex; align-items: center; gap: 6px; }
.calendar-nav button, .calendar-text-button { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid #d1dad5; border-radius: 8px; background: white; color: #52605a; font-size: 10px; }
.calendar-nav button:hover, .calendar-text-button:hover { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.calendar-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.calendar-month { margin: 0; padding: 18px 21px 20px; background: white; }
.calendar-month h3 { margin: 0 0 13px; font-size: 13px; text-align: center; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { margin-bottom: 6px; color: #8c9691; font-size: 9px; text-align: center; }
.calendar-days { row-gap: 4px; }
.calendar-blank, .calendar-day { min-height: 35px; }
.calendar-day { position: relative; border: 0; border-radius: 8px; background: transparent; color: #35423c; font-size: 11px; }
.calendar-day:hover { background: #e7f1ec; color: var(--green); }
.calendar-day.today { box-shadow: inset 0 0 0 1px #8aaf9f; color: var(--green); font-weight: 700; }
.calendar-day.in-range { border-radius: 0; background: #dfeee7; color: #0d5f47; }
.calendar-day.range-start, .calendar-day.range-end { border-radius: 8px; background: var(--green); color: white; box-shadow: none; font-weight: 700; }
.date-picker-foot { min-height: 72px; padding: 13px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.calendar-selection b, .calendar-selection small { display: block; }
.calendar-selection b { color: var(--green); font-size: 11px; }
.calendar-selection small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.calendar-actions .primary-button, .calendar-actions .secondary-button { min-height: 36px; padding: 0 13px; font-size: 10px; }
.calendar-actions .primary-button:disabled { cursor: not-allowed; background: #aeb8b3; opacity: .75; }
.range-status { min-height: 69px; margin-top: 2px; padding: 13px 15px; border: 1px solid #d5dfda; border-radius: 10px; background: #f4f8f6; display: flex; flex-direction: column; justify-content: center; }
.range-status b, .range-status small { display: block; }
.range-status b { color: var(--green); font-size: 12px; }
.range-status small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.range-status.warning { border-color: #f0c29f; background: #fff7f0; }
.range-status.warning b { color: var(--accent-dark); }
.weibo-filters { margin-top: 20px; padding: 17px 18px 18px; border: 1px solid #d9e2dd; border-radius: 12px; background: #fafcfb; }
.weibo-filters legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.weibo-filters > p { margin: -2px 0 12px; color: var(--muted); font-size: 10px; }
.filter-chip-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.filter-chip { position: relative; cursor: pointer; }
.filter-chip input { position: absolute; opacity: 0; pointer-events: none; }
.filter-chip span { min-height: 38px; padding: 0 12px; border: 1px solid #d5dcd8; border-radius: 9px; background: white; color: #65706a; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; transition: .16s ease; }
.filter-chip span::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border: 1px solid #abb5b0; border-radius: 50%; }
.filter-chip input:checked + span { border-color: #84ad9c; background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px rgba(22,107,80,.05); }
.filter-chip input:checked + span::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 2px var(--green-soft); }
.filter-chip input:focus-visible + span { outline: 3px solid rgba(22,107,80,.14); }
.source-chip span { border-style: dashed; }
.query-control-grid { display: grid; grid-template-columns: minmax(330px, 1.5fr) minmax(180px, .65fr) minmax(200px, .8fr); align-items: stretch; gap: 14px; margin-top: 20px; }
.paging-box, .paging-toggle, .sort-field { min-height: 90px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.paging-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; }
.paging-box > div:first-child b, .paging-box > div:first-child small { display: block; }
.paging-box > div:first-child b { font-size: 12px; }
.paging-box > div:first-child small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.page-stepper { height: 37px; display: grid; grid-template-columns: 35px 52px 35px; }
.page-stepper button, .page-stepper input { border: 1px solid #cbd4cf; background: white; color: var(--ink); text-align: center; }
.page-stepper button:first-child { border-radius: 8px 0 0 8px; }
.page-stepper button:last-child { border-radius: 0 8px 8px 0; }
.page-stepper button:hover { color: white; background: var(--green); }
.page-stepper input { width: 52px; border-left: 0; border-right: 0; outline: 0; -moz-appearance: textfield; }
.page-stepper input::-webkit-inner-spin-button { appearance: none; }
.page-presets { grid-column: 1 / -1; display: flex; gap: 6px; }
.page-presets button { min-width: 38px; height: 25px; padding: 0 8px; }
.sort-field { display: flex; flex-direction: column; justify-content: center; }
.sort-field > span { margin-bottom: 6px; }
.sort-field select { height: 36px; }
.sort-field small { min-height: 0; }
.paging-toggle { justify-content: center; }
.query-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 27px; }
.toggle-row { display: flex; align-items: center; gap: 12px; color: #3f4944; font-size: 12px; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { width: 38px; height: 21px; padding: 3px; background: #c9cfcc; border-radius: 99px; transition: .2s; }
.toggle::after { content: ""; display: block; width: 15px; height: 15px; border-radius: 50%; background: white; transition: .2s; }
.toggle-row input:checked + .toggle { background: var(--green); }
.toggle-row input:checked + .toggle::after { transform: translateX(17px); }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: #8a928e; }
.query-estimate b, .query-estimate small { display: block; }
.query-estimate b { color: var(--ink); font-size: 12px; }
.query-estimate small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.primary-button, .secondary-button { min-height: 44px; padding: 0 18px; border-radius: 9px; font-weight: 700; }
.primary-button { border: 0; background: var(--ink); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 32px; }
.primary-button:hover { background: var(--green); }
.primary-button:disabled { cursor: wait; opacity: .6; }
.secondary-button { border: 1px solid #cdd5d0; background: white; color: var(--ink); }
.secondary-button:disabled { opacity: .45; cursor: not-allowed; }

.capability-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 20px; border: 1px solid var(--line); background: var(--line); }
.capability-strip article { padding: 17px 20px; display: flex; align-items: center; gap: 14px; background: #eef1ee; }
.capability-strip article > span { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.capability-strip b, .capability-strip small { display: block; }
.capability-strip b { font-size: 13px; }
.capability-strip small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.results-section { padding-top: 58px; }
.results-header h2 span { color: var(--accent); font-size: 15px; vertical-align: top; }
.result-actions { display: flex; align-items: center; gap: 14px; }
.result-actions > span { color: var(--muted); font-size: 12px; }
.progress-panel { margin: 24px 0; padding: 16px 18px; border: 1px solid #cadbd3; background: var(--green-soft); }
.progress-copy { display: flex; justify-content: space-between; color: var(--green); font-size: 12px; }
.progress-track { height: 3px; margin-top: 12px; background: rgba(22,107,80,.15); overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--green); transition: width .25s; }
.notice-panel { min-height: 270px; margin-top: 24px; border: 1px dashed #c9d0cc; display: grid; place-items: center; align-content: center; text-align: center; background: rgba(255,255,255,.45); }
.notice-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: white; color: var(--green); font-size: 24px; }
.notice-panel h3 { margin: 15px 0 6px; }
.notice-panel p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.notice-panel.error { border-color: #e4b6aa; background: #fff4f0; }
.notice-panel.error .notice-icon { color: var(--accent-dark); }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.result-card { padding: 22px; min-width: 0; background: white; border: 1px solid var(--line); box-shadow: 0 8px 25px rgba(31,48,40,.045); }
.result-card.restricted-card { border-color: #e6c7b7; background: linear-gradient(145deg, #fff 0%, #fffaf7 100%); }
.card-topline, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-platform { padding: 5px 8px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .6px; }
.card-topline time { color: #8a938f; font-size: 11px; }
.card-title { margin: 16px 0 8px; font-size: 18px; line-height: 1.4; }
.card-copy { display: -webkit-box; overflow: hidden; margin: 0; color: #535d58; font-size: 13px; line-height: 1.7; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card-alert { margin-top: 14px; padding: 10px 12px; border-left: 3px solid #d58b61; background: #fff3eb; color: #775444; font-size: 10px; line-height: 1.55; }
.card-alert.success { border-left-color: var(--green); background: var(--green-soft); color: var(--green); }
.card-alert.error { border-left-color: var(--accent-dark); background: #fff0ec; color: #8c3f2c; }
.media-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 17px; overflow: hidden; }
.media-gallery:empty { display: none; }
.media-item { position: relative; aspect-ratio: 1; min-width: 0; overflow: hidden; background: #e8ece9; }
.media-item:first-child:nth-last-child(1) { aspect-ratio: 16 / 9; grid-column: 1 / -1; }
.media-item img, .media-item video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-item a { position: absolute; right: 5px; bottom: 5px; padding: 4px 6px; border-radius: 4px; color: white; background: rgba(0,0,0,.64); text-decoration: none; font-size: 9px; }
.card-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.card-footer { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.media-summary { color: var(--muted); font-size: 10px; }
.card-footer > div { display: flex; align-items: center; gap: 12px; }
.raw-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 10px; }
.detail-button { padding: 6px 9px; border: 1px solid #d28a64; border-radius: 6px; background: #fff4ed; color: #9b4c29; font-size: 10px; font-weight: 700; }
.detail-button:hover { color: white; background: #b95d35; }
.detail-button:disabled { cursor: wait; opacity: .65; }
.source-link { color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; }
.source-link:not([href]) { display: none; }
.raw-details { display: none; margin-top: 12px; }
.raw-details.open { display: block; }
.raw-details summary { font-size: 11px; }
.raw-details pre { max-height: 260px; overflow: auto; padding: 12px; background: #17211e; color: #d8e5df; font-size: 10px; white-space: pre-wrap; word-break: break-all; }

.settings-dialog { width: min(520px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 100px rgba(0,0,0,.2); }
.settings-dialog::backdrop { background: rgba(15,24,21,.55); backdrop-filter: blur(4px); }
.settings-dialog form { padding: 27px; }
.dialog-head { display: flex; justify-content: space-between; margin-bottom: 26px; }
.settings-dialog .field { display: block; margin-top: 17px; }
.secret-input { display: flex; }
.secret-input input { border-radius: 9px 0 0 9px; }
.secret-input button { min-width: 62px; border: 1px solid #ccd4cf; border-left: 0; border-radius: 0 9px 9px 0; background: #f2f4f2; }
.security-callout { margin-top: 20px; padding: 13px 15px; border-left: 3px solid var(--accent); background: #fff4ef; font-size: 11px; }
.security-callout p { margin: 4px 0 0; color: #78635b; }
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }

.account-preview { margin-top: 22px; padding: 18px; border: 1px solid #c8d8d0; background: linear-gradient(110deg, #edf5f1 0%, #fafcfb 68%); display: grid; grid-template-columns: 64px minmax(180px, 1fr) auto auto; align-items: center; gap: 18px; }
.account-avatar { width: 64px; height: 64px; position: relative; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: #dce7e1; color: var(--green); font-size: 20px; font-weight: 700; }
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-avatar img:not([src]), .account-avatar img[src=""] { display: none; }
.account-main { min-width: 0; }
.account-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.account-status i { width: 7px; height: 7px; border-radius: 50%; background: #2bb179; }
.account-main h3 { margin: 5px 0 3px; font-size: 19px; }
.account-main > p { margin: 0; max-width: 580px; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-ids { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: #6c7772; font-size: 9px; }
.account-stats { display: flex; gap: 18px; padding: 0 17px; border-left: 1px solid #cedbd5; border-right: 1px solid #cedbd5; }
.account-stats span { min-width: 52px; text-align: center; color: var(--muted); font-size: 9px; }
.account-stats b { display: block; color: var(--ink); font-size: 15px; }
.account-home-link { padding: 11px 13px; border: 1px solid var(--green); border-radius: 8px; color: var(--green); text-decoration: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.account-home-link:hover { color: white; background: var(--green); }

@media (max-width: 1280px) {
  .main-content { padding-left: 32px; padding-right: 32px; }
  .platform-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-grid { grid-template-columns: minmax(180px, 1fr) 24px minmax(180px, 1fr); }
  .range-status { grid-column: 1 / -1; }
  .filter-chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .query-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paging-box { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 25px 15px; }
  .brand > span:last-child, .side-nav a:not(.active), .side-nav button, .sidebar-note, .sidebar-footer { display: none; }
  .side-nav { margin-top: 52px; }
  .side-nav a { justify-content: center; padding: 13px; }
  .side-nav .nav-icon { font-size: 22px; }
  .section-heading { align-items: flex-start; }
  .account-preview { grid-template-columns: 58px 1fr auto; }
  .account-stats { display: none; }
  .date-grid { grid-template-columns: minmax(180px, 1fr) 24px minmax(180px, 1fr); }
  .range-status { grid-column: 1 / -1; }
  .filter-chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .query-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paging-box { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; justify-content: space-between; }
  .brand > span:last-child { display: inline; }
  .brand-mark { width: 31px; height: 31px; }
  .side-nav { margin: 0; display: block; }
  .side-nav .active { padding: 8px 12px; }
  .main-content { padding: 28px 16px 60px; }
  .topbar { align-items: center; }
  .status-badge { display: none; }
  .section-heading, #queryForm { padding: 21px 18px; }
  .section-heading p { display: none; }
  .platform-tabs { grid-template-columns: repeat(2, 1fr); }
  .primary-grid, .date-grid, .query-control-grid, .capability-strip, .result-grid { grid-template-columns: 1fr; }
  .filter-toolbar { align-items: flex-start; flex-direction: column; }
  .quick-range { justify-content: flex-start; }
  .date-arrow { display: none; }
  .date-picker { position: fixed; inset: auto 10px 10px; width: auto; max-height: calc(100vh - 20px); overflow: auto; border-radius: 15px; }
  .date-picker-head { align-items: flex-start; }
  .calendar-heading small { display: none; }
  .calendar-nav button[data-calendar-shift="-12"], .calendar-nav button[data-calendar-shift="12"] { display: none; }
  .calendar-months { grid-template-columns: 1fr; }
  .calendar-month:nth-child(2) { display: none; }
  .date-picker-foot { align-items: stretch; flex-direction: column; }
  .calendar-actions { justify-content: flex-end; }
  .range-status, .paging-box { grid-column: auto; }
  .filter-chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-preview { grid-template-columns: 52px 1fr; gap: 12px; }
  .account-avatar { width: 52px; height: 52px; }
  .account-home-link { grid-column: 1 / -1; text-align: center; }
  .query-footer, .results-header, .result-actions { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .capability-strip { gap: 1px; }
}
