:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172d2b;
  background: #f5f7f6;
  line-height: 1.5;
  --ink: #172d2b;
  --muted: #536760;
  --line: #dce4df;
  --green: #116052;
  --white: #fff;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, form { margin: 0; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #008875;
  outline-offset: 4px;
}
.wrap { width: min(1040px, calc(100% - 64px)); margin-inline: auto; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead, .brand, .account, .page-heading, .page-actions, .refresh,
.computer-head, .identity, .storage-head, .legend, .legend span, .events summary {
  display: flex;
  align-items: center;
}
.masthead { min-height: 64px; gap: 16px; justify-content: space-between; }
.brand {
  gap: 10px;
  text-decoration: none;
  font-size: 19px;
  letter-spacing: -.045em;
  color: #3e5750;
  white-space: nowrap;
}
.brand strong { color: var(--ink); font-weight: 750; }
.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 29px;
  height: 29px;
  padding-bottom: 8px;
  border-radius: 8px;
  background: var(--green);
}
.brand-mark i { display: block; width: 3px; height: 6px; border-radius: 1px; background: white; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 15px; }
.account { gap: 16px; min-width: 0; font-size: 13px; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.signout {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 3px 0 3px 16px;
  color: var(--green);
  background: transparent;
  font-weight: 650;
}
.signout:hover { text-decoration: underline; text-underline-offset: 4px; }

.overview { padding-block: 42px 72px; }
.page-heading { justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: clamp(30px, 3.5vw, 42px); font-weight: 700; line-height: 1.15; letter-spacing: -.05em; }
.page-actions { gap: 16px; }
.cadence { font-size: 13px; color: var(--muted); }
.refresh {
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  background: var(--white);
  color: #284d42;
  text-decoration: none;
  font-size: 14px;
  font-weight: 630;
}
.refresh:hover { background: #eaf1ed; border-color: #a8bfb4; }
.refresh-icon { font: 22px/1 Arial, sans-serif; }
.cards { display: grid; gap: 20px; }

.computer, .notice, .signin {
  border: 1px solid #d6e0da;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 3px 12px -6px #233e322b;
}
.computer { min-width: 0; }
.computer-head {
  justify-content: space-between;
  gap: 20px;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
}
.identity { gap: 13px; min-width: 0; }
.identity h2 { overflow-wrap: anywhere; font-size: 21px; line-height: 1.25; letter-spacing: -.035em; }
.platform, .label { color: var(--muted); font-size: 13px; }
.platform { display: block; margin-top: 2px; }
.device-icon {
  position: relative;
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid #d4e4dc;
  border-radius: 11px;
  background: #eef5f0;
  color: #386356;
}
.device-icon::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 9px;
  width: 20px;
  height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}
.device-icon::after {
  content: "";
  position: absolute;
  top: 29px;
  left: 15px;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.last-check { flex: 0 0 auto; display: grid; gap: 2px; text-align: right; font-size: 13px; }
.last-check time { color: #304941; font-weight: 550; font-variant-numeric: tabular-nums; }

.reading {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  padding: 23px 24px;
}
.reading.no-reading { grid-template-columns: 1fr; }
.finding {
  display: flex;
  align-items: flex-start;
  align-self: center;
  gap: 13px;
  min-width: 0;
}
.finding h3 { font-size: clamp(21px, 2vw, 26px); line-height: 1.22; letter-spacing: -.04em; }
.finding p { margin-top: 8px; max-width: 44ch; color: #4d6159; font-size: 15px; line-height: 1.55; }
.no-reading .finding p { max-width: 65ch; }
.signal {
  display: grid;
  flex: 0 0 33px;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #e5efeb;
  color: #365c4d;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
}
.state-warn .signal { background: #ffebc7; color: #814408; }
.state-good .signal { background: #dcefe3; color: #246744; }
.state-unknown .signal, .state-paused .signal { background: #e8edf0; color: #475e6a; }

.storage {
  min-width: 0;
  padding: 18px 21px;
  border-radius: 11px;
  color: #f5faf6;
  background: #183b34;
  --capacity: #84dfb5;
  --occupied: #55726a;
}
.state-warn .storage { --capacity: #ffcf78; }
.storage-head { gap: 8px; }
.storage-head h3 { font-size: 13px; font-weight: 600; color: #d3e6db; }
.storage code {
  border: 1px solid #56736a;
  border-radius: 4px;
  padding: 0 5px;
  color: #e0ede5;
  font: 12px/1.45 ui-monospace, monospace;
}
.amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 9px;
  margin-block: 5px 12px;
  color: #d2e3d9;
  font-size: 13px;
}
.amount strong { color: white; font-size: clamp(34px, 3.3vw, 43px); font-weight: 650; letter-spacing: -.055em; line-height: 1.1; }
.amount small { font-size: .47em; font-weight: 550; letter-spacing: -.025em; }
.storage meter {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: var(--occupied);
}
.storage meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: 4px; background: var(--occupied); }
.storage meter::-webkit-meter-optimum-value { border-radius: 4px; background: var(--capacity); }
.storage meter::-moz-meter-bar { border-radius: 4px; background: var(--capacity); }
.legend { gap: 15px; margin-top: 8px; color: #e3efe7; font-size: 12px; }
.legend span { gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--capacity); }
.legend span:last-child i { background: var(--occupied); border: 1px solid #95aaa1; }
.legend b { font-weight: 650; }

.events { border-top: 1px solid var(--line); }
.events summary {
  justify-content: space-between;
  gap: 12px;
  min-height: 47px;
  padding: 10px 24px;
  list-style: none;
  border-radius: 0 0 16px 16px;
  color: #344e44;
  font-size: 14px;
  font-weight: 600;
}
.events summary::-webkit-details-marker { display: none; }
.events summary:hover { background: #f4f8f5; }
.events summary b {
  display: inline-block;
  min-width: 20px;
  margin-left: 4px;
  border-radius: 5px;
  background: #edf2ed;
  color: #456354;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}
.chevron {
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.events[open] .chevron { transform: rotate(225deg); }
.events ul { list-style: none; padding: 0 24px 14px; margin: 0; }
.events li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 18px; padding: 9px 0; font-size: 14px; overflow-wrap: anywhere; }
.events li + li { border-top: 1px solid #edf1ed; }
.event-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

.notice, .signin { padding: 28px; }
.notice { max-width: 680px; }
.notice .device-icon { margin-bottom: 15px; }
.notice h2 { font-size: 23px; letter-spacing: -.035em; }
.notice p, .intro { margin-top: 7px; color: var(--muted); }
.login-page { padding-block: clamp(34px, 9vh, 96px) 50px; }
.signin { width: min(100%, 410px); margin-inline: auto; }
.signin h1 { font-size: 30px; }
.signin .field-hint { margin: 4px 0; color: var(--muted); font-size: 13px; }
.password-entry { display: flex; gap: 6px; }
.password-entry input { min-width: 0; }
.password-entry button { padding-inline: 10px; border: 1px solid #a8bcb1; border-radius: 7px; background: white; color: var(--green); font: inherit; font-size: 14px; }
.signin strong { overflow-wrap: anywhere; }
.signin label { display: block; margin-top: 19px; margin-bottom: 5px; font-size: 14px; font-weight: 630; }
.signin input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #a8bcb1; border-radius: 7px; color: var(--ink); background: var(--white); }
.primary { width: 100%; min-height: 44px; margin-top: 22px; border: 0; border-radius: 7px; background: var(--green); color: white; font-weight: 650; }
.primary:hover { background: #0d4d41; }
.error { margin-top: 16px; color: #94342b; }

@media (max-width: 780px) {
  .wrap { width: calc(100% - 40px); }
  .cadence { display: none; }
  .reading { gap: 18px; padding: 20px; }
  .computer-head { padding: 17px 20px; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .masthead { min-height: 57px; }
  .brand { gap: 7px; font-size: 17px; }
  .brand-mark { width: 25px; height: 25px; padding-bottom: 6px; }
  .account { gap: 8px; font-size: 12px; }
  .account-name { max-width: 19ch; }
  .signout { min-height: 40px; padding-left: 9px; }
  .overview { padding-block: 26px 42px; }
  .page-heading { gap: 8px; margin-bottom: 16px; }
  h1 { font-size: clamp(24px, 6.8vw, 33px); }
  .refresh { min-height: 40px; padding: 6px 9px; font-size: 13px; }
  .computer-head { align-items: flex-start; flex-direction: column; gap: 13px; padding: 17px; }
  .identity h2 { font-size: 20px; }
  .last-check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; text-align: left; }
  .reading { grid-template-columns: 1fr; gap: 17px; padding: 18px 17px; }
  .finding { gap: 10px; }
  .finding h3 { font-size: 22px; }
  .finding p { margin-top: 4px; }
  .storage { padding: 16px; }
  .amount { margin-block: 6px 12px; }
  .events summary { padding-inline: 17px; }
  .events ul { padding-inline: 17px; }
  .events li { flex-direction: column; gap: 2px; }
}
@media (max-width: 500px) {
  .refresh { width: 42px; min-height: 42px; padding: 0; }
  .refresh-word { display: none; }
}
@media (max-width: 380px) {
  .account-name { max-width: 8ch; }
  .refresh { gap: 4px; }
}

.account-meta { min-width: 0; text-align: right; }
.account-meta .account-name, .account-role { display: block; }
.account-role { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.connect-action, .secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
  line-height: 1.35; font-family: inherit; font-size: 14px; font-weight: 650;
  background: var(--green); color: white; text-decoration: none; text-align: center;
}
.connect-action:hover { background: #0d4d41; }
.secondary { background: white; color: var(--green); border-color: #b6c9be; }
.secondary[hidden] { display: none; }
.operator-heading { flex-wrap: wrap; }
.operator-heading .cadence { display: none; }
.device-actions { padding: 11px 24px; border-top: 1px solid var(--line); }
.device-actions a, .back, .text-action { color: var(--green); font-size: 14px; font-weight: 620; text-underline-offset: 3px; }
.workflow { max-width: 660px; padding-block: 30px 64px; }
.back { display: inline-block; margin-bottom: 16px; }
.workflow h1 { overflow-wrap: anywhere; }
.operation-panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-top: 18px; }
.operation-panel h2 { font-size: 20px; letter-spacing: -.025em; }
.operation-panel p { margin: 8px 0; color: var(--muted); }
.operation-panel .success, #copy-result { color: var(--green); }
.operation-panel .error, .errorlist { color: #94342b; }
.field { margin-bottom: 18px; }
.field label, .grant-form label { display: block; font-size: 14px; font-weight: 620; margin-bottom: 5px; }
.operation-panel select, .operation-panel input:not([type=hidden]) {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; font: inherit;
  border: 1px solid #a8bcb1; border-radius: 7px; background: white; color: var(--ink);
}
.copy-row { display: flex; align-items: stretch; gap: 8px; margin-top: 6px; }
.copy-row button { flex-shrink: 0; }
.grants { padding: 0; margin: 12px 0; list-style: none; }
.grants li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; overflow-wrap: anywhere; }
.text-action { border: 0; background: transparent; text-decoration: underline; padding: 8px 0; }
.grant-form { margin-top: 16px; }
#copy-result { font-size: 14px; }
@media (max-width: 650px) {
  .operator-heading .page-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .account-meta .account-name { max-width: none; }
  .operation-panel { padding: 17px; }
  .device-actions { padding-inline: 17px; }
  .copy-row { flex-wrap: wrap; }
  .copy-row button { width: 100%; }
}
