:root {
  --accent: #f7931a;
  --btn: #e07b00;
  --btn-hover: #c56a00;
  --ink: #1c1917;
  --deep: #14202b;
  --night: #0c141c;
  --plum: #1c2c3a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #f4f6f8;
  --red: #c2410c;
  --white: #fff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.45 "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
a { color: #9a3412; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
h1, h2 { line-height: 1.2; font-weight: 650; color: var(--deep); }
h1 { font-size: 1.7rem; margin: 0 0 10px; }
h2 { font-size: 1.2rem; margin: 22px 0 10px; }
.wrap { width: min(1100px, calc(100% - 28px)); margin: 0 auto; }
.main { padding: 22px 0 48px; min-height: 52vh; }
.muted { color: var(--muted); }
.lede { font-size: 1.05rem; }
.help { color: var(--muted); font-weight: 400; font-size: 0.88rem; margin: 0; }

.site-header { background: var(--deep); }
.head-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: var(--white); font-weight: 750; font-size: 1.7rem; letter-spacing: 0.06em; text-decoration: none; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.head-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.head-nav > a { color: var(--white); font-weight: 650; }
.head-nav > a.on, .head-nav > a:hover { color: var(--accent); text-decoration: none; }
.head-nav i { width: 1.1em; text-align: center; }

.drop { position: relative; }
.drop summary { list-style: none; cursor: pointer; font-weight: 650; color: var(--white); }
.drop summary::-webkit-details-marker { display: none; }
.drop summary i { color: var(--accent); }
.drop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--plum);
  border-radius: 4px;
  padding: 6px;
  z-index: 30;
}
.drop-menu a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; color: var(--white); border-radius: 4px; }
.drop-menu a:hover { background: #24384a; text-decoration: none; }

.site-footer { background: var(--plum); color: #e7e5e4; }
.foot-inner p { margin: 0; padding: 16px 0; font-size: 0.9rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn);
  color: var(--white);
  border: 0;
  border-radius: 4px;
  padding: 9px 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--btn-hover); color: var(--white); text-decoration: none; }
.btn.light { background: var(--white); color: var(--deep); border: 1px solid var(--line); }
.btn.light:hover { border-color: var(--accent); color: var(--deep); }
.btn.wide { width: 100%; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.hero { max-width: 640px; padding: 18px 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 650; }
label i { color: var(--btn); }
input:not([type]), input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  padding: 9px 10px;
  background: #fff;
  font-weight: 400;
}
input:focus { outline: 2px solid #fed7aa; border-color: var(--accent); }
input:disabled { background: var(--paper); color: var(--muted); }
.pass { position: relative; }
.pass input { padding-right: 40px; }
.pass .icon-btn { position: absolute; right: 4px; top: 4px; }

.flash { border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 12px; margin: 0 0 14px; background: var(--white); border-radius: 4px; }
.flash.bad { border-left-color: var(--red); }

.auth-card {
  max-width: 520px;
  margin: 8px auto 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(20, 32, 43, 0.08);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); }
.auth-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  color: var(--deep);
  font-weight: 700;
  border-bottom: 3px solid transparent;
}
.auth-tab i { color: var(--btn); }
.auth-tab:hover { text-decoration: none; background: var(--white); }
.auth-tab.on, .auth-tab.on:hover { color: var(--white); background: var(--deep); border-bottom-color: var(--accent); }
.auth-tab.on i { color: #fdba74; }
.auth-body { padding: 18px 18px 8px; }
.auth-body h1 { font-size: 1.35rem; }
.auth-google { margin: 0 0 14px; }
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: var(--white);
  color: #3c4043;
  font-weight: 650;
}
.google-btn:hover { background: #f8f9fa; color: #3c4043; text-decoration: none; }
.auth-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.auth-or::before, .auth-or::after { content: ""; height: 1px; background: var(--line); }
.auth-extra { margin: 4px 0 12px; }
.main > .form { max-width: 720px; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; padding: 16px 18px; }

.wallet {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 0 0 14px;
}
.wallet.is-new { border-top-color: #16a34a; }
.wallet-new { margin: 0 0 8px; color: #15803d; font-weight: 650; }
.wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 650;
  color: var(--deep);
}
.wallet-kind, .wallet-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wallet-kind .wallet-qr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 32, 43, 0.55);
}
.modal-card {
  position: relative;
  width: min(100%, 300px);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 16px 16px 18px;
  text-align: center;
}
.modal-card h2 { margin: 0 28px 12px; font-size: 1.05rem; }
.qr-mark { color: var(--accent); }
.modal-card img { width: 240px; height: 240px; max-width: 100%; }
.modal-close { position: absolute; top: 6px; right: 6px; }
.wallet-kind i, .wallet-tag i, .wallet-edit { color: var(--btn); }
.wallet-tag {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.wallet-name-form[hidden] { display: none; }
.wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.wallet-id { min-width: 0; font-family: Consolas, "Courier New", monospace; }
.wallet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wallet-actions .btn { white-space: nowrap; }
.wallet-delete { margin: 0; }
.tx-short { display: none; }
.btn i { color: inherit; }
.wallet-delete .btn i { color: #dc2626; }
.wallet-name i, .page-head h1 i, .page-head h2 i { color: var(--btn); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.page-head h1, .page-head h2 { margin: 0; }
.wallet-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet-tools form, .page-head form { margin: 0; }
.copy-row, .name-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.name-row { margin-bottom: 10px; }
.copy-btn { white-space: nowrap; }

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 0 0 18px;
}
.dash-split.is-solo { grid-template-columns: 1fr; }
.dash-wallets { margin: 0; }
.wallets-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px;
}
.wallets-pane .page-head { margin-bottom: 10px; }
.wallets-pane .dash-more { margin-top: auto; padding-top: 8px; }
.dash-more { display: flex; justify-content: flex-end; margin: 0; }
.balance-card { margin: 0; height: 100%; justify-items: center; }
.balance-card > i { font-size: 2.75rem; }
.balance-actions { display: grid; width: 100%; justify-self: stretch; grid-template-columns: 1fr 1fr; gap: 8px; }
.balance-actions .btn { width: 100%; margin-top: 0; justify-self: stretch; }
.balance-actions .btn:last-child { grid-column: 1 / -1; }
.balance-actions .btn i { color: var(--white); }
.dash-wallet {
  padding: 8px 10px;
  margin: 0;
}
.dash-wallet + .dash-wallet { border-top: 1px solid var(--line); }
.dash-wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.dash-wallet-row input {
  min-width: 0;
  font-family: Consolas, "Courier New", monospace;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper); font-size: 0.86rem; }
td.tx { font-family: Consolas, "Courier New", monospace; font-size: 0.82rem; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.hub-card {
  display: grid;
  align-content: start;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px;
}
.hub-card i { color: var(--btn); }
.hub-card .btn i { color: inherit; }
.hub-card strong { font-size: 1.25rem; color: var(--deep); }
.balance-card strong { font-size: 2.25rem; }
.hub-card small { color: #44403c; }
.hub-card .btn { justify-self: start; margin-top: 4px; }

@media (max-width: 800px) {
  .hub-grid, .copy-row, .name-row, .dash-split { grid-template-columns: 1fr; }
  .wallet-row { grid-template-columns: minmax(0, 1fr); }
  .wallet-actions { display: flex; justify-content: flex-end; gap: 8px; }
  .wallet-actions .tx-wide { display: none; }
  .wallet-actions .tx-short { display: inline; }
  .dash-wallet-row .copy-btn { padding-inline: 12px; }
  .dash-wallet-row .copy-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .head-inner { min-height: 64px; }
  .brand { font-size: 1.4rem; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
}
