/*
 * TunesBiz Devices — dashboard styles (docs/issues/022_dashboard_redesign).
 * Tokens and component classes follow the Nocturne design system and the
 * Claude Design prototype "TunesBiz Devices v2" (references/, not in git).
 * Fonts come from the OS (the CSP does not allow web fonts from a CDN).
 * Colors carry state only (ok / warn / err / acked); the accent marks actions.
 */

/* --- Tokens: dark (default) ------------------------------------------------ */
:root,
[data-tb-theme="dark"] {
  color-scheme: dark;
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);
  --color-neutral-100: #f3f5fe;
  --color-neutral-300: #cfd3e5;
  --color-neutral-500: #9397ab;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;
  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;
  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0, 0, 0, 0.65);

  --ok-fg: oklch(0.78 0.11 155);
  --ok-bg: oklch(0.30 0.045 155);
  --warn-fg: oklch(0.84 0.12 78);
  --warn-bg: oklch(0.33 0.055 70);
  --warn-soft: oklch(0.33 0.055 70 / 0.55);
  --warn-ink: oklch(0.89 0.09 80);
  --err-fg: oklch(0.78 0.14 25);
  --err-bg: oklch(0.33 0.08 25);
  --err-soft: oklch(0.33 0.08 25 / 0.6);
  --err-hover: oklch(0.33 0.08 25 / 0.5);
  --err-ink: oklch(0.88 0.08 25);
  --err-ink2: oklch(0.83 0.06 25);
  --acked-fg: oklch(0.76 0.06 25);
  --acked-bg: oklch(0.28 0.03 25);
  --acked-ink: oklch(0.82 0.05 25);
  --susp-ring: oklch(0.84 0.12 78 / 0.6);

  /* Secondary text. Kept readable: the faintest step is still clearly legible (2026-10-06). */
  --text-2: color-mix(in srgb, var(--color-text) 86%, transparent);
  --text-3: color-mix(in srgb, var(--color-text) 74%, transparent);
  --text-4: color-mix(in srgb, var(--color-text) 62%, transparent);
  --hover: color-mix(in srgb, var(--color-text) 7%, transparent);

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

/* --- Tokens: light ---------------------------------------------------------- */
[data-tb-theme="light"] {
  color-scheme: light;
  --color-bg: #f1f2f6;
  --color-surface: #fcfcfe;
  --color-text: #1d1f2b;
  --color-accent: #6b5fc0;
  --color-divider: color-mix(in srgb, #1d1f2b 14%, transparent);
  --color-neutral-100: #292b31;
  --color-neutral-300: #595d6c;
  --color-neutral-500: #9397ab;
  --color-neutral-700: #cfd3e5;
  --color-neutral-800: #e4e7f5;
  --color-neutral-900: #f3f5fe;
  --color-accent-100: #2b2741;
  --color-accent-200: #423a6a;
  --color-accent-300: #5d5294;
  --color-accent-400: #796cbf;
  --color-accent-500: #968ae0;
  --color-accent-600: #b5abfc;
  --color-accent-700: #d2cefd;
  --color-accent-800: #e7e5fe;
  --color-accent-900: #f5f4ff;
  --shadow-sm: 0 0 0 1px #e4e7f5;
  --shadow-md: 0 0 0 1px #cfd3e5, 0 6px 18px rgba(30, 32, 50, 0.1);
  --shadow-lg: 0 0 0 1px #cfd3e5, 0 16px 40px rgba(30, 32, 50, 0.16);

  --ok-fg: oklch(0.50 0.12 155);
  --ok-bg: oklch(0.94 0.04 155);
  --warn-fg: oklch(0.54 0.13 65);
  --warn-bg: oklch(0.95 0.05 85);
  --warn-soft: oklch(0.96 0.045 85);
  --warn-ink: oklch(0.45 0.11 65);
  --err-fg: oklch(0.54 0.18 25);
  --err-bg: oklch(0.94 0.035 25);
  --err-soft: oklch(0.95 0.03 25);
  --err-hover: oklch(0.94 0.035 25);
  --err-ink: oklch(0.45 0.16 25);
  --err-ink2: oklch(0.50 0.10 25);
  --acked-fg: oklch(0.50 0.06 25);
  --acked-bg: oklch(0.94 0.015 25);
  --acked-ink: oklch(0.42 0.06 25);
  --susp-ring: oklch(0.70 0.13 75 / 0.6);
}

/* --- Base ------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background: var(--color-bg);
  color: var(--color-text);
  /* No "antialiased" smoothing: on macOS it draws Japanese text too thin, above all on the dark theme. */
}
a { color: var(--color-accent-300); text-decoration: none; }
a:hover { color: var(--color-accent-200); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.faint { color: var(--text-4); }
.num { font-variant-numeric: tabular-nums; }

/* The page stays hidden until the login check passes (dashboard-auth.js). */
body.da-checking > *:not(#dashboardAuthOverlay) { visibility: hidden; }

/* --- Icons ------------------------------------------------------------------ */
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
.ic-lg { width: 28px; height: 28px; }
.spin { animation: tb-spin 0.9s linear infinite; }
@keyframes tb-spin { to { transform: rotate(360deg); } }

/* --- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 12px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent; color: var(--color-text);
  font-size: 13px; line-height: 1.3; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { border-color: var(--color-accent); color: var(--color-accent-200); }
.btn-primary:not(:disabled):hover { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:not(:disabled):hover, .btn-ghost:not(:disabled):hover { background: var(--hover); }
.btn-icon { width: 32px; padding: 0; }
.btn-danger { color: var(--err-fg); }
.btn-danger:not(:disabled):hover { background: var(--err-hover); }
.btn-warn { border-color: var(--warn-fg); color: var(--warn-ink); }
.btn-warn:not(:disabled):hover { background: var(--warn-soft); }

/* --- Form fields ------------------------------------------------------------ */
.input, select.input {
  width: 100%; min-height: 34px; padding: 6px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); background: var(--color-surface); color: var(--color-text);
}
.input:focus { outline: none; border-color: var(--color-accent); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--color-accent); width: 14px; height: 14px; margin: 0; }

/* Segmented choice */
.seg { display: inline-flex; padding: 2px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.seg-opt {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: var(--text-2);
}
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { background: var(--color-accent-900); color: var(--color-accent-200); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); }

/* Tags and badges */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tag-ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag-warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag-err { background: var(--err-bg); color: var(--err-fg); }
.tag-acked { background: var(--acked-bg); color: var(--acked-fg); }
.tag-neutral { background: color-mix(in srgb, var(--color-text) 9%, transparent); color: var(--text-2); }
.tag-accent { background: var(--color-accent-900); color: var(--color-accent-300); }

/* --- Header ----------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.app-header-inner {
  max-width: 1440px; margin: 0 auto; padding: 10px 28px;
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
}
.app-title { background: none; border: 0; padding: 0; cursor: pointer; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.app-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.app-status .fetch-error { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; background: var(--err-bg); color: var(--err-ink); }
.app-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 8px; margin-left: 10px; font-size: 13px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--color-accent-800); color: var(--color-accent-100); display: grid; place-items: center; font-size: 12px; }
.rule { height: 1px; background: linear-gradient(to right, transparent, var(--color-divider) 48px, var(--color-divider) calc(100% - 48px), transparent); }

/* "アプリで開く" (iPhone / iPad only) */
.open-in-app {
  max-width: 1440px; margin: 12px auto 0; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: var(--radius-md); background: var(--color-accent-900); color: var(--color-accent-200); font-size: 14px;
}
.open-in-app > span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 720px) { .open-in-app { margin: 12px 16px 0; } }

/* --- Layout ----------------------------------------------------------------- */
.view { max-width: 1440px; margin: 0 auto; padding: 20px 28px 72px; display: flex; flex-direction: column; gap: 20px; }
.empty-state { display: flex; flex-direction: column; gap: 6px; padding: 56px 4px; }
.empty-state .ic-lg { color: var(--text-4); }
.section-head {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding-bottom: 6px;
  background: linear-gradient(to right, var(--color-divider), var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.section-head h2 { font-size: 17px; }
.surface { background: var(--color-surface); border-radius: var(--radius-md); }

/* --- Panels (dialogs, menus, toast) ------------------------------------------ */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(10, 11, 20, 0.55); }
.dialog {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 20px 22px;
  border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title { font-size: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 9px 16px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-lg); font-size: 13px;
}

/* --- Device list ------------------------------------------------------------ */
.tiles { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1 1 140px;
  min-width: 140px; padding: 12px 16px; border: 0; border-radius: var(--radius-md); cursor: pointer;
  text-align: left; background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--color-text);
}
.tile:hover { filter: brightness(1.08); }
.tile[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--color-accent); }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.tile-count { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 13px; color: var(--text-4); }
/* Status tiles: the frame shows the state; the number takes its color when it is not zero. */
.tile.tone-ok { box-shadow: inset 0 0 0 1px var(--ok-fg); }
.tile.tone-warn { box-shadow: inset 0 0 0 1px var(--warn-fg); }
.tile.tone-err { box-shadow: inset 0 0 0 1px var(--err-fg); }
.tile.tone-ok .tile-label { color: var(--ok-fg); }
.tile.tone-warn .tile-label { color: var(--warn-fg); }
.tile.tone-err .tile-label { color: var(--err-fg); }
.tile.tone-ok .tile-count.nonzero { color: var(--ok-fg); }
.tile.tone-warn .tile-count.nonzero { color: var(--warn-fg); }
.tile.tone-err .tile-count.nonzero { color: var(--err-fg); }
.tile .tile-count.zero { color: var(--text-4); }
.tile.tone-ok[aria-pressed="true"], .tile.tone-warn[aria-pressed="true"], .tile.tone-err[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.tile.tone-ok[aria-pressed="true"] { color: var(--ok-fg); }
.tile.tone-warn[aria-pressed="true"] { color: var(--warn-fg); }
.tile.tone-err[aria-pressed="true"] { color: var(--err-fg); }
.tile[aria-pressed="true"] .tile-sub { color: var(--text-3); }
.tile.is-error { flex: 2 1 300px; background: color-mix(in srgb, var(--err-bg) 75%, transparent); box-shadow: inset 0 0 0 1px var(--err-fg); }
.tile.is-error .tile-label, .tile.is-error .tile-count { color: var(--err-ink); }
.tile.is-error .tile-sub { color: var(--err-ink2); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 300px; max-width: 420px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-4); }
.search .input { padding-left: 32px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 6px;
  border: 1px solid var(--color-divider); background: transparent; font-size: 12px; cursor: pointer;
}
.chip:not(:disabled):hover { background: var(--hover); }
.chip:disabled { cursor: default; }
.chip .ic { color: var(--text-3); }

.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 14px 16px; border-radius: var(--radius-md); background: var(--color-surface);
}
.card.is-error { box-shadow: inset 0 0 0 1px var(--err-fg); }
.card.is-suspected { box-shadow: inset 0 0 0 1px var(--susp-ring); }
.card.is-hidden { opacity: 0.6; }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.card-name-row { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.card-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.card-name.unnamed { color: var(--warn-fg); }
.card-serial { font-size: 13px; color: var(--text-3); }
.card-serial .mono { color: var(--color-text); }
.card-uuid { font-size: 12px; font-family: var(--mono); color: var(--text-4); overflow-wrap: anywhere; }
.card-times { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; color: var(--text-3); }
.card-times b { font-weight: 400; color: var(--color-text); font-variant-numeric: tabular-nums; }
.card-times b.warn { color: var(--warn-fg); }
.card-times b.err { color: var(--err-fg); }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.card-foot .btn { margin-left: auto; }

.band { display: flex; flex-direction: column; gap: 6px; padding: 9px 12px; border-radius: var(--radius-md); font-size: 13px; }
.band-title { font-size: 14px; }
.band.err { background: var(--err-soft); color: var(--err-ink2); }
.band.err .band-title { color: var(--err-ink); }
.band.acked { background: var(--acked-bg); color: var(--text-3); }
.band.acked .band-title { color: var(--acked-ink); font-size: 13px; }
.band.warn { background: var(--warn-soft); color: var(--text-3); }
.band.warn .band-title { color: var(--warn-ink); font-size: 13px; }
.band.info { flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px; background: var(--color-accent-900); color: var(--color-accent-200); }
.band-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.block-label { font-size: 13px; color: var(--text-3); }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: 13px; }
.state-item { display: flex; flex-direction: column; min-width: 0; }
.state-item span:first-child { color: var(--text-4); }
.state-item .warn { color: var(--warn-fg); }
.state-item .err { color: var(--err-fg); }
.settings { display: flex; flex-direction: column; gap: 2px; }
.setting {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; margin: 0 -6px;
  border: 0; border-radius: 6px; background: transparent; font-size: 13px; text-align: left; cursor: pointer;
}
.setting:not(:disabled):hover { background: var(--hover); }
.setting:disabled { cursor: default; }
.setting-label { width: 104px; flex: none; color: var(--text-3); }
.setting-value { flex: 1; min-width: 0; }
.setting-value.off { color: var(--text-4); }
.issues { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }

.menu {
  position: absolute; top: 48px; right: 12px; z-index: 25; width: 240px; padding: 6px;
  border-radius: 10px; background: var(--color-surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.menu-label { font-size: 12px; padding: 4px 10px 2px; color: var(--text-4); }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; font-size: 13px; text-align: left; cursor: pointer;
}
.menu-item:not(:disabled):hover { background: var(--hover); }
.menu-item:disabled { opacity: 0.45; cursor: default; }
.menu-item.warn { color: var(--warn-fg); }
.menu-item.danger { color: var(--err-fg); }
.menu-item.danger:not(:disabled):hover { background: var(--err-hover); }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--color-divider); }

.unmon-card { gap: 6px; }
.select-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }

/* --- Device details ----------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; align-items: start; }
.detail-card { padding: 16px 18px; }
.detail-card .card-name { font-size: 20px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.summary-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--color-surface); font-size: 13px; min-width: 0; }
.summary-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-value.err, .err-text { color: var(--err-fg); }
.summary-value.warn, .warn-text { color: var(--warn-fg); }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar {
  display: grid; grid-template-columns: minmax(0, 220px) 1fr 44px; align-items: center; gap: 10px;
  padding: 3px 6px; margin: 0 -6px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; text-align: left; cursor: pointer;
}
.bar:hover { background: var(--hover); }
.bar.is-active { background: var(--color-accent-900); }
.bar.routine .bar-label { color: var(--text-4); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--color-text) 8%, transparent); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 3px; background: var(--color-accent-500); }
.bar.routine .bar-fill { background: var(--color-neutral-500); }
.bar-count { text-align: right; color: var(--text-2); }
.table-wrap { overflow: auto; max-height: 70vh; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
table.events { width: 100%; border-collapse: collapse; font-size: 13px; }
table.events th {
  position: sticky; top: 0; z-index: 1; background: var(--color-surface); text-align: left; font-weight: 400;
  font-size: 13px; font-weight: 600; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--color-divider); white-space: nowrap;
}
table.events td { padding: 7px 10px; border-bottom: 1px solid var(--color-divider); vertical-align: top; }
table.events { min-width: 860px; }
table.events td:nth-child(4), table.events td:nth-child(5), table.events td:nth-child(6), table.events td:nth-child(7) { white-space: nowrap; }
table.events tr.routine td { color: var(--text-3); }
table.events tr.fold-row td { padding: 2px 6px; }
.outage { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-text) 4%, transparent); flex-wrap: wrap; }
.outage.is-ongoing { background: var(--err-soft); }

/* --- Dialog contents ---------------------------------------------------------- */
.form-grid { display: grid; gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1 1 140px; }
.note { font-size: 13px; color: var(--text-3); margin: 0; }
.warn-note { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--warn-soft); color: var(--warn-ink); font-size: 12px; }
.err-note { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--err-soft); color: var(--err-ink); font-size: 12px; }

/* --- Operators ------------------------------------------------------------------ */
.dialog-wide { width: min(720px, 100%); }
.auth-failed { background: var(--color-bg); }
.operator { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.operator.is-pending { background: var(--warn-soft); }

/* --- Small screens ---------------------------------------------------------- */
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-header-inner, .view { padding-left: 16px; padding-right: 16px; }
  .app-nav { margin-left: 0; width: 100%; }
  .account { margin-left: auto; }
}
