:root {

  color-scheme: light;

  --page:        #EDEAE3;
  --bg:          #F5F2EB;
  --card:        #F0EDE6;
  --card2:       #E8E4DB;
  --input:       #F5F2EB;

  --text:        #14120E;
  --hint:        #14120E;
  --dim:         #14120E;
  --sub:         #8A8377;
  --line:        #D9D4C8;
  --chevron:     #B3ABA0;

  --accent:      #14120E;
  --on-accent:   #F5F2EB;
  --btn:         #14120E;
  --btn-fg:      #F5F2EB;
  --accent-soft: #E3DFD4;
  --accent-text: #14120E;

  --nav-on:      #E3DFD4;

  --green:       #2F7D5B;
  --green-soft:  #E0EBE3;
  --red:         #C4453F;
  --red-bg:      #F3E3E1;
  --track:       #DED9CD;

  --amber-bg:     #F2E9D6;
  --amber-text:   #6B5A38;
  --amber-strong: #9A7B33;
  --amber-btn:    #F5F2EB;
  --amber-btn-fg: #14120E;

  --dashed:      #B3ABA0;
  --edge:        #C8B9A0;
  --edge-soft:   #E6DECF;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --pill:        rgba(255,255,255,.94);
  --pill-shadow: 0 6px 24px rgba(16,24,40,.16);
  --scrim:       rgba(11,13,16,.4);
  --qr-scrim:    rgba(11,13,16,.92);
  --sheet:       #F5F2EB;
  --toast:       #14120E;
  --toast-fg:    #F5F2EB;

  --off-bg:      #DED9CD;
  --off-fg:      #8A8377;

  --knob-sh:     inset 0 1px 2px rgba(0,0,0,.25);

  --sw-sh:       0 1px 3px rgba(0,0,0,.28);

  --sw-knob:     #F5F2EB;

  --mono: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ui:   'Martian Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --hdr: 54px;
  --nav: 62px;

  --snd-on: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16.5 8.5a5 5 0 0 1 0 7" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/><path d="M19.5 5.5a9 9 0 0 1 0 13" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>');
  --snd-off: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M17 9.5l5 5M22 9.5l-5 5" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>');
}

:root[data-theme="dark"], [data-theme="dark"] {
  color-scheme: dark;

  --page:        #0D0C09;
  --bg:          #131210;
  --card:        #191714;
  --card2:       #201D19;
  --input:       #100F0C;

  --text:        #D8D3C6;
  --hint:        #D8D3C6;
  --dim:         #D8D3C6;
  --sub:         #867E72;
  --line:        #262320;
  --chevron:     #5A554B;

  --accent:      #C9C3B4;
  --on-accent:   #0D0C09;
  --btn:         #2B2721;
  --btn-fg:      #D8D3C6;
  --accent-soft: #262320;
  --accent-text: #C9C3B4;

  --nav-on:      #262320;

  --green:       #5FA882;
  --green-soft:  #18241E;
  --red:         #C97C77;
  --red-bg:      #261A18;
  --track:       #262320;

  --amber-bg:     #2C2415;
  --amber-text:   #B79C6E;
  --amber-strong: #D2A044;
  --amber-btn:    #2F291A;
  --amber-btn-fg: #DCC896;

  --dashed:      #5A554B;
  --edge:        #38342C;
  --edge-soft:   #201D19;
  --pill:        rgba(25,23,20,.94);
  --pill-shadow: 0 6px 24px rgba(0,0,0,.5);
  --scrim:       rgba(0,0,0,.6);
  --qr-scrim:    rgba(0,0,0,.94);
  --sheet:       #191714;
  --toast:       #262320;
  --toast-fg:    #D8D3C6;

  --off-bg:      #2B2823;
  --off-fg:      #867E72;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea { font-family: inherit; color: inherit; }

body { letter-spacing: -.2px; font-size: 14px; }
.hdr-title { font-size: 15px; }
.btn-primary, .btn-ghost { font-size: 13px; padding: 14px 10px; }
.mini-v { font-size: 17px; }
.mini-k, .tile-k { font-size: 11px; }
.tab span { font-size: 10px; }
.deal .amount { letter-spacing: -1.4px; }
button { border: 0; background: none; cursor: pointer; }

button, .snd-row, 
button:active, .snd-row:active, 

.snd-row:active, .adm-row:active, .adm-top-r:active,
.btn-dashed:active, .lim-apply:active, .btn-primary:active { transform: scale(.985); }

button:focus-visible, input:focus-visible, .snd-row:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button, .snd-row, 
  button:active, .snd-row:active, 
}

.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

.screen, .screen * { min-width: 0; }
.app {
  position: relative;
  width: 100%; max-width: 480px; margin: 0 auto;

  height: var(--tg-vh, 100dvh);
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.hdr {
  flex: none; height: var(--hdr);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--edge);
  background: var(--bg);
  z-index: 5;
}
.hdr-l { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hdr-title {
  font-size: 17px; font-weight: 600; letter-spacing: -.3px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hdr-sub { font-size: 13px; color: var(--sub); flex: none; }
.hdr-sub.warn { color: var(--amber-strong); }

.hdr-back {
  flex: none; font-size: 22px; line-height: 1; color: var(--accent);
  background: none; padding: 0 4px 0 0; margin-right: 4px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: var(--red); }
.dot.warn { background: var(--amber-strong); }

.scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.scroll::-webkit-scrollbar { width: 0; }

.screen {
  display: none; flex-direction: column; gap: 16px;

  padding: 18px 16px 104px;
}
.screen.on { display: flex; }

.h1 { font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.h2 { font-size: 22px; font-weight: 600; letter-spacing: -.5px; }

.lbl {
  font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--text);
}
.lbl.in-card { padding-left: 14px; color: var(--sub); }
.note { font-size: 12px; line-height: 1.5; color: var(--sub); }
.row { display: flex; align-items: center; justify-content: space-between; }
.row.base { align-items: baseline; }
.col { display: flex; flex-direction: column; }
.sect { display: flex; flex-direction: column; gap: 9px; }
.hr { height: 1px; background: var(--line); }
.back { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--sub); cursor: pointer; text-align: left; }

.card {
  padding: 15px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 12px;
}
.card.p16 { padding: 16px; }
.tile {
  padding: 14px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 6px;
}
.tile-k { font-size: 12px; color: var(--sub); }
.tile-v { font-size: 27px; font-weight: 600; letter-spacing: -1px;
          font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mini {
  flex: 1 1 0; min-width: 0; padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--card2); border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 4px;
}
.mini-v { font-size: 20px; font-weight: 600; line-height: 1.1;
          font-variant-numeric: tabular-nums; }
.mini-k { font-size: 12px; color: var(--sub);
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-primary {
  padding: 15px; border-radius: var(--r-lg); width: 100%;
  background: var(--btn); color: var(--btn-fg);
  text-align: center; font-size: 15px; font-weight: 600;
}
.btn-primary:disabled { background: var(--card2); color: var(--chevron); }

.btn-ghost {
  padding: 15px; border-radius: var(--r-lg); width: 100%;
  background: var(--card2); color: var(--text); border: 1px solid var(--edge);
  text-align: center; font-size: 15px; font-weight: 600;
}
.btn-danger {
  padding: 13px; border-radius: var(--r-md); border: 1px solid var(--red);
  text-align: center; font-size: 12px; font-weight: 600; color: var(--red); width: 100%;
}
.btn-dashed {
  padding: 15px; border-radius: var(--r-lg); border: 1px dashed var(--edge);
  text-align: center; font-size: 13px; font-weight: 600; color: var(--accent); width: 100%;
}

.in {
  width: 100%; padding: 12px; border-radius: var(--r-lg);
  background: var(--input); border: 1px solid var(--edge);
  color: var(--text); font-size: 16px; font-weight: 500;
}
.in.mono { font-size: 12px; font-weight: 400; }
.in.sunk { background: var(--bg); }
.in.bad { border-color: var(--red); }
.in::placeholder { color: var(--chevron); }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--edge-soft); }

.active-deal {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 0;
  width: 100%; text-align: left;
}
.active-deal .ico {
  width: 38px; height: 38px; border-radius: var(--r-lg); flex: none;
  background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.active-deal .ico i {
  width: auto; height: auto; border-radius: 0; background: none;
  font-style: normal;
}
.active-deal .ico i::before { content: '₽'; }
.active-deal .arw { font-size: 20px; color: var(--accent); opacity: .65; }

.bars { display: flex; gap: 4px; align-items: flex-end; height: 30px; }
.bars b { width: 5px; border-radius: var(--r-sm); background: var(--green); }
.bars b.off { background: var(--chevron); }

.acc-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line);
  width: 100%; text-align: left;
}
.acc-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-meta { font-family: var(--mono); font-size: 12px; line-height: 1; color: var(--sub); }

.acc-card {
  border-radius: var(--r-lg); background: var(--card);
  border: 1px solid var(--line); overflow: hidden;
}
.acc-card > .top { padding: 14px; display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left; }
.acc-card .toggle {
  padding: 11px; width: 100%; text-align: center;
  font-size: 12px; font-weight: 600;
  border-top: 1px solid var(--line);
}
.acc-card .toggle.on  { background: transparent; color: var(--sub); }
.acc-card .toggle.off { background: var(--accent-soft); color: var(--accent); }
.acc-stats { display: flex; gap: 14px; font-size: 12px; color: var(--sub); }
.acc-stats b { color: var(--sub); font-weight: 400; }

.preset {
  padding: 8px 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  background: var(--input); color: var(--text);
}
.preset.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.stepper {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--track); border-radius: var(--r-md); overflow: hidden;
}
.stepper button { width: 34px; height: 34px; font-size: 16px; color: var(--accent); }
.stepper .val {
  width: 44px; text-align: center;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
}

.minmax { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.minmax label { display: flex; flex-direction: column; gap: 6px; }
.minmax span { font-size: 12px; color: var(--sub); }
.minmax .in { padding: 12px 11px; text-align: right; font-size: 14px; font-weight: 500; }

.limit-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: flex-end; }
.limit-row label { display: flex; flex-direction: column; gap: 6px; }
.limit-row span { font-size: 12px; color: var(--sub); }
.limit-row .in {
  padding: 12px 11px; text-align: right; font-size: 14px; font-weight: 500;
  background: var(--bg); box-shadow: var(--knob-sh);
}
.limit-row .in:focus {
  outline: none; border-color: var(--chevron);
  box-shadow: var(--knob-sh), 0 0 0 3px var(--line);
}
.limit-row button {
  padding: 12px 14px; border-radius: var(--r-md); white-space: nowrap;
  border: 1px solid var(--track); background: var(--input);
  font-size: 12px; font-weight: 600; color: var(--text);
}

.limit-row button.armed { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.slider { display: flex; align-items: center; gap: 12px; }
.slider .k { width: 34px; font-size: 12px; color: var(--sub); }
.slider .num {
  width: 66px; padding: 7px 8px; border-radius: var(--r-md);
  background: var(--bg); border: 1px solid var(--track); color: var(--text);
  font-family: var(--mono); font-size: 11px; font-weight: 500; text-align: right;
}
input[type=range] {
  flex: 1; height: 22px; -webkit-appearance: none; appearance: none; background: transparent;
}
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--track); border-radius: var(--r-sm); }
input[type=range]::-moz-range-track { height: 3px; background: var(--track); border-radius: var(--r-sm); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px;
  border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent);
}

.hint {
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--amber-bg); border: 1px solid var(--amber-strong);
  font-size: 11px; line-height: 1.5; color: var(--amber-strong);
}

.cab-bad {
  margin: 8px 14px 0; padding: 9px 11px; border-radius: var(--r-md);
  background: var(--red-bg); color: var(--red);
  font-size: 12px; line-height: 1.4; font-weight: 500;
}
.key-bad {
  padding: 14px; border-radius: var(--r-lg);
  background: var(--red-bg); border: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.key-bad .t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--red); }
.key-bad .t i { width: 14px; height: 14px; border-radius: var(--r-sm); border: 2px solid var(--red); flex: none; }
.key-bad p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text2); }

.warnbox {
  padding: 14px; border-radius: var(--r-lg);
  background: var(--amber-bg); border: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.warnbox .t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.warnbox .t i { width: 14px; height: 14px; border-radius: var(--r-sm); border: 2px solid var(--amber-strong); flex: none; }
.warnbox p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--amber-text); }

.warnbox .btn-ghost { background: var(--input); color: var(--text); }

.ok-badge {
  width: 44px; height: 44px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--green) 14%, transparent); border: 1px solid color-mix(in srgb, var(--green) 34%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.ok-badge i { width: 11px; height: 11px; border-radius: 50%; background: var(--green); }

.deal { border-radius: var(--r-lg); background: var(--card); border: 0; overflow: hidden; }
.deal .body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.deal .amount { font-size: 30px; font-weight: 700; letter-spacing: -.8px;
                font-variant-numeric: tabular-nums; }
.deal .pid { font-size: 12px; line-height: 1.2; color: var(--sub); }
.deal .who { font-size: 13px; color: var(--sub); }
.deal .qr-thumb {
  width: 78px; height: 78px; border-radius: var(--r-md); flex: none;
  background: repeating-linear-gradient(45deg,var(--card2) 0 5px,var(--track) 5px 10px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 8px; font-weight: 500; line-height: 1.3;
  color: var(--sub); text-align: center; overflow: hidden;
}

.deal .qr-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.deal .qr-big {
  display: block; width: 100%; max-width: 260px; aspect-ratio: 1;
  margin: 2px auto; padding: 10px; border-radius: var(--r-lg);
  background: #fff; object-fit: contain;
}
.deal .qr-big.empty {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg,var(--card2) 0 5px,var(--track) 5px 10px);
  font-size: 12px; color: var(--sub);
}
.deal .figs { display: flex; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--input); }
.deal .figs > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.deal .figs .k { font-size: 11px; color: var(--sub); }
.deal .figs .v { font-size: 14px; font-weight: 500; word-break: break-all; }

.state-box { padding: 14px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 6px; }
.state-box .t { font-size: 13px; font-weight: 600; }
.state-box .s { font-family: var(--mono); font-size: 11px; line-height: 1.4; }
.state-box.wait { background: var(--amber-bg); border: 1px solid var(--amber-strong); }
.state-box.wait .t, .state-box.wait .s { color: var(--amber-strong); }
.state-box.wait .s { color: var(--sub); }
.state-box.done { background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 32%, transparent); }
.state-box.done .t { color: var(--green); } .state-box.done .s { color: #A8BFA0; }
.state-box.dead { background: var(--red-bg); border: 1px solid var(--red); }
.state-box.dead .t { color: var(--red); } .state-box.dead .s { color: #C09189; }

.hold {
  position: relative; width: 100%;
  padding: 15px; border-radius: var(--r-lg);
  background: var(--accent); color: var(--on-accent);
  text-align: center; font-size: 14px; font-weight: 600;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.hold.danger { background: var(--red); }
.hold-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--green); transition: width .04s linear;
}
.hold.danger .hold-fill { background: var(--scrim); }
.hold-label { position: relative; }

.hist {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; border-radius: var(--r-lg);
  background: var(--card2); border: 1px solid var(--line);
  width: 100%; text-align: left; font: inherit; color: inherit;
  cursor: pointer;
}
.hist:active { background: var(--card); }
.hist .rub { font-size: 13px; font-weight: 500; }
.hist .meta { font-family: var(--mono); font-size: 11px; line-height: 1.3; color: var(--sub); }
.hist .st { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.hist .tm { font-size: 11px; color: var(--sub); }

.hlist { display: flex; flex-direction: column; gap: 1px;
         border-radius: var(--r-lg); overflow: hidden; background: var(--line); }
.hrow { display: flex; align-items: center; justify-content: space-between;
        gap: 12px; padding: 12px 14px; background: var(--card2); }
.hk { font-size: 13px; color: var(--sub); }
.hv { font-size: 13px; font-weight: 500; color: var(--text);
      text-align: right; word-break: break-word; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: var(--r-lg); background: var(--card2); }
.seg button {
  flex: 1; padding: 9px 4px; border-radius: var(--r-md); text-align: center;
  font-size: 13px; font-weight: 500;
  background: transparent; color: var(--sub);
}
.seg button.on { background: var(--input); color: var(--text); font-weight: 600; }

.big { font-size: 38px; font-weight: 700; letter-spacing: -1.3px;
       font-variant-numeric: tabular-nums; }
.big-l { font-size: 38px; font-weight: 700; letter-spacing: -1.3px;
         font-variant-numeric: tabular-nums; }
.kv { display: flex; flex-direction: column; gap: 5px; }
.kv .k { font-size: 12px; color: var(--sub); }
.kv .v { font-family: var(--mono); font-size: 15px; font-weight: 500; line-height: 1; }

.bar { height: 6px; border-radius: var(--r-sm); background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-sm); background: var(--accent); }
.bar.thin { height: 6px; }

.tbl { display: grid; gap: 6px; align-items: baseline; }
.tbl.lat { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.tbl.mkt { grid-template-columns: 1.4fr .8fr .8fr .9fr; }
.tbl.head { font-family: var(--mono); font-size: 11px; color: var(--sub); }
.tbl.body { padding: 8px 0; border-top: 1px solid var(--line); }
.tbl .r { text-align: right; }
.tbl .num { font-family: var(--mono); font-size: 11px; font-weight: 500; }
.tbl .nm { font-size: 11px; color: var(--sub); }

.errline {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 0; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
}
.errline .c { color: var(--sub); }
.errline .n { color: var(--sub); font-weight: 500; }

.per-acc {
  padding: 13px 14px; border-radius: var(--r-lg);
  background: var(--card2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}

.empty { padding: 26px 14px; text-align: center; font-size: 12px; color: var(--sub); line-height: 1.6; }

.tabs > * { min-width: 0; }
.tabs {

  position: absolute; left: 14px; right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  height: var(--nav); z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  align-items: center; padding: 0 6px;
  border: 2px solid var(--edge); border-radius: var(--r-md);
  background: var(--pill); box-shadow: var(--pill-shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; position: relative;

  color: var(--text);
  padding: 8px 0; border-radius: var(--r-sm); background: transparent;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; font-size: 11px; font-weight: 600; line-height: 1; color: inherit; }
.tab.on { background: var(--nav-on); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

.ic { display: block; width: 18px; height: 18px; position: relative; }

.ic-home {
  border: 0; background: currentColor;
  clip-path: polygon(
    50% 0,      100% 44%,   100% 100%,  0 100%,     0 44%,
    50% 0,
    50% 2.8px,  2.2px 45.5%, 2.2px 97%, 15.8px 97%, 15.8px 45.5%, 50% 2.8px
  );
}

.ic-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.ic-grid b { background: currentColor; border-radius: 1px; }
.ic-grid b:nth-child(1) { border-radius: 1px 1px 1px 4px; }
.ic-grid b:nth-child(4) { opacity: .4; }

.ic-circle { border: 0; }
.ic-circle::before {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 11px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translate(-50%, -60%) rotate(45deg);
}

.ic-bars   { display: flex; align-items: flex-end; gap: 3px; }
.ic-bars b { width: 3px; background: currentColor; border-radius: 1px 1px 0 0; }
.ic-bars b:nth-child(1) { height: 8px; }
.ic-bars b:nth-child(2) { height: 18px; }
.ic-bars b:nth-child(3) { height: 13px; }

.ic-arc    { border: 1.5px solid currentColor; border-radius: 50%;
             border-left-color: transparent; border-bottom-color: transparent; }

.ic-link { position: relative; }
.ic-link b {
  position: absolute; background: currentColor;
}

.ic-link b:nth-child(1) {
  left: 1px; top: 1px; width: 7px; height: 7px; border-radius: 50%;
}
.ic-link b:nth-child(1)::after {
  content: ''; position: absolute; left: -2px; top: 8px;
  width: 11px; height: 7px; border-radius: var(--r-md) 5px 0 0;
  background: currentColor;
}

.ic-link b:nth-child(2) {
  right: 0; top: 2px; width: 6px; height: 6px; border-radius: 50%;
  opacity: .75;
}
.ic-link b:nth-child(2)::after {
  content: ''; position: absolute; left: -1px; top: 7px;
  width: 9px; height: 6px; border-radius: var(--r-sm) 4px 0 0;
  background: currentColor;
}

.badge {
  position: absolute; top: 12px; right: 26px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber-strong);
}
.badge.hidden { display: none; }

.ov { position: absolute; inset: 0; z-index: 20; }
.ov-qr {
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 28px; text-align: center;
}
.qr-amount { font-size: 30px; font-weight: 600; letter-spacing: -1px; }
.qr-meta { font-size: 11px; color: var(--sub); margin-top: 7px; }
.qr-box {
  width: min(270px, 72vw); height: min(270px, 72vw);
  border-radius: var(--r-lg); background: var(--card2); padding: 10px;
  display: flex; align-items: center; justify-content: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-warn { margin: 0; font-size: 12px; color: var(--sub); line-height: 1.6; }
.qr-close { font-size: 11px; font-weight: 500; color: var(--accent); }

.ov-sheet { z-index: 24; background: var(--scrim); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--bg);
  border-top: 0; border-radius: var(--r-lg) 22px 0 0;
  padding: 22px 18px calc(26px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
  max-height: 85%; overflow-y: auto;
}
.sheet-head { display: flex; flex-direction: column; gap: 7px; }
.sheet-title { font-size: 19px; font-weight: 600; letter-spacing: -.2px; }
.sheet-sub { font-size: 14px; line-height: 1.55; color: var(--sub); }

.toast {
  position: absolute; left: 18px; right: 18px;
  bottom: calc(var(--nav) + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 26; padding: 13px 15px; border-radius: var(--r-lg);
  background: var(--input); border: 1px solid var(--chevron);
  font-size: 12px; color: var(--text);
  box-shadow: var(--pill-shadow);
}

.gate {
  position: absolute; inset: 0; z-index: 40;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.gate.hidden { display: none; }
.gate-box { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.gate-title { font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.gate-msg { font-size: 13px; line-height: 1.6; color: var(--sub); }

@media (hover: hover) {
  .acc-row:hover, .acc-card:hover { border-color: var(--chevron); }
  .btn-dashed:hover { border-color: var(--accent); background: var(--accent-soft); }
}

.acc-foot {
  display: flex; gap: 8px; align-items: stretch;
  padding: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 12px;
}
.acc-foot > * {
  height: 38px; border-radius: var(--r-md); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.acc-foot .toggle {
  flex: 1; padding: 0; width: auto; border-top: 0;
  border: 1px solid var(--line);
}
.acc-foot .toggle.on  { background: var(--input); color: var(--sub); }
.acc-foot .toggle.off { background: var(--accent-soft); color: var(--accent); border-color: var(--chevron); }
.lim-btn {
  padding: 0 15px; flex: 0 0 auto; border-radius: var(--r-lg);
  color: var(--text); background: var(--input); border: 1px solid var(--line);
}

.lim-btn.on { background: var(--line); }
.lim-btn.on { color: var(--accent); border-color: var(--accent); }
.lim-box {
  display: flex; flex-direction: column; gap: 11px;
  margin: 0 12px 12px; padding: 14px;
  background: var(--input); border: 1px solid var(--line); border-radius: var(--r-lg);
}

.snd-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 10px; padding: 11px 13px;
  background: var(--input); border: 1px solid var(--line); border-radius: var(--r-lg);
  font-size: 12.5px; font-weight: 500; color: var(--text);
}
.snd-row > span:first-child { display: flex; align-items: center; gap: 9px; }

.snd-ic {
  width: 15px; height: 15px; flex: 0 0 15px; display: block;
  background: var(--accent);
  -webkit-mask: var(--snd-on) center / contain no-repeat;
          mask: var(--snd-on) center / contain no-repeat;
}
.snd-ic.off {
  background: var(--sub);
  -webkit-mask-image: var(--snd-off);
          mask-image: var(--snd-off);
}
.snd-state {
  font-family: 'Martian Mono', monospace; font-size: 12px; color: var(--sub);
}
.snd-state.on { color: var(--accent); }

.cab {
  border-radius: var(--r-lg); background: var(--card);
  border: 1px solid var(--line); overflow: hidden; margin-bottom: 10px;
}
.cab-top {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 14px; text-align: left;
}
.cab-id { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.cab-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cab-sub { font-size: 12px; color: var(--sub); }
.cab-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cab-num b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cab-num span { font-size: 11px; color: var(--sub); }
.cab-top .arw {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--input); color: var(--sub);
  font-size: 14px; line-height: 1;
}
.cab-line {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 0 14px 11px; font-size: 12px; color: var(--sub);
}
.cab-foot {
  display: flex; gap: 8px; align-items: stretch;
  padding: 12px; border-top: 1px solid var(--line);
}
.cab-foot > * {
  height: 40px; border-radius: var(--r-lg); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.cab-foot .lim-btn { flex: 2; }
.cab-foot .toggle {
  flex: 3; padding: 0; width: auto; border-top: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.cab-foot .toggle.on  { background: var(--input); color: var(--sub); }
.cab-foot .toggle.off { background: var(--accent-soft); color: var(--accent); border-color: var(--chevron); }

.cab-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.cab-sect {
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--sub); margin-top: 6px;
}
.snd-btns { display: flex; gap: 7px; }
.snd-btns .lim-btn {
  flex: 1; height: 36px; padding: 0 8px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}

.lim-head { font-size: 11px; letter-spacing: .4px; color: var(--sub); }
.lim-apply { padding: 12px; border-radius: var(--r-lg); font-size: 12px; }
.btn-dashed.sm { padding: 11px; font-size: 11px; border-radius: var(--r-lg); }

.lim-box .limit-row { grid-template-columns: 1fr 1fr; }
.lim-box .in {
  border-radius: var(--r-lg); padding: 12px; text-align: center;
}

.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.chips .chip {
  padding: 8px 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  background: var(--input); color: var(--text); border: 0;
}
.chips .chip.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.brand-list {
  max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg);
}
.brand-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); text-align: left;
}
.brand-row:last-child { border-bottom: 0; }
.brand-n {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-c { font-size: 12px; color: var(--sub); }

.brand-s { font-size: 11px; font-weight: 600; color: var(--red); }
.brand-row.on .brand-n { color: var(--red); text-decoration: line-through; }

.in.ta {
  font-family: var(--mono); font-size: 13px; font-weight: 400;
  line-height: 1.5; resize: vertical; min-height: 84px;
}

.btn-primary[disabled] { opacity: .45; }

.snd-test {
  width: 100%; margin-top: 6px; padding: 9px 13px;
  background: transparent; border: 1px dashed var(--line);
  border-radius: var(--r-md); font-size: 11px; color: var(--sub);
}

.hero { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0 0; }
.hero-v { display: flex; align-items: baseline; gap: 6px; }
.hero-v .tnum {
  font-size: 42px; font-weight: 700; letter-spacing: -1.5px; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.hero-cur { font-size: 27px; font-weight: 600; color: var(--text); }
.hero-k { font-size: 14px; color: var(--sub); }

.row3 { display: flex; gap: 10px; }
.row3 > * { min-width: 0; }
.lbl-r { font-size: 13px; font-weight: 500; color: var(--accent-text); }

.group { border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.gsep { height: 1px; background: var(--line); margin-left: 60px; }
.grow {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; text-align: left; background: none;
}
.grow-name { font-size: 15px; color: var(--text); }
.grow-meta { font-size: 12px; color: var(--sub); }
.chev { font-size: 20px; color: var(--chevron); flex: none; }

.ad-t { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.ad-m { font-size: 12px; color: var(--sub);
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.reflink {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--input); color: var(--text); word-break: break-all;
}
.grow-v { font-size: 14px; font-weight: 600; color: var(--accent-text);
          font-variant-numeric: tabular-nums; flex: none; }

.krow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.krow-l {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  text-align: left; background: none; padding: 0;
}
.krow-id { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.krow-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.krow-name {
  font-size: 15px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.krow-tail { font-size: 11px; color: var(--sub); flex: none; }
.krow-set { font-size: 12px; color: var(--sub); }
.krow-num { font-size: 12px; color: var(--sub); }

.krow-btn {
  flex: none; padding: 7px 12px; border-radius: var(--r-md);
  background: var(--input); color: var(--sub);
  font-size: 13px; font-weight: 600;
}
.krow-btn.busy { opacity: .5; }
.krow-go { flex: none; font-size: 20px; color: var(--chevron); background: none; padding: 0 2px; }

.lrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 14px;
}
.lrow-k { font-size: 15px; color: var(--text); }
.lrow-v { font-size: 15px; font-weight: 500; color: var(--text);
          font-variant-numeric: tabular-nums; }
.lrow-v.acc { font-weight: 600; color: var(--accent-text); }
.gsep.flat { margin-left: 14px; }

.daterow { display: flex; align-items: center; gap: 8px; }
.daterow .in { flex: 1; padding: 11px 10px; border-radius: var(--r-lg); }
.daterow .dash { color: var(--sub); }

.per-acc { display: flex; flex-direction: column; gap: 7px; }
.pa-name { font-size: 15px; color: var(--text); }
.pa-n { font-size: 13px; color: var(--sub); }
.pa-s { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }

.spin {
  display: inline-block; width: 13px; height: 13px; margin-right: 7px;
  vertical-align: -2px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary.busy, .btn-ghost.busy { opacity: .75; }

button:disabled:active { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
}
.set-v { font-size: 13px; font-weight: 500; color: var(--text);
         font-variant-numeric: tabular-nums; }

.thm {
  display: flex; align-items: center; gap: 4px; flex: none;
  padding: 3px; border-radius: 999px; background: var(--card2);
}
.thm button {
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: transparent; color: var(--sub);
}
.thm button.on { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] .thm button.on,
[data-theme="dark"] .thm button.on { background: var(--accent); color: var(--on-accent); }

.ksq {
  width: 34px; height: 34px; border-radius: var(--r-md); flex: none;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
}
.ksq b { font-size: 13px; font-weight: 700; line-height: 1; }
.ksq i { font-size: 7px; font-weight: 600; letter-spacing: .04em; line-height: 1; font-style: normal; }
.ksq.on  { background: var(--green); color: #FFFFFF; }
.ksq.off { background: var(--off-bg); color: var(--off-fg); }
.ksq.busy { background: var(--amber-strong); color: var(--on-accent); }
.krow-stat { font-size: 12px; color: var(--sub); }

.set-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px; border-radius: var(--r-lg);
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600;
}
.set-ic {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  border: 2px solid currentColor;
}
.set-chev { font-size: 17px; line-height: 1; }

.lrow-v.muted, .lbl-v.muted { color: var(--sub); font-weight: 400; }
.lbl-v { font-size: 13px; font-weight: 500; color: var(--text); }
.lrow-a { display: flex; align-items: center; gap: 8px; }
.adot { width: 7px; height: 7px; border-radius: 50%; background: var(--chevron); flex: none; }
.adot.on { background: var(--green); }

.swrow {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 14px; border-radius: var(--r-lg);
  background: var(--input); text-align: left;
}
.swrow-t { font-size: 15px; font-weight: 500; color: var(--text); }
.swrow-s { font-size: 12px; line-height: 1.35; color: var(--sub); }

.sw {
  width: 51px; height: 31px; flex: none; padding: 2px; border-radius: 999px;
  background: var(--track); display: flex; justify-content: flex-start;
  transition: background-color .18s ease;
}
.sw.on { background: var(--green); justify-content: flex-end; }
.sw i {
  width: 27px; height: 27px; border-radius: 50%; background: var(--sw-knob);
  display: block; box-shadow: var(--sw-sh);
}

.in.num { text-align: right; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 12px; color: var(--sub); }

.per-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 14px; border-radius: var(--r-lg);
  background: var(--card); text-align: left;
}
.per-btn.on { background: var(--accent-soft); }

.cal {
  width: 17px; height: 17px; flex: none; position: relative;
  border: 2px solid currentColor; border-radius: var(--r-sm);
  margin-top: 2px;
}
.cal::before {
  content: ''; position: absolute; left: -2px; right: -2px; top: 1px;
  height: 2px; background: currentColor;
}
.cal::after {
  content: ''; position: absolute; left: 2px; top: -4px;
  width: 2px; height: 4px; border-radius: var(--r-sm);
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
}
.per-l { display: flex; align-items: center; gap: 10px; min-width: 0;
         font-size: 15px; font-weight: 600; color: var(--text); }
.per-btn.on .per-l { color: var(--accent-text); }
.per-r { font-size: 13px; font-weight: 500; color: var(--sub);
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.per-btn.on .per-r { color: var(--accent-text); }

.promo {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px; border-radius: var(--r-lg);
  background: var(--accent-soft); text-align: left;
}
.promo-ic {
  width: 38px; height: 38px; border-radius: var(--r-lg); flex: none;
  background: var(--accent); color: var(--on-accent);
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.promo-t { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.promo-s { font-size: 12px; color: var(--sub); }
.promo .chev { color: var(--accent); opacity: .65; }
