:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1e2422;
  --muted: #61706b;
  --line: #d7ded8;
  --green: #4d7250;
  --green-dark: #345a3a;
  --red: #d63f3f;
  --blue: #2f65c8;
  --amber: #c48322;
  --focus: #123f7a;
  --shadow: 0 16px 36px rgba(30, 36, 34, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

/* Sound map */
.soundmap-page { --sound-ink: #15342f; --sound-green: #173f38; background: #eef1ec; }
.soundmap-header { background: var(--sound-green); }
.soundmap-header .live-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: 12px; font-weight: 800; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #8ca39d; }
.live-pill.is-live i { background: #ff6b58; box-shadow: 0 0 0 5px rgba(255,107,88,.18); animation: sound-pulse 1.2s infinite; }
.soundmap-shell { max-width: 1440px; margin: auto; padding: clamp(22px,4vw,58px) clamp(16px,4vw,54px) 48px; }
.soundmap-hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(330px,.72fr); align-items: center; gap: clamp(28px,6vw,90px); margin-bottom: 34px; }
.soundmap-kicker { margin-bottom: 12px; color: #cd7d38; font-size: 12px; font-weight: 900; letter-spacing: .2em; }
.soundmap-hero h2 { color: var(--sound-ink); font-family: Georgia,"Yu Mincho",serif; font-size: clamp(37px,5vw,68px); line-height: 1.12; letter-spacing: -.035em; }
.soundmap-lead { max-width: 620px; margin-top: 20px; color: #566b66; line-height: 1.9; }
.meter-card { padding: 22px 24px 18px; border-radius: 18px; color: #fff; background: var(--sound-green); box-shadow: 0 22px 45px rgba(23,63,56,.2); }
.meter-top,.meter-labels { display: flex; justify-content: space-between; color: #b9c9c5; font-size: 11px; }
.meter-value { display: flex; align-items: baseline; justify-content: center; gap: 7px; margin: 10px 0 13px; }
.meter-value strong { font-size: 66px; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-value span { color: #b9c9c5; }
.meter-track { position: relative; height: 8px; overflow: visible; border-radius: 99px; background: rgba(255,255,255,.14); }
.meter-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#54bda6 0 48%,#e7b54c 68%,#ef705d); transition: width .1s; }
.meter-track b { position: absolute; top: -3px; left: 0; width: 2px; height: 14px; background: #fff; transition: left .15s; }
.meter-labels { margin-top: 7px; }
.measure-button { width: 100%; margin-top: 18px; padding: 13px; border: 0; border-radius: 10px; background: #f6f3e9; color: var(--sound-green); font-weight: 900; cursor: pointer; }
.measure-button span { color: #e36551; }
.measure-button.is-measuring { background: #ef705d; color: #fff; }
.meter-note { margin-top: 10px; color: #91aaa4; font-size: 10px; line-height: 1.45; }
.map-dashboard { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(290px,.72fr); gap: 18px; }
.map-card,.history-card,.privacy-card,.stats-grid article { border: 1px solid #d6ddd8; background: #fff; box-shadow: 0 12px 35px rgba(25,52,47,.06); }
.map-card { overflow: hidden; border-radius: 16px; }
.map-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 18px 20px; }
.map-toolbar h2,.history-heading h2 { color: var(--sound-ink); font-size: 17px; }
.map-toolbar p,.history-heading p { margin-top: 4px; color: #71807c; font-size: 11px; }
.locate-button,.history-heading button { padding: 9px 12px; border: 1px solid #d3dcd7; border-radius: 8px; background: #f8faf7; color: var(--sound-green); font-size: 12px; font-weight: 800; cursor: pointer; }
.sound-map { position: relative; height: 490px; background: #dce4df; z-index: 0; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #657974; font-size: 13px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 13px 20px; color: #65736f; font-size: 11px; }
.map-legend span { display: flex; align-items: center; gap: 6px; }.map-legend i { width: 9px; height: 9px; border-radius: 50%; }.map-legend .quiet { background:#2c8f7b }.map-legend .normal { background:#e4a832 }.map-legend .loud { background:#d95b47 }
.soundmap-side { display: grid; align-content: start; gap: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.stats-grid article { display: grid; padding: 14px 10px; border-radius: 12px; text-align: center; }
.stats-grid span { color: #71807c; font-size: 10px; }.stats-grid strong { margin-top: 5px; color: var(--sound-ink); font-size: 25px; }.stats-grid small { color: #9aa6a2; font-size: 9px; }
.history-card { padding: 17px; border-radius: 14px; }
.history-heading { display: flex; justify-content: space-between; align-items: center; }
.history-heading button:disabled,.clear-history:disabled { opacity: .4; cursor: default; }
.history-list { list-style: none; padding: 0; margin: 13px 0; }
.history-list li:not(.empty-history) { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #edf0ed; }
.history-list li > i { width: 9px; height: 9px; border-radius: 50%; }.history-list li div { display: grid; gap: 2px; }.history-list strong { color: var(--sound-ink); font-size: 13px; }.history-list strong small { margin-left: 5px; color: #7a8884; font-weight: 500; }.history-list span { color: #8b9793; font-size: 10px; }.history-list li > b { color: #71807c; font-size: 10px; }.history-list li > b::after { content:" peak"; font-weight: 400; }
.empty-history { padding: 27px 0; color: #8a9793; font-size: 12px; text-align: center; }
.clear-history { width: 100%; padding: 9px; border: 0; background: transparent; color: #9a655c; font-size: 11px; cursor: pointer; }
.privacy-card { display: flex; gap: 11px; padding: 14px; border-radius: 12px; }.privacy-card > span { color: #397b6d; font-size: 21px; }.privacy-card strong { color: var(--sound-ink); font-size: 12px; }.privacy-card p { margin-top: 4px; color: #71807c; font-size: 10px; line-height: 1.55; }
.soundmap-toast { position: fixed; z-index: 1000; left: 50%; bottom: 22px; max-width: calc(100% - 32px); padding: 11px 17px; border-radius: 99px; color: #fff; background: #183f38; box-shadow: 0 9px 25px rgba(0,0,0,.2); font-size: 12px; opacity: 0; transform: translate(-50%,15px); pointer-events: none; transition: .2s; }.soundmap-toast.is-visible { opacity: 1; transform: translate(-50%,0); }
@keyframes sound-pulse { 50% { opacity:.45 } }
@media (max-width: 900px) { .soundmap-hero,.map-dashboard { grid-template-columns: 1fr; }.sound-map { height: 440px; }.soundmap-side { grid-template-columns: 1fr 1fr; }.stats-grid { grid-column: 1/-1; } }
@media (max-width: 580px) { .soundmap-header { align-items:flex-start; }.soundmap-header .live-pill { margin-top:5px; }.soundmap-hero h2 { font-size: 40px; }.soundmap-shell { padding-top:28px; }.meter-card { padding:20px; }.sound-map { height: 390px; }.soundmap-side { grid-template-columns:1fr; }.stats-grid { grid-column:auto; }.page-nav { max-width: calc(100vw - 32px); overflow-x:auto; padding-bottom:3px; }.page-nav a { flex:0 0 auto; } }

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 42px);
  background: var(--green);
  color: #fff;
}

.menu-toggle {
  display: none;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  font-size: 13px;
  opacity: 0.86;
}

.page-nav {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.page-nav a {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 7px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.page-nav a:hover,
.page-nav a.is-current {
  background: #fff;
  color: var(--green-dark);
}

h1 {
  margin-top: 2px;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

.header-actions,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.icon-button span[aria-hidden="true"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  background: #e8eee9;
}

.icon-button:hover {
  border-color: var(--green-dark);
  background: #f4f8f4;
}

.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(18, 63, 122, 0.28);
  outline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(470px, 0.95fr) minmax(520px, 1.05fr);
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 42px) 34px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.input-panel,
.chart-panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.date-field,
.patient-grid label,
.memo-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.date-field input,
.patient-grid input,
.memo-field textarea,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.date-field input,
.patient-grid input {
  min-height: 38px;
  padding: 8px 10px;
}

.patient-grid select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.symbol-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.symbol-guide > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.triangle { color: var(--green-dark); font-size: 28px; line-height: 1; }
.symbol-guide span { display: grid; font-size: 13px; }
.symbol-guide small { color: var(--muted); }
.improvement { color: var(--muted); font-weight: 700; }
.improvement.is-positive { color: var(--green-dark); }
.threshold-table select { width: 82px; }

.normal-band { fill: rgba(77, 114, 80, 0.08); }
.target-line { stroke: var(--amber); stroke-width: 1.8; stroke-dasharray: 7 5; }
.threshold-series { fill: none; stroke: var(--green-dark); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.threshold-series.unaided { stroke: #7b8782; stroke-dasharray: 6 5; }
.threshold-marker { font-size: 25px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.threshold-marker.unaided { fill: #59635f; }
.threshold-marker.aided { fill: var(--green-dark); }
.threshold-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.threshold-legend span { display: inline-flex; align-items: center; gap: 6px; }
.threshold-legend i { font-style: normal; font-size: 18px; font-weight: 800; line-height: 1; }
.open-triangle { color: #59635f; }
.filled-triangle { color: var(--green-dark); }
.target-key { width: 22px; border-top: 2px dashed var(--amber); }
.measurement-note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f4f7f4; color: var(--muted); font-size: 12px; line-height: 1.6; }

.patient-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 10px;
  margin-bottom: 14px;
}

.table-scroll {
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audiogram-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.audiogram-table th,
.audiogram-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.audiogram-table thead th {
  position: sticky;
  top: 0;
  background: #eef3ef;
  z-index: 1;
}

.audiogram-table tbody th {
  width: 62px;
  text-align: center;
  background: #fafbf9;
  white-space: nowrap;
  font-size: 14px;
}

.audiogram-table tr:last-child th,
.audiogram-table tr:last-child td {
  border-bottom: 0;
}

select {
  width: 70px;
  min-height: 34px;
  padding: 5px 7px;
}

.measurement-cell {
  min-width: 0;
}

.reading-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.scale-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.scale-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  cursor: pointer;
}

.scale-toggle span {
  display: none;
}

.ear-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ear-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.ear-label.right::before {
  background: var(--red);
}

.ear-label.left::before {
  background: var(--blue);
}

.memo-field {
  margin-top: 14px;
}

.memo-field textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px 12px;
}

.chart-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr;
}

.print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.print-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.print-meta b {
  color: var(--ink);
}

.overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.overlay-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.overlay-button.is-active {
  border-color: var(--green);
  background: #eaf2eb;
  color: var(--green-dark);
}

.chart-wrap {
  width: 100%;
  aspect-ratio: 1.24 / 1;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

#chart {
  width: 100%;
  height: 100%;
  display: block;
}

.grid-line {
  stroke: #dce3de;
  stroke-width: 1;
}

.axis-line {
  stroke: #7f8b86;
  stroke-width: 1.2;
}

.tick-text {
  fill: #35423e;
  font-size: 13px;
  font-weight: 700;
}

.axis-label {
  fill: #4b5854;
  font-size: 13px;
}

.speech-banana {
  fill: rgba(55, 159, 175, 0.16);
  stroke: rgba(55, 159, 175, 0.3);
  stroke-width: 1.5;
}

.speech-label {
  fill: #0f888f;
  font-size: 16px;
  font-weight: 800;
}

.sound-dot {
  fill: rgba(196, 131, 34, 0.72);
}

.sound-label {
  fill: #7a5a22;
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3px;
}

.right-line,
.left-line,
.bone-right-line,
.bone-left-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.right-line,
.bone-right-line {
  stroke: var(--red);
}

.left-line,
.bone-left-line {
  stroke: var(--blue);
}

.left-line,
.bone-left-line {
  stroke-dasharray: 5 5;
}

.point-label {
  font-size: 22px;
  font-weight: 800;
  dominant-baseline: central;
  text-anchor: middle;
}

.right-point {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.6;
}

.left-point {
  fill: var(--blue);
  stroke: var(--blue);
  stroke-width: 2.8;
}

.left-point-stroke {
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.scale-marker {
  fill: var(--amber);
  font-size: 16px;
  font-weight: 800;
}

.scale-arrow {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.right-arrow {
  stroke: var(--red);
}

.left-arrow {
  stroke: var(--blue);
}

.right-arrow-head {
  fill: var(--red);
}

.left-arrow-head {
  fill: var(--blue);
}

.bone-marker {
  font-size: 24px;
  font-weight: 800;
}

.right-marker {
  fill: var(--red);
}

.left-marker {
  fill: var(--blue);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.right-key {
  border: 2px solid var(--red);
}

.left-key {
  background: var(--blue);
}

.masked-key {
  background: var(--amber);
}

.legend i.legend-symbol {
  display: inline-grid;
  min-width: 14px;
  height: 18px;
  border-radius: 0;
  place-content: center;
  font-size: 18px;
  font-weight: 800;
  font-style: normal;
  line-height: 1;
}

.legend-symbol.right {
  color: var(--red);
}

.legend-symbol.left {
  color: var(--blue);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.summary-item b {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.summary-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-item em,
.note-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.hearing-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.note-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcfa;
}

.note-item h3 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.3;
}

.note-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.right-note {
  border-left: 4px solid var(--red);
}

.left-note {
  border-left: 4px solid var(--blue);
}

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    min-height: 360px;
  }
}

@media (max-width: 680px) {
  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px 14px;
    padding: 10px 16px;
  }

  .app-header > div:first-child {
    min-width: 0;
  }

  .app-header .eyebrow {
    font-size: 10px;
  }

  .app-header h1 {
    padding-right: 54px;
    margin-top: 0;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-toggle {
    display: grid;
    position: absolute;
    top: 10px;
    right: 16px;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: transparent;
    place-content: center;
    gap: 5px;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.2s, opacity 0.2s;
  }

  .app-header.is-menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-header.is-menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .app-header.is-menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .app-header .page-nav,
  .app-header .header-actions,
  .app-header.soundmap-header .live-pill {
    display: none;
  }

  .app-header.is-menu-open .page-nav {
    display: grid;
    margin-top: 12px;
  }

  .app-header.is-menu-open .page-nav a {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  .app-header.is-menu-open .header-actions,
  .app-header.is-menu-open.soundmap-header .live-pill {
    display: flex;
    grid-column: 1 / -1;
  }

  .app-header.is-menu-open .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .app-header.is-menu-open .header-actions .icon-button {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    border-color: rgba(255, 255, 255, 0.38);
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
  }

  .app-header.is-menu-open .header-actions .button-text {
    display: inline;
  }

  .panel-header {
    display: grid;
  }

  .header-actions,
  .export-actions {
    justify-content: start;
  }

  .patient-grid,
  .symbol-guide,
  .summary,
  .hearing-notes {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .input-panel,
  .chart-panel {
    padding: 14px;
  }

  .chart-wrap {
    min-height: 300px;
  }

  .audiogram-table {
    font-size: 12px;
  }

  .audiogram-table th,
  .audiogram-table td {
    padding: 6px 2px;
  }

  .audiogram-table thead th {
    font-size: 10px;
  }

  .audiogram-table tbody th {
    width: 42px;
    font-size: 13px;
  }

  .reading-control {
    flex-direction: column;
    gap: 2px;
  }

  select {
    width: 43px;
    min-height: 34px;
    padding: 4px 2px;
    font-size: 12px;
  }

  .threshold-table select {
    width: 66px;
  }

  .scale-toggle input {
    width: 16px;
    height: 16px;
  }

  .scale-toggle span {
    display: inline;
  }

  .ear-label {
    gap: 3px;
  }

  .ear-label::before {
    width: 8px;
    height: 8px;
  }

  .button-text {
    display: none;
  }

  .icon-button {
    width: 42px;
    padding: 8px;
  }

  .export-actions .button-text {
    display: inline;
  }

  .export-actions .icon-button {
    width: auto;
    min-width: 88px;
    padding: 8px 12px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html,
  body {
    background: #fff;
    width: auto;
    min-width: 0;
  }

  .app-header,
  .header-actions,
  .export-actions,
  .input-panel,
  .overlay-controls {
    display: none !important;
  }

  .page-nav {
    display: none !important;
  }

  .layout {
    display: block;
    padding: 0;
  }

  .panel,
  .chart-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
    page-break-inside: avoid;
  }

  .chart-panel {
    display: block;
  }

  .chart-panel .panel-header {
    display: block;
    margin-bottom: 2mm;
  }

  .chart-panel h2 {
    font-size: 18pt;
  }

  .chart-panel .panel-header p,
  .legend,
  .note-item p {
    font-size: 9pt;
  }

  .print-meta {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 3mm;
    margin: 0 0 3mm;
    font-size: 10pt;
  }

  .print-meta span {
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 2mm;
  }

  .chart-wrap {
    min-height: 0;
    height: 137mm;
    aspect-ratio: auto;
    border-radius: 4px;
    page-break-inside: avoid;
  }

  .legend {
    gap: 6mm;
    margin-top: 4mm;
  }

  .summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 3mm;
    margin-top: 4mm;
  }

  .summary-item {
    padding: 3mm;
    border-radius: 4px;
  }

  .summary-item b {
    font-size: 15pt;
  }

  .hearing-notes {
    grid-template-columns: repeat(2, 1fr);
    gap: 3mm;
    margin-top: 3mm;
  }

  .note-item {
    padding: 3mm;
    border-radius: 4px;
  }

  .note-item h3 {
    font-size: 11pt;
  }

  .note-item p {
    line-height: 1.45;
  }
}
