@font-face {
  font-family: 'Onest';
  src: url('/fonts/Onest.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #111111;
  --snow: #f7f7f5;
  --steel: #8a8f98;
  --amber: #d9661f;
  --surface: #1a1b1d;
  --surface-2: #26282b;
  --line: #2e3033;
  --ink-soft: #33363a;
}

html,
body {
  margin: 0;
  background: var(--night);
  color: var(--snow);
  -webkit-text-size-adjust: 100%;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
}

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell.with-menu .bb-screen {
  min-height: calc(100dvh - 68px - env(safe-area-inset-bottom));
}

.shell.with-menu .bb-dock {
  padding-bottom: 14px;
}

.shell.with-bar .bb-screen {
  min-height: calc(100dvh - 136px - env(safe-area-inset-bottom));
}

.bb-page {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 18px 16px 24px;
  flex: 1;
}

.bb-page h1 {
  margin: 4px 0 14px;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.bb-page h2 {
  margin: 22px 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 600;
}

.bb-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.bb-rows > li,
.bb-rows > a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--snow);
  text-decoration: none;
  font-size: 16px;
}

.bb-rows .grow {
  flex: 1;
  min-width: 0;
}

.bb-rows small,
.bb-small {
  display: block;
  color: var(--steel);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.bb-mini-btn {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--snow);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.bb-mini-btn.amber {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--night);
}

.bb-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 16px;
}

.bb-switch input {
  width: 24px;
  height: 24px;
  flex: none;
  accent-color: #d9661f;
}

.bb-switch.off {
  color: var(--steel);
  cursor: default;
}

.bb-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bb-stat div {
  background: var(--surface);
  padding: 12px;
}

.bb-stat b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bb-stat span {
  font-size: 12px;
  color: var(--steel);
}

.bb-key {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  background: var(--surface);
  padding: 14px;
  word-spacing: 0.3em;
  user-select: all;
}

.bb-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--night);
  color: var(--snow);
  overflow: hidden;
}

.bb-screen button,
.bb-screen input,
.bb-screen textarea {
  font-family: inherit;
  color: inherit;
}

.bb-field {
  position: relative;
  flex: none;
  overflow: hidden;
}

.bb-chip {
  position: absolute;
  background: var(--night);
  color: var(--snow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.bb-word {
  left: 0;
  top: 0;
  padding: 12px 16px 12px 14px;
  font-weight: 800;
  letter-spacing: 0.34em;
  font-size: 18px;
}

.bb-word img {
  width: 30px;
  height: 30px;
  display: block;
}

.bb-body {
  padding: 22px 18px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bb-h1 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.bb-lead {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.45;
}

.bb-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--steel);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.bb-note svg {
  flex: none;
  margin-top: 2px;
}

.bb-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 10px;
  font-weight: 600;
}

.bb-input {
  height: 54px;
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 600;
}

.bb-input:focus {
  outline: none;
  border-color: var(--snow);
}

.bb-dock {
  flex: none;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bb-btn {
  height: 58px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.bb-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.bb-btn.amber {
  background: var(--amber);
  color: var(--night);
}

.bb-btn.snow {
  background: var(--snow);
  color: var(--night);
}

.bb-btn.ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--snow);
}

.bb-link {
  display: block;
  text-align: center;
  color: var(--steel);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 12px 4px;
  margin: -8px 0;
}

.bb-alert {
  background: var(--surface);
  border-left: 4px solid var(--amber);
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.4;
}

.bb-alert b {
  font-weight: 700;
}

.bb-input::placeholder {
  font-weight: 500;
  color: var(--steel);
  opacity: 1;
}
.bb-screen.pinned {
  padding-bottom: calc(168px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.bb-dock.pin {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  background: var(--night);
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.bb-dock.pin:empty {
  display: none;
}
