/* BEACON — shared stylesheet for both surfaces.
 *
 * One layout, two vocabularies. The pet surface and the corporate surface are
 * the SAME application; they differ in words, warmth and accent, never in
 * behaviour. Everything below is built on the house tokens
 * (hankelsner-ui-tokens.css); .theme-pet re-points a handful of them and
 * nothing else changes.
 */

/* --- the pet surface: same system, warmer skin ------------------------- */
.theme-pet {
  --bg: #fbf6ea; --surface: #ffffff; --surface-2: #fdf9f0; --inset: #f6eeda;
  --line: #ece0c6; --line-2: #ddcda6;
  --ink: #2b2118; --ink-2: #4d3f2f; --dim: #8a7a63;
  --accent: #a8891c; --accent-2: #c2a633; --accent-ink: #ffffff;
  --accent-soft: #fbf1cf;
  --display: Georgia, "Times New Roman", serif;
}
:root[data-theme="dark"] .theme-pet,
.theme-pet:where([data-dark]) {
  --bg: #17130c; --surface: #211a11; --surface-2: #291f14; --inset: #14100a;
  --line: #3a2e1d; --line-2: #4a3b26;
  --ink: #f4ecdd; --ink-2: #d8cbb4; --dim: #a2917a;
  --accent: #e0bf4a; --accent-2: #f0d268; --accent-ink: #1a1409;
  --accent-soft: #2c2213;
}
.theme-corp { --display: var(--sans); }

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* --- chrome ------------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: 20px;
  letter-spacing: 4px; color: var(--ink); text-decoration: none;
}
.wordmark small {
  display: block; font-family: var(--sans); font-size: 9.5px; font-weight: 600;
  letter-spacing: 2px; color: var(--dim); margin-top: -2px;
}
.topbar nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 13px; border-radius: var(--r-pill);
}
.topbar nav a:hover { background: var(--surface-2); color: var(--ink); }
.topbar nav a.on { background: var(--accent-soft); color: var(--accent); }
.themebtn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: var(--r-pill); width: 34px; height: 34px; cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.themebtn:hover { border-color: var(--line-2); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 34px 24px 80px; }
.wrap.narrow { max-width: 760px; }

.foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 22px 24px; color: var(--dim); font-size: 13px; text-align: center;
}
.foot a { color: var(--accent); }

/* --- type -------------------------------------------------------------- */
h1 { font-family: var(--display); font-size: 40px; line-height: 1.12; margin: 0 0 14px; letter-spacing: -.5px; }
h2 { font-size: 21px; margin: 34px 0 12px; letter-spacing: -.2px; }
h3 { font-size: 16px; margin: 22px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--ink-2); line-height: 1.6; }
.kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: 2.2px;
  color: var(--dim); text-transform: uppercase; margin-bottom: 8px;
}
.note { color: var(--dim); font-size: 13.5px; }
.warn { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn);
        border-radius: var(--r-sm); padding: 10px 13px; font-size: 14px; }
code, pre, .mono { font-family: var(--mono); }
a { color: var(--accent); }

/* --- cards / layout ---------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 46px; max-width: 22ch; }
@media (max-width: 620px) { .hero h1, h1 { font-size: 31px; } }

/* --- forms ------------------------------------------------------------- */
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .6px;
        text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }
input[type=text], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
textarea { resize: vertical; min-height: 62px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.field-row { margin-bottom: 16px; }
.field-row .hint { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.counter { float: right; font-size: 11px; color: var(--dim); font-weight: 600; }
.counter.over { color: var(--warn); }
.inline { display: flex; gap: 10px; align-items: flex-start; }
.inline > * { flex: 1; }
.inline > .shrink { flex: 0 0 190px; }
@media (max-width: 620px) { .inline { flex-direction: column; } .inline > .shrink { flex: 1 1 auto; width: 100%; } }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check label { text-transform: none; letter-spacing: 0; font-size: 14.5px;
               font-weight: 500; color: var(--ink); margin: 0; }
.check .sub { display: block; font-size: 12.5px; color: var(--dim); font-weight: 400; }

button, .btn {
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 11px 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost, .btn.ghost {
  background: var(--surface); color: var(--ink); border-color: var(--line-2);
}
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); }
button.small { padding: 7px 13px; font-size: 13.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* --- status ------------------------------------------------------------ */
.status {
  display: inline-block; padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.3px;
  text-transform: uppercase; background: var(--accent); color: var(--accent-ink);
  white-space: nowrap;
}
.status.missing { background: var(--warn); color: #fff; }
.status.ok { background: var(--ok); color: #fff; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}

/* --- record view ------------------------------------------------------- */
.rec-head { display: flex; gap: 20px; align-items: flex-start;
            justify-content: space-between; margin-bottom: 20px; }
.rec-head h1 { margin: 0 0 8px; }
.idline { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ilabel { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px;
          text-transform: uppercase; color: var(--dim); }
.ivalue { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent); }
.fields { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .fields { grid-template-columns: 1fr; } }
.flabel { font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
          text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.fvalue { font-size: 15.5px; color: var(--ink); }
dl.chain { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.chain dt { color: var(--dim); font-weight: 600; }
dl.chain dd { margin: 0; overflow-wrap: anywhere; }
pre.raw {
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; font-size: 13px; line-height: 1.55; overflow-x: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 14px;
}
table.hist { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.hist th { text-align: left; color: var(--dim); font-size: 11px;
                letter-spacing: 1.2px; text-transform: uppercase;
                border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.hist td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* --- search results ---------------------------------------------------- */
.results { display: grid; gap: 10px; }
.result {
  display: flex; gap: 14px; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 13px 16px; color: var(--ink);
}
.result:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.result .rname { font-weight: 700; font-size: 16px; }
.result .rid { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.result .grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--dim); }

/* --- the composer ------------------------------------------------------ */
.composer { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .composer { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 78px; }
.bytes { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.bytes b { color: var(--ink); }
.preview {
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow-y: auto;
}
.preview .k { color: var(--accent); font-weight: 700; }
.msgs { margin: 12px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.msgs li { padding: 7px 11px; border-radius: var(--r-sm); margin-bottom: 6px; }
.msgs li.err { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.msgs li.warnmsg { background: var(--accent-soft); color: var(--ink-2); border: 1px solid var(--line-2); }
.certprev { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
            background: #fff; display: block; }

/* --- steps ------------------------------------------------------------- */
.steps { display: flex; gap: 6px; margin: 0 0 22px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--dim);
}
.step.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.step .n { font-family: var(--mono); font-size: 11px; opacity: .85; }

/* --- wallet ------------------------------------------------------------ */
.wallet-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
               font-size: 14px; }
.addr { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.bal { font-weight: 700; font-size: 17px; }
.danger-note {
  background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
}

/* --- misc -------------------------------------------------------------- */
.stat { text-align: center; padding: 18px; }
.stat .big { font-size: 34px; font-weight: 700; font-family: var(--display); color: var(--accent); }
.stat .lbl { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--dim); }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line-2);
           border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
           vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 20px;
  border-radius: var(--r-pill); font-size: 14px; z-index: 60; box-shadow: var(--shadow-lg);
}
.hide { display: none !important; }
.prose { max-width: 74ch; }
.prose h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 16px; }
.prose th, .prose td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--dim); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; }
.prose pre { background: var(--inset); border: 1px solid var(--line);
             border-radius: var(--r-sm); padding: 13px 15px; overflow-x: auto; font-size: 13px; }
.prose code { background: var(--inset); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.prose pre code { background: none; padding: 0; }
