:root {
  --ink: #1c1914;
  --navy: #17324d;
  --navy-2: #0f2438;
  --paper: #f3eee4;
  --card: #fffaf2;
  --line: #d7cfc0;
  --amber: #c48a12;
  --ok: #1f6b45;
  --watch: #9a6b10;
  --alert: #9b2c2c;
  --muted: #6d6458;
  --shadow: 0 12px 40px rgba(23, 50, 77, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "IBM Plex Sans", "Noto Sans Sinhala", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #e7d7b0 0%, transparent 50%),
    linear-gradient(180deg, #ece6d8 0%, var(--paper) 40%);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100svh;
}

.wrap { width: min(1180px, calc(100% - 32px)); margin: 24px auto 80px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 22px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--navy-2);
  color: #f4ead7;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--amber);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand small, .who small { display: block; color: #c9bda8; font-size: 11px; letter-spacing: 0.04em; }
.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--amber);
  color: #1a1408;
  font-family: "Source Serif 4", serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.mark.lg { width: 64px; height: 64px; font-size: 16px; }
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid #3d5a73;
  background: #0f2438;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  margin: 0;
  background: #f4ead7;
  transition: transform 0.15s ease, opacity 0.15s ease, top 0.15s ease;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
body.nav-open { overflow: hidden; }
body.nav-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { top: 21px; transform: rotate(-45deg); }
.nav-drawer {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.topbar nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  color: #f4ead7;
  text-decoration: none;
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.topbar nav a.active, .topbar nav a:hover { border-color: var(--amber); }
.top-meta { display: flex; align-items: center; gap: 14px; }
.who { text-align: right; }
.scope-switch label { color: #c9bda8; font-size: 11px; gap: 4px; }
.scope-switch select {
  min-width: 0;
  width: 100%;
  max-width: 220px;
  background: #0f2438;
  color: #f4ead7;
  border-color: #3d5a73;
  padding: 6px 8px;
  font-size: 13px;
}
.lang a {
  color: #c9bda8;
  text-decoration: none;
  padding: 2px 6px;
  font-size: 12px;
}
.lang a.on { color: var(--amber); font-weight: 600; }

.page-head, .filter-bar, .stats, .split, .sheet, .logbook, .analysis-hero, .findings, .chart-block {
  margin-bottom: 22px;
}
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.page-head h1, .modal-card h2, .analysis-hero h2 { font-family: "Source Serif 4", serif; margin: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  appearance: none;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  padding: 9px 14px;
  font: 600 13px "IBM Plex Sans", sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.solid { background: var(--navy); color: #f7f1e4; }
.btn.ghost { border-color: #c9bda8; color: #f4ead7; }
.btn.tiny { padding: 4px 8px; font-size: 12px; }
.btn.danger { border-color: var(--alert); color: var(--alert); }
.btn:hover { opacity: 0.88; }

.filter-bar, .stats, .machine-card, .analysis-hero, .findings, .chart-block, .modal-card, .login-panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  padding: 14px 16px;
}
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: 16px "IBM Plex Sans", sans-serif;
  padding: 8px 10px;
  border: 1px solid #cfc6b6;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
.mono, .ampere-table input, .date-stamp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.date-stamp { margin-left: auto; color: var(--navy); font-weight: 600; }

.machine-switch {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px 16px 14px;
  margin-bottom: 18px;
}
.switch-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.switch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.switch-row a {
  text-decoration: none;
  color: var(--navy);
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  min-width: 92px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
}
.switch-row a small { display: block; color: var(--muted); font-size: 11px; }
.switch-row a.on {
  background: var(--navy);
  color: #f7f1e4;
  border-color: var(--navy);
}
.switch-row a.on small { color: #d8ccb6; }
.switch-row a.add-link {
  border-style: dashed;
  color: var(--muted);
}
.chart-frame {
  position: relative;
  width: 100%;
  height: 260px;
}
.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chart-title {
  font-family: "Source Serif 4", serif;
  font-size: 22px;
  margin: 28px 0 12px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.chart-head h3 { margin: 0; }
.filter-bar .btn { margin-bottom: 2px; }
.today-row td { background: #fff6e4; font-weight: 600; }
.logbook-date small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); padding: 0; overflow: hidden; }
.stats.prod-stats { grid-template-columns: repeat(4, 1fr); }
.stats.health-stats { grid-template-columns: repeat(6, 1fr); }
.prod-wrap { margin-bottom: 22px; }
.prod-wrap h2 { font-family: "Source Serif 4", serif; font-size: 20px; }
.prod-table small { display: block; color: var(--muted); }
.prod-table a { color: var(--navy); text-decoration: none; font-weight: 600; }
.prod-entry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.prod-entry.hours-entry { grid-template-columns: repeat(3, 1fr); }
.prod-entry.plant-prod {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
.plant-help {
  margin: 0;
}
.plant-prod-row {
  display: grid;
  gap: 14px;
  align-items: end;
}
.plant-prod-row-main {
  grid-template-columns: 1fr 1fr;
}
.plant-prod-row-time {
  grid-template-columns: 1fr 1fr 1fr auto;
}
.plant-prod-row label {
  min-width: 0;
}
.plant-prod-row input {
  width: 100%;
  height: 42px;
}
.plant-prod-row input[readonly] {
  background: #efe9dc;
  color: var(--navy);
  cursor: default;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
}
.plant-prod-save {
  display: flex;
  align-items: end;
  padding: 0;
}
.plant-prod-save .btn {
  height: 42px;
  min-width: 128px;
  white-space: nowrap;
  padding: 0 18px;
}
.prod-entry small { color: var(--muted); }
.stats.prod-stats article strong { font-size: 22px; }
.stats article { padding: 16px 18px; border-right: 1px solid var(--line); }
.stats article:last-child { border-right: 0; }
.stats span { color: var(--muted); font-size: 12px; display: block; }
.stats article small { display: block; margin-top: 4px; color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.stats strong { font-size: 28px; font-family: "IBM Plex Mono", monospace; }
.stats .ok strong { color: var(--ok); }
.stats .watch strong { color: var(--watch); }
.stats .alert strong { color: var(--alert); }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.split h2 { font-size: 18px; }
.alert-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.alert-list li, .machine-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.alert-list li.alert { border-left: 4px solid var(--alert); }
.alert-list li.watch { border-left: 4px solid var(--watch); }
.alert-list p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.machine-grid { display: grid; gap: 10px; }
.machine-card { text-decoration: none; color: inherit; flex-direction: column; }
.machine-card header { display: flex; justify-content: space-between; align-items: center; }
.machine-card.alert { border-color: #e8b4b4; }
.machine-card.watch { border-color: #e6cf93; }
.machine-card.amp-changed-card { box-shadow: inset 4px 0 0 var(--alert); }
.day-changed-note { display: block; margin-top: 6px; color: var(--alert); font-weight: 600; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 18px;
  align-items: stretch;
}
.profile-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  text-decoration: none;
  color: inherit;
}
.profile-card header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.profile-card header > div {
  min-width: 0;
  width: 100%;
}
.profile-card h2 {
  font-family: "Source Serif 4", serif;
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.profile-card p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.profile-card .pill {
  white-space: nowrap;
}
.profile-card.alert { border-left: 5px solid var(--alert); }
.profile-card.watch { border-left: 5px solid var(--watch); }
.profile-card.ok { border-left: 5px solid var(--ok); }
.profile-meta { list-style: none; padding: 0; margin: 12px 0 16px; color: var(--muted); font-size: 13px; }
.profile-meta li { margin: 4px 0; overflow-wrap: anywhere; }
.profile-card .row-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.profile-card .row-actions .btn.solid {
  grid-column: 1 / -1;
}
.profile-card .row-actions .btn {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}
.profile-card .row-actions form {
  margin: 0;
  min-width: 0;
}
a.profile-card:hover { border-color: var(--navy); }

.day-amp-table td.amp-pair { font-size: 13px; white-space: nowrap; }
.day-amp-table td.amp-pair.ok { background: #d8f3e3; }
.day-amp-table td.amp-pair.watch { background: #ffe3a3; }
.day-amp-table td.amp-pair.alert { background: #f7b4b4; }
.day-amp-table .amp-arrow { color: var(--muted); padding: 0 4px; }
.day-amp-table tr.amp-changed-row td:first-child { box-shadow: inset 4px 0 0 var(--alert); }

.pill {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill.ok { color: var(--ok); }
.pill.watch { color: var(--watch); }
.pill.alert { color: var(--alert); }
.pill.unknown { color: var(--muted); }
.pill.lg { font-size: 13px; padding: 8px 12px; }

.sheet { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--card); }
.sheet th, .sheet td, .ampere-table th, .ampere-table td, .mini th, .mini td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.sheet thead, .ampere-table thead, .mini thead { background: var(--navy); color: #f4ead7; }
.chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  background: #efe6d4;
  font-size: 12px;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { margin: 0; }

.logbook { background: var(--card); border: 1px solid #b7aa93; }
.logbook-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 16px 18px 12px;
  border-bottom: 2px solid var(--navy);
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(196, 138, 18, 0.06) 8px, rgba(196, 138, 18, 0.06) 16px);
}
.logbook-head strong {
  font-family: "Source Serif 4", serif;
  font-size: 28px;
  display: block;
  letter-spacing: 0.12em;
}
.logbook-head span { color: var(--muted); font-size: 12px; letter-spacing: 0.16em; }
.logbook-date { font-family: "IBM Plex Mono", monospace; font-size: 16px; color: var(--navy); }

.ampere-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.ampere-table th { font-weight: 500; font-size: 12px; text-align: center; }
.ampere-table td { background: #fff; }
.ampere-table input[type="number"], .ampere-table input[type="time"] {
  width: 100%;
  text-align: center;
  font-size: 15px;
  border: none;
  background: transparent;
  padding: 8px 4px;
}
.ampere-table textarea {
  width: 100%;
  min-width: 0;
  border: none;
  resize: vertical;
  background: transparent;
}
.ampere-table tr.watch td,
.ampere-table tr.alert td { background: #fff; }
.ampere-table tr.watch td.machine-cell { background: #fff6e4; }
.ampere-table tr.alert td.machine-cell { background: #fdecec; }
.amp-cell.ok { background: #d8f3e3 !important; }
.amp-cell.high-watch { background: #ffe3a3 !important; }
.amp-cell.high-alert { background: #f7b4b4 !important; }
.amp-cell.low-watch { background: #cfe4fb !important; }
.amp-cell.low-alert { background: #9ec2ef !important; }
.amp-cell.day-changed { box-shadow: inset 0 0 0 3px var(--alert); }
.std-line { margin-top: 6px; font-size: 11px; color: var(--muted); }
.amp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.swatch {
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
}
.swatch.ok { background: #d8f3e3; }
.swatch.high-watch { background: #ffe3a3; }
.swatch.high-alert { background: #f7b4b4; }
.swatch.low-watch { background: #cfe4fb; }
.swatch.low-alert { background: #9ec2ef; }
.swatch.day-changed { background: #fff; box-shadow: inset 0 0 0 2px var(--alert); }
.typical-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.machine-cell small { display: block; color: var(--muted); }
.machine-cell .print-only { display: none; }
.motor-tag { margin-top: 8px; font-weight: 600; }
.time-label { margin-top: 8px; font-size: 11px; }
.sticky-save {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.analysis-hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px; flex-wrap: wrap; }
.analysis-hero.alert { border-left: 6px solid var(--alert); }
.analysis-hero.watch { border-left: 6px solid var(--watch); }
.analysis-hero.ok { border-left: 6px solid var(--ok); }
.findings, .chart-block { padding: 18px; }
.findings ul { margin: 0; padding-left: 18px; }
.mini { width: 100%; min-width: 480px; border-collapse: collapse; margin-top: 14px; font-size: 13px; }

.modal { border: none; padding: 0; background: transparent; }
.modal::backdrop { background: rgba(15, 36, 56, 0.55); }
.modal-card { width: min(860px, 94vw); max-height: 90vh; overflow: auto; padding: 22px; display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.motor-head { display: flex; justify-content: space-between; align-items: center; }
.motor-row {
  display: grid;
  grid-template-columns: 70px 1.2fr 1fr 1fr 1fr 36px;
  gap: 8px;
  margin-top: 8px;
  align-items: end;
}
.motor-row > label { min-width: 0; }
.motor-row input { width: 100%; min-width: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.empty { color: var(--muted); padding: 24px; background: var(--card); border: 1px dashed var(--line); }
.flash { padding: 10px 14px; margin-bottom: 14px; }
.flash.ok { background: #e5f4ea; color: var(--ok); }
.flash.watch { background: #fff6e4; color: var(--watch); }
.flash.error { background: #fdecec; color: var(--alert); }

.login-body { min-height: 100vh; }
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-panel {
  margin: auto;
  width: min(420px, 90%);
  padding: 36px;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 24px; }
.login-brand h1 { font-family: "Source Serif 4", serif; margin: 12px 0 4px; }
.login-form { display: grid; gap: 14px; }
.login-form .btn { width: 100%; }
.login-copy {
  background: var(--navy-2);
  color: #f4ead7;
  display: grid;
  place-content: center;
  padding: 48px;
}
.login-copy h2 { font-family: "Source Serif 4", serif; }
.login-copy ol { line-height: 1.7; color: #d8ccb6; }
.login-lang { margin-top: 18px; }
.print-only { display: none; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 24px); margin: 16px auto 40px; }
  .login-shell, .split, .stats, .stats.prod-stats, .stats.health-stats, .prod-entry { grid-template-columns: 1fr 1fr; }
  .plant-prod-row-main { grid-template-columns: 1fr 1fr; }
  .plant-prod-row-time { grid-template-columns: 1fr 1fr; }
  .plant-prod-save { grid-column: 1 / -1; }
  .plant-prod-save .btn { width: 100%; }
  .login-copy { display: none; }
  .login-shell { grid-template-columns: 1fr; min-height: 100svh; }
  .login-panel { width: min(420px, calc(100% - 32px)); margin: 32px auto; padding: 28px 22px; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand small { display: none; }
  .nav-toggle { display: block; }
  .nav-drawer {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    flex: 1 0 100%;
    padding: 8px 0 12px;
    border-top: 1px solid #3d5a73;
  }
  .nav-drawer.open { display: flex; }
  .topbar nav {
    flex-direction: column;
    gap: 0;
  }
  .topbar nav a {
    padding: 12px 8px;
    border-bottom: 1px solid #3d5a73;
    min-height: 44px;
  }
  .top-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .who { text-align: left; }
  .scope-switch select { max-width: none; }
  .top-meta .btn { width: 100%; min-height: 44px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 26px; word-break: break-word; }
  .page-head .btn, .actions .btn { width: 100%; min-height: 44px; }
  .actions { flex-direction: column; }
  .filter-bar { align-items: stretch; }
  .filter-bar label, .filter-bar input, .filter-bar select, .filter-bar .btn { width: 100%; }
  .date-stamp { margin-left: 0; width: 100%; }
  .motor-row { grid-template-columns: 1fr 1fr; }
  .stats article { border-right: 1px solid var(--line); }
  .stats article:nth-child(2n) { border-right: 0; }
  .stats article:nth-last-child(-n + 2) { border-bottom: 0; }
  .chart-frame { height: 220px; }
  .chart-head { flex-direction: column; align-items: stretch; }
  .chart-head .btn { width: 100%; }
  .modal-card { width: calc(100vw - 24px); padding: 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; min-height: 44px; }
  .logbook-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .logbook-head strong { font-size: 22px; letter-spacing: 0.08em; }
  .log-form { padding-bottom: 84px; }
  .sticky-save {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    z-index: 15;
    justify-content: stretch;
    margin: 0;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: var(--paper);
    box-shadow: 0 -10px 24px rgba(23, 50, 77, 0.12);
  }
  .sticky-save .btn { width: 100%; min-height: 48px; }
  .profile-card .row-actions { grid-template-columns: 1fr 1fr; }
  .analysis-hero .pill.lg { white-space: normal; }
}

@media (max-width: 640px) {
  .stats, .stats.prod-stats, .stats.health-stats, .prod-entry, .plant-prod-row-main, .plant-prod-row-time {
    grid-template-columns: 1fr;
  }
  .stats article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stats article:last-child { border-bottom: 0; }
  .motor-row { grid-template-columns: 1fr; }
  .switch-row a { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .logbook-head span { letter-spacing: 0.04em; font-size: 11px; }
  .ampere-table { min-width: 0; }
  .ampere-table thead { display: none; }
  .ampere-table, .ampere-table tbody, .ampere-table tr, .ampere-table td {
    display: block;
    width: 100%;
  }
  .ampere-table tr {
    padding: 10px 12px 12px;
    border-bottom: 10px solid var(--paper);
  }
  .ampere-table td {
    border: 0;
    padding: 8px 0;
  }
  .ampere-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .ampere-table input[type="number"] {
    min-height: 44px;
    font-size: 18px;
    border: 1px solid var(--line);
    background: #fff;
  }
  .ampere-table textarea {
    min-height: 72px;
    border: 1px solid var(--line);
    padding: 8px;
  }
  .sheet, .mini { min-width: 520px; }
}

@media print {
  body { background: #fff; }
  .topbar, .no-print, .flash, .sticky-save, .nav-toggle { display: none !important; }
  .print-only { display: block; }
  .wrap { width: auto; margin: 0; }
  .logbook, .ampere-table input { box-shadow: none; }
  .table-scroll { overflow: visible; }
  .ampere-table { min-width: 0; display: table; }
  .ampere-table thead { display: table-header-group; }
  .ampere-table tbody { display: table-row-group; }
  .ampere-table tr { display: table-row; padding: 0; border: 0; }
  .ampere-table th, .ampere-table td { display: table-cell; }
  .ampere-table td[data-label]::before { content: none; }
  .ampere-table input { border: none; }
}
