:root {
  color: #111;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; overflow-x: hidden; }
body { background: #fff; color: #111; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 26px 18px calc(24px + env(safe-area-inset-bottom));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 26px;
}

h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: 0; }
h2 { margin: 0; font-size: 19px; }
.subtitle, .muted, .section-note { color: #6b6b6b; }
.subtitle { margin: 7px 0 0; font-size: 14px; }
.save-status { flex: none; color: #666; font-size: 13px; line-height: 24px; }
.save-status.error, .error-text { color: #b42318; }
.error-text { min-height: 18px; margin: 10px 0 0; font-size: 13px; }

.section { padding: 24px 0; border-top: 1px solid #e5e5e5; }
.section-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.section-number { color: #6b6b6b; font-size: 13px; font-variant-numeric: tabular-nums; }
.section-note { margin: 0 0 18px; font-size: 14px; line-height: 1.55; }

.field { display: block; margin: 16px 0; }
.field > span:first-child { display: block; margin-bottom: 7px; color: #555; font-size: 13px; }
.field small { color: #8a8a8a; font-weight: 400; }
input {
  width: 100%;
  height: 46px;
  border: 1px solid #cecece;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: #111;
  font-variant-numeric: tabular-nums;
  outline: none;
}
select {
  width: 100%;
  height: 46px;
  border: 1px solid #cecece;
  border-radius: 8px;
  background: #fff;
  padding: 0 36px 0 12px;
  color: #111;
  outline: none;
}
select:focus { border-color: #111; box-shadow: 0 0 0 1px #111; }
input:focus { border-color: #111; box-shadow: 0 0 0 1px #111; }
input.input-error { border-color: #b42318; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-grid .field:first-child { grid-column: 1 / -1; }
.input-with-unit { position: relative; display: block; }
.input-with-unit input { padding-right: 42px; }
.input-with-unit b {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: 13px;
  font-weight: 400;
  pointer-events: none;
}
.input-with-unit.density input { padding-right: 62px; }
.info-line {
  margin: 18px 0 0;
  border-left: 2px solid #111;
  padding-left: 10px;
  color: #444;
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.measurement-list { border-top: 1px solid #ededed; }
.measurement-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border-bottom: 1px solid #ededed;
}
.measurement-row > label { color: #444; font-size: 14px; }
.measurement-row .deviation { color: #777; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.measurement-row.outlier > label, .measurement-row.outlier .deviation { color: #b42318; }
.measurement-row.outlier input { border-color: #b42318; color: #b42318; }
.outlier-message {
  grid-column: 1 / -1;
  margin: -3px 0 10px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.45;
}
.summary { padding-top: 14px; }
.summary-progress { margin: 0; color: #666; font-size: 13px; }
.summary-grid, .result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.metric { margin: 0; }
.metric span { display: block; color: #777; font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.summary-alert { margin: 12px 0 0; color: #b42318; font-size: 13px; }
.summary-ok { margin: 12px 0 0; color: #666; font-size: 13px; }

.chart-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0; padding: 3px; background: #f1f1f1; border-radius: 9px; }
.chart-tab { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: #666; }
.chart-tab.active { background: #111; color: #fff; }
.chart { width: 100%; min-height: 218px; display: grid; place-items: center; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-placeholder { color: #777; font-size: 14px; text-align: center; }
.chart-average { min-height: 20px; margin: 8px 0 0; color: #555; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }

.result-empty { margin: 18px 0; color: #666; font-size: 14px; line-height: 1.6; }
.result-liquid { margin-top: 18px; }
.result-liquid h3 { margin: 0 0 8px; font-size: 14px; }
.final-viscosity { margin-top: 22px; padding-top: 18px; border-top: 1px solid #ddd; }
.final-viscosity span { display: block; color: #555; font-size: 13px; }
.final-viscosity strong { display: block; margin-top: 6px; font-size: 28px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.threshold-note { margin: 20px 0 0; color: #888; font-size: 11px; line-height: 1.5; }

.actions { display: grid; gap: 10px; padding-top: 8px; }
.primary-button, .secondary-button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 600;
}
.primary-button { border: 1px solid #111; background: #111; color: #fff; }
.secondary-button { border: 1px solid #bdbdbd; background: #fff; color: #111; }

.loading { padding: 80px 20px; color: #666; text-align: center; font-size: 14px; }
.missing { padding-top: 80px; text-align: center; }
.missing h1 { margin: 12px 0; }
.missing .primary-button { margin-top: 24px; }
.eyebrow { margin: 0; color: #777; font-size: 12px; letter-spacing: 0; text-transform: uppercase; }

.qr-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f5f5f5; }
.qr-card { width: min(100%, 420px); padding: 32px; border: 1px solid #ddd; border-radius: 8px; background: #fff; text-align: center; }
.qr-card h1 { margin-top: 10px; }
.qr-image { display: block; width: min(260px, 100%); height: auto; margin: 22px auto 16px; image-rendering: pixelated; }
.qr-link { display: inline-block; max-width: 100%; color: #111; font-size: 15px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tiny { margin: 18px 0 0; color: #888; font-size: 12px; line-height: 1.5; }

.account-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -14px 0 10px;
  color: #555;
  font-size: 13px;
  text-decoration: none;
}
.account-link:hover { color: #111; text-decoration: underline; }
.record-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: -14px 0 10px;
}
.record-nav .account-link { margin: 0; }
.page-links { margin: 0 0 12px; }
.outline-link, .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #111;
  font-size: 14px;
}
.outline-link {
  width: 100%;
  justify-content: center;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  text-decoration: none;
}
.text-link { flex: none; color: #555; }

.auth-page { padding-top: 48px; }
.auth-header { margin-bottom: 28px; }
.auth-header h1 { margin: 10px 0 8px; }
.auth-header .section-note { margin-bottom: 0; }
.auth-actions { display: grid; gap: 10px; margin-top: 8px; }
.auth-actions button:disabled,
.title-save-button:disabled { cursor: wait; opacity: .55; }
.anonymous-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  color: #555;
  font-size: 14px;
}
.auth-note { text-align: center; }
.claim-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}
.claim-panel h2 { margin-bottom: 8px; }
.claim-panel > p:not(.error-text) { color: #555; font-size: 14px; line-height: 1.6; }
.claim-panel button { margin-top: 10px; }

.records-header { align-items: center; padding-bottom: 20px; }
.records-header h1 { margin-top: 8px; }
.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 13px;
  text-decoration: underline;
}
.records-list { margin-top: 16px; border-top: 1px solid #e5e5e5; }
.record-row { padding: 20px 0; border-bottom: 1px solid #e5e5e5; }
.record-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.record-title-input {
  height: 44px;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-title-input:focus {
  border-bottom: 1px solid #111;
  box-shadow: none;
}
.title-save-button {
  min-height: 44px;
  border: 0;
  background: #fff;
  color: #666;
  font-size: 12px;
}
.record-meta {
  margin: 5px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.record-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.open-record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.delete-record-button {
  min-width: 64px;
  min-height: 44px;
  border: 0;
  background: #fff;
  color: #b42318;
  font-size: 13px;
}
.records-empty {
  margin: 48px 0;
  color: #777;
  font-size: 14px;
  text-align: center;
}

.home-page { padding-top: 46px; }
.home-header { padding-bottom: 34px; }
.home-header h1 { margin-top: 9px; }
.home-menu { border-top: 1px solid #ddd; }
.home-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid #ddd;
  color: #111;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.home-menu b { color: #777; font-size: 24px; font-weight: 400; }

.profile-list { margin: 0 0 28px; border-top: 1px solid #ddd; }
.profile-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid #ddd;
}
.profile-list dt { color: #666; font-size: 14px; }
.profile-list dd { margin: 0; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }

.archive-header { align-items: center; padding-bottom: 20px; }
.archive-header h1 { margin-top: 8px; }
.archive-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}
.archive-summary p {
  margin: 0;
  padding: 16px 7px;
  text-align: center;
}
.archive-summary p + p { border-left: 1px solid #e5e5e5; }
.archive-summary span { display: block; color: #777; font-size: 11px; }
.archive-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.archive-summary .summary-wide {
  grid-column: 1 / -1;
  border-top: 1px solid #e5e5e5;
  border-left: 0;
  text-align: left;
}
.archive-summary .summary-wide strong { font-size: 14px; }
.history-chart { width: 100%; margin-top: 12px; }
.history-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.archive-list-section { border-top: 0; }
.archive-list { border-top: 1px solid #e5e5e5; }
.archive-record { padding: 22px 0; border-bottom: 1px solid #e5e5e5; }
.archive-record-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.archive-record-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.archive-record-heading time { flex: none; color: #777; font-size: 12px; }
.archive-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}
.archive-metrics p { margin: 0; min-width: 0; }
.archive-metrics span { display: block; color: #777; font-size: 11px; line-height: 1.4; }
.archive-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.archive-status { margin: 16px 0 0; color: #555; font-size: 13px; }
.warning { color: #b42318 !important; }
.archive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.archive-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  font-size: 13px;
  text-decoration: none;
}
.archive-actions a:first-child { background: #111; color: #fff; }

.report-page { padding-top: 18px; }
.report-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 22px;
}
.report-nav a { color: #555; font-size: 13px; }
.report-header { padding-bottom: 26px; }
.report-header h1 { margin-top: 9px; }
.report-status {
  display: inline-block;
  margin: 16px 0 0;
  border-left: 2px solid #111;
  padding-left: 9px;
  color: #555;
  font-size: 13px;
}
.print-date { margin: 6px 0 0; color: #888; font-size: 12px; }
.report-section { padding: 23px 0; border-top: 1px solid #ddd; }
.report-section h2 { margin: 0 0 16px; font-size: 17px; }
.report-definition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  margin: 0;
}
.report-definition dt { color: #666; font-size: 13px; }
.report-definition dd {
  margin: 0;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.report-table-wrap { width: 100%; overflow-x: auto; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.report-table th, .report-table td {
  border: 1px solid #ccc;
  padding: 10px 6px;
  text-align: center;
}
.report-table thead th { color: #555; font-weight: 600; }
.report-table tbody th { font-weight: 400; }
.report-results { display: grid; gap: 14px; }
.report-result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ededed;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.report-result-row > span:first-child {
  grid-column: 1 / -1;
  color: #777;
  font-size: 11px;
}
.report-final-value {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.missing-data {
  margin-top: 16px;
  border-left: 2px solid #111;
  padding-left: 10px;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
}
.formula {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.formula-values { margin: 14px 0 0; color: #555; font-size: 13px; line-height: 1.7; }
.report-section > p:not(.threshold-note) { line-height: 1.7; }
.note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.note-heading h2 { margin-bottom: 12px; }
.small-button {
  min-height: 44px;
  border: 0;
  background: #fff;
  color: #555;
  font-size: 12px;
  text-decoration: underline;
}
textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: #111;
  line-height: 1.65;
  outline: none;
}
textarea:focus { border-color: #111; box-shadow: 0 0 0 1px #111; }
.print-note { display: none; }
.report-actions { display: grid; gap: 10px; padding: 24px 0 8px; }
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid #bbb;
  border-radius: 8px;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.assistant-page {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) auto;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
}
.assistant-topbar {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  min-height: 54px;
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: 1px solid #e5e5e5;
}
.assistant-topbar h1 { margin: 0; font-size: 16px; text-align: center; }
.assistant-topbar a,
.assistant-topbar button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #555;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
}
.assistant-topbar button { text-align: right; cursor: pointer; }
.assistant-messages {
  display: grid;
  align-content: start;
  gap: 15px;
  min-width: 0;
  padding: 18px 16px 24px;
  overflow: hidden;
}
.assistant-message { width: fit-content; min-width: 0; }
.assistant-message.user { justify-self: end; max-width: 82%; }
.assistant-message.assistant { justify-self: start; max-width: 92%; }
.assistant-message-content {
  min-width: 0;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  background: #f7f7f7;
  padding: 10px 12px;
  color: #111;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.assistant-message.user .assistant-message-content { border-color: #111; background: #111; color: #fff; white-space: pre-wrap; }
.assistant-message-content > :first-child { margin-top: 0; }
.assistant-message-content > :last-child { margin-bottom: 0; }
.assistant-message-content h1,
.assistant-message-content h2,
.assistant-message-content h3,
.assistant-message-content h4 { margin: 1em 0 .45em; font-size: 1em; line-height: 1.4; }
.assistant-message-content p { margin: .65em 0; }
.assistant-message-content ul,
.assistant-message-content ol { margin: .6em 0; padding-left: 1.4em; }
.assistant-message-content blockquote { margin: .7em 0; padding-left: .8em; border-left: 2px solid #bbb; color: #555; }
.assistant-message-content code { padding: .08em .3em; background: #ececec; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.assistant-message-content pre { max-width: 100%; overflow-x: auto; padding: 10px; background: #ececec; }
.assistant-message-content pre code { padding: 0; background: transparent; }
.assistant-message-content .math-display { max-width: 100%; overflow-x: auto; margin: .8em 0; text-align: center; }
.assistant-message-content .math-inline { white-space: nowrap; }
.assistant-message-content .math-fallback { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.assistant-message-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.assistant-message-content th,
.assistant-message-content td { padding: 5px 7px; border: 1px solid #ddd; text-align: left; white-space: nowrap; }
.assistant-message-content a { color: #111; text-decoration: underline; }
.assistant-message time { display: block; margin-top: 4px; color: #888; font-size: 10px; font-variant-numeric: tabular-nums; }
.assistant-message.user time { text-align: right; }
.assistant-composer {
  position: sticky;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5e5e5;
  background: #fff;
}
.assistant-input-shell { display: flex; align-items: end; gap: 8px; border: 1px solid #bbb; border-radius: 9px; padding: 5px 5px 5px 10px; }
.assistant-input-shell textarea { flex: 1; min-width: 0; max-height: 104px; min-height: 32px; padding: 5px 0; border: 0; resize: none; box-shadow: none; line-height: 1.45; }
.assistant-input-shell textarea:focus { border: 0; box-shadow: none; }
.assistant-input-shell button { min-width: 52px; min-height: 34px; border: 0; border-radius: 6px; background: #111; color: #fff; font-size: 13px; }
.assistant-input-shell button:disabled { background: #aaa; }
.assistant-composer-meta { display: flex; justify-content: space-between; min-height: 15px; padding: 5px 2px 0; color: #777; font-size: 11px; }
.assistant-composer .error-text { margin: 4px 0 0; font-size: 12px; }

.class-session-section { padding-bottom: 24px; border-bottom: 1px solid #ddd; }
.class-session-section .field { margin-top: 0; }
.class-create { margin-top: 16px; }
.class-create summary { min-height: 44px; color: #555; font-size: 14px; cursor: pointer; }
.class-create form { padding-top: 8px; }
.shared-class-header { padding: 24px 0 4px; }
.shared-class-header h2 { font-size: 18px; }
.shared-summary { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.shared-summary p { display: grid; gap: 4px; margin: 0; padding: 13px 0; }
.shared-summary p:nth-child(even) { padding-left: 16px; border-left: 1px solid #ddd; }
.shared-summary p:nth-child(n+3) { border-top: 1px solid #ddd; }
.shared-summary span { color: #777; font-size: 12px; }
.shared-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.shared-charts { border-top: 1px solid #ddd; }
.shared-charts > div { padding: 20px 0; border-bottom: 1px solid #ddd; }
.shared-charts h3 { margin: 0 0 8px; font-size: 14px; }
.shared-chart { min-height: 178px; display: grid; place-items: center; }
.shared-chart svg { display: block; width: 100%; height: auto; }
.shared-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 8px;
  padding: 24px 0 8px;
}
.shared-results-list { display: grid; gap: 12px; padding-bottom: 20px; }
.shared-result { padding: 15px 0; border-bottom: 1px solid #ddd; }
.shared-result h2 { margin: 0; font-size: 16px; }
.shared-result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shared-result-heading span { flex: none; color: #777; font-size: 11px; }
.shared-title { margin: 5px 0 12px; color: #666; font-size: 13px; }
.shared-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.shared-metrics p { display: grid; gap: 2px; margin: 0; }
.shared-metrics span { color: #777; font-size: 11px; }
.shared-metrics strong { font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 350px) {
  .app { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 21px; }
  .measurement-row { grid-template-columns: 52px minmax(0, 1fr) 66px; gap: 7px; }
  .input-with-unit.density b { font-size: 11px; }
  .input-with-unit.density input { padding-right: 55px; }
  .record-title-line { grid-template-columns: minmax(0, 1fr) 66px; gap: 4px; }
  .archive-metrics { gap: 10px; }
  .report-result-row { grid-template-columns: 1fr; }
  .report-result-row > span:first-child { grid-column: auto; }
}

@page { size: A4 portrait; margin: 16mm; }

@media print {
  html, body { min-width: 0; overflow: visible; }
  body { color: #000; background: #fff; font-size: 10pt; }
  .no-print, .loading { display: none !important; }
  .report-page {
    display: block !important;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .report-header { padding-bottom: 14pt; }
  .report-header h1 { font-size: 20pt; }
  .report-section {
    padding: 12pt 0;
    border-color: #777;
    break-inside: auto;
  }
  .report-section h2 { margin-bottom: 8pt; font-size: 12pt; }
  .keep-together, .report-table, .note-section { break-inside: avoid; }
  .report-table-wrap { overflow: visible; }
  .report-table th, .report-table td { border-color: #555; padding: 6pt; }
  .note-section textarea { display: none; }
  .print-note {
    display: block;
    min-height: 48pt;
    border: 1px solid #777;
    padding: 8pt;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
  }
  .warning { color: #000 !important; font-weight: 700; }
  .threshold-note { color: #333; }
}
