:root {
  --bg: #F7F4EF; --surface: #FFFEFC; --surface-2: #F0ECE5;
  --ink: #1A1410; --ink-2: #3A322C; --muted: #6B625B; --faint: #9A918A;
  --line: #E4DED5; --line-2: #D6CEC3;
  --brand: #FF5B2E; --brand-deep: #D9431A; --brand-soft: #FFE6DC;
  --ok: #1E9E6A; --ok-soft: #DDF3E9; --warn: #A8700E; --warn-soft: #F8EBD1; --risk: #C8402F; --risk-soft: #FBE7E3;
  --dark: #15100D; --dark-2: #211915; --dark-line: #2E2520; --dark-text: #EDE4DC; --dark-muted: #8E8279;
  --f-sans: "Geist", "Segoe UI", system-ui, sans-serif; --f-mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; background: var(--bg); }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 clamp(16px, 3vw, 32px); background: rgba(247,244,239,.88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand__mark { width: 30px; height: 30px; display: block; flex: none; }
.brand__mark svg { width: 100%; height: 100%; display: block; }
.brand__word { font-weight: 700; font-size: 21px; letter-spacing: -.04em; }
.brand__tag { padding: 2px 9px; border: 1px dashed var(--line-2); border-radius: 999px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .14em; margin-left: 2px; }
.bar__right { display: flex; align-items: center; gap: 8px; }
.net { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--muted); }
.net i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.net.is-ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.net.is-bad { border-color: #EBC2BA; color: var(--risk); background: var(--risk-soft); }
.net.is-bad i { background: var(--risk); }

.acct { position: relative; }
.acct__btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.acct__btn i { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--brand), #FFB547, var(--ok), var(--brand)); }
.acct__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); display: grid; padding: 6px; box-shadow: 0 20px 40px -16px rgba(26,20,16,.25); }
.acct__menu button, .acct__menu a { text-align: left; padding: 10px 12px; font-size: 14px; text-decoration: none; border-radius: 8px; }
.acct__menu button:hover, .acct__menu a:hover { background: var(--surface-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 600; letter-spacing: -.005em; transition: background .2s, border-color .2s, color .2s, opacity .2s; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn--lime { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--lime:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn--ghost { background: var(--surface); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { color: var(--brand-deep); font-size: 12px; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.notice { margin: 16px clamp(16px, 3vw, 32px) 0; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid #EED8AE; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.notice a { color: var(--ink); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 16px; padding: 20px clamp(16px, 3vw, 32px) 48px; max-width: 1400px; margin: 0 auto; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 14px; min-width: 0; grid-template-columns: minmax(0, 1fr); box-shadow: 0 1px 2px rgba(26,20,16,.03); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel__head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.panel__head h2 .mono { color: var(--faint); font-size: 11.5px; font-weight: 400; }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-decoration: none; white-space: nowrap; }
.pill.is-ok { color: var(--ok); background: var(--ok-soft); }
.pill.is-bad { color: var(--risk); background: var(--risk-soft); }
a.pill:hover { color: var(--ink); }
.empty { color: var(--faint); font-size: 14px; }

.kv { display: grid; gap: 0; border-top: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; flex: none; font-family: var(--f-mono); }
.kv dd { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.kv dd.big { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }

.tk-name strong { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.tk-name .mono { color: var(--brand-deep); }
.ca { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.ca code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }

/* policy */
.session { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.session__time { font-size: 24px; font-weight: 500; color: var(--faint); }
.session__time.is-on { color: var(--ok); }
.session__btns { display: flex; gap: 6px; }
.policy { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-family: var(--f-mono); }
.field b { font-weight: 500; color: var(--muted); }
.field input, .contact-add input { width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .contact-add input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[aria-invalid="true"] { border-color: var(--risk); }
.check { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check b { font-weight: 600; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check span { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); flex: none; transition: background .2s; }
.check span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .25s; }
.check input:checked + span { background: var(--ok); }
.check input:checked + span::after { transform: translateX(16px); }
.check input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.fine { color: var(--faint); font-size: 13px; }
.field-err { color: var(--risk); font-size: 13px; }
.field-err:empty { display: none; }

.contacts { display: grid; gap: 6px; }
.contacts li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.contacts li b { font-weight: 600; }
.contacts li code { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-mono); font-size: 12px; }
.contacts li button { color: var(--faint); font-size: 16px; line-height: 1; padding: 0 4px; }
.contacts li button:hover { color: var(--risk); }
.contacts .empty { border: 0; padding: 0; }
.contact-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 6px; }
.panel__head .pill { max-width: 55%; overflow: hidden; text-overflow: ellipsis; }

/* console: dark terminal */
.panel--console { background: var(--dark); border-color: var(--dark); color: var(--dark-text); gap: 16px; box-shadow: 0 30px 60px -30px rgba(26,20,16,.55); }
.panel--console .panel__head h2 .mono { color: var(--brand); }
.panel--console .pill { background: var(--dark-2); color: var(--dark-muted); }
.intent { display: flex; align-items: stretch; border: 1px solid var(--dark-line); border-radius: var(--r-md); background: var(--dark-2); overflow: hidden; }
.intent:focus-within { border-color: var(--brand); }
.intent__prompt { display: grid; place-items: center; padding: 0 4px 0 14px; color: var(--brand); font-size: 17px; }
.intent input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 15px 10px; outline: 0; font-size: 14px; color: #fff; }
.intent input::placeholder { color: #6E625A; }
.intent .btn { height: auto; border: 0; border-radius: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border: 1px solid var(--dark-line); border-radius: 999px; color: var(--dark-muted); font-size: 12px; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { background: #fff; color: var(--ink); border-color: #fff; }

.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--dark-line); border-radius: var(--r-md); overflow: hidden; }
.steps li { position: relative; padding: 10px 10px 10px 30px; font-size: 11.5px; color: #6E625A; text-transform: lowercase; font-family: var(--f-mono); }
.steps li + li { border-left: 1px solid var(--dark-line); }
.steps li::before { content: ""; position: absolute; left: 11px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border: 1.5px solid #4A3F38; border-radius: 50%; }
.steps li.is-run { color: #fff; }
.steps li.is-run::before { border-color: var(--brand); border-top-color: transparent; animation: spin .7s linear infinite; }
.steps li.is-ok { color: var(--dark-text); }
.steps li.is-ok::before { background: var(--ok); border-color: var(--ok); }
.steps li.is-fail { color: #FF8A78; }
.steps li.is-fail::before { background: #FF6B5B; border-color: #FF6B5B; }
.steps li.is-skip { opacity: .4; }
@keyframes spin { to { transform: rotate(360deg); } }

.out { min-height: 220px; border: 1px solid var(--dark-line); border-radius: var(--r-md); background: #100C0A; padding: 18px; display: grid; gap: 14px; align-content: start; }
.out__empty { color: var(--dark-muted); font-size: 14px; max-width: 52ch; }
.out__empty b { color: #fff; font-weight: 600; }
.res__title { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; color: #fff; }
.res__tag { color: var(--brand); text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; margin-bottom: 6px; font-family: var(--f-mono); }
.res__rows { display: grid; border-top: 1px dashed var(--dark-line); }
.res__rows div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--dark-line); font-size: 13.5px; }
.res__rows dt { color: var(--dark-muted); font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; flex: none; }
.res__rows dd { text-align: right; overflow-wrap: anywhere; font-family: var(--f-mono); font-size: 12.5px; min-width: 0; }
.checks { display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; font-size: 13.5px; align-items: baseline; }
.checks li::before { content: "✓"; color: #4CD69B; font-family: var(--f-mono); flex: none; }
.checks li.no::before { content: "✕"; color: #FF8A78; }
.checks li.warn::before { content: "!"; color: #FFB547; }
.checks li.no { color: #FF8A78; }
.checks li.warn { color: #FFB547; }
.res__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel--console .btn:not(.btn--lime) { background: var(--dark-2); border-color: var(--dark-line); color: var(--dark-text); }
.panel--console .btn:not(.btn--lime):hover { border-color: #fff; }
.res__msg { font-size: 14px; color: var(--dark-muted); }
.res__msg.is-err { color: #FF8A78; }
.res__msg.is-ok { color: #4CD69B; }
.res__msg a, .panel--console a { color: var(--brand); }
.help { display: grid; gap: 8px; font-size: 14px; color: var(--dark-muted); }
.help code { color: #fff; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 6px; padding: 2px 6px; font-family: var(--f-mono); font-size: 12px; }

.activity { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.activity li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.activity li.empty { display: block; border: 0; padding: 0; }
.activity time { color: var(--faint); font-family: var(--f-mono); font-size: 11px; }
.activity a { color: var(--brand-deep); font-family: var(--f-mono); font-size: 11.5px; text-decoration: none; }
.activity a:hover { text-decoration: underline; }
.st { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.st--pending { color: var(--warn); background: var(--warn-soft); }
.st--success { color: var(--ok); background: var(--ok-soft); }
.st--failed { color: var(--risk); background: var(--risk-soft); }

/* dialog */
.dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(380px, calc(100vw - 32px)); box-shadow: 0 30px 60px -20px rgba(26,20,16,.35); }
.dialog::backdrop { background: rgba(26,20,16,.35); backdrop-filter: blur(3px); }
.dialog form { padding: 22px; display: grid; gap: 14px; }
.dialog h3 { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.wallets { display: grid; gap: 6px; }
.wallets button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); text-align: left; }
.wallets button:hover { border-color: var(--ink); }
.wallets img { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .col--wide { order: -1; }
}
@media (max-width: 560px) {
  .net { display: none; }
  .brand__word { display: none; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li:nth-child(4) { border-left: 0; }
  .steps li:nth-child(n+4) { border-top: 1px solid var(--dark-line); }
  .intent { flex-wrap: wrap; }
  .intent input { flex-basis: calc(100% - 40px); }
  .intent .btn { width: 100%; height: 44px; }
  .contact-add { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
