:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #dde3ea;
  --focus: #1f6feb;
  --time: #5b5fc7;
  --school: #0b74b9;
  --positive: #137a3a;
  --positive-bg: #e8f6ed;
  --negative: #b42318;
  --negative-bg: #fff0ed;
  --trade: #9a5b00;
  --shadow: 0 10px 30px rgba(24, 32, 42, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #ffffff;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 3px;
}

.offline-banner {
  position: fixed;
  z-index: 50;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  max-width: 100vw;
  padding: 10px 16px;
  background: #1f2937;
  color: white;
  text-align: center;
  font-size: 0.9rem;
}

.login-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-card {
  width: min(420px, 100%);
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #20294f;
  color: white;
  font-weight: 800;
  margin-bottom: 18px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.login-card p {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.compact {
  gap: 10px;
}

label,
.modal-field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.95rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  width: min(100%, 720px);
  max-width: 100%;
  padding: 0 max(12px, env(safe-area-inset-left)) calc(104px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  margin: 0 auto;
  background: #ffffff;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.chat-screen.active {
  height: calc(100dvh - 126px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 6px;
}

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

.chat-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0;
}

.chat-thread {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 2px 12px;
  -webkit-overflow-scrolling: touch;
}

.chat-turn {
  display: grid;
  gap: 8px;
}

.load-older-chat {
  justify-self: center;
  width: auto;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(24, 32, 42, 0.06);
}

.chat-message {
  max-width: min(86%, 560px);
  min-width: 0;
  padding: 11px 13px;
  border: 0;
  border-radius: 18px;
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
}

.user-message {
  justify-self: end;
  background: #e9eef6;
}

.assistant-message {
  justify-self: start;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: pointer;
}

.assistant-message.failed {
  background: #fff4f2;
  color: #7a271a;
}

.chat-live-transcript {
  margin: 0;
  min-height: 0;
  max-height: 72px;
  padding: 8px 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.chat-composer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.08);
}

.chat-composer textarea {
  min-height: 26px;
  max-height: 140px;
  padding: 9px 4px 8px 8px;
  border: 0;
  background: transparent;
  resize: none;
  line-height: 1.35;
  outline: none;
}

.chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-icon-button,
.chat-send-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.chat-icon-button {
  background: #f2f4f7;
  color: #344054;
}

.chat-send-button {
  background: #111827;
  color: #ffffff;
}

.chat-send-button:disabled,
.chat-icon-button:disabled {
  opacity: 0.45;
}

.chat-icon-button.listening {
  background: #fee4e2;
  color: #b42318;
}

.send-icon {
  width: 19px;
  height: 19px;
  display: block;
  background: currentColor;
  -webkit-mask-image: url("/icons/ui/send.svg");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("/icons/ui/send.svg");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-inline: calc(-1 * max(12px, env(safe-area-inset-left)));
  padding: calc(18px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-left)) 24px max(12px, env(safe-area-inset-right));
  background: #ffffff;
}

.app-topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -160px;
  height: 160px;
  pointer-events: none;
  background: #ffffff;
}

.app-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 30px;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 28%, rgba(255, 255, 255, 0));
}

.child-switcher {
  width: min(444px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 2px;
  border: 1px solid #d7dce5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 12px rgba(24, 32, 42, 0.05);
}

.child-tab {
  min-width: 0;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1f2937;
  font-weight: 750;
}

.child-tab.active {
  background: #ffffff;
  color: #4f27ff;
  box-shadow: 0 1px 4px rgba(24, 32, 42, 0.12);
}

.child-tab-icon {
  width: 26px;
  height: 26px;
  display: block;
  background: currentColor;
  -webkit-mask-image: url("/icons/ui/user.svg");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("/icons/ui/user.svg");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.child-tab:not(.active) .child-tab-icon {
  color: #667085;
}

.voice-command-widget {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(156px, 0.65fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin: 0 0 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4db9f7 0%, #0064ff 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 100, 255, 0.2);
  overflow: hidden;
}

.voice-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.voice-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

#voice-command-status {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0.9;
  text-align: right;
}

.voice-state {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.voice-mode-badge.live {
  background: #dcfae6;
  color: #067647;
}

.voice-mode-badge.browser {
  background: #e0e7ff;
  color: #3730a3;
}

.voice-mode-badge.fallback,
.voice-mode-badge.upload {
  background: #fef0c7;
  color: #93370d;
}

.voice-mode-badge.processing,
.voice-mode-badge.connecting {
  background: #e0f2fe;
  color: #075985;
}

.voice-command-list {
  display: grid;
  gap: 10px;
}

.voice-live-transcript {
  margin: 0 0 10px;
  min-height: 42px;
  max-height: 96px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.voice-live-transcript.interim {
  color: rgba(255, 255, 255, 0.84);
  font-style: italic;
}

.voice-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.voice-command-item {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #07153d;
  box-shadow: 0 6px 16px rgba(7, 21, 61, 0.08);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.voice-command-item:active {
  transform: translateY(1px);
}

.voice-command-item.failed {
  color: #7a271a;
  background: #fff4f2;
}

.voice-bubble-icon,
.voice-arrow-icon {
  width: 24px;
  height: 24px;
  display: block;
  color: #0064ff;
}

.voice-bubble-icon {
  border: 3px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.voice-bubble-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 8px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor, -6px 0 0 currentColor;
}

.voice-bubble-icon::after {
  content: "";
  position: absolute;
  left: -2px;
  bottom: -5px;
  width: 8px;
  height: 8px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(10deg);
  background: inherit;
}

.voice-arrow-icon {
  justify-self: end;
  position: relative;
}

.voice-arrow-icon::before,
.voice-arrow-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 11px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: right center;
}

.voice-arrow-icon::before {
  transform: rotate(45deg);
}

.voice-arrow-icon::after {
  transform: rotate(-45deg);
}

.voice-command-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-command-text strong,
.voice-command-text span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.voice-command-text strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.voice-command-text span {
  color: #667085;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.voice-command-control {
  display: grid;
  place-items: center;
}

.voice-record-button {
  position: relative;
  width: clamp(128px, 34vw, 210px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: #0064ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.voice-record-ring {
  position: absolute;
  inset: 16%;
  border-radius: inherit;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(7, 21, 61, 0.15), 0 0 0 28px rgba(255, 255, 255, 0.12), 0 0 0 54px rgba(255, 255, 255, 0.08);
}

.voice-record-icon {
  position: relative;
  z-index: 1;
  width: 46%;
  height: 46%;
  display: block;
  background: currentColor;
  -webkit-mask-image: url("/icons/ui/mic.svg");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("/icons/ui/mic.svg");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.voice-record-button.listening {
  color: #b42318;
}

.voice-record-button.listening .voice-record-icon {
  width: 28%;
  height: 28%;
  border-radius: 8px;
  -webkit-mask-image: none;
  mask-image: none;
}

.voice-record-button.listening .voice-record-ring {
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 8px 22px rgba(7, 21, 61, 0.15), 0 0 0 28px rgba(255, 255, 255, 0.12), 0 0 0 54px rgba(255, 255, 255, 0.08);
  }
  50% {
    box-shadow: 0 8px 22px rgba(7, 21, 61, 0.15), 0 0 0 36px rgba(255, 255, 255, 0.18), 0 0 0 68px rgba(255, 255, 255, 0.12);
  }
}

.screen-header {
  padding: 10px 2px 16px;
}

.screen-header p {
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 700;
}

.screen-header h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.balance-panel,
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.balance-panel {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 150px;
  padding: 26px 18px;
  margin-bottom: 18px;
}

.balance-panel span {
  color: var(--muted);
  font-weight: 750;
}

.balance-panel strong {
  font-size: clamp(2.6rem, 15vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.time-accent {
  border-top: 5px solid var(--time);
}

.school-accent {
  border-top: 5px solid var(--school);
}

.quick-grid,
.school-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.school-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.adjust,
.wide-action,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.adjust {
  min-height: 72px;
  font-size: 1.45rem;
}

.positive {
  color: var(--positive);
  background: var(--positive-bg);
  border-color: #abefc6;
}

.negative {
  color: var(--negative);
  background: var(--negative-bg);
  border-color: #fecdca;
}

.neutral {
  color: #344054;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.wide-action,
.primary-button {
  width: 100%;
  background: #20294f;
  color: white;
  border-color: #20294f;
}

.time-action {
  background: var(--time);
  border-color: var(--time);
  margin-bottom: 24px;
}

.custom-time-action {
  background: #ffffff;
  color: var(--time);
  border-color: color-mix(in srgb, var(--time) 42%, #ffffff);
  margin-bottom: 10px;
}

.trade-action {
  background: #b76e00;
  border-color: #b76e00;
  margin-bottom: 24px;
}

.secondary-button {
  background: #eef4ff;
  color: #1849a9;
  border-color: #b2ccff;
}

.danger-button {
  background: var(--negative);
  color: white;
  border-color: var(--negative);
}

.ghost-button,
.text-button,
.danger-link {
  background: transparent;
  color: #344054;
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 750;
}

.text-button,
.danger-link {
  border-color: transparent;
  color: #475467;
  padding-inline: 4px;
}

.danger-link {
  color: var(--negative);
  margin-top: 12px;
}

.danger-text {
  color: var(--negative);
}

.school-date-box {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.school-date-box > span {
  color: var(--muted);
  font-weight: 750;
}

.date-control {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
}

.date-control button {
  min-height: 52px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  font-weight: 850;
}

.activity-section {
  margin-top: 4px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.activity-group {
  margin-bottom: 16px;
}

.activity-group h3 {
  margin: 18px 0 8px;
  color: #475467;
  font-size: 0.98rem;
}

.activity-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.activity-main {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.activity-title {
  font-size: 1.12rem;
  font-weight: 850;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-meta,
.activity-reason,
.user-row span,
.muted {
  color: var(--muted);
}

.activity-reason {
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.positive-text {
  color: var(--positive);
}

.negative-text {
  color: var(--negative);
}

.special-text {
  color: var(--trade);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 2px;
  padding: 7px max(10px, env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 22px rgba(24, 32, 42, 0.08);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: layout paint;
  will-change: transform;
}

.bottom-nav-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.nav-button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 850;
}

.environment-badge {
  min-height: 11px;
  color: #98a2b3;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
}

.nav-button.active {
  background: #eef4ff;
  color: #1849a9;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.icon-clock {
  -webkit-mask-image: url("/icons/ui/clock.svg");
  mask-image: url("/icons/ui/clock.svg");
}

.icon-chat {
  -webkit-mask-image: url("/icons/ui/chat.svg");
  mask-image: url("/icons/ui/chat.svg");
}

.icon-school {
  -webkit-mask-image: url("/icons/ui/school.svg");
  mask-image: url("/icons/ui/school.svg");
}

.icon-settings {
  -webkit-mask-image: url("/icons/ui/settings.svg");
  mask-image: url("/icons/ui/settings.svg");
}

.settings-card {
  padding: 16px;
  margin-bottom: 14px;
}

.settings-card h2 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.settings-card h3 {
  margin: 10px 0 0;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.access-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
}

.access-field legend {
  padding: 0 4px;
  color: #344054;
  font-weight: 750;
}

.access-grid,
.user-access-grid {
  display: grid;
  gap: 8px;
}

.access-chip {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-weight: 750;
}

.access-chip input {
  width: auto;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: end center;
  padding: 12px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.45);
  overflow-x: hidden;
}

.modal {
  width: min(520px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

.modal h2 {
  margin-bottom: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 10px;
  margin-top: 18px;
}

.segmented-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0 0 14px;
}

.segmented-field legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: #344054;
  font-size: 0.95rem;
  font-weight: 650;
}

.segment-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-weight: 850;
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option.selected:first-of-type {
  color: var(--positive);
  background: var(--positive-bg);
  border-color: #abefc6;
}

.segment-option.selected:last-of-type {
  color: var(--negative);
  background: var(--negative-bg);
  border-color: #fecdca;
}

.date-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 0.55fr);
  gap: 10px;
}

.quick-date-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}

.chip-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-weight: 800;
}

.apply-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 14px;
}

.apply-minutes-field {
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 1;
}

.step-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-weight: 900;
}

.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.voice-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  padding: 8px 12px;
  font-weight: 800;
}

.voice-button.recording {
  color: var(--negative);
  background: var(--negative-bg);
  border-color: #fecdca;
}

.voice-icon {
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  -webkit-mask-image: url("/icons/ui/mic.svg");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("/icons/ui/mic.svg");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.voice-status {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (min-width: 560px) {
  .apply-stepper {
    grid-template-columns: 52px 52px minmax(0, 1fr) 52px 52px;
  }

  .apply-minutes-field {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .voice-command-widget {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .voice-command-control {
    grid-row: 1;
  }

  .voice-record-button {
    width: min(150px, 54vw);
  }

  .voice-record-ring {
    box-shadow: 0 8px 22px rgba(7, 21, 61, 0.15), 0 0 0 20px rgba(255, 255, 255, 0.12), 0 0 0 38px rgba(255, 255, 255, 0.08);
  }

  .voice-heading h2 {
    font-size: 1rem;
  }
}

.transaction-detail {
  display: grid;
  gap: 6px;
}

.voice-detail {
  display: grid;
  gap: 14px;
}

.voice-detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.voice-detail-transcript {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 750;
  line-height: 1.35;
}

.voice-detail-grid {
  display: grid;
  gap: 8px;
}

.voice-detail-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.voice-detail-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.voice-detail-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.form-error,
.status-message.error {
  color: var(--negative);
  min-height: 1.2em;
}

.status-message {
  color: var(--positive);
}

.empty-state {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (min-width: 720px) {
  .bottom-nav {
    left: 50%;
    width: 720px;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    border-inline: 1px solid var(--line);
  }
}
