/* ---------------------------------------------------------------------------
   Minimal monochrome theme: day = white, night = near-black.
   The active theme is set as data-theme on <html> by the pre-paint script in
   index.html and by applyTheme() in app.js. Tokens are the single source of
   truth; Telegram themeParams are not read directly.
--------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --page: #ffffff;
  --card: #ffffff;
  --field: #f3f4f6;
  --text: #111113;
  --hint: #6b7280;
  --accent: #111113;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --separator: rgba(17, 17, 19, 0.09);
  --line: rgba(17, 17, 19, 0.16);
  --bar: #d4d4d8;
  --shadow-sm: 0 1px 2px rgba(17, 17, 19, 0.04), 0 10px 26px rgba(17, 17, 19, 0.06);
  --shadow-hero: 0 14px 34px rgba(17, 17, 19, 0.08);
  --shadow-cta: 0 12px 26px rgba(17, 17, 19, 0.18);
  --pad: clamp(12px, 4vw, 20px);
  --safe-top: var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-left: var(--tg-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-right: var(--tg-safe-area-inset-right, env(safe-area-inset-right, 0px));
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #0a0a0b;
  --card: #161618;
  --field: #242428;
  --text: #f4f4f5;
  --hint: #a1a1aa;
  --accent: #f4f4f5;
  --accent-text: #0a0a0b;
  --danger: #f87171;
  --separator: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.18);
  --bar: #3f3f46;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 26px rgba(0, 0, 0, 0.45);
  --shadow-hero: 0 14px 34px rgba(0, 0, 0, 0.55);
  --shadow-cta: 0 12px 26px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: var(--app-height, 100vh);
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

@supports (height: 100dvh) {
  body {
    height: var(--app-height, 100dvh);
  }
}

button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Shell. --app-height is set from Telegram.WebApp.viewportStableHeight in JS
   so the layout does not jump when the keyboard opens.
--------------------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: var(--app-height, 100vh);
  margin: 0 auto;
  padding:
    calc(6px + var(--safe-top))
    calc(var(--pad) + var(--safe-right))
    calc(6px + var(--safe-bottom))
    calc(var(--pad) + var(--safe-left));
}

@supports (height: 100dvh) {
  .app {
    height: var(--app-height, 100dvh);
  }
}

/* Top bar ------------------------------------------------------------------ */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
  animation: rise 0.4s ease-out both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--text);
  color: var(--page);
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.brand-name {
  overflow: hidden;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background-color 0.18s ease;
}

.icon-btn:active {
  transform: scale(0.96);
  background: var(--field);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

.setup-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background-color 0.18s ease;
}

.setup-pill svg {
  width: 15px;
  height: 15px;
  color: var(--text);
}

.setup-pill:active {
  transform: scale(0.97);
  background: var(--field);
}

/* Quick entry -------------------------------------------------------------- */
.hero {
  position: relative;
  flex: none;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--separator);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-hero);
  color: var(--text);
  animation: rise 0.5s 0.04s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hero-label {
  color: var(--hint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-date {
  color: var(--hint);
  font-size: 11.5px;
  font-weight: 500;
}

.amount-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 2px 0 9px;
  border-bottom: 1.5px solid var(--line);
  transition: border-color 0.2s ease;
}

.amount-row:focus-within {
  border-color: var(--text);
}

.amount-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(36px, 11.5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.amount-input::placeholder {
  color: var(--hint);
  opacity: 0.45;
}

.amount-input:focus-visible {
  outline: none;
}

.amount-currency {
  flex: none;
  margin-bottom: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.amount-hint {
  min-height: 16px;
  margin: 5px 1px 0;
  color: var(--hint);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.amount-hint.is-error {
  color: var(--danger);
}

/* Unit picker + quick amounts ---------------------------------------------- */
.unit-row {
  display: flex;
  gap: 3px;
  margin-top: 7px;
  padding: 3px;
  border-radius: 12px;
  background: var(--field);
}

.unit-btn {
  flex: 1;
  height: 26px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.unit-btn:active {
  transform: scale(0.97);
}

.unit-btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.quick-amounts {
  display: flex;
  gap: 6px;
  margin: 8px -18px 0;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}

.quick-amounts::-webkit-scrollbar {
  display: none;
}

.quick-amount {
  flex: none;
  height: 28px;
  padding: 0 11px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.quick-amount:active {
  transform: scale(0.96);
  background: var(--field);
}

.chips {
  display: flex;
  gap: 7px;
  margin: 9px -18px 0;
  padding: 1px 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease;
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.chip-emoji {
  font-size: 14px;
  line-height: 1;
}

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 13px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-cta);
  transition: transform 0.12s ease, opacity 0.18s ease;
}

.add-btn svg {
  width: 18px;
  height: 18px;
}

.add-btn:active {
  transform: scale(0.985);
  opacity: 0.85;
}

@media (hover: hover) {
  .add-btn:hover {
    opacity: 0.92;
  }

  .chip:hover {
    border-color: var(--line);
  }

  .quick-amount:hover {
    border-color: var(--line);
    background: var(--field);
    color: var(--text);
  }

  .icon-btn:hover,
  .setup-pill:hover {
    background: var(--field);
  }
}

/* Today's list ------------------------------------------------------------- */
.scroll {
  flex: 1;
  min-height: 0;
  padding: 2px 2px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll::-webkit-scrollbar {
  width: 0;
}

.summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 3px 12px;
  animation: rise 0.5s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.summary-main {
  min-width: 0;
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.day-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.day-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.day-btn:active {
  background: var(--field);
}

.back-today {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: underline;
  text-transform: none;
}

.summary-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  font-size: clamp(30px, 9vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.summary-value #total {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-currency {
  color: var(--hint);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
}

.summary-meta {
  margin-top: 4px;
  color: var(--hint);
  font-size: 11.5px;
}

.summary-month {
  margin-top: 2px;
  color: var(--hint);
  font-size: 11.5px;
  font-weight: 500;
}

.week {
  flex: none;
  width: 104px;
}

.week-label {
  margin-bottom: 6px;
  color: var(--hint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 46px;
}

.week-bar {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.week-bar:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.week-bar-fill {
  width: 100%;
  min-height: 6px;
  border-radius: 4px 4px 3px 3px;
  background: var(--bar);
  transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}

.week-bar.is-today .week-bar-fill {
  background: var(--text);
}

.week-bar.is-active .week-bar-fill {
  background: var(--text);
}

.week-bar:hover .week-bar-fill {
  background: var(--text);
}

.list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  list-style: none;
}

.expense {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--separator);
}

.expense:last-child {
  border-bottom: 0;
}

.expense-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--field);
  font-size: 17px;
}

.expense-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.expense-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.expense-open:active {
  opacity: 0.75;
}

.expense-category {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-time {
  color: var(--hint);
  font-size: 11px;
}

.expense-amount {
  flex: none;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delete-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -7px -8px -7px -4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--hint);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.delete-btn svg {
  width: 15px;
  height: 15px;
}

.delete-btn:active {
  background: var(--field);
  color: var(--danger);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.expense.enter {
  animation: enter 0.24s ease-out;
}

.empty {
  margin-top: 2px;
  padding: 34px 20px 30px;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 18px;
  background: var(--field);
  color: var(--hint);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-title {
  margin: 12px 0 3px;
  font-size: 14.5px;
  font-weight: 700;
}

.empty-sub {
  margin: 0;
  color: var(--hint);
  font-size: 12.5px;
}

/* Day history -------------------------------------------------------------- */
.history {
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--separator);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.history-head {
  padding: 10px 12px 4px;
  color: var(--hint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-list {
  display: flex;
  flex-direction: column;
  max-height: 236px;
  overflow-y: auto;
  scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
  width: 0;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.history-row + .history-row {
  box-shadow: inset 0 1px 0 var(--separator);
}

.history-row[aria-current="true"] {
  background: var(--field);
  box-shadow: none;
}

.history-date {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.history-count {
  color: var(--hint);
  font-size: 11px;
  white-space: nowrap;
}

.history-total {
  min-width: 62px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 8px;
  padding: 8px 8px 6px;
}

.ghost-btn {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

.ghost-btn:active {
  background: var(--field);
}

/* Edit sheet --------------------------------------------------------------- */
.edit-amount-row {
  margin-top: 8px;
}

.edit-amount-row .amount-input {
  font-size: 34px;
}

.sheet .chips {
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 0;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Toast -------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-cta);
  font-size: 12.5px;
  font-weight: 600;
  transform: translateX(-50%);
  animation: rise 0.18s ease-out;
}

.toast-action {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: underline;
}

/* Bottom sheet ------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.open {
  opacity: 1;
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  padding: 10px 20px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 28px 28px 0 0;
  background: var(--card);
  outline: none;
  transform: translateY(30px);
  transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.26, 1);
}

.sheet-backdrop.open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line);
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: var(--field);
  color: var(--hint);
}

.sheet-close svg {
  width: 14px;
  height: 14px;
}

.sheet-title {
  margin: 6px 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sheet-lead {
  margin: 0;
  color: var(--hint);
  font-size: 13px;
  line-height: 1.55;
}

.os-tabs {
  display: flex;
  gap: 3px;
  margin: 16px 0 4px;
  padding: 3px;
  border-radius: 13px;
  background: var(--field);
}

.os-tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.os-tab[aria-selected="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tab-panel h3 {
  margin: 14px 0 2px;
  font-size: 13.5px;
  font-weight: 700;
}

.steps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 10px 0;
  padding-left: 34px;
  font-size: 13px;
  line-height: 1.5;
}

.steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  content: counter(step);
  counter-increment: step;
  font-size: 11px;
  font-weight: 700;
}

.steps b {
  font-weight: 600;
}

.note {
  margin: 6px 0 0;
  color: var(--hint);
  font-size: 11.5px;
  line-height: 1.5;
}

.os-note {
  margin: 10px 0 0;
  color: var(--hint);
  font-size: 11.5px;
  font-weight: 600;
}

.link-box {
  display: flex;
  align-items: center;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--field);
}

.link-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sheet-primary,
.sheet-secondary {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  font: inherit;
  font-size: 13.5px;
  transition: opacity 0.15s ease;
}

.sheet-primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.sheet-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.sheet-actions button:active {
  opacity: 0.7;
}

.sheet-stats {
  margin: 14px 0 0;
  color: var(--hint);
  font-size: 11.5px;
  text-align: center;
}

/* Motion ------------------------------------------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-3px);
  }
  40%,
  60% {
    transform: translateX(3px);
  }
}

.shake {
  animation: shake 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
