/* Hallmark · shape: app screen · genre: editorial · theme: Ink (by request) · redesign: cards
 * nav: a top bar, the wordmark over a live count, search and two controls at the end · signature: each portal is one card sized by its content; the front says what the service is and what it is using right now, the back turns over under the pointer to the detail and the start / stop / restart controls · states: loading, empty, error, full, editing · ink: paper
 * axes: light/grotesk-sans/chromatic-teal · posture: restrained · contrast: pass · v3.0.0 */
/* Hallmark · waive 22 · ink and greys at zero chroma · a notice board is printed in plain black, so the launcher keeps that ink */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --radius-control: 10px;
  --shell: 68rem;
  --logo: 7.25rem; /* the size of the mark bled off each card's corner */
  /* the page ground: one soft diagonal wash, peach to butter to mint to sky, no purple in it and no glow */
  --wash-1: oklch(94% 0.05 55);
  --wash-2: oklch(96% 0.06 95);
  --wash-3: oklch(95% 0.05 165);
  --wash-4: oklch(94% 0.05 230);
  --control-h: var(--space-xl);
  --mark-size: 48px;
  /* each card takes the hue of its own mark: a pale front, a deep back, the lightness and chroma fixed so the ink always reads */
  --tint-l: 96%; --tint-c: 0.035; --tint-back-l: 27%; --tint-back-c: 0.09;
  --card-pad: var(--space-md);
}

body {
  min-height: 100dvh;
  background-color: var(--wash-2);
  background-image: linear-gradient(155deg, var(--wash-1) 0%, var(--wash-2) 34%, var(--wash-3) 68%, var(--wash-4) 100%);
  background-repeat: no-repeat;
  background-size: cover;
}
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding: var(--space-xl) var(--gutter) var(--space-2xl); }

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-md) var(--space-lg); margin-bottom: var(--space-lg); }
.top h1 { max-width: none; font-size: var(--text-3xl); }
.brand { display: flex; align-items: center; gap: var(--space-sm); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.summary { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); min-height: 1.4em; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }

.field {
  height: var(--control-h); min-width: 0; width: 14rem; padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-control);
  background: var(--color-paper); color: var(--color-ink);
  transition: border-color var(--dur-micro) var(--ease-out);
}
.field::placeholder { color: var(--color-muted); }
.field:hover { border-color: var(--color-ink); }
.field:disabled { opacity: 0.5; cursor: not-allowed; }
.field--sm { width: 100%; height: 32px; font-size: var(--text-sm); }

.btn {
  height: var(--control-h); padding: 0 var(--space-md); white-space: nowrap; cursor: pointer;
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control);
  background: var(--color-paper); color: var(--color-ink); font-weight: 600;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-paper-3); }
.btn:active { background: var(--color-rule); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--sm { height: 32px; padding: 0 var(--space-sm); font-size: var(--text-sm); }
.btn--warn { border-color: var(--color-error); color: var(--color-error); }
body.editing #edit { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }

/* ---- cards: one flat grid, every card sized by its content, the cards in a row as tall as the tallest ----
 * the front is one big link that opens the service in a new window; the back is a panel with the detail and the buttons, and it turns over under the mouse.
 * on a phone there is no hover, so a small "정보" button at the card's lower right turns it over instead */
.sheet { margin: 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.cards > li { position: relative; min-width: 0; perspective: 1400px; }
/* both faces sit in the same grid cell, so the card is as tall as the taller face and still turns over */
.flip { display: grid; height: 100%; transform-style: preserve-3d; transition: transform var(--dur-long) var(--ease-out); }
.face {
  grid-area: 1 / 1; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--space-sm);
  min-width: 0; min-height: max(13.5rem, calc(var(--logo) + 2.25rem)); padding: var(--card-pad);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.front { background: var(--color-paper); color: var(--color-ink); }
.back { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); transform: rotateY(180deg); }
.tinted .front { background: oklch(var(--tint-l) var(--tint-c) var(--hue)); }
.tinted .back { background: oklch(var(--tint-back-l) var(--tint-back-c) var(--hue)); border-color: oklch(var(--tint-back-l) var(--tint-back-c) var(--hue)); }
.face--link { color: var(--color-ink); text-decoration: none; cursor: pointer; }
.face--link:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
/* the back is a panel, not a link; a see-through link is laid over it (under the buttons, which are siblings and not inside it),
 * so a click anywhere on the back opens the service while the buttons still work on their own */
.face-cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.b-actions { position: relative; z-index: 2; }

/* mouse: the card turns over under the pointer; the face that is facing away takes no clicks; the turn button is not needed */
@media (hover: hover) and (pointer: fine) {
  body:not(.editing) .cards > li:hover .flip, body:not(.editing) .cards > li:has(.back :focus-visible) .flip { transform: rotateY(180deg); }
  body:not(.editing) .cards > li:hover .front, body:not(.editing) .cards > li:has(.back :focus-visible) .front { pointer-events: none; }
  body:not(.editing) .cards > li:not(:hover):not(:has(.back :focus-visible)) .back { pointer-events: none; }
  .flip-btn { display: none; }
  .face--link { transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
  .face--link:hover { border-color: var(--color-ink); box-shadow: 0 8px 20px -12px color-mix(in oklch, var(--color-ink) 55%, transparent); }
}
/* touch and anything without a hover: the small button turns the card over; tapping the back does not open the service by accident */
@media not all and (hover: hover) and (pointer: fine) {
  .cards > li.is-flipped .flip { transform: rotateY(180deg); }
  .cards > li.is-flipped .front, .cards > li:not(.is-flipped) .back { pointer-events: none; }
  .face-cover { display: none; }
  .f-foot, .b-actions { padding-right: 4.5rem; }
}

/* the turn button: sits over the lower right corner of whichever face shows */
.flip-btn {
  position: absolute; right: var(--card-pad); bottom: var(--card-pad); z-index: 2; height: 28px; padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper); color: var(--color-ink); font-size: var(--text-xs); font-weight: 600; line-height: 1; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.flip-btn:hover { background: var(--color-paper-3); }

/* front: the site's mark as an app-icon shape bled off the upper right corner, the text on the left */
.logo {
  position: absolute; top: -0.875rem; right: -0.875rem; width: var(--logo); aspect-ratio: 1 / 1; overflow: hidden;
  display: grid; place-items: center; border-radius: 22%; pointer-events: none;
}
.logo--letter { background: var(--color-ink); color: var(--color-paper); font-size: calc(var(--logo) * 0.42); font-weight: 700; }
.logo--emoji { background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); font-size: calc(var(--logo) * 0.47); line-height: 1; }
.logo--photo img { width: 100%; height: 100%; object-fit: cover; }
.logo--icon { background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); }
.logo--icon img { width: 58%; height: 58%; object-fit: contain; }
/* the text column is at least as tall as the part of the mark that shows, so the mark ends above the usage line instead of covering it */
.f-text { position: relative; z-index: 1; min-width: 0; max-width: calc(100% - var(--logo) + 0.375rem + var(--card-pad)); min-height: calc(var(--logo) - 0.875rem - var(--card-pad) + 0.5rem); }
.name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: var(--text-xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  word-break: keep-all; overflow-wrap: anywhere;
}
.f-text .host { margin-top: var(--space-2xs); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--color-muted); font-size: var(--text-xs); }
.desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: var(--space-xs) 0 0;
  color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere;
}
.f-text .use { margin-top: var(--space-xs); }

/* front, lower half: what the service is using right now, then the state and who uses it */
.f-bottom { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-sm); margin-top: auto; }
.f-res { padding-top: var(--space-sm); border-top: var(--rule-hair) solid var(--color-rule); }
.f-res[hidden] { display: none; }
.res-top { display: flex; align-items: baseline; gap: var(--space-xs); }
.res-label { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.res-val { margin-left: auto; font-size: var(--text-lg); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.res-pct { min-width: 3.2em; text-align: right; color: var(--color-ink-2); font-size: var(--text-xs); }
.f-res .gauge { margin-top: var(--space-2xs); }
.res-sub { margin-top: var(--space-2xs); color: var(--color-ink-2); font-size: var(--text-xs); }
.f-res.is-off .res-val { color: var(--color-muted); font-size: var(--text-md); }
.f-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); min-height: 28px; }
body.editing .f-foot { padding-right: 0; justify-content: space-between; }
.f-foot .host { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--color-muted); font-size: var(--text-xs); }

/* editing: small mark, name and line in fields */
.f-head { display: flex; align-items: center; gap: var(--space-sm); }
.mark {
  width: var(--mark-size); height: var(--mark-size); flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: var(--radius-control); background: var(--color-ink); color: var(--color-paper);
  font-size: var(--text-lg); font-weight: 700;
}
.mark.img { background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); }
.mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.f-title { min-width: 0; flex: 1; }

/* back: ink, the address, what the record says, the container detail, then the buttons along the bottom */
.back .name-small { color: var(--color-paper-3); font-size: var(--text-sm); font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.b-addr { font-size: var(--text-md); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.b-lines { display: grid; gap: 2px; color: var(--color-paper-3); font-size: var(--text-xs); line-height: 1.5; }
.meter { height: 6px; margin-top: var(--space-xs); overflow: hidden; border-radius: var(--radius-pill); background: color-mix(in oklch, var(--color-paper) 28%, transparent); }
.meter span { display: block; height: 100%; width: calc(var(--w) * 1%); border-radius: var(--radius-pill); background: var(--color-paper); }
.b-detail { padding-top: var(--space-sm); border-top: var(--rule-hair) solid color-mix(in oklch, var(--color-paper) 25%, transparent); }
.b-detail[hidden] { display: none; }
.b-live { white-space: pre-line; color: var(--color-paper); font-size: var(--text-xs); line-height: 1.55; }
.cu-hint { margin-top: var(--space-xs); color: var(--color-paper-3); font-size: var(--text-xs); }
.b-users { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); }
.b-users-label { color: var(--color-paper-3); font-size: var(--text-xs); }
.b-user { color: var(--color-paper); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.b-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-top: auto; }
.b-ctl { display: contents; }
.back .btn--sm { height: 30px; }
.back .btn--open { display: inline-flex; align-items: center; background: var(--color-paper); color: var(--color-ink); text-decoration: none; }
.back .btn--warn { background: transparent; border-color: color-mix(in oklch, var(--color-paper) 60%, transparent); color: var(--color-paper); }
.back .btn:not(.btn--open):not(.btn--warn) { background: transparent; border-color: color-mix(in oklch, var(--color-paper) 60%, transparent); color: var(--color-paper); }

/* the mark grows with the screen: big on a wide screen (cards get wider with it, two across), as it was on a tablet, smaller on a phone */
@media (min-width: 64rem) {
  :root { --logo: 11rem; --card-pad: var(--space-lg); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr)); gap: var(--space-lg); }
  .name { font-size: var(--text-2xl); }
  .desc { font-size: var(--text-md); }
  .f-text .host { font-size: var(--text-sm); }
}
/* 큰 화면: 화면 폭을 더 쓰고 카드를 3열, 아주 큰 화면은 4열로 */
@media (min-width: 90rem) {
  :root { --shell: 88rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 120rem) {
  :root { --shell: 112rem; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* 태블릿 세로(40~64rem): 카드 2열, 작은 아이콘 */
@media (min-width: 40.01rem) and (max-width: 63.99rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
}
@media (max-width: 40rem) {
  :root { --logo: 8.5rem; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .face { min-height: 14rem; }
  .name { font-size: var(--text-lg); }
}
/* 아주 작은 폰: 아이콘은 크게 유지하되 카드 여백만 줄임 */
@media (max-width: 24rem) {
  :root { --logo: 7.5rem; --card-pad: var(--space-sm); }
  .top h1 { font-size: var(--text-2xl); }
  .tools .btn { flex: 1 1 auto; }
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
  .login .field { width: 100%; }
}
@media (pointer: coarse) {
  .flip-btn { height: 36px; padding: 0 var(--space-md); }
  .back .btn--sm { height: 40px; }
}


/* state tags: in is pale teal, out is an outline, nothing else carries state */
.pill {
  display: inline-flex; flex: none; align-items: center; gap: var(--space-2xs); height: 22px; padding: 0 var(--space-xs);
  border-radius: var(--radius-pill); background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
  color: var(--color-ink); font-size: var(--text-xs); font-weight: 600; line-height: 1; white-space: nowrap;
}
/* the live state as a signal icon: teal arcs when it answers, grey arcs struck through when it does not */
.wifi { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.wifi circle { fill: currentColor; stroke: none; }
.wifi .slash { stroke: var(--color-ink); }
.pill--in .wifi { color: var(--color-accent); }
.pill--out { color: var(--color-muted); }
.pill--out .wifi { color: var(--color-muted); }
.use { display: flex; align-items: center; gap: var(--space-2xs); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; line-height: 1; white-space: nowrap; }
.bars { width: 14px; height: 14px; flex: none; }
.bars rect { fill: var(--color-rule); }
.bars .on { fill: var(--color-ink); }

/* who uses it: small tags on the card, chips to switch them on while editing */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2xs); max-height: 24px; overflow: hidden; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-xs);
  border-radius: var(--radius-pill); background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
  color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}

/* loading: cards in the shape of what is coming */
.skel .face { pointer-events: none; }
.skel .mark { background: var(--color-paper-3); }
.bar { height: 14px; border-radius: var(--radius-pill); background: var(--color-paper-3); }
.bar + .bar { margin-top: var(--space-xs); }
.bar--name { width: 55%; }
.bar--host { width: 80%; }
.bar--desc { width: 90%; }

/* editing: the front only, fields for the name and the line, who uses it, which container it is */
.name-input {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-control);
  background: var(--color-paper); color: var(--color-ink); font-weight: 600;
  transition: border-color var(--dur-micro) var(--ease-out);
}
.name-input:hover { border-color: var(--color-ink); }
.name-input.saved { border-color: var(--color-accent); }
.name-input.error { border-color: var(--color-error); }
.picker { display: flex; flex-direction: column; gap: var(--space-2xs); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.family { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin: 0 0 var(--space-md); }
.family-label { font-size: var(--text-sm); font-weight: 600; }
.family-form { display: flex; gap: var(--space-xs); }
.family-form .field { width: 9rem; height: 32px; }
.family-form .btn { height: 32px; padding: 0 var(--space-sm); font-size: var(--text-sm); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); list-style: none; margin: 0; padding: 0; }
.people { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2xs); height: 28px; padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper); color: var(--color-ink); font-size: var(--text-sm); font-weight: 600; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.chip--plain { cursor: default; }
button.chip[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.chip-x { border: 0; background: none; color: var(--color-muted); font-size: var(--text-md); line-height: 1; cursor: pointer; }
.chip-x:hover { color: var(--color-ink); }
.is-hidden .face { opacity: 0.5; }

.hint, .msg { margin: 0 0 var(--space-md); color: var(--color-ink-2); font-size: var(--text-sm); }
.msg:empty { display: none; }
.foot { margin-top: var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }

/* ---- NAS status: a plain ruled sheet below the cards, ink on paper, one line of trend per metric ---- */
.sys { margin-top: var(--space-xl); padding: var(--space-md) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); }
.sys-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); }
.sys-title { margin: 0; font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; }
.sys-sub { color: var(--color-muted); font-size: var(--text-xs); }
.sys-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.sys-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.met { min-width: 0; padding: var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control); background: var(--color-paper-2); }
.met-label { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.met-value { margin-top: var(--space-2xs); font-size: var(--text-xl); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.met-detail { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-xs); line-height: 1.4; overflow-wrap: anywhere; }
.gauge { height: 6px; margin-top: var(--space-xs); overflow: hidden; border-radius: var(--radius-pill); background: var(--color-rule); }
.gauge span { display: block; height: 100%; width: calc(var(--w) * 1%); border-radius: var(--radius-pill); background: var(--color-ink); transition: width var(--dur-long) var(--ease-out); }
.gauge.warm span { background: var(--color-accent); }
.gauge.hot span { background: var(--color-error); }
.spark { display: block; width: 100%; height: 28px; margin-top: var(--space-xs); }
.spark-line { fill: none; stroke: var(--color-ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: var(--color-rule); opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .gauge span, .flip { transition: none; } }

/* login and password forms */
.login { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin: 0 0 var(--space-md); padding: var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control); background: var(--color-paper-2); }
.login-title { flex: 1 1 100%; margin: 0; color: var(--color-ink-2); font-size: var(--text-sm); }
.login .field { width: 11rem; }
.login-msg { flex: 1 1 100%; margin: 0; color: var(--color-error); font-size: var(--text-sm); }
.login-msg:empty { display: none; }

/* diagnosis and history: findings first, then who is using what, then what the record says about next time */
.diag, .hist { margin-top: var(--space-md); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.dg-find, .hist-pred, .hist-causes, .hist-list { list-style: none; margin: 0; padding: 0; }
.dg-item { padding: var(--space-xs) 0; }
.dg-item + .dg-item { border-top: var(--rule-hair) solid var(--color-rule); }
.dg-item-head { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-md); }
.dg-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-xs); border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-xs); font-weight: 600; flex: none; }
.dg-tag--bad { background: var(--color-error); color: var(--color-paper); }
.dg-bad .dg-tag { background: var(--color-error); color: var(--color-paper); }
.dg-warn .dg-tag { background: var(--color-ink); color: var(--color-paper); }
.dg-info .dg-tag { background: var(--color-accent-soft); color: var(--color-accent-soft-ink); }
.dg-detail { margin: var(--space-2xs) 0 0; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.5; overflow-wrap: anywhere; }
.dg-cols { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: var(--space-sm); }
.dg-col-title { margin-bottom: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.dg-row { display: flex; justify-content: space-between; gap: var(--space-sm); padding: 2px 0; font-size: var(--text-sm); }
.dg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-val { flex: none; color: var(--color-ink-2); }
.dg-disks { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-xs); overflow-wrap: anywhere; }
.diag > .sys-sub { margin-top: var(--space-sm); }
.dg-ctl { margin-top: var(--space-md); }
.ct-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control); background: var(--color-paper-2); }
.ct-row + .ct-row { margin-top: var(--space-xs); }
.ct-heavy { border-color: var(--color-error); }
.ct-info { min-width: 0; flex: 1 1 14rem; }
.ct-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-xs); font-size: var(--text-md); }
.ct-id { color: var(--color-muted); font-size: var(--text-xs); }
.ct-note { margin-top: 2px; color: var(--color-ink-2); font-size: var(--text-xs); overflow-wrap: anywhere; }
.ct-btns { display: flex; gap: var(--space-xs); flex: none; }
.hist-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-md); }
.hist-pred li { margin-bottom: var(--space-2xs); font-size: var(--text-md); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; align-items: end; height: 64px; margin: var(--space-sm) 0 var(--space-md); }
.hr { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.hr-bar { display: block; width: 100%; min-height: 2px; height: calc(var(--h) * 0.6%); border-radius: 2px; background: var(--color-ink); }
.hr-label { height: 12px; color: var(--color-muted); font-size: 10px; line-height: 12px; }
.hist-causes li, .hist-list li { padding: 2px 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.hist-causes { margin-bottom: var(--space-md); }
.hist-when { display: inline-block; min-width: 7.5rem; color: var(--color-muted); }

@media (max-width: 40rem) {
  .shell { padding-top: var(--space-lg); }
  .tools { width: 100%; }
  .field { flex: 1 1 0; width: auto; }
  .sys { padding: var(--space-md); }
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
  .ct-btns { width: 100%; }
  .hist-when { display: block; min-width: 0; }
}
/* 넓은 화면: NAS 상태 패널도 여유 있게 */
@media (min-width: 90rem) {
  .sys-grid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
  .sys { padding: var(--space-lg) var(--space-xl); }
}
/* 폰 가로 모드처럼 세로가 낮은 화면: 위아래 여백 축소 */
@media (max-height: 30rem) and (orientation: landscape) {
  .shell { padding-block: var(--space-md); }
  .top { margin-bottom: var(--space-md); }
}
@media (pointer: coarse) {
  .field, .btn, .name-input { height: 44px; }
  .btn--sm, .field--sm { height: 40px; }
}
