/* Grape Authority console: the wallet's design (apps/wallet/public/style.css tokens, fonts and components). */
@font-face { font-family: Manrope; src: url("assets/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/DMSans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f7f7f5; --paper: #fff; --ink: #241c2c; --muted: #6f6879; --line: #e8e5eb; --purple: #652fa0; --violet: #9b82c5;
  --orange: #ff6c00; --green: #2f6b55; --red: #a3181b; --red-bg: #fdecec; --amber-bg: #fff4dc; --amber: #7a5000;
  --sidebar: 218px; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "DM Sans", sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--purple); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #b598db; outline-offset: 3px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Manrope, sans-serif; font-weight: 500; letter-spacing: -0.04em; }
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; letter-spacing: -0.02em; }
p { color: var(--muted); overflow-wrap: anywhere; }
li, dd, .needed, .banner { overflow-wrap: anywhere; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; word-break: break-all; }
.hidden { display: none !important; }
.skip { position: fixed; z-index: 50; top: -80px; left: 20px; background: #fff; padding: 12px; }
.skip:focus { top: 10px; }

/* layout */
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; background: #fbfbfa; border-right: 1px solid var(--line); padding: 30px 16px 16px; display: flex; flex-direction: column; overflow-y: auto; z-index: 10; }
.brand { display: block; margin: 0 12px 34px; text-decoration: none; }
.brand img { width: 120px; height: 46px; object-fit: contain; }
.brand span { font-size: 9px; letter-spacing: 0.25em; color: #85808b; display: block; padding: 6px 0 0 3px; }
.nav-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; text-align: left; font-size: 13px; margin-bottom: 4px; color: #6d6775; }
.nav-button:hover { background: #f0edf2; color: var(--ink); }
.nav-button.active { color: var(--purple); background: #eee8f5; font-weight: 600; }
.nav-button .count { margin-left: auto; font-size: 10px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 0 7px; }
.sidebar-note { margin-top: auto; padding: 16px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.7; }
.shell { margin-left: var(--sidebar); min-width: 0; }
.topbar { min-height: 76px; padding: 12px 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fbfbfa; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mobile-brand { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.chip { font-size: 11px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 25px; padding: 7px 12px; background: #fff; max-width: 100%; }
.chip.me { border-color: #d9c8ea; color: var(--purple); }
.dot { height: 7px; width: 7px; border-radius: 50%; background: #6b957e; box-shadow: 0 0 0 3px #6b957e1c; flex-shrink: 0; }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px #a3181b1c; }
.dot.idle { background: #b9b2c0; box-shadow: none; }
.network-banner { font-size: 11px; color: #715a80; background: #f0ecf4; padding: 8px 34px; }
main { padding: 26px 34px 60px; max-width: 1240px; min-width: 0; }
.mobile-nav { display: none; }

/* banners */
.banner { border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.banner > div { flex: 1 1 260px; min-width: 0; }
.banner b { display: block; font-family: Manrope, sans-serif; font-size: 15px; margin-bottom: 4px; }
.banner p { font-size: 12px; line-height: 1.7; }
.banner.stopped { background: var(--red-bg); border: 2px solid var(--red); color: var(--red); }
.banner.stopped p, .banner.error p { color: #7d1517; }
.banner.error { background: var(--red-bg); border: 1px solid #e8b4b5; color: var(--red); }
.banner.warn { background: var(--amber-bg); border: 1px solid #f0d49a; color: var(--amber); }
.banner.warn p { color: var(--amber); }
.banner.ok { background: #e9f4ee; border: 1px solid #bfdccd; color: var(--green); }
.banner.ok p { color: var(--green); }
.banner.emergency { background: #fff; border: 1px dashed #e3b6b7; }
.banner.emergency b { color: var(--red); }

/* headings and cards */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #776783; margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; min-width: 0; margin-bottom: 14px; }
.card > p { font-size: 12.5px; line-height: 1.8; }
.card > p + p { margin-top: 8px; }
.card h2, .card h3 { margin-bottom: 8px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.stat .value { font-family: Manrope, sans-serif; font-size: 20px; letter-spacing: -0.03em; margin-top: 4px; overflow-wrap: anywhere; }
.stat .value.bad { color: var(--red); }
.stat .value.good { color: var(--green); }
.stat small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.pill { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: #f1ebf7; color: #6f4e8b; white-space: nowrap; display: inline-block; }
.pill.emergency, .pill.cancelled { background: var(--red-bg); color: var(--red); }
.pill.activated { background: #e6f2ec; color: var(--green); }
.pill.scheduled, .pill.ready { background: #e9f0fb; color: #1d467c; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.key { border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; font-size: 11.5px; min-width: 0; }
.key b { display: block; font-weight: 600; font-size: 12px; }
.key.yes { background: #eef7f2; border-color: #c6e1d3; }
.key .state { display: block; font-size: 11px; color: var(--muted); }
.key.yes .state { color: var(--green); font-weight: 600; }
.key.yes .state::before { content: "✓ "; }
.key.me { outline: 2px solid #c9b1e3; }
.needed { font-size: 13px; color: var(--ink); background: #f6f3f9; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.record-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.record-summary { font-size: 14px; color: var(--ink); margin: 6px 0 4px; overflow-wrap: anywhere; }
details { margin-top: 10px; font-size: 12px; }
summary { cursor: pointer; color: #6f4e8b; }

/* buttons and forms */
.btn { padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-size: 12.5px; line-height: 1.4; transition: transform 0.2s var(--ease), background 0.2s; text-decoration: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #251509; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #ee6400; }
.btn-secondary { background: #fff; border: 1px solid #e5ddea; color: #5f446e; }
.btn-dark { background: #382046; color: #fff; }
.btn-danger { background: var(--red); color: #fff; font-weight: 600; }
.btn-subtle { background: #f5f2f8; color: #725683; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.field { display: block; margin: 12px 0; font-size: 12px; color: #6d5b7a; }
.field > span { display: block; margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field textarea, .field select {
  width: 100%; max-width: 100%; padding: 11px 12px; border: 1px solid #e3d9eb; border-radius: 9px; background: #fcfafd; font-size: 13px; color: #3d2a4a; }
.field textarea { min-height: 90px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.field input.secret, input.secret { -webkit-text-security: disc; width: 100%; padding: 11px 12px; border: 1px solid #e3d9eb; border-radius: 9px; background: #fcfafd; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; margin: 10px 0; }
.check input { margin-top: 3px; flex-shrink: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.choice { border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: left; background: #fff; min-width: 0; }
.choice b { display: block; font-size: 13px; margin-bottom: 3px; }
.choice small { color: var(--muted); font-size: 11.5px; line-height: 1.6; display: block; }
.choice.selected { border-color: var(--purple); box-shadow: 0 0 0 2px #e4d6f2; }
.choice.danger b { color: var(--red); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 12px 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 12px 34px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #eee8f5; color: var(--purple); font-size: 11px; display: grid; place-items: center; font-weight: 600; }
.steps li b { color: var(--ink); font-weight: 600; }
.command { background: #241c2c; color: #f4eefa; border-radius: 10px; padding: 12px 14px; margin: 8px 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.checklist { list-style: none; padding: 0; margin: 10px 0; font-size: 12.5px; }
.checklist li { padding: 4px 0 4px 24px; position: relative; overflow-wrap: anywhere; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.checklist li.bad::before { content: "✕"; color: var(--red); }
.checklist li.warn::before { content: "!"; color: var(--amber); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #241c2c; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 12.5px; z-index: 60; max-width: calc(100vw - 32px); }
dialog { border: 1px solid #e6dceb; border-radius: 22px; padding: 0; width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 40px); background: #fff; color: var(--ink); box-shadow: 0 30px 130px #1f0e392e; }
dialog::backdrop { background: #21182f4d; backdrop-filter: blur(6px); }
.dialog-body { padding: 22px 24px; }
.dialog-body h2 { margin-bottom: 10px; }

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .shell { margin: 0; }
  .topbar { padding: 12px 16px; min-height: 64px; }
  .mobile-brand { display: block; }
  .mobile-brand img { width: 100px; height: 40px; object-fit: contain; }
  .network-banner { padding: 8px 16px; }
  main { padding: 18px 16px 50px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; padding: 10px 16px; background: #fbfbfa; border-bottom: 1px solid var(--line); }
  .mobile-nav .nav-button { margin: 0; padding: 9px 10px; font-size: 12px; justify-content: center; }
  .mobile-nav .nav-button .count { display: none; }
  h1 { font-size: 26px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .card { padding: 16px; }
}
