/* Hallmark: PANSURE work surfaces, developer operations. */
/* Preserve the ink navigation and mint focus from the shared style guide. */
:root {
  color-scheme: light;
  --font: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --ink: #0a0d12;
  --nav: #101720;
  --nav-line: #303e48;
  --nav-text: #eff5f4;
  --nav-muted: #afbfca;
  --nav-raised: #202d37;
  --mint: #39d5b4;
  --canvas: #f3f5f7;
  --panel: #fff;
  --field: #fbfcfd;
  --line: #dbe2e7;
  --input-line: #84929e;
  --text: #16202a;
  --muted: #566373;
  --action: #08705e;
  --action-hover: #085b4d;
  --on-action: #fff;
  --soft: #eaf2f2;
  --good: #137156;
  --good-bg: #e5f6ef;
  --warn: #86500b;
  --warn-bg: #fff3dd;
  --bad: #a82837;
  --bad-bg: #fcebef;
  --shadow: 0 10px 30px rgb(10 13 18 / 12%);
  --scrim: rgb(10 13 18 / 62%);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #10161d;
    --panel: #18212b;
    --field: #111922;
    --line: #34424e;
    --input-line: #718394;
    --text: #f1f5f7;
    --muted: #b5c3ce;
    --action: #39d5b4;
    --action-hover: #67dec4;
    --on-action: #0a0d12;
    --soft: #263b42;
    --good: #87ebca;
    --good-bg: #1e4239;
    --warn: #ffd28a;
    --warn-bg: #423421;
    --bad: #ffb5bf;
    --bad-bg: #482a33;
  }
}

*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0; min-width: 0; overflow-x: clip }
body { min-height: 100dvh; font: 400 .9375rem/1.53 var(--font); background: var(--canvas); color: var(--text) }
button, input, select, textarea { font: inherit }
button, a { -webkit-tap-highlight-color: transparent }
button { cursor: pointer }
button:disabled { opacity: .65; cursor: wait }
a { color: var(--action); text-underline-offset: .18em }
button, a, input, select, textarea { transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out }
:focus-visible { outline: 2px solid var(--action); outline-offset: 3px }
::selection { background: var(--mint); color: var(--ink) }
[hidden] { display: none !important }
hr { border: 0; border-top: 1px solid var(--line) }
h1, h2, h3, p { margin: 0 }
h1, h2, h3 { overflow-wrap: anywhere; min-width: 0; font-weight: 650; line-height: 1.28 }
h1 { letter-spacing: -.025em; font-size: 1.75rem }
h2 { letter-spacing: -.014em; font-size: 1.125rem }
h3 { font-size: 1rem }
code, .numeric { font: .9em var(--mono); font-variant-numeric: tabular-nums }
code { overflow-wrap: anywhere }

.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-160%); padding: .7rem 1rem; border-radius: .5rem; background: var(--panel) }
.skip-link:focus { transform: none }
.noscript { position: fixed; left: 1rem; bottom: 1rem; background: var(--panel); padding: .7rem 1rem; border-radius: .5rem }
.wordmark { display: flex; align-items: baseline; gap: .55rem; white-space: nowrap; font-size: 1.05rem }
.wordmark strong { letter-spacing: .025em; font-size: 1.12rem }
.standalone { min-height: 100dvh; display: grid; place-items: center; padding: 1.2rem }
.login { width: min(100%, 28rem); padding: clamp(1.25rem, 6vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background-color: var(--panel) }
.login h1 { margin-block: 1.15rem .35rem }
.login > p { color: var(--muted) }
.login form { margin-top: 1.35rem }
.login .form-actions .primary { width: 100% }

.console { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr) }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; min-height: 100dvh; max-height: 100dvh; overflow-y: auto; padding: 1.35rem .9rem .9rem; color: var(--nav-text); background: var(--nav); border-right: 1px solid var(--nav-line) }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 0 .45rem }
.sidebar nav { display: grid; gap: .18rem; margin-top: 1.5rem }
.nav-link { min-height: 2.75rem; padding: .62rem .65rem; border: 1px solid transparent; border-radius: .5rem; display: flex; align-items: center; gap: .6rem; color: var(--nav-muted); text-decoration: none; font-size: .9rem }
.nav-link::before { content: ""; flex: 0 0 .4rem; height: .4rem; border: 1px solid currentColor; border-radius: 1px }
.nav-link:hover { background: var(--nav-raised); color: var(--nav-text) }
.nav-link[aria-current="page"] { color: var(--mint); background: var(--nav-raised); border-color: var(--nav-line); font-weight: 650 }
.nav-link[aria-current="page"]::before { background: currentColor }
.sidebar :focus-visible { outline-color: var(--mint) }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--nav-line); padding: .9rem .45rem .1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; justify-content: space-between }
.sidebar-footer .account { color: var(--nav-muted); overflow-wrap: anywhere; min-width: 0; font-size: .82rem }
.sidebar-footer .button { background: var(--nav-raised); border-color: var(--nav-line); color: var(--nav-text) }
.sidebar-footer .button:hover { border-color: var(--mint) }
.mobile-menu { display: none }

.main { min-width: 0; width: 100%; max-width: 100rem; margin-inline: auto; padding: 2rem clamp(1rem, 3.5vw, 3rem) 3rem }
.page-header { display: flex; align-items: flex-start; gap: .8rem; justify-content: space-between; margin: 0 0 1.35rem }
.page-header p { color: var(--muted); margin-top: .35rem }
.page-header h1:focus { outline: none }
.content { display: grid; gap: 1.05rem; min-width: 0 }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; min-width: 0 }
.block { padding: 1.2rem }
.panel-heading { display: flex; gap: .65rem; align-items: flex-start; justify-content: space-between; margin-bottom: .8rem; min-width: 0 }
.panel-heading p { margin-top: .3rem; color: var(--muted); font-size: .875rem }
.panel-heading .button { flex-shrink: 0 }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem }
.metric { display: grid; align-content: start; gap: .45rem; padding: .9rem 1rem; text-decoration: none; color: var(--text) }
a.metric:hover { border-color: var(--action); background: var(--soft) }
.metric-label, .metric-hint { color: var(--muted); font-size: .825rem }
.metric-value { overflow-wrap: anywhere; font-size: 1.3rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.22 }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem }
.stack { display: grid; gap: .8rem; min-width: 0 }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem }
.button-row.nowrap { flex-wrap: nowrap }
.detail-lead { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 0 }
.facts dt { font-size: .8rem; color: var(--muted); margin-bottom: .25rem }
.facts dd { margin: 0; overflow-wrap: anywhere }

.button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 2.75rem; border: 1px solid transparent; border-radius: .5rem; padding: .52rem .75rem; font-size: .875rem; font-weight: 630; line-height: 1.25; text-decoration: none; white-space: nowrap }
.button:active { transform: scale(.98) }
.button.primary { background: var(--action); color: var(--on-action) }
.button.primary:not(:disabled):hover { background: var(--action-hover) }
.button.secondary { color: var(--text); background: var(--panel); border-color: var(--line) }
.button.secondary:not(:disabled):hover { background: var(--soft); border-color: var(--action) }
.button.danger { background: var(--bad-bg); color: var(--bad); border-color: var(--bad) }
.button.danger:not(:disabled):hover { background: var(--panel) }
.badge { display: inline-block; width: fit-content; padding: .13rem .45rem; border-radius: .35rem; background: var(--soft); color: var(--text); white-space: nowrap; font-size: .8125rem; font-weight: 620 }
.badge-good { color: var(--good); background: var(--good-bg) }
.badge-warn { color: var(--warn); background: var(--warn-bg) }
.badge-bad { color: var(--bad); background: var(--bad-bg) }
.inline-error, .notice { padding: .65rem .8rem; border-radius: .5rem; overflow-wrap: anywhere }
.inline-error { grid-column: 1 / -1; color: var(--bad); background-color: var(--bad-bg) }
.notice { margin-bottom: .9rem; background-color: var(--good-bg); color: var(--good) }
.notice.warning { background-color: var(--warn-bg); color: var(--warn) }
.empty { padding: 1.1rem .05rem; color: var(--muted); font-size: .9rem }
.loading { height: 5rem; position: relative; display: flex; align-items: center; padding: 1rem 1.2rem; color: var(--muted) }
.loading::before { content: ""; width: .7rem; height: .7rem; margin-right: .6rem; border: 2px solid var(--action); border-radius: 50% }

.table-wrap { overflow: auto; max-width: 100%; scrollbar-color: var(--input-line) var(--panel); border: 1px solid var(--line); border-radius: .54rem }
.table-wrap th:first-child, .table-wrap td:first-child { padding-inline-start: .8rem }
table { border-collapse: collapse; width: 100%; text-align: start; font-size: .875rem }
th { background: var(--canvas); color: var(--muted); font-weight: 620; white-space: nowrap; text-align: start }
th, td { padding: .7rem .62rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere }
tr:last-child td { border-bottom: 0 }
td .button { min-height: 2.35rem }
td .cell-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: .18rem }
td:first-child { min-width: 6rem }

.editor, .filters { display: grid; align-items: end; gap: .85rem }
.editor { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.single-form { grid-template-columns: minmax(0, 1fr) }
.filters { grid-template-columns: repeat(2, minmax(0, 13rem)) minmax(0, max-content); margin-bottom: .8rem }
.field { min-width: 0; display: grid; align-content: start; gap: .32rem }
.field label, legend { font-size: .875rem; font-weight: 620 }
.field small, legend + p, .help { color: var(--muted); font-size: .82rem }
.field :is(input, select, textarea) { width: 100%; color: var(--text); border: 1px solid var(--input-line); background-color: var(--field); border-radius: .5rem; min-height: 2.75rem; padding: .55rem .65rem }
.field textarea { min-height: 7rem; resize: vertical }
.field :is(input, select, textarea):focus { border-color: var(--action) }
.field input::placeholder, .field textarea::placeholder { color: var(--muted) }
.form-actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-start }
.wide { grid-column: 1 / -1 }
.filters .form-actions { grid-column: auto }
.check-group { border: 0; padding: 0; margin: 0; min-width: 0 }
.check-group legend { margin-bottom: .3rem }
.checks { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .95rem }
.checks label { display: flex; align-items: center; gap: .43rem; min-height: 2.75rem; font-size: .875rem }
.checks input { accent-color: var(--action); width: 1.05rem; height: 1.05rem; margin: 0 }
.copy-fallback { position: fixed; top: 0; left: 0; opacity: 0 }
.data-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .45rem }
.meta-list { padding: 0; margin: 0; list-style: none; display: grid; gap: .45rem; color: var(--muted); font-size: .875rem }
.task-result { max-height: 16rem; max-width: min(34rem, 70vw); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: .55rem; background: var(--field); border: 1px solid var(--line); border-radius: .45rem; font: .8125rem var(--mono) }
.release-notes { min-width: 7.9rem }
.release-notes p { min-width: min(14rem, 75vw) }
.secret-value { display: block; margin-block: .6rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--field); padding: .8rem; color: var(--text); overflow-wrap: anywhere; user-select: all }

dialog { width: min(37rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); border: 1px solid var(--line); border-radius: .8rem; padding: 0; box-shadow: var(--shadow); background: var(--panel); color: var(--text) }
dialog::backdrop { background: var(--scrim) }
.dialog-content { padding: 1.1rem }
.dialog-heading { display: flex; align-items: flex-start; gap: .8rem; justify-content: space-between; margin-bottom: 1rem }
.dialog-heading p { color: var(--muted); margin-top: .28rem; font-size: .875rem; overflow-wrap: anywhere }

@media (max-width: 70rem) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}

@media (max-width: 51rem) {
  .console { display: block }
  .sidebar { z-index: 2; min-height: 0; max-height: calc(100dvh - 3rem); padding: .55rem .7rem; border-right: 0; border-bottom: 1px solid var(--nav-line) }
  .sidebar-top { padding: 0 }
  .mobile-menu { display: inline-flex; color: var(--nav-text); border-color: var(--nav-line); background: var(--nav-raised) }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: .65rem 0; gap: .15rem }
  .sidebar :is(nav, .sidebar-footer) { display: none }
  .sidebar[data-expanded=true] nav { display: grid }
  .sidebar[data-expanded=true] .sidebar-footer { display: flex; margin-top: 0; padding: .55rem 0 .1rem }
  .nav-link { justify-content: center; padding: .4rem .15rem; font-size: .8125rem; text-align: center }
  .nav-link::before { display: none }
  .main { padding: 1.2rem .85rem 2rem }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .filters .form-actions { grid-column: 1 / -1 }
  td .button { min-height: 2.75rem }
}

@media (max-width: 35rem) {
  .page-header { margin-bottom: .9rem }
  h1 { font-size: 1.45rem }
  .page-header p { font-size: .86rem }
  .block { padding: .85rem }
  .editor, .pair { grid-template-columns: minmax(0, 1fr) }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .panel-heading { flex-wrap: wrap }
  .table-wrap table { min-width: 29rem }
}

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