@layer layouts {
  /* public split (unchanged structure) */
  .pub { display: grid; grid-template-columns: 40% 60%; min-height: 100vh; max-width: 1600px; margin: 0 auto; }
  .pub-brand { display: flex; flex-direction: column; gap: 32px; padding: 64px 56px 48px; }
  .headline { margin-top: 80px; font: 600 var(--text-hero)/1.22 var(--font-display); letter-spacing: -0.02em; }
  :lang(zh-Hans) .headline { letter-spacing: .01em; }
  .subhead { margin-top: 20px; max-width: 25em; font-size: 16px; line-height: 1.8; color: var(--color-text-muted); }
  .pub-nav { display: flex; gap: 24px; margin-top: auto; }
  .pub-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text-muted); font-size: var(--text-md); text-decoration: none; }
  .pub-nav a:hover { color: var(--color-text); }
  .pub-nav a[aria-current="page"] { color: var(--color-text); font-weight: 600; }
  .pub-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--color-brand); }
  .pub-main { padding: 88px 48px 48px 32px; }
  .sheet { max-width: 520px; padding: 32px; border-radius: var(--radius-surface); background: var(--color-surface); box-shadow: var(--shadow-sheet); border: 1px solid var(--color-line); }
  .sheet-title { margin-bottom: 22px; font: 600 22px/1.35 var(--font-display); letter-spacing: -0.01em; }
  .sheet .seg { margin-bottom: 20px; }
  .sheet .dropzone, .sheet .file-chip { margin-bottom: 20px; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .pub-toolbar { position: absolute; top: 18px; right: 32px; z-index: 5; }
  .pub-toolbar .pref-btn { background: var(--color-surface); border-color: var(--color-line); color: var(--color-text); min-height: 40px; }
  @media (pointer: coarse) { .pub-toolbar .pref-btn { min-height: 44px; } }

  /* centered sheet (errors, auth, maintenance) */
  .center { display: grid; place-items: center; min-height: 100vh; padding: 64px 20px; }
  .center .sheet { width: 100%; max-width: 440px; }
  .center-top { position: absolute; top: 20px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; }
  .err-code { font: 600 13px/1 var(--font-mono); color: var(--color-text-muted); letter-spacing: .08em; }
  .err-title { margin-top: 10px; font: 600 26px/1.3 var(--font-display); }
  .err-msg { margin-top: 8px; color: var(--color-text-muted); }

  /* console shell */
  .console { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; font-size: var(--text-md); }
  .side { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 20px 12px 14px; background: var(--side-bg); border-right: 1px solid var(--color-line); }
  .side .wordmark { margin: 2px 10px 22px; font-size: 20px; }
  .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--color-line); }
  .user { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; font-size: var(--text-sm); color: var(--color-text-muted); min-width: 0; }
  .user b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); font-weight: 600; }
  .avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--color-line-strong); font: 600 11px/1 var(--font-ui); color: var(--color-text); }
  .main { min-width: 0; display: flex; flex-direction: column; }
  .topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 28px; border-bottom: 1px solid var(--color-line); background: color-mix(in srgb, var(--color-canvas) 90%, transparent); backdrop-filter: blur(8px); }
  .crumb { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-text-muted); }
  .crumb [aria-current] { color: var(--color-text); }
  .topbar .spacer { flex: 1; }
  .menu-toggle { display: none; }
  .content { width: 100%; max-width: 1320px; padding: 28px 28px 56px; }
  .page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
  .page-head .text { flex: 1; min-width: 0; }
  .page-title { font: 600 var(--text-3xl)/1.2 var(--font-display); letter-spacing: -0.015em; }
  :lang(zh-Hans) .page-title { letter-spacing: .01em; }
  .page-desc { margin-top: 6px; color: var(--color-text-muted); font-size: var(--text-md); }
  .page-actions { display: flex; gap: 8px; }
  .snapshot { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--font-mono); color: var(--color-text-muted); white-space: nowrap; }
  .snapshot.delayed { color: var(--status-progress); }
  .grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .stack > * + * { margin-top: 20px; }

  @media (max-width: 1100px) { .grid-2, .grid-2e { grid-template-columns: 1fr; } }
  @media (max-width: 720px) {
    .page-head .text { flex-basis: 100%; }
  }
  @media (max-width: 900px) {
    .pub { grid-template-columns: 1fr; align-content: start; }
    .pub-brand { padding: 70px 20px 8px; gap: 12px; align-items: center; text-align: center; }
    .headline, .subhead { display: none; }
    .pub-nav { margin-top: 0; justify-content: center; }
    .pub-main { padding: 8px 12px 32px; }
    .sheet { max-width: none; padding: 24px 20px; }
    .pub-toolbar { top: 14px; right: 14px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .console { grid-template-columns: 1fr; }
    .side { display: none; }
    .menu-toggle { display: inline-grid; }
    .topbar { padding: 0 12px; }
    .crumb .root { display: none; }
    .prefs .pref-text, .prefs .caret { display: none; }
    .content { padding: 20px 14px 40px; }
    .page-head { flex-wrap: wrap; }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(odd) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--color-line); }
    .toast-host { left: 12px !important; right: 12px !important; bottom: 12px !important; }
    .toast-host .toast { width: 100%; }
    .bulkbar .spacer { display: none; }
    .result .v { font-size: 24px; }
  }
}

@layer layouts {
  .skip-link { display: inline-flex; align-items: center; min-height: 44px; position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px; border-radius: var(--radius-control); background: var(--color-action); color: var(--color-on-action); transform: translateY(-200%); }
  .skip-link:focus { transform: none; }
  .toast-host { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; justify-items: end; gap: 8px; max-width: min(440px, calc(100vw - 24px)); }
  .toast { padding-top: 8px; padding-bottom: 8px; }
  .toast > span { min-width: 0; overflow-wrap: anywhere; }
  .dialog::backdrop, .navigation-drawer::backdrop { background: var(--color-overlay); }
  .dialog-body { overflow-wrap: anywhere; white-space: pre-line; }
  .navigation-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0; width: min(320px, 88vw); max-width: none; height: 100dvh; max-height: none; border: 0; background: var(--side-bg); color: var(--color-text); }
  .navigation-drawer .side { display: flex; min-height: 100%; padding-top: 60px; border-right: 0; }
  .drawer-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
  @media (pointer: coarse) { .nav-item, .nav-sub .nav-item { min-height: 44px; } }
  @media (max-width: 900px) {
    .no-js .side { display: flex; min-height: auto; border-right: 0; border-bottom: 1px solid var(--color-line); }
    .no-js .menu-toggle { display: none; }
  }
}

@layer layouts {
  .sheet .upload-field .dropzone, .sheet .upload-field .file-chip { margin-bottom: 0; }
}

@layer layouts {
  .report-head { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 22px; }
  .report-head .sheet-title { margin: 6px 0 0; }
  .report-feedback { font-size: var(--text-md); overflow-wrap: anywhere; }
  .result .v.result-message { font-size: var(--text-sm); }
  .report-content .results { margin: 6px 0 22px; }
  .report-download-title { margin-bottom: 10px; }
  .report-download-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
  .report-download-head .report-download-title { margin-bottom: 0; }
  .report-download-head .icon-btn[hidden] { display: none; }
  .guide-page .center { place-items: start center; padding-top: 88px; padding-inline: 32px; }
  .guide-page .center .sheet { max-width: 1120px; }
  .report-guide .guide-task { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--color-line); }
  .report-guide .guide-task:first-of-type { border-top: 0; padding-top: 8px; }
  .guide-text .label { display: block; margin-bottom: 6px; font-size: var(--text-md); }
  .guide-lead { margin: 0 0 12px; font-size: var(--text-sm); line-height: 1.6; color: var(--color-text-muted); }
  .guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; font-size: var(--text-sm); line-height: 1.6; }
  .guide-steps li { counter-increment: step; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
  .guide-steps li::before { content: counter(step); display: grid; place-items: center; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--color-brand); color: var(--color-on-action); font: 600 11px/1 var(--font-mono); }
  .guide-notes { margin: 14px 0 0; padding-left: 18px; font-size: var(--text-xs); line-height: 1.6; color: var(--color-text-muted); display: grid; gap: 4px; }
  .guide-figure { margin: 0; min-width: 0; }
  .guide-shot { position: relative; display: block; border: 1px solid var(--color-line); border-radius: var(--radius-surface); overflow: hidden; background: var(--color-sunken); }
  .guide-shot img { display: block; width: 100%; height: auto; }
  .guide-pin { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--color-brand); color: var(--color-on-action); font: 600 11px/1 var(--font-mono); box-shadow: 0 0 0 2px var(--color-surface); }
  .guide-figure.is-narrow .guide-shot { max-width: 560px; }
  .guide-figure.is-medium .guide-shot { max-width: 760px; }
  @media (max-width: 900px) {
    .report-guide .guide-task { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 0; }
  }
  .report-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--color-line); display: grid; justify-items: center; gap: 10px; }
  .report-retention { font-size: var(--text-xs); }
}

@layer layouts {
  .report-backup-note { margin: 14px 0; }
  .settings .note { margin-bottom: 10px; }
}

@layer layouts {
  .report-skeleton { display: grid; gap: 18px; margin: 22px 0; }
  .report-skeleton[hidden] { display: none; }
  .report-skeleton .skeleton:nth-child(2) { width: 75%; }
  .report-skeleton .skeleton:nth-child(3) { width: 55%; }
}

@layer layouts {
  .form-heading { margin-bottom: 22px; }
  .form-heading .sheet-title { margin-bottom: 6px; }
}

@layer layouts {
  .console-brand { margin: 2px 10px 22px; }
  .side .console-brand .wordmark { margin: 0 0 4px; }
  .user-meta { min-width: 0; }
  .user-meta > span { display: block; overflow-wrap: anywhere; }
  .section-gap { height: 20px; }
  .page-head > div:first-child { flex: 1; min-width: 0; }
  .page-head > .right, .panel-head > .right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .panel-head { flex-wrap: wrap; }
  .panel-head > .panel-title { flex: 1; min-width: 0; }
  .report-pair { display: flex; flex-wrap: wrap; gap: 6px; }
  .row-heading { font-weight: 600; overflow-wrap: anywhere; }
  .t-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
  .grid-2e > .panel + .panel, .grid-2 > .panel + .panel, .oapi-channel-grid > .panel + .panel, .oapi-docs-grid > .panel + .panel { margin-top: 0; }
  .ops-table .ops-report-cell > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .ops-freshness { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; font: 400 var(--text-xs)/1.4 var(--font-mono); color: var(--color-text-muted); }
  .ops-delayed, .ops-refresh-error { color: var(--status-progress); }
  .ops-viewbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
  .ops-views { display: flex; gap: 20px; flex: 1; }
  .ops-views a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text-muted); text-decoration: none; border-bottom: 2px solid transparent; }
  .ops-views a[aria-current] { border-bottom-color: var(--color-brand); color: var(--color-text); }
  .ops-form .filters { padding: 0; }
  .ops-form .filter-label.field { display: grid; align-items: initial; }
  .ops-issue { padding: 14px 18px; margin-bottom: 20px; border-left: 2px solid var(--status-danger); background: var(--status-danger-bg); }
  .ops-issue h2 { font-size: var(--text-md); color: var(--status-danger); }
  .ops-issue-neutral { border-color: var(--color-line-strong); background: var(--color-sunken); }
  .ops-issue-neutral h2 { color: var(--color-text); }
  .availability-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 18px; border-bottom: 1px solid var(--color-line); }
  .availability-row:last-child { border-bottom: 0; }
  .availability-name { display: flex; align-items: center; gap: 8px; }
  .availability-meta { color: var(--color-text-muted); font-size: var(--text-sm); }
  .ops-metric-comparisons, .stat-foot { font-size: var(--text-xs); }
  .stat-foot .row { gap: 8px; }
  .stat-foot b { font-weight: 600; }
  .ops-change-better { color: var(--status-success); }
  .ops-change-worse { color: var(--status-danger); }
  .ops-change-neutral { color: var(--color-text); }
  .ops-mobile-label { display: none; }
}

@layer layouts {
  .ops-form { max-width: 760px; }
}

@layer layouts {
  .ops-today-stats { --cols: 5; }
  #overview-live .inbox-row .when { max-width: 95px; text-align: right; }
  #overview-live .inbox-row .issue { align-items: flex-start; overflow-wrap: anywhere; }
  #overview-live .inbox-row .issue .status { flex: none; }
  #overview-live .table-wrap a { display: inline-flex; align-items: center; min-height: 44px; }
  #overview-live .availability-meta a { display: inline-flex; align-items: center; min-height: 44px; }
  @media (max-width: 720px) {
    .table.stack tfoot { display: block; }
    .table.stack th.primary { grid-column: 1 / -1; padding: 0; border: 0; }
  }
}

@layer layouts {
  .ops-report-cell a.score { display: inline-flex; align-items: center; min-height: 28px; }
  @media (pointer: coarse) { .ops-report-cell a.score { min-height: 44px; } }
}

@layer layouts {
  @media (pointer: coarse) {
    [data-paperchk-surface="ops"] .back,
    [data-paperchk-surface="ops"] .crumb a,
    .ops-summary a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
    .ops-views a { min-width: 44px; justify-content: center; }
    .ops-form .filter-label:has(input[type="checkbox"]) { min-width: 44px; min-height: 44px; }
    #overview-live .table-wrap a, #overview-live .availability-meta a { min-width: 44px; }
    .console .table a.score { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  }
}
