/*
 * The signed-in app's one card language, on every pane: an icon tile, a bold title, and a smaller
 * description under it. Loaded after the look stylesheets, so the type is the same in both looks;
 * colours come from their tokens.
 */

#view-wallet { --amber: #b86e00; --amber-tint: rgba(184, 110, 0, .1); }
html[data-look="black"] #view-wallet { --amber: #ff9f0a; --amber-tint: rgba(255, 159, 10, .14); }

/* The icons are symbols in one hidden sprite at the top of the app: plain line drawings in the
   text colour (white in the black look), on a neutral tile. No coloured icons. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------- icon tiles */

#view-wallet .ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
}
#view-wallet .ico svg,
#view-wallet .btn-ico,
#view-wallet .mini-ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#view-wallet .ico.sm { width: 32px; height: 32px; border-radius: 9px; }
#view-wallet .ico.sm svg { width: 17px; height: 17px; }
#view-wallet .btn-ico { width: 15px; height: 15px; margin-right: 6px; flex: none; }
#view-wallet .mini-ico { width: 14px; height: 14px; flex: none; }

/* ------------------------------------------------------------------ heads */

/* icon | title over description | chip, switch or button */
#view-wallet .card-head,
#view-wallet .lane-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 1px;
}
#view-wallet .lane-head { margin-bottom: 14px; }
#view-wallet :is(.card-head, .lane-head) > .ico { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
#view-wallet :is(.card-head, .lane-head) > h2 { grid-column: 2; grid-row: 1; align-self: end; }
#view-wallet :is(.card-head, .lane-head) > :is(.sub, p) { grid-column: 2; grid-row: 2; align-self: start; }
#view-wallet :is(.card-head, .lane-head) > :not(.ico, h2, .sub, p) { grid-column: 3; grid-row: 1 / span 2; justify-self: end; }
/* A head with only a title still centres it on the icon. */
#view-wallet :is(.card-head, .lane-head) > h2:only-of-type:not(:has(~ :is(.sub, p))) { grid-row: 1 / span 2; align-self: center; }

#view-wallet .card-head h2,
#view-wallet .lane-head h2,
#view-wallet .notice-body h2,
#view-wallet .alert-body h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--text);
}

/* ----------------------------------------------------------- descriptions */

#view-wallet .card-head .sub,
#view-wallet .lane-head p,
#view-wallet .card :is(.quiet, .fine, .small),
#view-wallet .notice-body .quiet,
#view-wallet .alert-body .quiet,
#view-wallet .help :is(.card p, dd, li),
#view-wallet .help-steps li {
  font-size: 13px;
  line-height: 1.55;
}
#view-wallet .card-head .sub,
#view-wallet .lane-head p { margin: 0; color: var(--muted); }
#view-wallet .card .fine { color: var(--muted); }
#view-wallet .pane-head .quiet { font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
#view-wallet .kv { font-size: 13.5px; }
#view-wallet .kv code { font-size: 12px; }
#view-wallet .help-terms dt, #view-wallet .help-pair h3 { font-size: 14px; }
#view-wallet .help-ui { font-weight: 500; }

/* ------------------------------------------------------------ the cards */

#view-wallet .card { transition: border-color .2s ease, box-shadow .2s ease; }
#view-wallet .grid-2 > .card:hover { border-color: var(--hair-strong); }
#view-wallet .card.wide { grid-column: 1 / -1; }
#view-wallet .card .row { gap: 8px; }
#view-wallet .card .btn { display: inline-flex; align-items: center; }

/* The notice and alert banners: icon, words, then the action. */
#view-wallet :is(.notice, .alert) > .ico { align-self: flex-start; }
#view-wallet :is(.notice-body, .alert-body) { flex: 1 1 320px; }

/* ------------------------------------------------------- the rules page */

.rule-how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin: 22px 0 18px;
  padding: 0;
  list-style: none;
}
.rule-how li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 14px;
}
.rule-how b { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.rule-how small { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* the on/off switch: it says ON or OFF, the knob shows which, and a push changes it */
.switch {
  position: relative;
  width: 64px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hair-strong);
  cursor: pointer;
  transition: background .22s ease, box-shadow .2s ease;
}
.switch::before {
  content: 'OFF';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font: 700 10px/1 var(--sans);
  letter-spacing: .08em;
  color: var(--text-2);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .26s cubic-bezier(.16, 1, .3, 1);
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::before { content: 'ON'; right: auto; left: 11px; color: #fff; }
.switch[aria-checked="true"]::after { transform: translateX(32px); }
.switch.leaving { background: var(--amber); }
.switch.danger[aria-checked="true"] { background: var(--danger); }
.switch:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--brand-tint); }
.switch.danger:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--danger-tint); }
.switch:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
/* pushed, and waiting for the palm: the knob breathes until the answer comes */
.switch.pending { cursor: progress; }
.switch.pending::after { animation: switch-wait 1.1s ease-in-out infinite; }
@keyframes switch-wait { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .18), 0 2px 6px rgba(0, 0, 0, .35); } }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } .switch.pending::after { animation: none; } }

/* a plain checkbox drawn as the same switch, for "Send everything" */
#view-wallet .check.toggle { gap: 12px; cursor: pointer; }
#view-wallet .check.toggle input {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 54px;
  height: 28px;
  flex: none;
  margin: 0;
  border-radius: 999px;
  background: var(--hair-strong);
  cursor: pointer;
  transition: background .22s ease;
}
#view-wallet .check.toggle input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
  transition: transform .24s cubic-bezier(.16, 1, .3, 1);
}
#view-wallet .check.toggle input::after { content: 'OFF'; position: absolute; top: 50%; right: 7px; transform: translateY(-50%); font: 700 9px/1 var(--sans); letter-spacing: .06em; color: var(--text-2); }
#view-wallet .check.toggle input:checked { background: var(--brand); }
#view-wallet .check.toggle input:checked::before { transform: translateX(26px); }
#view-wallet .check.toggle input:checked::after { content: 'ON'; right: auto; left: 8px; color: #fff; }
#view-wallet .check.toggle input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.rule-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.rule-state .chip { flex: none; }
#view-wallet .chip.ok { background: var(--ok-tint); color: var(--ok); }
#view-wallet .chip.amber { background: var(--amber-tint); color: var(--amber); }
#view-wallet .chip.blue { background: var(--brand-tint); color: var(--brand-hover); }

.palm-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.palm-hint svg { color: var(--text); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  font-size: 12px;
  color: var(--text-2);
}
.tag svg { color: var(--text); }

/* "How it works": the longer words, a tap away */
.explain { border-top: 1px solid var(--hair); padding-top: 10px; }
.explain summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-hover);
  cursor: pointer;
  list-style: none;
}
.explain summary::-webkit-details-marker { display: none; }
.explain summary::after { content: '+'; font-weight: 500; }
.explain[open] summary::after { content: '\2212'; }
.explain p { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

/* palm nodes holding a rule: one dot per node */
.node-hold { display: grid; gap: 6px; }
.node-hold:empty { display: none; }
.node-line { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.node-line b { font-weight: 600; color: var(--text); min-width: 70px; }
.node-dots { display: inline-flex; gap: 4px; }
.node-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hair-strong); }
.node-dots i.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }

/* rows of networks and accounts, each with its mark */
.tile-list { display: grid; gap: 8px; }
.tile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
}
.tile-row .what { display: grid; gap: 1px; min-width: 0; flex: 1; }
.tile-row .what b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.tile-row .what small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tile-row .value { font-size: 13.5px; font-weight: 650; color: var(--text); white-space: nowrap; }
button.tile-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
button.tile-row:hover { border-color: var(--brand-tint-2); background: var(--brand-tint); }
button.tile-row .mini-ico { color: var(--text); }

/* daily limits: a slider between sensible amounts, a typed amount, and a save that says when */
.limit-row { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hair); transition: border-color .2s ease; }
.limit-row.raising { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.limit-row.lowering { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.limit-top { display: flex; align-items: center; gap: 12px; }
.limit-top .what { display: grid; gap: 1px; flex: 1; min-width: 0; }
.limit-top .what b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.limit-top .what small { font-size: 12px; color: var(--muted); }
.limit-value { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.limit-row.raising .limit-value { color: var(--amber); }
.limit-row.lowering .limit-value { color: var(--ok); }

.slider-wrap { position: relative; margin-top: 4px; }
:is(#view-wallet, #quantum-fees) .range {
  --fill: 0%;
  --track: var(--brand);
  display: block;
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
#view-wallet .limit-row.raising .range { --track: var(--amber); }
#view-wallet .limit-row.lowering .range { --track: var(--ok); }
:is(#view-wallet, #quantum-fees) .range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--track) var(--fill), var(--hair-strong) var(--fill));
}
:is(#view-wallet, #quantum-fees) .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--track) 30%, transparent), 0 2px 8px rgba(0, 0, 0, .4);
  transition: transform .15s ease;
}
:is(#view-wallet, #quantum-fees) .range:active::-webkit-slider-thumb { transform: scale(1.12); }
:is(#view-wallet, #quantum-fees) .range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--hair-strong); }
:is(#view-wallet, #quantum-fees) .range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--track); }
:is(#view-wallet, #quantum-fees) .range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
:is(#view-wallet, #quantum-fees) .range:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 999px; }
/* where the limit is now, so a slide away from it is easy to see */
.now-mark {
  --p: 0;
  position: absolute;
  top: 50%;
  left: calc(12px + (100% - 24px) * var(--p));
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--text-2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .8;
}
.range-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.limit-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.limit-type { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
#view-wallet .limit-input {
  width: 96px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--hair-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.limit-unit { font-size: 12.5px; color: var(--muted); }
.limit-effect { font-size: 12px; color: var(--muted); }
.limit-effect.now { color: var(--ok); }
.limit-effect.later { color: var(--amber); }

/* saved addresses */
.book-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 380px;
  padding: 0 12px;
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
}
#view-wallet .search input { flex: 1; height: 36px; padding: 0; border: 0; background: transparent; font-size: 13.5px; }
.book-panel { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hair); }
.book-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.book-panel .two-up { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 640px) { .book-panel .two-up { grid-template-columns: minmax(0, 1fr); } }
.net-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.net-pick button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}
.net-pick button[aria-checked="true"] { border-color: var(--brand); background: var(--brand-tint); color: var(--text); }
.net-pick .account-mark { width: 24px; height: 24px; font-size: 11px; }

.drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1.5px dashed var(--hair-strong);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-tint); }
.drop b { font-size: 13.5px; color: var(--text); }
.drop small { font-size: 12px; color: var(--muted); }
.drop .ico { margin-bottom: 4px; }
#view-wallet .book-panel textarea { min-height: 92px; font: 12.5px/1.5 var(--mono); }

.upload-table { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.upload-row {
  display: grid;
  grid-template-columns: 34px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 12.5px;
}
.upload-row .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.upload-row .what { display: grid; gap: 1px; min-width: 0; }
.upload-row .what b { font-weight: 650; color: var(--text); }
.upload-row .what code { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.upload-row .account-mark { width: 26px; height: 26px; font-size: 11px; }
.upload-row.bad { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.upload-sum { display: flex; flex-wrap: wrap; gap: 6px; }

.book-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.book-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--hair); }
.book-row .what { display: grid; gap: 2px; min-width: 0; flex: 1; }
.book-row .what b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.book-row .what code { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.book-row .chip { flex: none; }
.book-empty { display: grid; justify-items: center; gap: 6px; padding: 22px; text-align: center; border: 1px dashed var(--hair-strong); border-radius: 14px; }
.book-empty b { font-size: 13.5px; color: var(--text); }
.book-empty small { font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .rule-how { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rule-how li { padding: 10px 12px; }
  /* A chip or button beside a title squeezes it on a phone, so it goes under the words. A switch stays. */
  #view-wallet :is(.card-head, .lane-head) > :not(.ico, h2, .sub, p, .switch) { grid-column: 2 / -1; grid-row: 3; justify-self: start; margin-top: 6px; }
}

.book-list > .book-empty { grid-column: 1 / -1; }
.upload-row .chip { height: auto; min-height: 22px; padding: 4px 9px; white-space: normal; text-align: right; line-height: 1.3; }
.rule-state > span:last-child { flex: 1 1 220px; min-width: 0; }
#limit-rows { gap: 8px; }
.limit-effect:empty { display: none; }

/* Coin marks follow the icons: the glyph in the text colour on the same neutral tile. */
#view-wallet .account-mark,
#view-wallet .account.active .account-mark {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
}
#view-wallet .account-mark.ghost { color: var(--muted); }

/* Square boxes across the dashboard: cards, rows, tiles, panels, fields, icon tiles, buttons and
   chips. Only the switches, sliders, status dots, network marks and people keep a round shape. */
#view-wallet {
  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;
  --r-xl: 0;
}
#view-wallet :is(
  .card, .side, .nav, .account, .account-card, .frozen-banner, .ranges, .ico,
  .rule-how li, .help-pair > div, .limit-row, .tile-row, .book-row, .book-panel, .drop,
  .search, .tabs, .tabs > *, .seg, .seg > *, .warn-note, .notice-line, .qr, .address,
  .save-bar, .upload-table, .upload-sum, .member-row
),
#view-wallet :is(input:not([type="checkbox"], [type="radio"], .range), textarea, select) {
  border-radius: 0;
}
#view-wallet .account-list .account,
#view-wallet .account-list > button,
#view-wallet .card.total,
#view-wallet .card.total::before,
#view-wallet .btn.brand,
#view-wallet :is(.btn, .icon-btn, .chip, .tag, .signer-chip, .net-pick button) {
  border-radius: 0;
}

/* The fee popup shown before a wallet is made quantum safe: an amount slider, a choice of gas
   price, and one payment's fees from each kind of wallet side by side. Square, as the dashboard. */
#quantum-fees .qf-block { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--hair); background: var(--surface-2); }
#quantum-fees .qf-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#quantum-fees .qf-label { font-size: 12.5px; color: var(--muted); }
#quantum-fees .qf-amount { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
#quantum-fees .qf-pickers { display: flex; flex-wrap: wrap; gap: 8px; }
#quantum-fees :is(.seg, .seg-item, .btn, .qf-block) { border-radius: 0; }
#quantum-fees .qf-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#quantum-fees .qf-table th, #quantum-fees .qf-table td { padding: 7px 8px; text-align: right; border-top: 1px solid var(--hair); }
#quantum-fees .qf-table th:first-child { text-align: left; font-weight: 500; color: var(--muted); }
#quantum-fees .qf-table thead th { border-top: 0; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
#quantum-fees .qf-table .qf-total :is(th, td) { font-weight: 700; color: var(--text); }
#quantum-fees .qf-table .qf-share :is(th, td) { border-top: 0; padding-top: 0; font-size: 11.5px; color: var(--faint); }
@media (max-width: 560px) {
  #quantum-fees .qf-table { font-size: 12px; }
  #quantum-fees .qf-table th, #quantum-fees .qf-table td { padding: 6px 4px; }
}
#quantum-fees #quantum-fees-once dd { font-family: var(--sans); font-size: 13px; line-height: 1.5; }

/* Phones and tablets get an app layout. The menu becomes a tab bar fixed to the bottom of the
   screen, with the overview in the middle on a blue square, and the overview page shows every
   account and section as a square to tap, two to a row on a phone. The desktop is unchanged. */
.home-tiles { display: none; }
#add-account .side-tab-label { display: none; }

@media (max-width: 1040px) {
  #view-wallet.shell { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  #view-wallet #side-nav {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    overflow: visible;
    padding: 0 0 env(safe-area-inset-bottom);
    /* White in both looks, with black icons, and lit from above so it stands off the page. */
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, .1);
    background: linear-gradient(180deg, #ffffff 0%, #f6f7f9 55%, #eceef2 100%);
    box-shadow:
      inset 0 1px 0 #ffffff,
      inset 0 -1px 0 rgba(0, 0, 0, .06),
      0 -2px 6px rgba(0, 0, 0, .08),
      0 -14px 30px rgba(0, 0, 0, .14);
  }
  #view-wallet #side-nav :is(.side-label, .side-note, #account-list) { display: none; }
  #view-wallet #side-nav .side-head { display: contents; }
  #view-wallet #side-nav .nav,
  #view-wallet #side-nav #add-account {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    /* Every tab fills its whole cell, over the bar's top line and down through the space a phone
       keeps clear at the bottom edge, so the blue square is the same size on whichever tab. */
    height: calc(73px + env(safe-area-inset-bottom));
    margin: -1px 0 calc(-1 * env(safe-area-inset-bottom));
    padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1d1d1f;
    font: 600 11px/1 var(--sans);
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
  }
  #view-wallet #side-nav .nav svg,
  #view-wallet #side-nav #add-account svg { width: 22px; height: 22px; color: currentColor; }
  #view-wallet #side-nav .nav:hover,
  #view-wallet #side-nav #add-account:hover:not(:disabled) { background: transparent; color: #000; }
  /* The page you are on is a flat blue square. An account page counts as the overview, since
     the accounts open from there. */
  #view-wallet #side-nav .nav.active,
  #view-wallet #side-nav[data-pane="account"] .nav[data-nav="dashboard"] {
    background: var(--brand);
    color: #fff;
    box-shadow: none;
  }
  #view-wallet #side-nav .nav.active:hover,
  #view-wallet #side-nav[data-pane="account"] .nav[data-nav="dashboard"]:hover { background: var(--brand-hover); color: #fff; }
  #view-wallet #side-nav .nav[data-nav="security"] { order: 1; }
  #view-wallet #side-nav .nav[data-nav="rules"] { order: 2; }
  #view-wallet #side-nav .nav[data-nav="dashboard"] { order: 3; }
  #view-wallet #side-nav .nav[data-nav="help"] { order: 4; }
  #view-wallet #side-nav #add-account { order: 5; }
  #add-account .side-tab-label { display: inline; }


  /* Nothing fixed to the bottom may sit under the bar. */
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  #view-wallet .save-bar { bottom: calc(90px + env(safe-area-inset-bottom)); }

  #view-wallet .home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  #view-wallet #accounts-lane { display: none; }
}

@media (max-width: 640px) {
  #view-wallet .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.home-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--lift-1);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow var(--quick), border-color var(--quick), transform .1s var(--ease);
}
.home-tile:hover { border-color: var(--hair-strong); box-shadow: var(--lift-2); }
.home-tile:active { transform: scale(.98); }
.home-tile .account-mark { width: 36px; height: 36px; font-size: 15px; }
#view-wallet .home-tile .ico { width: 36px; height: 36px; }
.home-tile-text { display: grid; gap: 3px; min-width: 0; line-height: 1.2; }
.home-tile-text b { font-size: 15px; font-weight: 700; letter-spacing: -.015em; color: var(--text); }
.home-tile-text small { font-size: 12px; line-height: 1.3; color: var(--muted); }
.home-tile.warn .home-tile-text small { color: var(--amber); font-weight: 600; }
.home-tile-amount {
  font: 600 12.5px/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* The coin the total card shows: Bitcoin, Ethereum or BNB, picked above the balance. */
#view-wallet #coins { margin-bottom: 14px; }

/* On a phone the page already has its 16px gutter, so the panes add none of their own, and the
   balance stays on one line, its unit included. */
@media (max-width: 640px) {
  #view-wallet .panes { padding: 8px 0 0; }
  #view-wallet .card.total { padding: 20px 18px; }
  #view-wallet .card.total .amount { white-space: nowrap; font-size: clamp(28px, 9vw, 40px); }
}

/* A coin's own mark fills its round tile, so the tile itself shows nothing behind it. */
#view-wallet .account-mark.coin,
#view-wallet .account.active .account-mark.coin { background: transparent; box-shadow: none; overflow: hidden; }
.account-mark.coin svg { display: block; width: 100%; height: 100%; }

/* The desktop account list: room around the Accounts heading and its add button, and each
   account's name on a line of its own, with the network and the balance under it. */
@media (min-width: 1041px) {
  #view-wallet #side-nav .side-head.spaced { margin: 22px 0 10px; padding: 0 6px 0 0; }
  #view-wallet #side-nav .side-head .side-label { margin: 0 0 0 10px; }
  #view-wallet #side-nav #add-account { width: 32px; height: 32px; }
  #view-wallet #side-nav .account-list { gap: 4px; }
  #view-wallet #side-nav .account-list .account {
    display: grid;
    grid-template-columns: 29px minmax(0, 1fr) auto;
    grid-template-areas: "mark name name" "mark chain amount";
    column-gap: 10px;
    row-gap: 4px;
    align-items: center;
    padding: 8px 9px;
  }
  #view-wallet #side-nav .account-list .account-mark { grid-area: mark; }
  #view-wallet #side-nav .account-list .account-text { display: contents; }
  #view-wallet #side-nav .account-list .account-text b { grid-area: name; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #view-wallet #side-nav .account-list .account-text small { grid-area: chain; line-height: 1.25; }
  #view-wallet #side-nav .account-list .account-amount { grid-area: amount; margin-left: 0; }
}

/* A long network name stays on one line in its square. */
.home-tile-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
