/* Shared visual system. Keep workflow, visibility and data rules in their modules. */
:root {
  --ink: #183d3d;
  --green: #235f52;
  --muted: #687c73;
  --line: #e0e8e2;
  --paper: #f5f7f4;
  --surface-soft: #f0f5f1;
  --radius: 16px;
  --shadow: 0 2px 4px #183d3d03, 0 8px 28px #183d3d04;
}
html { color-scheme: light; }
body {
  color: #2b4038;
  background: var(--paper);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { color: var(--ink); background: #dcebe2; }
button, input, select, textarea, .button {
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button, .button { border-radius: 10px; font-weight: 600; line-height: 1.5; }
button:hover:not(:disabled), .button:hover { filter: none; box-shadow: 0 3px 10px #183d3d12; }
button:disabled { box-shadow: none; }
button:focus-visible, a:focus-visible, .button:focus-within, summary:focus-visible {
  outline: 3px solid #609c83;
  outline-offset: 3px;
}
input, select, textarea { color: #2b4038; accent-color: var(--green); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-radius: 9px; }
input::placeholder, textarea::placeholder { color: #87968d; }
select { font: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  border-color: #618f7d;
  box-shadow: 0 0 0 3px #235f5214;
}
input[type="checkbox"], input[type="radio"] { flex-shrink: 0; }
.secondary { color: #365d4d; border-color: #d4e0d7; background: #fff; }
.secondary:hover:not(:disabled) { background: #f0f6f1; border-color: #afc8b8; }
.text-button:hover, .help-link:hover { box-shadow: none; }
h1, .pd-heading h1, #template-designer h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.7px;
}
.eyebrow, .pd-kicker, #template-designer .eyebrow {
  color: #658675;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  margin-bottom: 10px;
}
.muted, .footnote, small { color: var(--muted); }

/* A quiet, persistent navigation frame. */
.workspace { grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  width: 232px;
  padding: 32px 16px 24px;
  background: #fbfdfb;
  border-right-color: var(--line);
  overflow-y: auto;
  z-index: 40;
}
.brand { gap: 12px; margin: 0 12px 46px; font-size: 18px; }
.brand b {
  width: 40px;
  height: 42px;
  flex-shrink: 0;
  background: #235f52;
  border-radius: 12px;
  font: 27px Georgia, serif;
  box-shadow: 0 4px 12px #235f5218;
}
.brand small { margin-top: 3px; font-size: 10px; letter-spacing: 3px; }
.nav-label { margin: 0 16px 14px; color: #82958a; font-size: 10px; }
.nav-button {
  position: relative;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #647a6e;
  font-size: 14px;
  font-weight: 500;
}
.nav-button:hover:not(:disabled) { color: #235f52; background: #edf3ee; box-shadow: none; }
.nav-button.active { color: #fff; background: #235f52; box-shadow: 0 4px 12px #235f5218; }
.nav-button.active:hover { color: #fff; background: #1d5146; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; stroke-width: 1.7; }
.nav-button .badge { border-radius: 6px; padding: 1px 7px; background: #ecebda; color: #7a6a3c; }
.nav-button.active .badge { background: #ffffff24; color: #fff; }
.nav-more {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.nav-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  color: #647a6e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { color: #235f52; background: #edf3ee; }
.nav-more-chevron { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.6; }
.nav-more[open] > summary { margin-bottom: 6px; }
.nav-more[open] .nav-more-chevron { transform: rotate(180deg); }
.sidebar-bottom { margin-inline: 12px; padding: 20px 0 0; }
#logout { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; }
#logout::before { content: "↗"; font-size: 16px; }
.topbar {
  height: 70px;
  padding: 0 36px;
  color: #718479;
  background: #fbfdfb;
  font-size: 12px;
}
#current-user:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: #476653;
  background: #fff;
  white-space: nowrap;
}
#current-user:not(:empty)::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e7f0e9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23557964' stroke-width='1.5'%3E%3Ccircle cx='12' cy='9' r='3'/%3E%3Cpath d='M6 20v-2a6 6 0 0 1 12 0v2'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.main-content { max-width: 1680px; padding: 32px 36px 48px; }
.page-heading, .pd-heading { margin-bottom: 28px; gap: 20px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading p { line-height: 1.8; }
#refresh-status:empty { display: none; }
#refresh-status:not(:empty) { padding: 10px 14px; background: #ecf2ed; border-radius: 9px; font-size: 12px; }

/* Surfaces share the same rhythm across reports, directories and imports. */
.panel, .metrics article, .pd-panel, .pd-card, .report-summary, .report-card,
#template-designer .panel {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-heading { padding: 22px 24px; gap: 16px; }
.panel-heading h3 { color: var(--ink); font-size: 16px; font-weight: 650; }
.panel-heading span { color: var(--muted); font-size: 12px; }
.actions { gap: 8px; }
.actions button, .actions .button { padding: 9px 13px; font-size: 12px; }
.tag, #template-designer .tag, #template-designer .type-tag {
  font-size: 11px;
  line-height: 1.6;
  padding: 3px 9px;
  border-radius: 6px;
}
.tag.muted { color: #687b6e; }
.notice { border-radius: 12px; padding: 14px 18px; }
.notice:empty { display: none; }
.empty, #template-designer .empty { padding: 56px 24px; color: #6e8476; line-height: 1.9; }
.empty::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  background: #edf3ed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none' stroke='%23849e8b' stroke-width='1.5'%3E%3Crect x='11' y='9' width='18' height='23' rx='3'/%3E%3Cpath d='M16 16h8M16 21h8M16 26h5'/%3E%3C/svg%3E") center no-repeat;
  border-radius: 12px;
}
.table-scroll, .pd-table-wrap, .field-table-wrap { overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #c4d3c9 transparent; }
th, #template-designer th { background: #f2f6f2; color: #647d6d; font-weight: 600; font-size: 12px; }
td { padding: 19px 22px; color: #405b4b; font-size: 13px; }
td small { font-size: 11px; }
td strong { font-size: 13px; margin-bottom: 6px; }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background: #f6f9f5; }
td button { border-radius: 8px; }
.list-pager, .pd-pager { font-size: 12px; gap: 12px; }
.list-pager button, .pd-pager button { border-radius: 8px; padding: 7px 12px; font-size: 12px; }
.group-toolbar { background: #fbfdfb; padding: 18px 24px; gap: 14px; }
.group-search { gap: 10px; }
.group-search input, .group-search select { height: 42px; border-color: #d6e1d8; }
.group-toolbar > .muted { color: #6d8173; font-size: 12px; }
.groups-pager { padding: 16px 24px; }
.group-filter-chip { font-size: 12px; border-color: #d1e1d5; background: #edf5ee; }
.group-bulk-bar { border-radius: 10px; padding: 12px 14px; }
.help-links { gap: 12px 24px; margin-bottom: 20px; }
.help-link { color: #235f52; font-size: 16px; font-weight: 700; text-decoration-color: #7fa493; text-underline-offset: 5px; }
.binding-actions select { border: 1px solid #d6e1d8; background: #fff; }

/* Login retains the original forest-green identity. */
.login-wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-story { padding: clamp(36px, 5vw, 80px); background: #163d36; }
.login-story::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -260px;
  right: -180px;
  border: 1px solid #73938645;
  border-radius: 50%;
  box-shadow: 0 0 0 64px #7393860a, 0 0 0 128px #73938608;
  pointer-events: none;
}
.wordmark { display: inline-flex; align-items: center; font-size: 16px; letter-spacing: 2px; }
.login-story h1 { color: #f4f3e6; margin-top: clamp(70px, 15vh, 160px); font-size: clamp(34px, 3.5vw, 52px); line-height: 1.55; letter-spacing: 1px; z-index: 1; }
.login-story p { max-width: 360px; font-size: 14px; z-index: 1; }
.story-bottom { padding-top: 70px; color: #b4c6bc; font-size: 10px; }
.login-form { width: 380px; max-width: calc(100% - 48px); }
.login-form h2 { color: var(--ink); font-size: 30px; letter-spacing: -.5px; }
.login-form .muted { font-size: 13px; margin-bottom: 32px; }
.login-form label { margin-top: 22px; color: #42604e; }
.login-form input { height: 50px; margin-top: 9px; border-color: #d2dfd5; background: #fff; }
.login-form button { min-height: 48px; margin-top: 28px; box-shadow: 0 4px 14px #235f521a; }
.login-form > small { display: block; margin-top: 24px; text-align: center; font-size: 11px; }

/* Reports: distinct upload, status and preview areas without changing order. */
.mode-control { gap: 8px; }
.mode-badge { padding: 8px 12px; border: 1px solid #dce8dc; border-radius: 9px; background: #eaf2e8; }
.mode-control button { padding: 8px 12px; border-radius: 9px; }
.sending-panel { position: relative; padding: 22px 24px 22px 28px; }
.sending-panel::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 3px; border-radius: 0 3px 3px 0; background: #7da68c; }
.sending-panel h3 { font-size: 14px; color: #4c6f59; }
#send-status { font-size: 16px; color: var(--ink); }
#send-queue-description { font-size: 12px; }
#send-queue:empty { display: none; }
#send-queue p { padding: 12px 14px; border: 1px solid #e6ede6; background: #f7faf6; font-size: 12px; }
.upload-panel { padding: 24px; gap: 18px; flex-wrap: wrap; background: #f9fcf8; border-color: #bacfbc; }
.upload-panel div:nth-child(2) { flex: 1 1 360px; min-width: 0; }
.upload-symbol { width: 50px; height: 52px; border-radius: 14px; color: #47765b; background: #e6f0e4; }
.upload-panel small { font-size: 11px; }
#upload-state:not(:empty) { flex-basis: 100%; margin-left: 68px; font-size: 12px; overflow-wrap: anywhere; }
#upload-state:empty { display: none; }
.report-type-switch { margin: 28px 0 18px; gap: 6px; }
.report-type-switch h3 { font-size: 16px; margin-right: 18px; }
.report-type-switch button { border-radius: 9px; padding: 9px 16px; font-size: 12px; background: #fff; }
.report-type-switch button.active { color: #fff; background: #235f52; border-color: #235f52; }
.report-preview-panel { box-shadow: none; border: 0; border-radius: 0; }
.report-preview-panel > .panel-heading { padding: 0 0 18px; }
.report-summary { padding: 20px 24px; transition: border-color .16s ease, box-shadow .16s ease; }
.report-summary:hover { border-color: #b8cebe; box-shadow: 0 4px 16px #183d3d08; }
.report-summary-company h4 { color: var(--ink); font-size: 15px; }
.report-summary-action { background: #eef5ee; color: #235f52; border-color: #d5e3d6; }
.report-snapshot { background: #f5f8f3; border-color: #e1e9df; border-radius: 12px; }
.report-card-foot { background: #fafcf9; }
.issue-tabs { gap: 8px; margin-bottom: 20px; }
.issue-tabs button { font-size: 12px; padding: 9px 16px; }
#review-banner:empty { display: none; }
#page-issues > .actions:has(#issue-search) {
  align-items: center;
  padding: 16px 18px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 14px;
}
#issue-search { flex: 1 1 260px; width: auto; min-width: 0; margin: 0; }
#page-issues > .actions:has(#issue-prev) { justify-content: flex-end; margin-top: 16px; }
#issues-count { font-size: 12px; margin-top: 12px; }
#bot-running { background: #edf4eb; border: 1px solid #dde8d9; border-radius: 12px; padding: 14px 18px; font-size: 12px; }
#bot-empty { padding: 48px 24px; background: #fff; border: 1px dashed #c9d9ca; border-radius: 16px; text-align: center; color: #6e8476; font-size: 13px; }
#bot-list { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
#page-bots:has(#bot-empty:not(.hidden)) #bot-list { display: none; }
.import-errors summary { color: #94703c; }
.import-errors-content { background: #faf8f2; border-radius: 8px; padding: 6px 12px; font-size: 12px; }

/* Dashboard: editorial hierarchy and consistent, legible data surfaces. */
.pd-dashboard { --pd-border: var(--line); --pd-muted: #6c8173; }
.pd-module-tabs { padding: 0 0 12px; margin-bottom: 22px; gap: 6px; }
.pd-module-tabs button { color: #647b6a; padding: 10px 20px; border-radius: 9px; }
.pd-module-tabs button.active { background: #235f52; }
.pd-toolbar { padding: 16px 18px; gap: 12px; border-radius: 14px; box-shadow: var(--shadow); }
.pd-toolbar select, .pd-panel-heading select { font-size: 12px; border-color: #d6e1d8; }
.pd-presets, .pd-tabs { padding: 4px; border-radius: 9px; background: #edf3ee; }
.pd-presets button, .pd-tabs button { color: #617c69; border-radius: 6px; }
.pd-date-range { border-color: #d6e1d8; border-radius: 9px; min-height: 38px; }
.pd-data-date { margin-bottom: 20px; color: #708474; }
.pd-cards { gap: 16px; margin-bottom: 22px; }
.pd-card { padding: 22px; gap: 16px; }
.pd-card:hover { transform: none; border-color: #bed0c2; box-shadow: 0 5px 20px #183d3d09; }
.pd-card:first-child { background: #235f52; border-color: #235f52; }
.pd-card-label { font-size: 12px; color: #667e6b; }
.pd-card strong { font-weight: 650; letter-spacing: -1px; }
.pd-budget-cards .pd-card strong { font-size: clamp(24px, 2.1vw, 34px); }
.pd-budget-cards .pd-card:nth-child(2) strong { font-size: clamp(28px, 2.4vw, 38px); }
.pd-budget-cards .pd-card:last-child strong { font-size: 22px; letter-spacing: -.3px; }
.pd-card-context, .pd-change { color: #6b8071; font-size: 12px; }
.pd-effect-cards .pd-card:first-child { background: #fff; border-color: var(--line); }
.pd-effect-cards .pd-card:first-child .pd-card-label, .pd-effect-cards .pd-card:first-child .pd-change { color: #667e6b; }
.pd-effect-cards .pd-card strong { font-size: 30px; }
.pd-budget-edit { border-radius: 8px; font-size: 11px; padding: 6px 10px; }
.pd-budget-edit:hover:not(:disabled) { background: #ffffff26; box-shadow: none; }
.pd-panel { padding: 24px; margin-bottom: 22px; }
.pd-panel-heading { gap: 12px; margin-bottom: 22px; }
.pd-panel-heading h2 { font-size: 16px; color: #254c3b; font-weight: 650; }
.pd-tag { font-size: 11px; color: #68806e; background: #eef4ee; border-radius: 6px; }
.pd-subheading { color: #52705c; font-size: 13px; margin: 28px 0 16px; }
.pd-chart-tooltip { padding: 14px 18px; border-radius: 10px; background: #f5f8f3; }
.pd-chart-tooltip span, .pd-axis { color: #667d6b; fill: #667d6b; }
.pd-chart-grid { stroke: #e8eee7; }
.pd-efficiency { padding: 18px 0 22px; gap: 14px; }
.pd-efficiency span { color: #6a806f; font-size: 12px; }
.pd-efficiency b { font-size: 14px; }
.pd-video-stats strong { font-size: 32px; }
.pd-video-stats span, .pd-engagement span { color: #68816f; }
.pd-table-wrap th { padding: 14px 12px; color: #617b68; background: #f0f5ef; }
.pd-table-wrap td { padding: 17px 12px; color: #3f5d48; }
.pd-table-wrap tbody tr:nth-child(even) { background: #fafcf9; }
.pd-table-wrap tbody tr:hover { background: #eff5ed; }
.pd-company-table th button { color: #5e7865; }
.pd-company-tools input { margin-top: 0; min-height: 40px; }
.pd-quality { border-style: solid; background: #f0f5ee; border-radius: 12px; padding: 16px 18px; }
.pd-quality summary, .pd-quality-items { color: #657d65; font-size: 12px; }
.pd-empty, .pd-no-data { color: #6d8170; line-height: 1.8; }
.pd-calendar { border-radius: 16px; padding: 20px; border-color: #d7e3d8; box-shadow: 0 12px 48px #183d3d20; z-index: 60; }
.pd-calendar-weekday { color: #6b8271; }
.pd-calendar-grid button { border-radius: 7px; }
.pd-calendar-grid button.outside { color: #8b9c8e; }
.pd-calendar-footer { gap: 12px; }

/* Dialogs keep their existing scroll/focus behavior and share a single finish. */
dialog, .help-dialog, .report-detail-dialog, .pd-number-dialog, #template-designer dialog {
  color: #2b4038;
  border-color: #d8e4da;
  border-radius: 18px;
  box-shadow: 0 24px 80px #143d3233;
}
dialog::backdrop, .help-dialog::backdrop, .report-detail-dialog::backdrop, #template-designer dialog::backdrop {
  background: #102f285c;
  backdrop-filter: blur(4px);
}
dialog h2, .help-dialog h2 { color: var(--ink); }
.help-close { border-radius: 9px; color: #718675; }
.help-close:hover { background: #edf3ee; }
.binding-dialog-header, .report-detail-header { background: #fbfdfb; }
.binding-dialog-header { padding: 26px 28px 0; }
.binding-dialog-header h2 { font-size: 21px; }
.binding-dialog-body { padding-top: 24px; padding-bottom: 24px; }
.binding-dialog-footer { background: #fafcf9; }
.binding-form-actions { padding-top: 16px; padding-bottom: 16px; }
.binding-report-section { background: #f8fbf7; border-radius: 14px; padding: 20px; }
.binding-scope-note { background: #eef5ed; border-radius: 0 10px 10px 0; }
.binding-readonly { background: #f3f7f1; color: #49634f; }
.report-detail-header h2 { font-size: 19px; }

/* Both the embedded and the dedicated template editor use these components. */
#template-designer .library-tools, body:has(> .sidebar) .library-tools { padding: 18px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 14px; }
#template-designer .filters input, #template-designer .filters select { margin-top: 0; }
#template-designer button, #template-designer input, #template-designer select, #template-designer textarea { border-radius: 9px; }
#template-designer .primary { background: #235f52; border-color: #235f52; }
#template-designer .section-panel { padding: 26px; }
#template-designer .step, .step { border-radius: 8px; color: #346348; background: #e9f2e6; width: 28px; height: 28px; }
#template-designer .section-heading h2 { font-size: 17px; }
#template-designer .preview-content { background: #f5f8f2; border-radius: 12px; padding: 24px; }
#template-designer .template-name { color: var(--ink); }
#template-designer .field-table th, #template-designer .field-table td { padding: 12px 10px; }
#template-designer .field-table .source { color: #687d6e; }
#template-designer .callout { border: 1px solid #e6e8d5; border-radius: 10px; }
body:has(> .sidebar) > main { margin-left: 232px; }
body:has(> .sidebar) .container { max-width: 1500px; padding: 32px 36px 56px; }
body:has(> .sidebar) .sidebar .brand { margin-bottom: 0; }
body:has(> .sidebar) .sidebar .nav-label { margin-top: 40px; }
body:has(> .sidebar) .nav-item { margin: 4px 0; padding: 12px 16px; font-size: 14px; border-radius: 10px; }
body:has(> .sidebar) .nav-item.selected { color: #fff; background: #235f52; }

@media (max-width: 1250px) {
  .pd-card { padding: 20px 16px; }
  .pd-primary-grid { gap: 16px; }
  .pd-panel { padding: 20px; }
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 196px minmax(0, 1fr); }
  .sidebar { width: 196px; padding: 28px 12px 20px; }
  .brand { margin-inline: 8px; font-size: 16px; gap: 10px; }
  .nav-button { padding: 12px; font-size: 13px; }
  .main-content { padding: 28px 22px 40px; }
  .topbar { padding-inline: 22px; }
  .page-heading { flex-wrap: wrap; align-items: flex-start; }
  .mode-control { justify-content: flex-start; }
  .pd-budget-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pd-calendar { left: auto; right: 0; }
  body:has(> .sidebar) > main { margin-left: 196px; }
  body:has(> .sidebar) .container { padding: 28px 22px 40px; }
}
@media (max-width: 720px) {
  body:has(> .sidebar) > .sidebar { position: static; width: auto; height: auto; padding: 16px; overflow: visible; }
  body:has(> .sidebar) > main { margin-left: 0; }
  body:has(> .sidebar) .container { padding: 24px 16px 36px; }
  body:has(> .sidebar) .nav-item { margin: 0; padding: 8px 12px; }
}
@media (max-width: 700px) {
  .workspace { display: block; }
  .sidebar { width: auto; height: auto; padding: 18px 16px 12px; position: static; overflow: visible; }
  .brand { margin: 0 0 16px; font-size: 17px; }
  .brand b { width: 34px; height: 36px; font-size: 24px; border-radius: 10px; }
  .brand small { font-size: 9px; }
  .sidebar nav { gap: 5px; padding-bottom: 5px; scrollbar-width: thin; }
  .nav-button { flex: 0 0 auto; min-height: 40px; padding: 10px 12px; margin: 0; gap: 7px; font-size: 12px; }
  .nav-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .sidebar-bottom { margin: 12px 0 0; padding: 8px 0 0; justify-content: flex-end; }
  #logout { font-size: 11px; padding: 2px 0; }
  .topbar { height: 52px; padding: 0 16px; gap: 10px; font-size: 11px; }
  #current-user:not(:empty) { padding: 4px 8px 4px 5px; gap: 5px; }
  #current-user:not(:empty)::before { width: 20px; height: 20px; background-size: 18px; }
  .main-content { padding: 24px 16px 36px; }
  h1, .pd-heading h1, #template-designer h1 { font-size: 25px; }
  .page-heading, .pd-heading { gap: 14px; margin-bottom: 22px; }
  .page-heading p { font-size: 12px; }
  .panel, .metrics article, .pd-panel, .pd-card, .report-summary, #template-designer .panel { border-radius: 13px; }
  .panel-heading, .group-toolbar, .upload-panel, .sending-panel { padding: 18px; }
  .panel-heading { gap: 14px; }
  .panel-heading .actions { width: 100%; }
  .actions button, .actions .button { padding: 9px 11px; font-size: 12px; }
  .group-search { flex-basis: 100%; min-width: 0; flex-wrap: wrap; }
  #group-filter-field, #report-filter-field, #group-filter-text, #group-filter-status, #report-filter-text { flex-basis: 100%; }
  .groups-pager { padding: 14px 18px; }
  #page-groups .directory-import-bar { justify-content: flex-start; width: 100%; }
  #page-groups .group-view-switch { flex: 1 1 100%; }
  #page-groups .group-view-switch .group-view-option { flex: 1; }
  #page-groups .directory-import-bar > button { flex: 1 1 0; min-width: 0; }
  .upload-panel { gap: 14px; flex-wrap: wrap; }
  .upload-panel div:nth-child(2) { min-width: 0; flex-basis: calc(100% - 64px); }
  .upload-panel .button { margin-left: 64px; }
  #upload-state:not(:empty) { margin-left: 64px; }
  .upload-panel p { line-height: 1.7; }
  .upload-symbol { width: 48px; height: 50px; }
  .report-type-switch { margin-top: 24px; gap: 6px; }
  .report-type-switch h3 { width: 100%; margin: 0 0 8px; }
  .report-summary { padding: 16px; gap: 8px 12px; }
  .report-summary-company h4 { font-size: 14px; }
  .report-summary-action { padding: 8px 10px; }
  .pd-heading { align-items: flex-start; }
  .pd-heading-right button { padding: 8px 10px; }
  .pd-module-tabs { gap: 6px; margin-bottom: 18px; }
  .pd-module-tabs button { flex: 1; padding: 10px 12px; font-size: 13px; }
  .pd-toolbar { padding: 14px; gap: 12px; }
  .pd-cards { gap: 12px; margin-bottom: 18px; }
  .pd-card { padding: 18px 14px; gap: 14px; }
  .pd-budget-cards .pd-card strong { font-size: 25px; }
  .pd-budget-cards .pd-card:nth-child(2) strong { font-size: 25px; }
  .pd-budget-cards .pd-card strong i { font-size: 12px; margin-right: 3px; }
  .pd-budget-cards .pd-card:last-child strong { font-size: 19px; }
  .pd-effect-cards .pd-card strong { font-size: 28px; }
  .pd-card-context, .pd-change { font-size: 11px; }
  .pd-effect-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pd-panel { padding: 18px 16px; }
  .pd-panel-heading { margin-bottom: 18px; }
  .pd-panel-heading h2 { font-size: 15px; }
  .pd-chart-tooltip { padding: 12px; gap: 10px 16px; }
  .pd-calendar { position: fixed; inset: auto 12px; top: 50%; transform: translateY(-50%); width: auto; max-width: none; padding: 16px; }
  .pd-efficiency { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .pd-efficiency span { font-size: 11px; }
  .pd-quality summary { gap: 10px; }
  .pd-quality summary b { margin-left: 0; }
  #template-designer .library-tools { padding: 14px; gap: 14px; }
  #template-designer .filters { gap: 8px; flex-wrap: wrap; }
  #template-designer .filters select { flex: 1; }
  #template-designer .section-panel { padding: 20px 16px; }
  #template-designer .section-heading { gap: 14px; }
  #template-designer .section-heading .actions { width: 100%; }
  #template-designer .section-heading button { padding: 8px 10px; }
  .binding-dialog-header { padding: 20px 18px 0; }
  .binding-dialog-body { padding: 20px 18px; }
  .binding-form-actions { padding: 14px 18px; }
  .binding-dialog-header h2 { font-size: 19px; }
  .binding-report-section { padding: 18px; }
  .report-detail-header { padding: 18px; }
  .report-detail-header h2 { font-size: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-story { min-height: 260px; padding: 28px; }
  .login-story h1 { margin: 34px 0 16px; font-size: 30px; }
  .login-story p { font-size: 12px; margin-bottom: 0; }
  .login-story::after { width: 420px; height: 420px; right: -260px; bottom: -340px; }
  .login-form { margin: 36px auto 44px; }
  .login-form h2 { font-size: 26px; }
  .login-form .muted { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Approved dashboard layout using the existing site colors. */
.topbar #pd-module-tabs{margin:0 18px 0 auto;border:1px solid #d6e1d8;border-radius:8px;padding:3px;gap:3px;background:#edf3ee;flex-shrink:0}
.topbar #pd-module-tabs button{padding:7px 15px;border-radius:6px;font-size:12px;color:#617c69;background:transparent}
.topbar #pd-module-tabs button.active{background:#235f52;color:#fff;box-shadow:0 1px 5px #183d3d1b}
body:has(#page-overview.hidden) #pd-module-tabs,body:has(.workspace.hidden) #pd-module-tabs{display:none}
.pd-dashboard{--pd-green:#286f5d;--pd-blue:#658ab0;--pd-border:#e0e8e2;--pd-muted:#6c8173;color:#2b4038}
.pd-dashboard .pd-kicker{color:#658675}.pd-dashboard .pd-heading h1{color:#254c3b}
.pd-heading-subtitle{font-size:12px;color:#6c8173;margin:4px 0 0}
.pd-dashboard .pd-toolbar,.pd-dashboard .pd-panel,.pd-dashboard .pd-card{border-color:#e0e8e2;border-radius:11px;box-shadow:0 5px 20px #183d3d08;background:#fff}
.pd-dashboard .pd-toolbar{align-items:center;margin-bottom:16px}
.pd-dashboard .pd-toolbar>button[type=submit]{background:#235f52;border-color:#235f52;color:#fff}
.pd-dashboard .pd-presets{background:#edf3ee}.pd-dashboard .pd-presets button.active{color:#235f52}
.pd-dashboard .pd-date-range{border-color:#d6e1d8}.pd-dashboard .pd-date-range input{color:#40574b}
.pd-dashboard .pd-date-range{display:grid;grid-template-columns:112px 18px 112px 36px;align-items:center;column-gap:8px;width:max-content;padding:4px 8px}
.pd-dashboard .pd-date-range input{width:112px;min-width:0;padding:0!important;margin:0;text-align:center;pointer-events:none;user-select:none;cursor:default}
.pd-dashboard .pd-date-range>span{text-align:center}
.pd-dashboard .pd-date-range #pd-calendar-toggle{width:36px;height:36px;padding:0;display:grid;place-items:center}
.pd-number-dialog:has(.pd-setting-list){width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px 26px}
.pd-number-dialog .pd-setting-list{display:grid;margin:12px 0}
.pd-number-dialog .pd-setting-row{display:grid;grid-template-columns:minmax(0,1fr) 175px;align-items:center;gap:16px;border-bottom:1px solid #e0e8e2;padding:11px 0;font-size:13px;color:#2b4038}
.pd-number-dialog .pd-setting-row input{width:100%;min-width:0;margin:0;padding:9px 10px;font-size:13px;appearance:textfield;-moz-appearance:textfield}
.pd-number-dialog .pd-setting-row input::-webkit-inner-spin-button,.pd-number-dialog .pd-setting-row input::-webkit-outer-spin-button{appearance:none;margin:0}
.pd-number-dialog .pd-setting-row:first-child{padding-top:4px}
@media(max-width:520px){.pd-number-dialog:has(.pd-setting-list){padding:20px}.pd-number-dialog .pd-setting-row{grid-template-columns:minmax(0,1fr) 130px;gap:8px}}
.pd-dashboard .pd-budget-cards{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.pd-dashboard .pd-card:first-child,.pd-dashboard .pd-effect-cards .pd-card:first-child{background:#fff;border-color:#e0e8e2;color:#2b4038}
.pd-dashboard .pd-card:first-child strong,.pd-dashboard .pd-card strong{color:#234d3f}
.pd-dashboard .pd-card strong{animation:none}
.pd-dashboard .pd-card-label,.pd-dashboard .pd-card:first-child .pd-card-label{color:#667e6b}
.pd-dashboard .pd-card-context,.pd-dashboard .pd-card:first-child .pd-card-context{color:#6b8071}
.pd-dashboard .pd-budget-cards .pd-card{position:relative;min-height:135px;gap:10px}
.pd-dashboard .pd-budget-cards .pd-card strong{font-size:clamp(20px,2vw,27px)}
.pd-dashboard .pd-more-controls{display:flex;justify-content:flex-end;margin:-9px 0 14px}
.pd-dashboard .pd-more-toggle{border:1px solid #d6e1d8;background:#fff;color:#235f52;border-radius:8px;padding:8px 13px;font-size:12px;font-weight:600}
.pd-dashboard .pd-more-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px}
.pd-dashboard .pd-more-grid[hidden]{display:none}
.pd-dashboard .pd-more-grid .pd-card{min-height:135px;gap:10px}
.pd-dashboard .pd-more-grid .pd-card strong{font-size:clamp(20px,2vw,27px)}
.pd-dashboard .pd-budget-edit{position:absolute;right:16px;top:16px;background:transparent;border:0;color:#286f5d;padding:0;font-size:11px}
.pd-dashboard .pd-behind strong{color:#db615d!important}.pd-dashboard .pd-spend-meter::-webkit-meter-optimum-value{background:#db615d}.pd-dashboard .pd-spend-meter::-moz-meter-bar{background:#db615d}
.pd-dashboard .pd-panel-heading h2{color:#254c3b}
.pd-dashboard .pd-tabs{background:#edf3ee}.pd-dashboard .pd-tabs button.active{color:#235f52}
.pd-dashboard .pd-chart-tooltip{background:#f5f8f3;border-color:#e0e8e2}.pd-dashboard .pd-chart-tooltip>strong,.pd-dashboard .pd-chart-tooltip b{color:#315b48}
.pd-dashboard .pd-spend-bar{fill:#508d78}.pd-dashboard .pd-table-wrap th{background:#f0f5ef;color:#617b68}.pd-dashboard .pd-table-wrap td{color:#3f5d48}
.pd-dashboard .pd-table-wrap tbody tr:nth-child(even){background:#fff}.pd-dashboard .pd-table-wrap tbody tr:hover{background:#f2f8f7}
.pd-dashboard .pd-pager{margin-bottom:16px}.pd-dashboard .pd-efficiency{border:0;margin:0}.pd-dashboard .pd-effect-cards{margin:0}
.pd-dashboard .pd-brand-name,.pd-dashboard .pd-alert-link{border:0;background:transparent;color:#286f5d;padding:0;font-size:12px}
.pd-alert-row{display:grid;grid-template-columns:1fr auto;gap:4px 8px;border-top:1px solid #e0e8e2;padding:13px 0}.pd-alert-row b{font-size:12px}.pd-alert-row p{grid-column:1/-1;margin:0;color:#879b8e;font-size:11px}.pd-alert-tag{font-size:10px;color:#cf6761;background:#fff0ee;padding:3px 6px;border-radius:4px}
#pd-alert-count{display:inline-block;background:#e86661;color:#fff;border-radius:99px;padding:1px 6px;margin-left:5px;font-size:10px}
#pd-alert-count[hidden]{display:none}.pd-alert-dialog{width:min(510px,100vw);height:100dvh;max-height:100dvh;position:fixed;right:0;left:auto;top:0;margin:0;border:0;border-radius:0;padding:26px;box-shadow:-15px 0 45px #183d3d25;color:#2b4038}
.pd-alert-dialog::backdrop{background:#183d3d85}.pd-alert-dialog-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e0e8e2;padding-bottom:15px}.pd-alert-dialog h2{font-size:19px;margin:0}
.pd-alert-record{border:1px solid #e0e8e2;border-radius:9px;padding:16px;margin:12px 0}.pd-alert-record h3{font-size:13px;margin:0}.pd-alert-record p{font-size:11px;color:#819487}.pd-alert-record input{width:100%;border:1px solid #d6e1d8;border-radius:6px;padding:8px;margin-bottom:10px}
.pd-alert-record button{background:#235f52;color:#fff;border:0;padding:7px 11px;font-size:11px}
@media(max-width:700px){.topbar #pd-module-tabs{margin:0 0 0 auto}.topbar #pd-module-tabs button{padding:6px 8px;font-size:11px}.pd-dashboard .pd-budget-cards,.pd-dashboard .pd-more-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.pd-dashboard .pd-budget-edit{position:static;align-self:flex-start}.pd-dashboard .pd-heading{display:block}.pd-dashboard .pd-heading-right{margin-top:14px}.pd-dashboard .pd-presets{width:100%}.pd-dashboard .pd-presets button{flex:1}.pd-dashboard .pd-date-range{width:100%;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr) 36px}.pd-dashboard .pd-date-range input{width:100%}.pd-dashboard .pd-toolbar>button[type=submit]{width:100%}}

/* Compact alert center; preserve dashboard context behind the dialog. */
.pd-alert-dialog{width:min(620px,calc(100vw - 32px));height:auto;max-height:calc(100dvh - 48px);inset:0;margin:auto;border:1px solid #e0e8e2;border-radius:16px;padding:24px;overflow:auto;box-shadow:0 18px 65px #183d3d25}
.pd-alert-dialog::backdrop{background:#183d3d38;backdrop-filter:none}
.pd-alert-dialog .pd-alert-close{background:transparent;border:0;color:#627e70;font-size:26px;padding:0;width:32px;height:32px;line-height:1}
.pd-alert-record-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.pd-alert-record h3{font-size:14px}.pd-alert-record p{font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.pd-alert-value{display:block;font-size:23px;color:#c76a35;margin-top:16px}
.pd-alert-record button.secondary{background:#eef3ef;color:#486f5d}
.pd-alert-handle{margin-top:14px}.pd-alert-handle[hidden],.pd-alert-action[hidden]{display:none}
.pd-alert-handle .pd-dialog-actions{margin-top:10px}
@media(max-width:520px){.pd-alert-dialog{padding:18px;max-height:calc(100dvh - 32px)}.pd-alert-value{font-size:20px}}

/* 预警中心使用独立双栏工作区；列表与详情各自滚动，不改变看板滚动位置。 */
.pd-alert-center{width:min(1180px,calc(100vw - 40px));height:min(850px,calc(100dvh - 40px));max-width:none;max-height:none;display:flex;flex-direction:column;overflow:hidden;padding:24px;color:#2b4038}
.pd-alert-center> .pd-alert-tabs{flex-shrink:0}
.pd-alert-state-notice{display:flex;align-items:center;gap:10px;margin:4px 0 8px;padding:10px 12px;border:1px solid #ead9ac;border-radius:8px;background:#fff9ea;color:#775e2e;font-size:12px}
.pd-alert-state-notice span{flex:1;line-height:1.5}
.pd-alert-state-notice button{white-space:nowrap}
.pd-alert-center-body{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(0,1.5fr);gap:16px;min-height:0;flex:1}
.pd-alert-center .pd-alert-list,.pd-alert-detail-pane{min-height:0;max-height:none;overflow:auto;padding:0 6px 0 0}
.pd-alert-record{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:7px;padding:12px;margin:0 0 8px;border:1px solid #e0e8e2;border-radius:9px;background:#fff;text-align:left;color:#365946;white-space:normal}
.pd-alert-record.active{border-color:#43816c;background:#f2f8f4}
.pd-alert-record h3,.pd-alert-record b{margin:0;font-size:13px}
.pd-alert-record .pd-alert-detail{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.pd-alert-detail-pane{border:1px solid #e0e8e2;border-radius:10px;padding:18px;background:#fff}
.pd-alert-detail-pane h3{margin:4px 0 12px;font-size:17px}
.pd-alert-detail-pane>.pd-alert-value{display:block;margin:14px 0}
.pd-alert-back{display:none}
.pd-alert-truncation{padding:10px;background:#fff7e8;color:#87632d;border-radius:7px;font-size:12px;line-height:1.6}
.pd-alert-checks{margin-top:18px;padding-top:12px;border-top:1px solid #edf1ee;color:#60766b;font-size:12px}
.pd-alert-checks summary{cursor:pointer;font-weight:600}
.pd-alert-checks p{margin:8px 0}
.pd-stale{margin:18px 0;padding:14px;border:1px solid #e0e8e2;border-radius:9px;background:#f9fbf9}
.pd-stale h4{margin:0 0 10px;font-size:13px}
.pd-stale input{width:100%;border:1px solid #dfe7e1;border-radius:7px;padding:9px;margin-bottom:8px}
.pd-stale-results{min-width:0}
.pd-stale-row{display:flex;justify-content:space-between;gap:12px;padding:7px 2px;border-bottom:1px solid #edf1ee;font-size:12px}
.pd-stale-row span{color:#829087;white-space:nowrap}
.pd-stale-pager{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:11px;color:#829087}
.pd-stale-pager span{flex:1}
.pd-alert-detail-pane>input{width:100%;margin:12px 0 8px;border:1px solid #dfe7e1;border-radius:7px;padding:10px}
.pd-daily-table{overflow-x:auto}
@media(max-width:700px){
  .pd-alert-center{inset:0;width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:18px}
  .pd-alert-center-body{display:block}
  .pd-alert-center-body .pd-alert-list,.pd-alert-center-body .pd-alert-detail-pane{height:100%;max-height:100%;overflow:auto}
  .pd-alert-center-body:not(.show-detail-mobile) .pd-alert-detail-pane{display:none}
  .pd-alert-center-body.show-detail-mobile .pd-alert-list{display:none}
  .pd-alert-back{display:inline-flex;margin:0 0 12px}
  .pd-alert-state-notice{align-items:flex-start;flex-direction:column}
}
/* 体验调整：沿用配色和组件，仅统一操作层级与窄屏布局。 */
#page-accounts .table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.report-exports, .group-management { position: relative; }
.report-exports summary, .group-management summary { cursor: pointer; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; color: #235f52; background: #fff; font-size: 13px; }
.report-exports > div, .group-management > div { position: absolute; z-index: 45; right: 0; top: 100%; min-width: 180px; padding: 12px; display: grid; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.binding-help-links { margin: 0 0 20px; padding: 14px 18px; border: 1px solid #c7dcd2; border-left: 4px solid #235f52; border-radius: 10px; background: #edf4ef; }
.queue-details { margin-top: 12px; }
.queue-details > summary { cursor: pointer; color: #235f52; }
.import-extra > summary, .import-retention { display: none; }
#page-reports .sending-panel { padding: 18px 24px; }
#page-reports #send-status { font-size: 13px; font-weight: 400; margin: 8px 0; }
#page-reports #report-action-reason { margin: 8px 0 16px; font-size: 12px; line-height: 1.7; }
#pd-filter-pending { padding: 12px 16px; border-left: 3px solid #235f52; background: #ecf2ed; color: #163d36; }
.pd-empty-action { margin: 10px; }
.bot-section-title { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
#bot-editor[open] { display: flex; flex-direction: column; overflow: hidden; }
#bot-form { overflow-y: auto; min-height: 0; padding: 0 4px; scroll-padding-bottom: 90px; }
#bot-form .edit-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); z-index: 1; }
#template-designer .period .empty { padding: 22px 16px; }
#template-designer .period .empty::before { display: none; }
#template-designer #td-preview-route { margin: 10px 0; }
@media (min-width: 1400px) {
  #template-designer #td-editor:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  #template-designer #td-editor > .editor-heading, #template-designer #td-editor > .section-panel:first-of-type { grid-column: 1 / -1; }
  #template-designer #td-editor > .section-panel { min-width: 0; margin: 0; }
  #template-designer .preview-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .workspace .topbar #breadcrumb { display: none; }
  .workspace .topbar { height: auto; min-height: 32px; padding: 0 16px 8px; justify-content: flex-end; gap: 8px; }
  .workspace #current-user:not(:empty) { font-size: 11px; max-width: 100%; overflow-wrap: anywhere; }
  .workspace .main-content { padding-top: 16px; }
  .workspace #refresh-status:not(:empty) { padding: 6px 10px; margin: 0 0 12px; font-size: 11px; }
  #page-overview #pd-module-tabs { margin: 0 0 16px; width: fit-content; }
  #page-reports .report-type-switch { margin: 0 0 16px; }
  #page-reports .sending-panel { padding: 14px 16px; }
  #page-reports .panel-heading > .actions { width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  #page-reports .upload-panel { padding: 16px; }
  #page-reports .upload-symbol { display: none; }
  #page-reports .upload-panel > div:nth-child(2) { margin: 0; }
  #page-reports #upload-state:not(:empty) { margin-left: 0; }
  #page-issues .issue-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #page-issues .issue-tabs button { margin: 0; width: 100%; }
  #page-accounts .table-wrap, #page-imports .table-scroll, #page-issues .table-scroll { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  #page-accounts .table-wrap > table, #page-imports .table-scroll > table, #page-issues .table-scroll > table { display: block; min-width: 0; width: 100%; }
  #page-accounts thead, #page-imports thead, #page-issues thead { display: none; }
  #account-rows, #import-rows, #issue-rows { display: grid; gap: 12px; }
  #account-rows > tr, #import-rows > tr, #issue-rows > tr { display: grid; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  #account-rows > tr > td, #import-rows > tr > td, #issue-rows > tr > td { display: block; width: auto; min-width: 0; max-width: none; padding: 8px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  #account-rows > tr > td::before, #import-rows > tr > td::before, #issue-rows > tr > td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #6e8476; font-size: 11px; font-weight: 400; }
  #account-rows td:last-child > div, #issue-rows td:last-child > div { display: flex; flex-wrap: wrap; gap: 8px; }
  #account-rows td button, #issue-rows td button { min-height: 40px; margin: 0; }
  #import-rows > tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  #import-rows > tr > td:first-child { grid-column: 1 / -1; }
  #import-rows > tr > td:nth-child(4) { grid-column: 1 / -1; order: 4; }
  #import-rows > tr > td:nth-child(4)::before { display: none; }
  #import-rows > tr > td:nth-child(5) { display: none; }
  #import-rows > tr > td:nth-child(6) { grid-column: 1 / -1; order: 3; }
  #import-rows .import-extra > summary { display: list-item; cursor: pointer; color: #235f52; padding: 8px 0; }
  #import-rows .import-retention { display: block; margin-top: 8px; }
  #page-groups .directory-import-bar { gap: 8px; }
  #page-groups .group-view-switch { width: 100%; }
  #page-groups .binding-help-links { margin-bottom: 12px; padding: 12px 14px; }
  #page-groups .binding-help-links .help-link { max-width: 100%; white-space: normal; }
  #page-groups .group-management { margin-left: auto; order: 1; }
  #group-binding-table .group-mobile-card { padding: 14px; }
  #template-designer #td-editor { padding-bottom: 100px; }
  #template-designer .editor-heading > .actions { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; z-index: 35; display: flex; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fbfdfb; }
  #template-designer .editor-heading > .actions button { flex: 1; }
  #bot-editor { max-height: calc(100dvh - 24px); padding: 20px 16px 0; }
}

/* ---- 日报管理页排版：统一间距、压缩多余空隙（2026-11-12） ---- */
#page-reports .page-heading { margin-bottom: 22px; }
#page-reports .page-heading-side { width: min(100%, 244px); align-items: stretch; gap: 8px; }
#page-reports .page-heading .report-type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9f0ea;
}
#page-reports .page-heading .report-type-switch button { border-color: transparent; background: transparent; }
#page-reports .page-heading .report-type-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px #183d3d1a;
}
#page-reports .mode-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#page-reports .mode-badge { align-items: center; justify-content: center; min-height: 38px; }
#page-reports .mode-control:has(#auto-hour-save:not(.hidden)) .mode-badge { grid-column: 1 / -1; }
#page-reports .panel { margin-bottom: 14px; border-radius: 14px; }
#page-reports .report-preview-panel { position: relative; margin-bottom: 0; }

/* 页面操作统一尺寸，保留切换按钮和主要操作的视觉区别。 */
#page-reports :is(.mode-control button, .queue-actions button, .report-upload-actions .button,
  .group-search button, .report-preview-actions button, .report-exports summary,
  .report-summary-action, .list-pager button) {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 13px;
  white-space: nowrap;
}

#page-reports #report-queue-panel { padding: 16px 20px 14px; }
#report-queue-panel .queue-title h3 { margin: 0 0 2px; font-size: 15px; }
#report-queue-panel .queue-meta { font-size: 12px; }
#report-queue-panel #send-all:disabled { opacity: 1; background: #eef2ee; border-color: #e3e9e3; color: #8d9c93; }
#report-queue-panel .queue-empty,
#report-queue-panel .queue-note { margin: 8px 0 0; }
#report-queue-panel .queue-row { padding: 10px 0; }

/* 导入区：图标与文字收紧，上传状态缩进对齐 */
#page-reports .upload-panel { padding: 16px 20px; gap: 14px; }
#page-reports .upload-symbol { width: 40px; height: 40px; font-size: 21px; border-radius: 11px; }
#page-reports .upload-panel h3 { margin: 0 0 3px; font-size: 15px; }
#page-reports .upload-panel p { margin: 0 0 2px; font-size: 12px; }
#page-reports .upload-panel small { font-size: 11px; }
#page-reports #upload-state:not(:empty) { margin-left: 54px; font-size: 12px; }
#page-reports .report-upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
#page-reports #report-upload-brand-label:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }
#page-reports #report-account-brand:empty { display: none; }
#page-reports #report-upload-brand {
  height: 38px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid #d6e1d8;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}
#page-reports .report-upload-actions .button { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
#report-file:focus-visible + label { outline: 2px solid #235f52; outline-offset: 2px; }
#report-file:disabled + label { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* 筛选条：统一行高，把空间留给预览 */
#page-reports .group-toolbar { padding: 12px 16px; gap: 8px 12px; border-bottom: 0; }
#page-reports .group-search { gap: 8px; }
#page-reports .group-search select,
#page-reports .group-search input { height: 38px; font-size: 13px; }
#page-reports #report-filter-field { flex: 0 0 132px; }
#page-reports .group-toolbar > .muted { font-size: 12px; }

/* 预览操作和状态分类分两层排列。 */
#page-reports .report-preview-panel > .panel-heading { padding: 2px 0 12px; align-items: center; flex-wrap: wrap; gap: 12px; }
#page-reports .report-preview-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; min-width: 0; }
#page-reports .report-preview-heading h3 { margin: 0; font-size: 16px; }
#page-reports .report-preview-actions { flex-wrap: wrap; align-items: center; gap: 10px; }
#page-reports .report-preview-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#page-reports .report-exports summary { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
#page-reports .report-exports summary::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
#page-reports .report-exports[open] summary { background: #edf4ee; }
#page-reports .report-exports > div { top: calc(100% + 5px); padding: 6px; box-shadow: 0 6px 18px #183d3d15; }
#page-reports #report-action-reason { margin: 0 0 12px; font-size: 12px; }
#page-reports #report-action-reason:empty { display: none; }
#page-reports .report-view-switch { margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#page-reports .report-view-switch button:not(.hidden) {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 38px;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}
#page-reports .report-view-switch button:hover:not(.hidden),
#page-reports .report-view-switch button.active:not(.hidden) { background: #e4efe7; color: #235f52; }
#page-reports .report-view-switch button.active:not(.hidden) { border-color: #c2d8ca; }
#page-reports .report-view-switch button span {
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e8eeea;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#page-reports .report-view-switch button.active span { background: #235f52; color: #fff; }
#report-view-status:empty { display: none; }
#report-view-status.report-view-loading {
  position: absolute;
  z-index: 1;
  right: 0;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
#page-reports :is(#report-list-area, #sv-batch, #report-empty)[inert] { opacity: 0.55; }

/* 公司卡片：收紧到一屏能看到的密度 */
#page-reports .report-cards { gap: 10px; }
#page-reports .report-summary { padding: 14px 18px; gap: 14px; }
#page-reports .report-summary-company h4 { margin: 0 0 3px; font-size: 14px; }
.report-content-editor { display: grid; gap: 12px; padding: 22px 26px; }
.report-content-editor > label { font-weight: 600; }
.report-content-editor > p { margin: 0; }
.report-content-editor > textarea { box-sizing: border-box; width: 100%; min-height: 260px; resize: vertical; line-height: 1.7; }
.report-content-editor-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.report-lifecycle-action { margin-left: auto; }
.report-lifecycle-action.danger { color: #9b3c35; border-color: #e4c5be; }
.report-delete-notice { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid #cbded0; border-radius: 12px; background: #f2f8f2; color: #2b4938; box-shadow: 0 8px 24px #153d3120; font-size: 13px; }
.report-delete-notice > span { min-width: 0; overflow-wrap: anywhere; }
.report-delete-notice > button { flex-shrink: 0; padding: 6px 10px; font-size: 12px; }
.report-trash { padding: 18px 22px 22px; }
.report-trash-dialog { width: min(720px, calc(100vw - 24px)); }
.report-trash > [hidden] { display: none; }
.report-trash > p { margin: 0 0 14px; }
.report-trash-list { display: grid; gap: 10px; margin-bottom: 14px; }
.report-trash-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #dce6de; border-radius: 10px; }
.report-trash-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.report-trash-row strong, .report-trash-row small { display: block; }
.report-trash-row small { margin-top: 5px; color: var(--muted); }
.report-trash-row > button { flex-shrink: 0; }
@media (max-width: 700px) {
  .report-delete-notice { right: 16px; bottom: 16px; }
  .report-trash { padding: 16px; }
  .report-trash-row { flex-wrap: wrap; }
}
.report-edit-control { display: inline-flex; position: relative; align-items: center; }
.report-edit-control.is-disabled { cursor: not-allowed; }
.report-edit-control.is-disabled > button { pointer-events: none; }
.report-edit-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 10;
  width: max-content; max-width: min(260px, calc(100vw - 48px)); padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 10px;
  background: rgba(242, 248, 245, .78); color: #24443d;
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 6px 20px rgba(24, 61, 49, .12);
  font-size: 12px; font-weight: 400; line-height: 1.5; white-space: normal; text-align: center;
  pointer-events: none; visibility: hidden; opacity: 0; transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .7, .2, 1), visibility 0s linear 220ms;
}
.report-edit-control.is-disabled:hover > .report-edit-tooltip,
.report-edit-control.is-disabled:focus-within > .report-edit-tooltip {
  visibility: visible; opacity: 1; transform: translate(-50%, 0);
  transition-delay: 80ms, 80ms, 0s;
}
@media (prefers-reduced-motion: reduce) {
  .report-edit-tooltip { transition: none; transform: translate(-50%, 0); }
}
#page-reports .report-blocked-note { margin: 0 0 12px; font-size: 12px; }
#page-reports .report-summary.report-cost-exceeded { background: #fff0ee; border-color: #e5aba4; }
#page-reports .report-cost-warning { display: block; margin-top: 4px; color: #8e3029; font-weight: 600; overflow-wrap: anywhere; }
#report-cost-dialog h2 { margin: 0 0 16px; }
#report-cost-dialog .pd-setting-row span { overflow-wrap: anywhere; }
#report-cost-dialog #report-cost-brand-fields .pd-setting-row:first-child { padding-top: 11px; }

@media (max-width: 700px) {
  .report-content-editor { padding: 16px; }
  #page-reports .panel { border-radius: 12px; }
  #page-reports #report-queue-panel,
  #page-reports .upload-panel { padding: 14px; }
  #page-reports .group-toolbar { padding: 12px 14px; }
  #page-reports .report-preview-panel > .panel-heading { flex-direction: column; align-items: stretch; }
  #page-reports .report-preview-actions { width: 100%; }
  #page-reports .report-exports > div { min-width: 142px; }
  #page-reports .report-summary { padding: 12px 14px; }
  #page-reports #upload-state:not(:empty) { margin-left: 0; }
}
@media (max-width: 480px) {
  #page-reports .group-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  #page-reports .group-search :is(select, input) { width: 100%; min-width: 0; }
  #page-reports .report-preview-tools,
  #page-reports .report-view-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-reports .report-preview-tools,
  #page-reports .report-preview-tools button,
  #page-reports #enqueue-all { width: 100%; }
  #page-reports .report-exports > div { right: auto; left: 0; }
  #page-reports :is(.report-preview-actions button, .report-exports summary, .report-view-switch button:not(.hidden)) { min-height: 42px; }
}
#page-reports #batch-meta:empty { display: none; }
