:root {
  color-scheme: light;
  --canvas: #f5f7f6;
  --paper: #fff;
  --forest: #142b23;
  --ink: #203029;
  --muted: #5f7067;
  --line: #dfe6e1;
  --soft-line: #eaf0ec;
  --green: #285a43;
  --accent: #c2f880;
  --sidebar-width: 222px;
  --gutter: clamp(24px, 3vw, 48px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.55; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .49; cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
:focus-visible { outline: 3px solid #497d58; outline-offset: 3px; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.skip {
  position: fixed; left: 12px; top: 8px; z-index: 10; padding: 8px 12px; border-radius: 6px;
  color: var(--forest); background: var(--accent); transform: translateY(-150%);
}
.skip:focus { transform: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; align-self: start; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; padding: 0 17px 0; color: #e8f1ea; background: var(--forest);
}
.brand {
  display: flex; align-items: center; gap: 11px; min-height: 80px; padding: 0 8px;
  font-size: 1.22rem; line-height: 1; font-weight: 700; letter-spacing: -.055em; white-space: nowrap;
}
.brand img { display: block; width: 34px; height: 34px; }
.sidebar-body { flex: 1; min-height: 0; overflow: auto; padding-top: 25px; }
.nav-caption { margin: 0 12px 11px; color: #a1b6ab; font-size: .75rem; letter-spacing: .09em; font-weight: 550; }
.nav-caption.second { margin-top: 30px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; min-height: 44px; border-radius: 8px;
  color: #c8d8cf; font-size: .9rem; font-weight: 550; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar nav a svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar nav a:hover { color: #fff; background: #203c2e; }
.sidebar nav a:is(.active, .current, [aria-current="page"]) {
  background: #2e4b38; color: #effbdf; box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar nav a:is(.active, .current, [aria-current="page"]) svg { color: var(--accent); }
.sidebar :focus-visible { outline-color: var(--accent); outline-offset: -3px; }
.side-foot { display: flex; gap: 11px; align-items: center; padding: 19px 5px 21px; border-top: 1px solid #334c40; }
.host-icon { display: grid; place-items: center; width: 36px; height: 36px; background: #243f31; border: 1px solid #375343; border-radius: 9px; color: #c4dea9; }
.host-icon svg { width: 18px; height: 18px; }
.side-foot b, .side-foot small { display: block; }
.side-foot b { font-size: .85rem; line-height: 1.5; font-weight: 600; }
.side-foot small { color: #a1b6ab; font-size: .75rem; }
.workspace, .overview-main, .card, main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 65px; padding: 10px var(--gutter); background: #fff; border-bottom: 1px solid var(--line);
}
.crumb, .server-pill { display: inline-flex; align-items: center; }
.crumb { gap: 12px; font-size: .825rem; color: var(--muted); }
.crumb svg { width: 17px; height: 17px; color: #607569; }
.crumb b { color: #a6b4ab; font-weight: 400; }
.crumb strong { color: #344a3c; font-weight: 600; }
.server-pill {
  gap: 7px; width: fit-content; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px;
  background: #f7f9f7; color: #57675e; font-size: .75rem; line-height: 1.5; font-weight: 550; white-space: nowrap;
}
.server-pill i, .hero-tag i { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #909c95; }
.server-pill.online { border-color: #d6e6d4; background: #f1f8ef; color: #3c6547; }
.server-pill.online i { background: #478653; box-shadow: 0 0 0 2px #e1efda; }
.server-pill.offline { border-color: #efddce; color: #864d27; background: #fff6ee; }
.server-pill.offline i { background: #bb7642; }

main { width: 100%; max-width: 1570px; margin: 0 auto; padding: 30px var(--gutter) 40px; }
main:focus { outline: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2, h3, p { margin: 0; }
.page-heading h1, .page-head h1 { font-size: clamp(1.75rem, 2.2vw, 2.2rem); line-height: 1.28; letter-spacing: -.044em; font-weight: 710; }
.page-heading p, .page-head p { color: var(--muted); font-size: .9rem; margin-top: 5px; line-height: 1.65; }
.actions, .form-actions, .modal-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.btn, .small-btn, .btn-icon, .modal-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff;
  border: 1px solid #d3ddd6; border-radius: 8px; font-size: .875rem; line-height: 1.4; font-weight: 600;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn { min-height: 40px; padding: 8px 14px; white-space: nowrap; }
.btn svg, .small-btn svg, .btn-icon svg { width: 16px; height: 16px; stroke-width: 1.9; }
.btn.primary { background: #244c36; border-color: #244c36; color: #fff; box-shadow: 0 1px 2px #102b2012; }
.btn.primary:hover:enabled { background: #183b2b; border-color: #183b2b; }
.btn.secondary, .small-btn { background: #fff; color: #374c3e; }
.btn.secondary:hover:enabled, .small-btn:hover:enabled, .btn-icon:hover:enabled, .modal-close:hover:enabled { border-color: #a7bcae; background: #f1f6f1; }
.btn-icon, .modal-close { width: 40px; height: 40px; padding: 0; }

.hero {
  position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden; min-height: 203px;
  border: 1px solid #294c39; border-radius: 16px; color: #f1f8ee;
  background: radial-gradient(ellipse at 84% 44%, #36563b 0%, #284a35 34%, transparent 66%), linear-gradient(112deg, #1b3728, #264a32);
}
.hero-copy { z-index: 1; flex: 0 1 auto; padding: 22px clamp(22px, 2.6vw, 38px); }
.hero-heading, .hero-tag, .hero-detail, .hero-detail span { display: flex; align-items: center; }
.hero-heading { gap: 10px; }
.hero-heading h2 { font-size: 1.02rem; font-weight: 630; letter-spacing: .025em; }
.hero-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: #35523a; border: 1px solid #4b6746; border-radius: 8px; }
.hero-icon svg { width: 17px; height: 17px; }
.hero-tag { margin-left: 2px; gap: 6px; padding: 2px 8px; color: #d5e8c8; background: #344e39; border: 1px solid #526951; border-radius: 99px; font-size: .75rem; white-space: nowrap; }
.hero-tag i { width: 5px; height: 5px; background: #b3d58e; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); max-width: 415px; margin: 18px 0 16px; }
.metric { display: flex; flex-direction: column; align-items: flex-start; padding-right: 30px; }
.metric + .metric { border-left: 1px solid #55705a; padding-left: clamp(18px, 2.6vw, 38px); }
.metric span { font-size: .80rem; color: #c4d6c6; white-space: nowrap; }
.metric strong { order: -1; color: #f4f8ef; font-size: clamp(2rem, 3.1vw, 2.85rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 590; font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.hero-detail { gap: 16px; flex-wrap: wrap; color: #bed0be; font-size: .76rem; }
.hero-detail span { gap: 6px; }
.hero-detail svg { width: 13px; height: 13px; }
.radar { position: absolute; z-index: -1; right: 1.5%; top: 50%; transform: translateY(-50%); display: block; width: 42%; max-width: 472px; height: 109%; object-fit: contain; user-select: none; pointer-events: none; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(278px, 1fr); align-items: start; gap: 20px; margin-top: 21px; }
.overview-main { display: grid; align-content: start; gap: 20px; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 2px 5px #1c322606; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 21px; min-height: 62px; border-bottom: 1px solid var(--soft-line); }
.card-head h2 { display: flex; align-items: center; gap: 9px; color: #203427; font-size: 1.04rem; line-height: 1.35; letter-spacing: -.015em; font-weight: 660; }
.card-head h2 svg { width: 18px; height: 18px; color: #52795c; stroke-width: 1.85; }
.meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.text-link, .text-button, .wallet-link { display: inline-flex; align-items: center; gap: 4px; color: #365f43; font-weight: 550; }
.text-link, .text-button { font-size: .81rem; white-space: nowrap; }
.text-link svg, .text-button svg { width: 14px; height: 14px; }
.text-link:hover, .wallet-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button { padding: 5px 8px; border: 0; background: transparent; border-radius: 5px; }
.text-button:hover { background: #edf4ec; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; padding: 26px 18px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 15px;
  background: #eaf1e9; color: #587861; border: 1px solid #d6e3d7; border-radius: 13px;
  box-shadow: 0 0 0 5px #f5f8f4;
}
.empty-icon svg { width: 24px; height: 24px; stroke-width: 1.65; }
.empty b, .empty-line b { color: #35483a; font-size: .94rem; font-weight: 610; }
.empty p, .empty-line p { color: var(--muted); margin: 4px 0 0; font-size: .83rem; line-height: 1.6; }
.empty .text-button { margin-top: 8px; }
.wallet-preview .empty { min-height: 211px; }
.empty-line { display: flex; gap: 13px; align-items: center; padding: 23px 22px; }
.line-icon { display: grid; place-items: center; flex: none; width: 39px; height: 39px; border-radius: 10px; color: #598065; background: #eef4ed; }
.line-icon svg { width: 20px; height: 20px; stroke-width: 1.7; }
.empty-line p { margin-top: 2px; }
.network-list { padding: 0 20px 4px; }
.network-row { display: flex; gap: 11px; align-items: center; width: 100%; min-height: 55px; padding: 8px 0; border: 0; background: transparent; text-align: left; }
.network-row + .network-row { border-top: 1px solid var(--soft-line); }
.network-row:focus-visible { outline-offset: -2px; border-radius: 3px; }
.network-row:hover .network-name b { color: #31704a; }
.coin { display: block; width: 32px; height: 32px; object-fit: contain; flex: none; border-radius: 50%; }
.network-name { min-width: 0; flex: 1; }
.network-name b, .network-name small, .network-cell b, .network-cell small { display: block; }
.network-name b { color: #26362d; font-size: .9rem; line-height: 1.4; font-weight: 640; letter-spacing: -.015em; }
.network-name small, .network-cell small { font-size: .74rem; color: var(--muted); line-height: 1.5; }
.chip { display: inline-flex; align-items: center; width: fit-content; white-space: nowrap; font-size: .75rem; line-height: 1.45; padding: 2px 8px; background: #f2f4f2; color: #607068; border: 1px solid #e4e9e5; border-radius: 99px; font-weight: 500; }
.chip.good { border-color: #d9e8d6; background: #edf6e9; color: #3e6944; }
.chip.warn { border-color: #f0dcc3; background: #fff5e8; color: #84561d; }

.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--soft-line); }
.search, .select-wrap { display: flex; align-items: center; position: relative; }
.search { width: min(370px, 100%); }
.search svg, .select-wrap svg { position: absolute; width: 16px; height: 16px; color: #67786b; pointer-events: none; }
.search svg { left: 11px; }
.select-wrap svg { right: 10px; width: 14px; height: 14px; }
.search input, .select-wrap select, #tg-form input {
  height: 40px; min-width: 0; border: 1px solid #d1dcd3; border-radius: 7px; background: #fff; color: var(--ink);
  font-size: .875rem; line-height: 1.5;
}
.search input { width: 100%; padding: 7px 10px 7px 35px; }
.select-wrap select { width: 100%; padding: 7px 32px 7px 12px; appearance: none; }
input::placeholder { color: #738078; opacity: 1; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .845rem; line-height: 1.5; }
th, td { padding: 13px 17px; white-space: nowrap; border-bottom: 1px solid var(--soft-line); }
th:first-child, td:first-child { padding-left: 21px; }
th:last-child, td:last-child { padding-right: 21px; }
th { color: #5c6e60; background: #f8faf8; font-size: .78rem; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfa; }
td { color: #415247; }
.wallet-link { gap: 7px; }
.wallet-link svg { width: 16px; height: 16px; }
.mono, .number, code, .balance-cell { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.network-cell { display: flex; align-items: center; gap: 9px; }
.network-cell .coin { width: 28px; height: 28px; }
.network-cell b { font-weight: 600; color: var(--ink); }
.copy { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: #3d5746; padding: 6px 2px; border-radius: 4px; }
.copy svg { width: 14px; height: 14px; color: #687e6c; }
.copy:hover { color: #206126; background: #f0f5ef; }
.history-address { display: block; font-size: .73rem; color: var(--muted); margin-top: 4px; }
.balance-cell > span { display: block; line-height: 1.6; }
.balance-cell b { font-weight: 550; }
.balance-cell small { font-family: inherit; color: var(--muted); }
.positive { color: #36734b; }
.negative { color: #ad4e3e; }
.pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--soft-line); padding: 14px 20px; }
.pager span { margin-right: auto; font-size: .8rem; color: var(--muted); }
.small-btn { min-height: 34px; padding: 5px 10px; font-size: .8rem; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr); align-items: start; gap: 20px; }
#tg-form, .rules dl { padding: 21px; margin: 0; }
#tg-form label { display: block; font-size: .875rem; font-weight: 640; margin-bottom: 6px; }
#tg-form input { display: block; width: 100%; padding: 8px 11px; height: 43px; }
#tg-form input + label { margin-top: 16px; }
.field-hint { margin-top: 10px; font-size: .82rem; line-height: 1.7; color: var(--muted); }
.form-actions { margin-top: 22px; }
#form-result { margin-top: 0; font-size: .85rem; color: #a3402d; }
#form-result:not(:empty) { margin-top: 12px; }
.rules dt { font-size: .88rem; font-weight: 620; }
.rules dd { margin: 4px 0 16px; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.rules dd:last-child { margin-bottom: 0; }

dialog {
  width: min(542px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto;
  padding: 0; border: 1px solid #d4dfd5; border-radius: 16px; background: #fff; color: var(--ink);
  box-shadow: 0 24px 90px #10271c42, 0 6px 18px #10271c1c;
}
dialog::backdrop { background: #081a125d; }
.modal-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--soft-line); }
.modal-head h2 { font-size: 1.2rem; line-height: 1.45; font-weight: 660; letter-spacing: -.025em; }
.modal-head p { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.modal-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: #3d6948; background: #edf4e9; border: 1px solid #d9e5d7; border-radius: 11px; }
.modal-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.modal-close { margin-left: auto; width: 32px; height: 32px; border-color: transparent; border-radius: 7px; }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 19px 24px 22px; }
.privacy-note, .banner { display: flex; align-items: flex-start; gap: 8px; font-size: .83rem; line-height: 1.65; padding: 10px 13px; border: 1px solid #dce8d7; color: #46624a; background: #f1f7ee; border-radius: 8px; }
.privacy-note svg, .banner svg { width: 16px; height: 16px; margin-top: 2px; }
.privacy-note { margin-bottom: 15px; }
.banner { margin-bottom: 18px; color: #7c512b; border-color: #e9d8c4; background: #fff7ed; }
iframe.import-frame { display: block; width: 100%; height: 270px; border: 0; background: #fff; }
.address-import label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 640; }
.address-import input[type="file"], .address-import textarea {
  display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.address-import input[type="file"] { padding: 7px; font-size: .875rem; }
.address-import input::file-selector-button {
  margin-right: 9px; padding: 6px 11px; border: 0; border-radius: 5px; background: #edf4ed; color: var(--green); font: inherit; cursor: pointer;
}
.address-import textarea { padding: 9px 11px; font: 1rem/1.55 ui-monospace, monospace; resize: vertical; }
.address-format { margin: 0 0 9px; color: var(--muted); font-size: .875rem; }
.input-divider { display: flex; align-items: center; gap: 11px; margin: 15px 0; color: var(--muted); font-size: .8rem; }
.input-divider::before, .input-divider::after { content: ""; flex: 1; height: 1px; background: var(--soft-line); }
.privacy-note b { display: block; font-size: .88rem; font-weight: 620; }
.privacy-note p { margin-top: 2px; }
.review-lead { margin-bottom: 12px; font-size: .875rem; color: #506256; }
.review-list { max-height: min(46vh, 390px); overflow: auto; padding-right: 3px; }
.review-item { padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafcf9; overflow-wrap: anywhere; }
.review-item:last-child { margin-bottom: 0; }
.review-item summary { cursor: pointer; color: #344d3a; font-size: .9rem; font-weight: 600; }
.review-item dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 10px; margin: 10px 0 0; }
.review-item dt { margin: 0; font-size: .78rem; color: #426048; font-weight: 600; }
.review-item dd { margin: 0; min-width: 0; line-height: 1.4; }
.review-item dd code { overflow-wrap: anywhere; }
.review-item b, .review-item strong { color: var(--ink); font-size: .9rem; }
.review-item code, .review-item small { font-size: .76rem; color: var(--muted); }
.modal-actions { justify-content: flex-end; margin-top: 18px; }
.form-error, #form-result.form-error { color: #a3402d; font-size: .85rem; }
.form-error:not(:empty) { margin-top: 9px; }
.loading { display: grid; place-items: center; gap: 12px; min-height: 180px; color: var(--muted); font-size: .9rem; }
#toast {
  position: fixed; z-index: 9; bottom: 24px; left: calc(50% + var(--sidebar-width) / 2); transform: translate(-50%, 8px);
  background: #213c2c; color: #fff; border: 1px solid #48634f; border-radius: 8px; padding: 10px 16px;
  opacity: 0; pointer-events: none; box-shadow: 0 4px 18px #162b2426; font-size: .88rem; text-align: center;
  max-width: min(500px, 90vw); width: max-content; transition: opacity .15s ease, transform .15s ease;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1150px) {
  :root { --gutter: 26px; --sidebar-width: 202px; }
  .sidebar { padding-inline: 13px; }
  .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr); gap: 16px; }
  .overview-main { gap: 16px; }
  .hero-copy { padding-inline: 24px; }
  .radar { right: 0; width: 39%; }
  .card-head { padding-inline: 17px; }
  .network-list { padding-inline: 16px; }
}
@media (max-width: 940px) {
  :root { --sidebar-width: 185px; --gutter: 20px; }
  .brand { gap: 8px; font-size: 1.08rem; padding-inline: 3px; }
  .brand img { width: 31px; height: 31px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .metrics { grid-template-columns: repeat(3, minmax(75px, 1fr)); }
  .metric { padding-right: 15px; }
  .metric + .metric { padding-left: 18px; }
  .overview-grid { grid-template-columns: minmax(0, 1.3fr) minmax(220px, 1fr); }
  .network-row { gap: 8px; }
  .network-row .coin { width: 29px; height: 29px; }
  .settings-grid { grid-template-columns: minmax(0, 1.2fr) minmax(210px, 1fr); }
}
@media (max-width: 800px) {
  :root { --sidebar-width: 0px; --gutter: 22px; }
  .shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 0 var(--gutter) 9px; }
  .brand { min-height: 55px; padding: 0; width: fit-content; font-size: 1.15rem; }
  .brand img { width: 30px; height: 30px; }
  .nav-caption, .side-foot, .crumb { display: none; }
  .sidebar-body { flex: none; display: flex; gap: 5px; padding: 0; overflow: visible; }
  .sidebar nav { display: flex; gap: 5px; }
  .sidebar nav a { min-height: 40px; gap: 7px; padding: 7px 12px; font-size: .84rem; }
  .sidebar nav a svg { width: 16px; height: 16px; }
  .sidebar nav a:is(.active, .current, [aria-current="page"]) { box-shadow: inset 0 -2px 0 var(--accent); }
  .topbar { position: absolute; top: 14px; right: var(--gutter); min-height: 0; padding: 0; border: 0; background: transparent; }
  .server-pill { color: #d7e6d8; border-color: #47614e; background: #2a4232; }
  .server-pill.online { color: #d8edcb; background: #2a4835; border-color: #49664c; }
  .server-pill.online i { background: #b9ee8b; box-shadow: none; }
  main { padding-top: 23px; }
  .page-head { align-items: center; margin-bottom: 17px; }
  .settings-grid { grid-template-columns: minmax(0, 1.3fr) minmax(210px, 1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 15px; }
  .sidebar { padding-bottom: 7px; }
  .sidebar-body { gap: 3px; }
  .sidebar-body nav:first-of-type { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 3; gap: 3px; }
  .sidebar-body nav:last-of-type { display: flex; flex: 1.2; }
  .sidebar nav a { justify-content: center; padding-inline: 3px; flex: 1; font-size: .82rem; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-heading h1, .page-head h1 { font-size: 1.68rem; }
  .page-heading p, .page-head p { font-size: .845rem; }
  .actions { width: 100%; }
  .btn { min-height: 42px; }
  .hero { min-height: 185px; border-radius: 13px; }
  .hero-copy { padding: 19px 17px; }
  .hero-heading { gap: 8px; }
  .hero-heading h2 { font-size: .96rem; }
  .metrics { grid-template-columns: repeat(3, minmax(64px, 1fr)); max-width: 270px; margin: 16px 0; }
  .metric span { font-size: .76rem; }
  .metric strong { font-size: 2.13rem; }
  .metric + .metric { padding-left: 13px; }
  .hero-detail { gap: 8px 13px; font-size: .74rem; }
  .radar { right: -1%; width: 44%; height: auto; opacity: .77; }
  .overview-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; margin-top: 15px; }
  .overview-main { gap: 15px; }
  .settings-grid { margin-top: 0; }
  .card { border-radius: 12px; }
  .card-head { min-height: 54px; padding: 14px 16px; }
  .card-head h2 { font-size: 1rem; }
  .wallet-preview .empty { min-height: 198px; }
  .empty { min-height: 200px; }
  .empty-line { padding: 17px 16px; }
  .network-row { min-height: 55px; }
  .network-row .coin { width: 31px; height: 31px; }
  .filters, #tg-form, .rules dl { padding: 15px; }
  .filters { gap: 8px; }
  .search { flex: 1 1 140px; }
  .select-wrap { flex: 1 1 105px; }
  .search input, .select-wrap select, #tg-form input { font-size: 1rem; }
  th, td { padding: 10px 13px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .modal-head { padding: 17px 16px 14px; gap: 9px; }
  .modal-body { padding: 15px 16px 18px; }
  iframe.import-frame { height: 287px; }
}
@media (max-width: 405px) {
  .sidebar nav a { gap: 4px; }
  .sidebar nav a svg { width: 14px; height: 14px; }
  .radar { right: -2%; opacity: .66; }
}
@media (max-width: 355px) {
  .sidebar nav a svg { display: none; }
  .radar { right: -8%; opacity: .28; }
  .hero-detail { gap: 4px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

#sub-controls { padding: 21px; }
#sub-controls > p { color: var(--muted); margin-bottom: 18px; }
#sub-controls #tg-form { padding: 20px 0 0; margin-top: 20px; border-top: 1px solid var(--line); }

.portfolio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); }
.portfolio-summary, .portfolio-holdings { min-width: 0; padding: clamp(19px, 2.6vw, 30px); }
.portfolio-summary {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  color: #f3f9f0; background: radial-gradient(ellipse at 100% 0, #365b3d, transparent 70%), #1b392b;
}
.portfolio-heading, .portfolio-heading h2, .holdings-heading, .portfolio-poll, .portfolio-total {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.portfolio-heading h2, .holdings-heading h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.portfolio-heading h2 svg { width: 19px; height: 19px; color: var(--accent); }
.portfolio-status { padding: 1px 8px; border: 1px solid #68816a; border-radius: 12px; color: #e1efd6; font-size: .76rem; }
.portfolio-total { width: 100%; align-items: baseline; gap: 3px 8px; margin: 12px 0 7px; }
.portfolio-total strong {
  min-width: 0; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(2.05rem, 3.6vw, 3.15rem);
  font-weight: 600; letter-spacing: -.045em; line-height: 1.12; font-variant-numeric: tabular-nums;
}
.portfolio-total strong.long-value { font-size: clamp(1.45rem, 2.8vw, 2.1rem); }
.portfolio-total > span { color: #c4d8c4; font-size: .81rem; font-weight: 600; }
.portfolio-coverage { color: #e3eddf; font-size: .875rem; }
.portfolio-notices { margin-top: 6px; color: #efddb3; font-size: .82rem; }
.portfolio-poll { margin-top: 14px; color: #c3d4c2; font-size: .78rem; }
.portfolio-poll svg { width: 14px; height: 14px; }
.holdings-heading { justify-content: space-between; gap: 4px 12px; margin-bottom: 9px; }
.portfolio-quote { color: var(--muted); font-size: .77rem; }
.portfolio-quote a { text-decoration: underline; text-decoration-color: #b2c1b3; text-underline-offset: 2px; }
.portfolio-quote.old-quote { color: #805518; }
.holding-table { table-layout: fixed; }
.holding-table th, .holding-table td { padding: 6px 3px; white-space: normal; overflow-wrap: anywhere; }
.holding-table thead th { background: transparent; color: var(--muted); font-weight: 500; }
.holding-table th:first-child { width: 19%; padding-left: 0; }
.holding-table th:last-child, .holding-table td:last-child { width: 32%; padding-right: 0; }
.holding-table th:not(:first-child), .holding-table td { text-align: right; }
.holding-table tbody th { color: var(--ink); font-size: .87rem; font-weight: 630; background: transparent; }
.holding-table tbody tr:last-child th { border-bottom: 0; }
.holding-table .holding-quantity, .holding-table .holding-estimate { font-variant-numeric: tabular-nums; font-size: .85rem; }
.holding-table .no-quote { color: var(--muted); font-size: .79rem; }
.portfolio-empty { color: var(--muted); font-size: .88rem; }
@media (max-width: 640px) {
  .portfolio-summary, .portfolio-holdings { padding: 17px; }
}
