:root { color-scheme: light; --ink: #202928; --muted: #62716d; --line: #dce3df; --page: #f6f8f7; --accent: #126b58; --blue: #1966a0; --bad: #b32738; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 6px; padding: 8px 14px; background: var(--accent); color: #fff; cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(.94); }
button:disabled { opacity: .55; cursor: wait; }
button svg, .search svg { flex-shrink: 0; width: 18px; height: 18px; }
button.secondary, button.icon-button { background: #fff; color: var(--ink); border-color: var(--line); }
button.icon-button { width: 42px; height: 42px; padding: 0; flex: 0 0 42px; }
:focus-visible { outline: 3px solid #45a493; outline-offset: 3px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; background: #fff; color: var(--ink); border: 1px solid #bbc9c2; border-radius: 5px; font-size: 16px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; accent-color: var(--accent); flex-shrink: 0; }
label { display: grid; gap: 5px; font-size: 14px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 18px; }
h3 { font-size: 17px; }
a { color: var(--blue); text-underline-offset: 3px; overflow-wrap: anywhere; }
.shell { width: min(1180px, 100%); margin: auto; padding: 0 24px 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 0 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { border-radius: 8px; flex-shrink: 0; }
.brand span { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 8px; }
#connectionStatus { font-size: 12px; color: var(--muted); }
.auth-panel { max-width: 400px; padding: 28px 0; margin: 35px auto; }
.auth-panel form { display: grid; gap: 16px; margin-top: 22px; }
.auth-panel p { margin-top: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.notice { padding: 12px 14px; border-left: 3px solid var(--bad); background: #fff0f2; color: var(--bad); margin: 0 0 16px; }
.criteria { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 12px 0 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 24px 0; }
.metrics div { padding: 0 20px; border-left: 1px solid var(--line); }
.metrics div:first-child { border: 0; padding-left: 0; }
.metrics span { display: block; font-size: 13px; color: var(--muted); }
.metrics strong { font-size: 30px; display: block; margin-top: 4px; }
.metrics div:nth-child(2) strong { color: var(--accent); }
.metrics div:nth-child(3) strong { color: var(--blue); }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 4px; }
.tabs button { background: transparent; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; padding: 12px 18px; min-height: 48px; }
.tabs button.active { border-bottom-color: var(--accent); color: var(--accent); }
.view { padding: 22px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head > span { color: var(--muted); font-size: 12px; text-align: right; }
.spaced { margin-top: 32px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.search { display: flex; align-items: center; position: relative; width: 285px; max-width: 100%; }
.search svg { position: absolute; left: 10px; color: var(--muted); }
.search input { padding-left: 36px; }
.check { display: flex; align-items: center; gap: 8px; }
.listing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.listing { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-width: 0; }
.listing header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.listing h3 { overflow-wrap: anywhere; }
.price { font-size: 22px; font-weight: 700; color: var(--accent); margin: 8px 0; }
.detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.detail + .detail { margin-top: 4px; }
.badge { display: inline-block; border-radius: 4px; font-size: 12px; padding: 3px 6px; white-space: nowrap; background: #edf1ef; color: #4d5e57; }
.badge.good { background: #e2f3eb; color: #185f48; }
.badge.warn { background: #fff2d5; color: #795512; }
.badge.bad { background: #fce7eb; color: var(--bad); }
.listing .actions { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.actions a { margin-right: auto; font-size: 14px; }
.empty { grid-column: 1 / -1; padding: 38px 0; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 12px 14px 12px 0; }
th { font-weight: 500; color: var(--muted); }
td strong, td span { display: block; }
td span { font-size: 12px; color: var(--muted); }
.rows .row { border-bottom: 1px solid var(--line); padding: 13px 0; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.row .body { white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.row > div { min-width: 0; }
.row > span { flex-shrink: 0; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding-top: 16px; font-size: 12px; }
#offlineStatus { display: block; color: var(--bad); }
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 24px; width: min(660px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
dialog::backdrop { background: #162c2466; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
.confirm { margin-top: 18px; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.error { color: var(--bad); margin-top: 12px; font-size: 13px; }
@media (max-width: 720px) {
  .shell { padding: 0 16px 22px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 18px 0; }
  h1 { font-size: 20px; }
  .toolbar { margin-left: auto; }
  #connectionStatus { max-width: 150px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .metrics div:nth-child(3) { border: 0; padding-left: 0; }
  .metrics span { min-height: 20px; font-size: 12px; }
  .tabs { gap: 0; }
  .tabs button { flex: 1; font-size: 13px; padding: 10px 6px; gap: 5px; }
  .listing-grid { grid-template-columns: minmax(0, 1fr); }
  .listing { padding: 16px; }
  .filters { gap: 12px; }
  .search { width: 100%; }
  .section-head > span { max-width: 58%; }
  .section-head h2 { flex-shrink: 0; }
  dialog { padding: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
}
