/* ==========================================================================
   Dashboard (/app)
   Layout: framed shell -> sidebar | main (topbar, board: main column + side column)
   ========================================================================== */

.page-app {
  background: var(--page);
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1600px;
  min-height: calc(100dvh - 32px);
  margin: 16px auto;
  width: calc(100% - 32px);
  border-radius: 36px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-md);
}

.anchor {
  position: absolute;
  top: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  height: calc(100dvh - 32px);
  padding: 30px 18px 22px;
  border-right: 1px solid var(--line);
}
.sidebar__logo {
  padding-inline: 12px;
}
.sidebar__nav {
  position: relative;
  display: grid;
  gap: 4px;
}
.sidebar__indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  border-radius: var(--r-control);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  transform: translateY(var(--y, 0px));
  transition: transform 0.6s var(--ease-spring), height 0.3s var(--ease-out);
}
.sidenav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r-control);
  color: var(--ink-2);
  font-weight: 500;
  transition: color 0.25s var(--ease-out);
}
.sidenav-item .ph {
  font-size: 1.3rem;
}
.sidenav-item:hover,
.sidenav-item.is-active {
  color: var(--ink);
}
.sidenav-item.is-active {
  font-weight: 700;
}
.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.sidebar__who {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.sidebar__who strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__who span {
  font-size: 0.8rem;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Main + topbar
   -------------------------------------------------------------------------- */
.main {
  position: relative;
  min-width: 0;
  padding: 22px clamp(16px, 2vw, 28px) 32px;
}
.nb-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.topbar__logo {
  display: none;
}
.nb-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 460px;
  height: 52px;
  border-radius: var(--r-control);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.25s var(--ease-out);
}
.nb-search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.nb-search > .ph {
  position: absolute;
  left: 18px;
  font-size: 1.15rem;
  color: var(--ink-3);
  pointer-events: none;
}
.nb-search input {
  width: 100%;
  height: 100%;
  padding: 0 48px 0 48px;
  border: 0;
  background: none;
  font-size: 0.95rem;
  outline: none;
}
.nb-search input::placeholder {
  color: var(--ink-3);
}
.nb-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search__kbd {
  position: absolute;
  right: 14px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-3);
}
.nb-search:focus-within .search__kbd {
  opacity: 0;
}

.segmented {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-left: auto;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.segmented__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: var(--w, 0px);
  border-radius: var(--r-pill);
  background: var(--panel);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transform: translateX(var(--x, 0px));
  transition: transform 0.55s var(--ease-spring), width 0.3s var(--ease-out);
}
.segmented__opt {
  position: relative;
  z-index: 1;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.25s var(--ease-out);
}
.segmented__opt:hover,
.segmented__opt.is-active {
  color: var(--ink);
}
.topbar__actions {
  display: flex;
  gap: 10px;
}
.bell {
  position: relative;
}
.bell__dot {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--panel);
  transition: transform 0.4s var(--ease-spring);
}
.bell.is-read .bell__dot {
  transform: scale(0);
}
.bell[aria-expanded="true"] .ph {
  animation: ring 0.7s var(--ease-out);
}
@keyframes ring {
  20% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-10deg);
  }
  60% {
    transform: rotate(6deg);
  }
}
.notif {
  display: grid;
  gap: 2px;
}
.notif li {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
}
.notif li:hover {
  background: var(--panel-2);
}
.notif .ph {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-icon);
  background: var(--panel-2);
  font-size: 1.1rem;
}
.notif span {
  display: grid;
  font-size: 0.88rem;
  line-height: 1.35;
}
.notif small {
  color: var(--ink-3);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Board
   -------------------------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.board__main,
.board__side {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.panel {
  position: relative;
  padding: 24px;
  border-radius: var(--r-panel);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.panel__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.panel__meta {
  font-size: 0.84rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.panel__meta strong {
  color: var(--ink);
  font-size: 0.92rem;
}

/* Flash when a sidebar item jumps to a section */
[data-flash].is-flash {
  animation: flash 1.1s var(--ease-out);
}
@keyframes flash {
  0% {
    box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-md);
  }
}

/* Entry: panels rise in sequence on first load */
/* backwards, not both: a retained transform would turn each panel into a stacking
   context and trap popovers (and position: fixed menus) underneath its siblings. */
.board__main > *,
.board__side > * {
  animation: rise 0.9s var(--ease-out) backwards;
}
.board__main > :nth-child(2) {
  animation-delay: 0.08s;
}
.board__main > :nth-child(3) {
  animation-delay: 0.16s;
}
.board__side > :nth-child(1) {
  animation-delay: 0.12s;
}
.board__side > :nth-child(2) {
  animation-delay: 0.2s;
}
.board__side > :nth-child(3) {
  animation-delay: 0.28s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

/* --------------------------------------------------------------------------
   Hero band: greeting, card, balance over soft pixel clouds
   -------------------------------------------------------------------------- */
.hero-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  grid-template-areas:
    "copy card"
    "balance card";
  gap: 22px 28px;
  padding: 26px 26px 26px 26px;
  border-radius: var(--r-panel);
  background: var(--panel-2);
  overflow: hidden;
  isolation: isolate;
}
.hero-band__clouds {
  position: absolute;
  inset: 30% 0 0;
  z-index: -1;
}
.hero-band__clouds canvas {
  max-width: none;
  image-rendering: pixelated;
}
.hero-band__copy {
  grid-area: copy;
  padding: 8px 0 0 4px;
}
.hero-band__name {
  margin-top: 10px;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
  padding-bottom: 0.06em;
}
.hero-band__sub {
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--ink-2);
}
.hero-band__card {
  grid-area: card;
  align-self: center;
  justify-self: center;
  width: min(100%, 340px);
  scroll-margin-top: 24px;
}
.hero-band__card .bank-card {
  --rot: 7deg;
}

.balance {
  grid-area: balance;
  container-type: inline-size;
  display: grid;
  gap: 10px;
  padding: 22px 88px 22px 24px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.balance__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--ink-2);
  font-weight: 500;
}
.balance__eye {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 1.1rem;
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.balance__eye:hover {
  color: var(--ink);
  background: var(--panel-2);
}
.balance__value {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-size: clamp(1.5rem, calc((100cqi - 116px) / 6.4), 3rem);
  line-height: 1.05;
  white-space: nowrap;
  transition: filter 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}
.balance.is-hidden .balance__value,
.balance.is-hidden .balance__change {
  filter: blur(10px);
  opacity: 0.55;
  user-select: none;
}
.balance__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.balance__change {
  font-size: 0.92rem;
  color: var(--ink-2);
  transition: filter 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}
.balance__go {
  position: absolute;
  right: 20px;
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  translate: 0 -50%;
}
.balance__go .ph {
  transition: transform 0.4s var(--ease-out);
}
.balance__go:hover .ph {
  transform: translateX(3px);
}
@media (prefers-reduced-transparency: reduce) {
  .balance {
    background: var(--panel);
    backdrop-filter: none;
  }
}

/* --------------------------------------------------------------------------
   Action buttons
   -------------------------------------------------------------------------- */
.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.actions .popover-wrap {
  display: grid;
}
.action {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 22px;
  border-radius: var(--r-control);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition:
    transform 0.5s var(--ease-spring),
    box-shadow 0.25s var(--ease-out);
}
.action .ph {
  font-size: 1.45rem;
  transition: transform 0.5s var(--ease-spring);
}
.action:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm);
}
.action:hover .ph {
  transform: translateY(-2px) rotate(-6deg);
}
.action:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}
.action--primary {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: none;
}
.action--primary:hover {
  box-shadow: var(--shadow-md);
}
/* "Ещё" is the last action in the row, so its menu opens leftwards. */
.popover--menu {
  right: 0;
  left: auto;
  transform-origin: top right;
}

/* --------------------------------------------------------------------------
   Transactions + spending
   -------------------------------------------------------------------------- */
.board__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.tx__list {
  display: grid;
  gap: 2px;
  margin-inline: -10px;
}
.tx__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--r-control);
  transition: background-color 0.2s var(--ease-out);
}
.tx__row:hover {
  background: var(--panel-2);
}
.tx__row.is-new {
  animation: tx-in 0.9s var(--ease-out);
}
@keyframes tx-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    background: var(--panel-2);
  }
  40% {
    opacity: 1;
    transform: none;
    background: var(--panel-2);
  }
}
.tx__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-icon);
  background: var(--panel-2);
  font-size: 1.25rem;
}
.tx__main,
.tx__side {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}
.tx__main strong {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx__main small,
.tx__side small {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.tx__side {
  justify-items: end;
  text-align: right;
}
.tx__side strong {
  font-size: 0.98rem;
  white-space: nowrap;
}
.tx__side strong.is-in {
  padding: 1px 8px;
  margin-right: -8px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
}
.nb-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 12px 12px;
  text-align: center;
  color: var(--ink-2);
}
.nb-empty > .ph {
  font-size: 1.8rem;
  color: var(--ink-3);
}
.nb-empty p {
  max-width: 30ch;
  font-size: 0.92rem;
}
.nb-empty[hidden] {
  display: none;
}

.spend {
  container-type: inline-size;
}
@container (max-width: 520px) {
  .spend .donut {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
  }
  .spend .donut__legend {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Side column: insights bars, goal, quick actions
   -------------------------------------------------------------------------- */
.insights__text {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.insights__text .ph {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-icon);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 1.2rem;
}
.nb-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.nb-bars::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 140px;
  height: 1px;
  background: var(--line);
}
.bars__col {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.bars__hit {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 140px;
  border-radius: 10px;
}
.bars__bar {
  width: 22px;
  height: calc(var(--h) * 1%);
  border-radius: 4px 4px 0 0;
  background: var(--viz-muted);
  transform-origin: bottom;
  transition:
    transform 0.9s var(--ease-out),
    background-color 0.25s var(--ease-out),
    filter 0.25s var(--ease-out);
  transition-delay: calc(var(--i) * 60ms), 0s, 0s;
}
.nb-js .nb-bars:not(.is-in) .bars__bar {
  transform: scaleY(0);
}
.bars__col.is-current .bars__bar {
  background: var(--viz-strong);
}
.bars__hit:hover .bars__bar,
.bars__hit:focus-visible .bars__bar {
  background: var(--ink-3);
}
.bars__col.is-current .bars__hit:hover .bars__bar,
.bars__col.is-current .bars__hit:focus-visible .bars__bar {
  background: var(--viz-strong);
  filter: opacity(0.85);
}
.bars__value {
  position: absolute;
  bottom: calc(var(--h-cur, 100) * 1% + 8px);
  left: 50%;
  translate: -50% 0;
  font-size: 0.78rem;
  white-space: nowrap;
}
.bars__label {
  font-size: 0.78rem;
  color: var(--ink-3);
}
.bars__col.is-current .bars__label {
  color: var(--ink);
  font-weight: 700;
}
.nb-chart-tip {
  position: absolute;
  z-index: var(--z-popover);
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: none;
  translate: -50% calc(-100% - 10px);
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
}
.nb-chart-tip.is-on {
  opacity: 1;
}

.goal__media {
  aspect-ratio: 16 / 10;
  margin-bottom: 16px;
  cursor: pointer;
}
.goal__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.goal__sum {
  margin: 4px 0 14px;
  font-size: 0.9rem;
  color: var(--ink-3);
}
.goal__sum strong {
  color: var(--ink);
}

.quick__list {
  display: grid;
  gap: 2px;
  margin-inline: -10px;
}
.quick__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-control);
  text-align: left;
  font-weight: 600;
  font-size: 0.94rem;
  transition: background-color 0.2s var(--ease-out);
}
.quick__row > .ph {
  margin-left: auto;
  color: var(--ink-3);
  transition: transform 0.4s var(--ease-out);
}
.quick__row:hover {
  background: var(--panel-2);
}
.quick__row:hover > .ph {
  transform: translateX(3px);
}
.quick__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-icon);
  background: var(--panel-2);
  font-size: 1.2rem;
}

/* --------------------------------------------------------------------------
   Operation dialog (sheet)
   -------------------------------------------------------------------------- */
.sheet {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--r-panel);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg);
  overflow: auto;
}
.sheet[open] {
  animation: sheet-in 0.55s var(--ease-out);
}
.sheet.is-closing {
  animation: sheet-out 0.25s var(--ease-out) forwards;
}
.sheet::backdrop {
  background: rgb(10 10 10 / 0.38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.4s var(--ease-out);
}
.sheet.is-closing::backdrop {
  animation: fade-out 0.25s var(--ease-out) forwards;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
}
@keyframes sheet-out {
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
.sheet__form {
  padding: 24px;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.sheet__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sheet__body {
  display: grid;
  gap: 18px;
}
.nb-field {
  display: grid;
  gap: 8px;
}
.nb-field[hidden] {
  display: none;
}
.nb-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.nb-field input {
  height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 1.05rem;
  outline: none;
  transition: box-shadow 0.2s var(--ease-out);
}
.nb-field input::placeholder {
  color: var(--ink-3);
}
.nb-field input:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.nb-field input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px var(--danger);
}
.field__hint {
  font-size: 0.82rem;
  color: var(--ink-3);
}
.field__error {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--danger);
}
.field__error:empty {
  display: none;
}
.sheet__submit {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
}
.sheet__done {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 0 4px;
  text-align: center;
}
.sheet__done[hidden],
.sheet__body[hidden] {
  display: none;
}
.sheet__check {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 2rem;
  animation: check-pop 0.7s var(--ease-spring) both;
}
@keyframes check-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}
.sheet__done-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}
.sheet__done-text {
  margin-bottom: 14px;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Mobile tab bar
   -------------------------------------------------------------------------- */
.tabbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Below 1440 the full sidebar would squeeze the board, so it folds into an icon rail. */
@media (max-width: 1439px) {
  .shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .sidebar {
    align-items: center;
    padding-inline: 12px;
  }
  .sidebar__logo {
    padding: 0;
  }
  .sidebar .logo-word,
  .sidenav-item span,
  .sidebar__who {
    display: none;
  }
  .sidebar__nav {
    width: 100%;
  }
  .sidenav-item {
    justify-content: center;
    padding: 0;
  }
  .sidebar__profile {
    padding-inline: 0;
  }
}

@media (max-width: 1279px) {
  .board {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .action {
    padding: 0 16px;
    gap: 10px;
  }
}

@media (max-width: 1100px) {
  .board {
    grid-template-columns: minmax(0, 1fr);
  }
  .board__side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board__side .quick {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .board__pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .action {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    padding: 0 6px;
    font-size: 0.85rem;
  }
  .hero-band {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "card"
      "balance";
  }
  .hero-band__card {
    width: min(78%, 320px);
    padding-block: 8px;
  }
}

@media (max-width: 767px) {
  .shell {
    display: block;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 14px 16px calc(96px + env(safe-area-inset-bottom));
  }
  .nb-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo actions"
      "search search"
      "period period";
    gap: 12px;
  }
  .topbar__logo {
    display: block;
    grid-area: logo;
  }
  .topbar__actions {
    grid-area: actions;
  }
  .nb-search {
    grid-area: search;
    max-width: none;
  }
  .search__kbd {
    display: none;
  }
  .segmented {
    grid-area: period;
    margin-left: 0;
  }
  .board__side {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel {
    padding: 20px;
  }
  .hero-band {
    padding: 20px;
  }
  .balance {
    padding: 20px 76px 20px 20px;
  }
  .balance__go {
    right: 14px;
    width: 48px;
    height: 48px;
  }
  .popover-wrap .nb-popover {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    width: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-width: none;
    transform-origin: bottom center;
  }
  .nb-topbar .popover-wrap .nb-popover {
    top: 76px;
    bottom: auto;
  }
  .toast-region {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-chrome);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-top: 1px solid var(--line);
  }
  .tabbar__item {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 12px;
    color: var(--ink-3);
    font-size: 0.7rem;
    font-weight: 600;
  }
  .tabbar__item .ph {
    font-size: 1.4rem;
  }
  .tabbar__item.is-active {
    color: var(--ink);
  }
  .sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    max-height: calc(100dvh - 24px);
  }
  .sheet__form {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .hero-band__name {
    font-size: 2.6rem;
  }
  .balance__value {
    font-size: 1.75rem;
  }
  .segmented__opt {
    padding: 0 12px;
  }
}
