:root {
  --paper: #f6f6ee;
  --surface: #fffef8;
  --green: #173f34;
  --pine: #174639;
  --lime: #e3eea0;
  --muted: #627269;
  --line: #dce0d3;
  --coral: #f6a480;
  --soft: #e9eee3;
  --shadow: 0 5px 20px rgba(38,55,40,.045);
  font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  color: var(--green);
  background: var(--paper);
  line-height: 1.55;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

button,a,input,select,textarea {
  touch-action: manipulation;
}

button:focus-visible,a:focus-visible,[tabindex]:focus-visible {
  outline: 3px solid #738e29;
  outline-offset: 4px;
}

button {
  border: 0;
}

a {
  color: inherit;
}

h1,h2,h3,p {
  margin: 0;
}

button svg,.icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}

button {
  color: var(--green);
}

[hidden] {
  display: none!important;
}

.skip {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 20;
  background: white;
  padding: 12px 16px;
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

.loading {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
}

.loading strong {
  color: var(--green);
  font-size: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-copy strong {
  font-size: 29px;
  font-weight: 850;
  letter-spacing: -.11em;
  line-height: 1.1;
}

.brand-copy small {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .08em;
}

.brandmark {
  position: relative;
  background: var(--pine);
  display: inline-block;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.brandmark:before {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  left: 9px;
  top: 14px;
  background: var(--lime);
  border-radius: 2px 14px 14px 14px;
  transform: rotate(45deg);
}

.brandmark:after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  right: 7px;
  top: 9px;
  background: var(--coral);
}

.date-label {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-label .icon {
  width: 17px;
  height: 17px;
}

.login-page {
  min-height: 100dvh;
  max-width: 1520px;
  margin: auto;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px,4.4vw,72px);
}

.login-header {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(420px,1.15fr) minmax(360px,.85fr);
  align-items: stretch;
  flex: 1;
  margin-bottom: clamp(35px,6.5vh,82px);
  max-height: 850px;
  min-height: min(640px,75vh);
}

.cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 33px;
  background-color: #184b3c;
  background-image: radial-gradient(ellipse at 38% 35%,#275e4b,transparent 64%),linear-gradient(130deg,#123c31,#1d4f3e);
  color: #f5f6d9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px,3.4vw,55px);
  min-height: 530px;
}

.cover:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .25;
  background-image: radial-gradient(#a4b89c 1px,transparent 1px);
  background-size: 15px 15px;
  mask-image: linear-gradient(145deg,transparent 10%,#000 70%);
}

.cover-copy {
  position: relative;
  z-index: 1;
  pointer-events: none;
  width: 100%;
}

.cover h2 {
  font-size: clamp(40px,4.6vw,75px);
  line-height: 1.17;
  letter-spacing: -.055em;
  font-weight: 700;
}

.cover h2 span {
  color: var(--lime);
}

.cover-caption {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #eef0cd;
  letter-spacing: .04em;
}

.cover-caption i {
  width: 28px;
  height: 1px;
  background: #c4d58c;
}

.instrument-art {
  position: absolute;
  inset: 10% 0 1%;
  pointer-events: none;
  container-type: inline-size;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(213,232,157,.2);
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  right: -7%;
  bottom: 9%;
  transform: rotate(-13deg) scaleY(.63);
}

.orbit.two {
  width: 90%;
  right: -15%;
  bottom: -2%;
  border-color: rgba(213,232,157,.12);
}

.meter {
  position: absolute;
  width: clamp(135px,33cqw,235px);
  aspect-ratio: .64;
  bottom: 14%;
  right: 18%;
  transform: rotate(23deg);
  border-radius: 24% 24% 25% 25% / 18% 18% 16% 16%;
  background: linear-gradient(116deg,#f4f1d8 4%,#e2e3bc 50%,#c7d1a9 100%);
  border: 2px solid #edf0d7;
  box-shadow: inset -5px -7px 0 #aebc99,inset 3px 4px 0 #ffffe4,12px 18px 0 -3px #153c3088,22px 32px 30px #0c322e55;
  padding: 0;
}

.meter:before {
  content: "";
  width: 29%;
  height: 17%;
  position: absolute;
  left: 34%;
  bottom: -14%;
  background: repeating-linear-gradient(0deg,#f3f1da 0 8px,#c2c7a7 8px 10px);
  border-radius: 0 0 3px 3px;
  box-shadow: inset -3px 0 #b6bc9e;
  z-index: -1;
}

.meter:after {
  content: "";
  position: absolute;
  width: 29%;
  height: 4%;
  left: 34%;
  bottom: -14%;
  background: #ebb08b;
  border-radius: 0 0 3px 3px;
}

.meter-screen {
  position: absolute;
  left: 14%;
  top: 17%;
  width: 72%;
  height: 43%;
  border-radius: 12% / 9%;
  background: linear-gradient(150deg,#92a789,#b5c39b);
  border: 4px solid #677c67;
  box-shadow: 0 0 0 2px #f1f3d0,inset 2px 3px 5px #53674d66;
  color: #304c3a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2%;
}

.meter-led {
  display: flex;
  gap: 12%;
  align-items: center;
  margin: 4% 0;
  width: 72%;
  height: 32%;
  justify-content: center;
}

.meter-led i {
  display: block;
  background: #354c3a;
  width: 32%;
  height: 18%;
  transform: skew(-9deg);
  clip-path: polygon(12% 0,100% 0,88% 100%,0% 100%);
}

.meter-unit {
  font: 600 clamp(8px,1.6cqw,12px) ui-monospace,monospace;
  opacity: .82;
  letter-spacing: .035em;
}

.meter-button {
  position: absolute;
  bottom: 15%;
  left: 37%;
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg,#416452,#315642);
  box-shadow: inset 1px 2px 0 #83a081,1px 2px 0 #ffffdb;
  display: grid;
  place-items: center;
}

.meter-button:after {
  content: "";
  width: 24%;
  height: 24%;
  border: 2px solid #c9d9a9;
  border-radius: 50%;
}

.swatch {
  position: absolute;
  right: 5%;
  bottom: 20%;
  width: clamp(33px,9cqw,65px);
  aspect-ratio: 1;
  border-radius: 12% 65% 62% 65%;
  background: linear-gradient(115deg,#fab39a,#efa182);
  transform: rotate(48deg);
  box-shadow: 6px 9px 0 #173d3266;
}

.login-side {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 40px clamp(25px,5vw,85px);
}

.login-content {
  width: 100%;
  max-width: 380px;
}

.login-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #e7eed6;
  color: #38633d;
  display: grid;
  place-items: center;
  margin-bottom: 23px;
}

.login-content h1 {
  font-size: clamp(29px,3vw,45px);
  line-height: 1.25;
  letter-spacing: -.055em;
}

.login-content>p {
  margin: 14px 0 33px;
  color: var(--muted);
  font-size: 16px;
}

.login-content form>label {
  display: block;
  font-weight: 650;
  margin-bottom: 9px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  display: block;
  width: 100%;
  height: 56px;
  border: 1.5px solid #abb8a3;
  border-radius: 11px;
  background: var(--surface);
  padding: 0 54px 0 16px;
  outline: 0;
}

.password-wrap input:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px #e1e9c7;
}

.eye {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 47px;
  height: 48px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #65756b;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  font-weight: 600;
}

.btn:hover {
  border-color: #a9b79d;
}

.btn.primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #fffef4;
}

.btn.primary:hover {
  background: #0e362a;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn.login-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 19px;
  justify-content: space-between;
  padding: 10px 18px;
}

.login-error,.page-error {
  color: #923817;
  background: #ffeddf;
  padding: 10px 12px;
  border-radius: 9px;
  margin-top: 10px;
  font-size: 14px;
}

.login-foot {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 23px;
}

.login-foot .icon {
  width: 15px;
  height: 15px;
}

.shell {
  --side: 218px;
  max-width: 1810px;
  min-height: 100dvh;
  margin: auto;
  display: grid;
  grid-template-columns: var(--side) minmax(0,1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 36px 19px 28px;
  border-right: 1px solid var(--line);
  background: #f0f2e8;
}

.sidebar .brand {
  padding-left: 7px;
}

.sidebar .brand-copy {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.sidebar .brand-copy small {
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 62px;
}

.nav button,.logout {
  display: flex;
  align-items: center;
  gap: 13px;
  background: transparent;
  text-align: left;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 12px;
  min-height: 48px;
}

.nav button:hover,.logout:hover {
  background: #e8ebdd;
}

.nav button[aria-current=page] {
  background: var(--pine);
  color: #f8f8e9;
}

.nav button[aria-current=page] .icon {
  color: var(--lime);
}

.logout {
  margin-top: auto;
  font-size: 14px;
  color: var(--muted);
}

.logout .icon {
  width: 19px;
  height: 19px;
}

.main {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(28px,3.6vw,64px);
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 27px;
}

.page-head h1 {
  font-size: clamp(32px,3.4vw,49px);
  line-height: 1.2;
  letter-spacing: -.055em;
}

.page-head .date-label {
  margin-top: 8px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin: 22px 0;
}

.quick {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 17px;
  box-shadow: var(--shadow);
  text-align: left;
  min-height: 75px;
}

.quick:hover,.record:hover {
  border-color: #a5b99f;
}

.quick strong {
  font-weight: 680;
  font-size: 16px;
}

.quick>.icon:last-child {
  margin-left: auto;
  width: 17px;
  color: var(--muted);
}

.kind-icon {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: #e2ecc7;
  color: #325b36;
  display: grid;
  place-items: center;
  flex: none;
}

.kind-icon.glucose,.key.glucose {
  background: #dce9ac;
  color: #325730;
}

.kind-icon.meal,.key.meal {
  background: #f7dbbd;
  color: #794525;
}

.kind-icon.med,.key.med {
  background: #dfe8f1;
  color: #3b5f76;
}

.overview-top {
  display: grid;
  grid-template-columns: minmax(220px,.78fr) minmax(340px,1.42fr);
  gap: 17px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 23px;
  min-width: 0;
}

.card h2,.section-head h2 {
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.04em;
}

.cardhead,.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.micro,.chart-note,.muted {
  font-size: 13px;
  color: var(--muted);
}

.reading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #1c4b3b;
  color: #fffde7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-color: #1c4b3b;
  padding: 25px;
}

.reading:before,.reading:after {
  content: "";
  position: absolute;
  border: 1px solid #e2ee9e22;
  width: 275px;
  height: 275px;
  border-radius: 50%;
  z-index: -1;
  right: -150px;
  bottom: -200px;
}

.reading:after {
  width: 350px;
  height: 350px;
  right: -160px;
  bottom: -215px;
}

.reading h2 {
  font-size: 18px;
}

.reading .icon {
  color: #dfeba6;
}

.reading-val {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 17px 0 9px;
}

.reading-val strong {
  color: var(--lime);
  font-size: clamp(56px,5.3vw,82px);
  letter-spacing: -.065em;
  line-height: 1.1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.reading-val span {
  font-size: 14px;
  color: #d5e4cc;
}

.reading-info {
  color: #dfebd3;
  font-size: 14px;
}

.reading .btn {
  align-self: flex-start;
  margin-top: 20px;
  background: #e0eca4;
  color: #234634;
  border: 0;
}

.plotbox {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 11px 0 4px;
}

.plotbox svg.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart text {
  fill: #637167;
  font-family: system-ui,sans-serif;
  font-size: 13px;
}

.chart .gridline {
  stroke: #dce2d6;
  stroke-dasharray: 3 4;
}

.chart .point {
  fill: #2a674b;
  stroke: #fffef8;
  stroke-width: 1.8;
}

.chart .point.low {
  fill: #be562d;
}

.chart-note {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-note::before {
  content: "";
  border-radius: 50%;
  width: 7px;
  height: 7px;
  background: #2a674b;
}

.chart-empty {
  border: 1px dashed #d2d9c9;
  border-radius: 14px;
  width: 100%;
  min-height: 145px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  background: linear-gradient(to bottom,#f5f7ee44,#f3f5e966);
}

.chart-empty .icon {
  color: #759462;
  width: 27px;
  height: 27px;
}

.timeline-card {
  margin-top: 17px;
}

.textbtn {
  padding: 8px 3px;
  background: transparent;
  color: #3c614b;
  font-size: 14px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.textbtn .icon {
  width: 16px;
  height: 16px;
}

.records {
  display: grid;
}

.record {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 13px 2px;
  min-height: 67px;
  border-bottom: 1px solid var(--line);
}

.record:last-child {
  border-bottom: 0;
}

.record .kind-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.record .kind-icon .icon {
  width: 19px;
  height: 19px;
}

.record b,.record small {
  display: block;
  overflow-wrap: anywhere;
}

.record b {
  font-size: 16px;
  line-height: 1.45;
}

.record small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.record time {
  font-size: 14px;
  font-weight: 600;
  color: #5b6c61;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-empty {
  padding: 30px 0 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #edf0e3;
  display: grid;
  place-items: center;
  flex: none;
}

.timeline-empty strong {
  display: block;
  color: var(--green);
  font-weight: 650;
}

.timeline-empty p {
  margin-top: 3px;
  font-size: 14px;
}

.pillgroup {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  background: #eaede0;
  border-radius: 12px;
  padding: 4px;
  gap: 3px;
  flex-wrap: wrap;
}

.pillgroup button {
  border-radius: 9px;
  background: transparent;
  padding: 7px 12px;
  font-size: 14px;
  color: #54665a;
}

.pillgroup button[aria-pressed=true] {
  background: var(--surface);
  color: var(--green);
  font-weight: 680;
  box-shadow: 0 1px 4px #1c3b241a;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.history-filters label {
  font-size: 14px;
  color: var(--muted);
}

.history-filters input {
  min-height: 41px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 5px 7px;
  max-width: 100%;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  line-height: 1.4;
  margin: 26px 0 9px;
}

.group-title small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.record-panel {
  padding: 3px 20px;
}

.history-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0;
}

.history-count {
  font-size: 14px;
  color: var(--muted);
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 13px;
  margin: 14px 0;
}

.metric h2 {
  font-size: 15px;
  color: #5d7062;
  font-weight: 620;
}

.metric strong {
  display: inline-block;
  font-size: clamp(30px,3.4vw,53px);
  line-height: 1.22;
  font-weight: 640;
  letter-spacing: -.045em;
  margin: 13px 5px 2px 0;
}

.metric span {
  font-size: 13px;
  color: var(--muted);
}

.metric:first-child {
  background: #e4edbd;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(230px,.65fr);
  gap: 15px;
}

.analysis-grid .plotbox {
  min-height: 170px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 14px;
}

.list-row:last-child {
  border: 0;
}

.insight {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.insight:last-child {
  border: 0;
  padding-bottom: 0;
}

.insight .icon {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: #5d7b46;
}

.insight.attention .icon,.insight.urgent .icon {
  color: #ab4d2c;
}

.insight.urgent strong {
  color: #94381e;
}

.insight p {
  font-size: 15px;
  color: #516458;
  margin-top: 4px;
}

.ref-note {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 2px 0;
  line-height: 1.65;
}

.page-error .btn {
  margin-left: 9px;
}

.loading-inline {
  color: var(--muted);
  padding: 24px 0;
}

#toast {
  position: fixed;
  bottom: max(24px,env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: 12px 20px;
  border-radius: 12px;
  background: #163c31;
  color: #fffbe9;
  box-shadow: 0 8px 25px #1d3b3433;
  max-width: 90vw;
  width: max-content;
  font-size: 15px;
}

@media(min-width:1550px) {
  .login-grid {
    flex: none;
    height: 740px;
    margin-top: 24px;
  }
  .shell {
    --side: 250px;
  }
  .sidebar {
    padding: 42px 28px;
  }
  .main {
    padding: 55px 62px;
  }
  .card {
    padding: 29px;
  }
  .overview-top {
    gap: 22px;
  }
  .record-panel {
    padding: 4px 24px;
  }
}

@media(max-width:1100px) {
  .shell {
    --side: 174px;
  }
  .sidebar {
    padding: 30px 13px;
  }
  .main {
    padding: 30px 23px;
  }
  .quick {
    gap: 8px;
    padding: 12px;
  }
  .quick strong {
    font-size: 15px;
  }
  .cover {
    min-height: 500px;
  }
  .login-grid {
    grid-template-columns: minmax(340px,1.05fr) minmax(325px,.95fr);
  }
  .login-side {
    padding: 30px 6%;
  }
  .overview-top {
    grid-template-columns: minmax(190px,.83fr) minmax(260px,1.17fr);
  }
  .card {
    padding: 18px;
  }
  .record-panel {
    padding: 2px 16px;
  }
  .analysis-grid {
    grid-template-columns: minmax(0,1.2fr) minmax(200px,.8fr);
  }
}

@media(max-width:770px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    padding: 14px 20px 0;
    background: var(--paper);
    border: 0;
  }
  .sidebar .brand {
    padding: 0;
  }
  .sidebar .brand-copy {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .sidebar .brandmark {
    width: 37px;
    height: 37px;
  }
  .sidebar .brand-copy strong {
    font-size: 25px;
  }
  .nav {
    display: flex;
    grid-column: 1/-1;
    order: 3;
    margin: 14px 0 0;
    gap: 5px;
    padding: 4px;
    border-radius: 12px;
    background: #e9eddf;
  }
  .nav button {
    flex: 1;
    justify-content: center;
    min-height: 40px;
    padding: 7px 3px;
    gap: 6px;
    font-size: 14px;
    border-radius: 9px;
  }
  .nav button .icon {
    width: 17px;
    height: 17px;
  }
  .logout {
    margin: 0;
    padding: 6px;
    min-height: 40px;
    gap: 5px;
    font-size: 13px;
  }
  .main {
    padding: 24px 20px 40px;
  }
  .login-header {
    min-height: 80px;
  }
  .login-page {
    padding: 0 20px;
  }
  .login-grid {
    grid-template-columns: minmax(260px,1fr) minmax(280px,1fr);
    min-height: 470px;
    margin-bottom: 32px;
  }
  .cover {
    min-height: 470px;
    padding: 26px;
  }
  .cover h2 {
    font-size: 43px;
  }
  .meter {
    right: 20%;
    bottom: 19%;
    width: 38cqw;
  }
  .cover-caption {
    font-size: 11px;
    gap: 7px;
  }
  .cover-caption i {
    width: 14px;
  }
  .login-side {
    padding: 25px 0 25px 25px;
  }
  .page-head {
    margin-bottom: 18px;
  }
  .analysis-metrics {
    gap: 9px;
  }
  .quick-grid {
    gap: 9px;
  }
  .quick>.icon:last-child {
    display: none;
  }
  .quick strong {
    font-size: 15px;
  }
  .record-panel {
    padding: 2px 16px;
  }
}

@media(max-width:600px) {
  .login-page {
    padding: 0 19px;
    max-width: 460px;
  }
  .login-header {
    min-height: 69px;
  }
  .login-header .brandmark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .login-header .brand-copy {
    gap: 9px;
  }
  .login-header .brand-copy strong {
    font-size: 25px;
  }
  .login-header .brand-copy small {
    font-size: 12px;
  }
  .login-header .date-label {
    font-size: 12px;
  }
  .login-header .date-label .icon {
    display: none;
  }
  .login-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    justify-content: flex-start;
    gap: 0;
    margin: 0 0 32px;
    flex: none;
  }
  .cover {
    min-height: 208px;
    height: clamp(200px,32vh,255px);
    border-radius: 23px;
    padding: 24px 20px;
  }
  .cover h2 {
    font-size: clamp(37px,10.8vw,51px);
    line-height: 1.14;
  }
  .cover-caption {
    font-size: 12px;
    letter-spacing: 0;
    max-width: 53%;
    gap: 6px;
  }
  .cover-caption i {
    flex: none;
    width: 12px;
  }
  .instrument-art {
    inset: 0;
  }
  .meter {
    width: 25cqw;
    right: 18%;
    bottom: 21%;
    max-width: 112px;
  }
  .swatch {
    width: 7cqw;
    right: 6%;
    bottom: 25%;
  }
  .orbit {
    width: 48%;
    bottom: 4%;
    right: -4%;
  }
  .orbit.two {
    width: 68%;
    right: -11%;
    bottom: -10%;
  }
  .meter-unit {
    font-size: 7px;
  }
  .meter-screen {
    border-width: 2px;
  }
  .meter-button:after {
    border-width: 1px;
  }
  .login-side {
    padding: 27px 4px 18px;
    justify-items: stretch;
  }
  .login-content {
    max-width: none;
  }
  .login-icon {
    display: none;
  }
  .login-content h1 {
    font-size: 30px;
  }
  .login-content>p {
    margin: 7px 0 19px;
    font-size: 15px;
  }
  .login-foot {
    margin-top: 12px;
  }
  .sidebar {
    padding: 13px 14px 0;
  }
  .main {
    padding: 22px 14px 35px;
  }
  .page-head h1 {
    font-size: 32px;
  }
  .date-label {
    font-size: 13px;
  }
  .overview-top {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    border-radius: 17px;
    padding: 17px;
  }
  .reading {
    min-height: 155px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0;
  }
  .reading .cardhead {
    grid-column: 1/-1;
  }
  .reading-val {
    margin: 9px 0 3px;
  }
  .reading-val strong {
    font-size: 60px;
  }
  .reading-info {
    grid-column: 1;
    grid-row: 3;
    font-size: 13px;
    max-width: 100%;
  }
  .reading .btn {
    grid-column: 2;
    grid-row: 2/4;
    align-self: center;
    margin: 0;
    padding: 8px 12px;
    font-size: 14px;
  }
  .quick-grid {
    gap: 7px;
    margin: 13px 0;
  }
  .quick {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 79px;
    padding: 8px 2px;
    border-radius: 13px;
  }
  .quick .kind-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .quick .kind-icon .icon {
    width: 17px;
    height: 17px;
  }
  .quick strong {
    font-size: 14px;
  }
  .timeline-card {
    margin-top: 12px;
  }
  .plotbox {
    min-height: 120px;
  }
  .chart-empty {
    min-height: 115px;
  }
  .card h2,.section-head h2 {
    font-size: 19px;
  }
  .reading h2 {
    font-size: 16px;
  }
  .analysis-metrics {
    gap: 6px;
  }
  .metric {
    padding: 12px 9px;
  }
  .metric h2 {
    font-size: 12px;
    line-height: 1.4;
  }
  .metric strong {
    font-size: 28px;
    margin: 9px 2px 0 0;
  }
  .metric span {
    font-size: 11px;
  }
  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .analysis-grid .plotbox {
    min-height: 130px;
  }
  .pillgroup button {
    font-size: 13px;
    min-height: 34px;
    padding: 5px 9px;
  }
  .page-head>.pillgroup {
    flex-shrink: 0;
  }
  .history-filters {
    gap: 7px;
  }
  .history-filters .pillgroup button {
    min-height: 38px;
    padding: 6px 10px;
  }
  .record {
    grid-template-columns: 36px minmax(0,1fr) auto;
    gap: 9px;
  }
  .record-panel {
    padding: 2px 12px;
  }
  .group-title {
    margin-top: 18px;
  }
  .chart-note {
    font-size: 12px;
  }
}

@media(max-width:350px) {
  .login-page {
    padding: 0 13px;
  }
  .quick strong,.nav button {
    font-size: 13px;
  }
  .login-header .date-label {
    font-size: 11px;
  }
  .reading-val strong {
    font-size: 49px;
  }
  .sidebar {
    padding: 11px 10px 0;
  }
  .main {
    padding: 20px 10px;
  }
  .metric span {
    display: block;
  }
  .history-filters .pillgroup button {
    padding: 4px 7px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}
