:root {
  color-scheme: dark;
  --bg: #020817;
  --panel: rgba(4, 13, 35, .88);
  --line: rgba(0, 119, 255, .28);
  --blue: #0878ff;
  --cyan: #5ee7ff;
  --green: #27f66d;
  --amber: #ff8a19;
  --text: #f8fbff;
  --muted: #8da2cb;
  --terminal-viewport-height: 100dvh;
  --terminal-compose-panel-height: 100dvh;
  --terminal-bottom-safe: max(8px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 118, 255, .38), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(36, 214, 255, .12), transparent 32%),
    #010511;
  color: var(--text);
}

body.native-shell .terminal-stage {
  padding: 0;
}

body.native-shell .terminal-language-switch {
  top: max(4px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
}

body.native-shell .terminal-header .bell-button {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 38px);
  right: max(10px, env(safe-area-inset-right));
  left: auto;
  z-index: 31;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 10px;
  background: rgba(3, 16, 52, .82);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
}

body.native-shell .terminal-header .bell-button svg {
  width: 22px;
  height: 22px;
}

body.native-shell .terminal-header .bell-button span {
  top: 6px;
  right: 6px;
}

body.terminal-ai-active .terminal-header .bell-button {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.native-shell .phone-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--terminal-viewport-height, 100dvh);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.native-shell .install-panel {
  display: inline-grid;
}

body.native-shell .bottom-nav {
  min-height: clamp(68px, 8.3dvh, 78px) !important;
  padding: 6px clamp(10px, 3.4vw, 16px) var(--terminal-bottom-safe) !important;
  align-items: stretch;
}

body.native-shell .bottom-nav button {
  align-content: center;
  padding-bottom: 0;
  transform: translateY(-2px);
}

button,
input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.terminal-stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  height: var(--terminal-viewport-height, 100dvh);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 24px;
}

.terminal-language-switch {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 10px;
  background: rgba(3, 16, 52, .82);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}

.terminal-language-switch button {
  width: 36px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 5px;
  background: transparent;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
  cursor: pointer;
  line-height: 1;
}

.terminal-language-switch button:hover,
.terminal-language-switch button:focus-visible,
.terminal-language-switch button.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(255, 138, 25, .28), 0 6px 14px rgba(0, 0, 0, .24);
  outline: none;
}

.flag-icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.flag-es {
  background: linear-gradient(to bottom, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.flag-us {
  background: repeating-linear-gradient(to bottom, #b22234 0 1.7px, #ffffff 1.7px 3.4px);
}

.flag-us::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 54%;
  background: #3c3b6e;
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  height: min(920px, calc(100vh - 48px));
  height: min(920px, calc(100dvh - 48px));
  height: min(920px, calc(var(--terminal-viewport-height, 100dvh) - 48px));
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 32px auto auto minmax(0, 1fr) auto;
  border: 1px solid rgba(41, 137, 255, .52);
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(3, 10, 29, .96), rgba(0, 5, 18, .98)),
    radial-gradient(circle at 50% 3%, rgba(5, 95, 255, .28), transparent 42%);
  box-shadow:
    0 0 0 5px rgba(20, 90, 190, .16),
    0 28px 90px rgba(0, 0, 0, .68),
    inset 0 0 42px rgba(0, 119, 255, .12);
}

.phone-shell::before {
  display: none;
}

body.terminal-charge-mode .phone-shell {
  grid-template-rows: minmax(0, 1fr) auto;
  border-color: transparent;
  background:
    radial-gradient(circle at 50% 16%, rgba(8, 120, 255, .24), transparent 42%),
    linear-gradient(180deg, rgba(1, 7, 22, .98), rgba(0, 3, 12, .98));
  box-shadow: none;
}

body.terminal-charge-mode .status-bar,
body.terminal-charge-mode .terminal-header,
body.terminal-charge-mode .merchant-card {
  display: none;
}

body.terminal-history-mode .merchant-card {
  display: none;
}

body.terminal-activity-mode .merchant-card {
  display: none;
}

body.terminal-settings-mode .merchant-card {
  display: none;
}

.status-bar {
  position: relative;
  z-index: 5;
  height: 32px;
  padding: 6px 18px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #f8fbff;
  font-size: 15px;
  font-weight: 800;
}

.status-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.terminal-brand small,
.connected-pill,
.secure-note,
.manual-actions {
  display: flex;
  align-items: center;
}

.terminal-header {
  min-height: 72px;
  padding: 0 26px 2px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  grid-template-rows: auto;
  align-items: center;
  gap: 10px;
}

body.terminal-activity-mode .terminal-header {
  min-height: 206px;
  padding: 0 26px 6px;
  grid-template-rows: auto auto auto;
}

.icon-button,
.bell-button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #cfe0ff;
  cursor: pointer;
}

.icon-button {
  display: grid;
  align-content: center;
  gap: 6px;
}

.top-menu-button {
  width: 34px;
  height: 34px;
  gap: 5px;
}

.icon-button span {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: #d8e6ff;
}

.top-menu-button span { width: 24px; }

.terminal-brand {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 3px;
}

.terminal-gmail-button {
  grid-column: 1;
  justify-self: start;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #dff7ff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform 160ms ease;
}

.terminal-gmail-button:hover,
.terminal-gmail-button:focus-visible {
  transform: translateY(-1px);
}

.terminal-gmail-button:focus-visible {
  outline: none;
}

.terminal-gmail-icon {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(94, 231, 255, .34));
  animation: terminalGmailSoftPulse 2.85s ease-in-out infinite;
  transform-origin: center;
  will-change: filter, transform;
}

.terminal-gmail-button:hover .terminal-gmail-icon,
.terminal-gmail-button:focus-visible .terminal-gmail-icon {
  filter: drop-shadow(0 0 12px rgba(94, 231, 255, .58));
}

@keyframes terminalGmailSoftPulse {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(94, 231, 255, .28));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(94, 231, 255, .58));
    transform: scale(1.045);
  }
}

.terminal-trial-countdown {
  min-height: 22px;
  max-width: 150px;
  padding: 0 10px;
  border: 1px solid rgba(94, 231, 255, .34);
  border-radius: 999px;
  background: rgba(4, 22, 62, .58);
  color: #5eead4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 8px 20px rgba(0, 0, 0, .22);
}

.terminal-trial-countdown[hidden] {
  display: none;
}

.terminal-trial-countdown.is-expired {
  border-color: rgba(251, 113, 133, .52);
  background: rgba(76, 5, 25, .56);
  color: #fecdd3;
}

.terminal-trial-countdown.is-active-plan {
  border-color: rgba(56, 189, 248, .30);
  color: #bae6fd;
}

.terminal-header .bell-button { grid-column: 3; }

.invoice-hero-strip {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

body.terminal-activity-mode .invoice-hero-strip {
  display: grid;
}

.invoice-hero-copy {
  min-width: 0;
}

.invoice-hero-copy strong {
  display: block;
  color: #f8fbff;
  font-size: clamp(32px, 4.8dvh, 38px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: .01em;
}

.invoice-hero-copy span {
  display: block;
  margin-top: 2px;
  color: #7f93b6;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.invoice-filter-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(8, 120, 255, .6);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(6, 28, 86, .88), rgba(3, 13, 44, .86));
  color: #2ca1ff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(127, 214, 255, .12), 0 10px 24px rgba(1, 12, 34, .35);
}

.invoice-filter-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.invoice-refresh-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 10px;
  background: rgba(4, 22, 62, .58);
  color: rgba(187, 226, 255, .84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .16s ease, border-color .16s ease, background-color .16s ease, transform .16s ease;
  opacity: .78;
}

.invoice-refresh-btn:hover,
.invoice-refresh-btn:focus-visible {
  opacity: 1;
  border-color: rgba(94, 231, 255, .55);
  background: rgba(6, 29, 82, .78);
  outline: none;
}

.invoice-refresh-btn:active {
  transform: translateY(1px);
}

.invoice-refresh-btn.is-loading {
  opacity: .5;
  pointer-events: none;
}

.invoice-refresh-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 8px;
  border: 1px solid rgba(8, 120, 255, .45);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(2, 16, 52, .96), rgba(2, 10, 32, .96));
  box-shadow: 0 18px 36px rgba(1, 12, 34, .42);
  display: grid;
  gap: 6px;
  z-index: 12;
}

.invoice-filter-menu[hidden] {
  display: none;
}

.invoice-filter-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(5, 22, 66, .56);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.invoice-filter-menu button[aria-checked="true"] {
  border-color: rgba(94, 231, 255, .55);
  color: #7fe6ff;
  background: rgba(8, 120, 255, .24);
}

.invoice-filter-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-filter-btn:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .65);
  outline-offset: 1px;
}

.terminal-inline-metrics {
  display: none;
  grid-column: 1 / -1;
  gap: 7px;
  margin-top: 2px;
}

body.terminal-activity-mode .terminal-inline-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 2px;
}

.inline-metric-btn {
  min-height: 54px;
  padding: 6px 6px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(3, 16, 52, .8), rgba(2, 8, 30, .68));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
  color: #f8fbff;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  cursor: pointer;
}

.inline-metric-btn span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.inline-metric-btn strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.inline-metric-btn[data-metric="today"] strong {
  color: #f8fbff;
}

.inline-metric-btn[data-metric="paid"] strong {
  color: #22e07d;
}

.inline-metric-btn[data-metric="pending"] strong {
  color: #ffb347;
}

.inline-metric-btn[data-metric="overdue"] strong {
  color: #ff5f72;
}

.inline-metric-btn:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .6);
  outline-offset: 1px;
}

.inline-metric-btn.is-filtered {
  border-color: rgba(94, 231, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(127, 214, 255, .3), 0 0 20px rgba(0, 119, 255, .24);
}

.invoice-results,
.estimates-results {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.terminal-logo {
  width: clamp(38px, 5.7dvh, 48px);
  height: clamp(38px, 5.7dvh, 48px);
  display: block;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(0, 119, 255, .34), 0 0 24px rgba(255, 138, 25, .12);
}

.terminal-brand strong { font-size: 18px; line-height: 1; }
.terminal-brand em { color: var(--blue); font-style: normal; }
.terminal-brand small { gap: 7px; color: var(--green); font-size: 12px; font-weight: 800; }

.online-dot,
.connected-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(39, 246, 109, .9);
}

.bell-button { position: relative; }
.bell-button svg { width: 28px; height: 28px; fill: none; stroke: #d8e6ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bell-button span {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 138, 25, .85);
}

.merchant-card,
.payment-card,
.orders-dock,
.terminal-overview-card,
.settings-card,
.processor-connect-card,
.activity-grid > div,
.terminal-overview-grid > div,
.history-item,
.activity-feed > div,
.manual-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(3, 16, 52, .88), rgba(2, 8, 30, .76));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025), 0 18px 50px rgba(0, 0, 0, .26);
}

.merchant-card { margin: 0 26px clamp(5px, .9dvh, 8px); overflow: hidden; border-radius: 18px; }

.merchant-top {
  min-height: clamp(58px, 7.6dvh, 72px);
  padding: clamp(8px, 1.35dvh, 12px);
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.merchant-avatar {
  width: clamp(42px, 5.6dvh, 52px);
  height: clamp(42px, 5.6dvh, 52px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, #2e9bff, #034bff 72%);
  font-size: 18px;
  font-weight: 950;
  cursor: pointer;
}

.merchant-avatar:hover,
.merchant-avatar:focus-visible {
  filter: saturate(1.08) brightness(1.06);
  box-shadow: 0 0 0 2px rgba(94, 231, 255, .42);
  outline: none;
}

.merchant-avatar.has-logo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.merchant-top strong,
.merchant-bottom strong { display: block; color: #f8fbff; font-size: clamp(14px, 1.85dvh, 17px); }
.merchant-top span,
.merchant-bottom span { color: var(--muted); font-size: 13px; }

.connected-pill {
  min-height: 32px;
  padding: 0 12px;
  gap: 8px;
  border: 1px solid rgba(39, 246, 109, .25);
  border-radius: 999px;
  color: var(--green);
  background: rgba(1, 106, 58, .24);
  font-size: 12px;
  font-weight: 900;
}

.merchant-bottom { display: grid; grid-template-columns: 1fr 1fr; }
.merchant-bottom > div { padding: clamp(7px, 1.1dvh, 10px); }
.merchant-bottom > div + div { border-left: 1px solid var(--line); }

.stripe-word { color: #6757ff !important; font-size: clamp(18px, 2.6dvh, 23px) !important; letter-spacing: 0; }

.stripe-word em {
  margin-left: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(0, 119, 255, .18);
  font-size: 11px;
  font-style: normal;
}

.screen-panel {
  grid-row: 4;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(94, 231, 255, .55) rgba(1, 12, 42, .22);
  scrollbar-width: thin;
  display: none;
  padding: 0 26px clamp(8px, 1.4dvh, 14px);
}
.screen-panel.is-active {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.screen-panel::-webkit-scrollbar { width: 6px; }
.screen-panel::-webkit-scrollbar-track { background: rgba(1, 12, 42, .22); }
.screen-panel::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(94, 231, 255, .55); }
.screen-panel[data-screen="terminal"].is-active,
.screen-panel[data-screen="charge"].is-active { gap: clamp(8px, 1.3dvh, 12px); }

body.terminal-charge-mode .screen-panel[data-screen="charge"] {
  grid-row: 1;
  justify-content: stretch;
  overflow: hidden;
  padding: clamp(36px, 5.4dvh, 50px) 20px clamp(8px, 1.3dvh, 12px);
}

body.terminal-charge-mode .bottom-nav { grid-row: 2; }

body.terminal-charge-mode .charge-action-card {
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  border: 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 18%, rgba(94, 231, 255, .2), transparent 30%),
    radial-gradient(circle at 82% 14%, rgba(0, 119, 255, .25), transparent 26%),
    linear-gradient(180deg, rgba(4, 22, 58, .86), rgba(1, 8, 28, .96));
  box-shadow: 0 20px 70px rgba(0, 0, 0, .34), inset 0 0 0 1px rgba(255, 255, 255, .04);
}

body.terminal-charge-mode .orders-dock {
  border-color: rgba(94, 231, 255, .18);
  background: rgba(1, 10, 29, .62);
  box-shadow: none;
}

.terminal-orders-dock {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.terminal-orders-dock .order-list {
  flex: 1 1 auto;
  max-height: none;
}

.terminal-overview-card {
  padding: clamp(13px, 1.9dvh, 16px);
  display: grid;
  gap: clamp(10px, 1.5dvh, 14px);
  border-radius: 18px;
}

.terminal-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.terminal-overview-grid > div {
  min-height: clamp(72px, 10.4dvh, 92px);
  padding: clamp(12px, 1.7dvh, 15px);
  border-radius: 14px;
}

.terminal-overview-grid strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(15px, 2.1dvh, 18px);
  line-height: 1.2;
}

.payment-card {
  position: relative;
  overflow: hidden;
  appearance: none;
  width: 100%;
  min-height: clamp(420px, 61dvh, 560px);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(13px, 2dvh, 22px) 20px clamp(12px, 1.8dvh, 20px);
  border-color: rgba(0, 119, 255, .7);
  border-radius: 22px;
  color: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025), 0 0 34px rgba(0, 119, 255, .22), 0 18px 56px rgba(0, 0, 0, .3);
}

.payment-card:disabled { cursor: not-allowed; opacity: .76; }

.payment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background:
    radial-gradient(circle at 86% 16%, rgba(0, 180, 255, .38), transparent 24%),
    repeating-radial-gradient(circle at 86% 10%, transparent 0 8px, rgba(77, 193, 255, .16) 9px 10px);
  pointer-events: none;
}

.card-light {
  position: absolute;
  right: 30%;
  top: 52%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 28px 12px rgba(0, 219, 255, .8);
  animation: spark 3.2s ease-in-out infinite;
}

.document-icon,
.tap-core {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 119, 255, .8);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 90, 255, .28), rgba(0, 0, 0, .18));
  box-shadow: 0 0 24px rgba(0, 119, 255, .4), inset 0 0 18px rgba(0, 119, 255, .16);
}

.document-icon { width: clamp(48px, 7.6dvh, 70px); height: clamp(48px, 7.6dvh, 70px); }
.document-icon svg,
.tap-core svg { width: 38px; height: 38px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.payment-kicker {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: clamp(8px, 1.45dvh, 16px);
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.payment-card h1,
.payment-title {
  position: relative;
  z-index: 1;
  display: block;
  margin: clamp(7px, 1.15dvh, 11px) 0 0;
  font-size: clamp(20px, 3dvh, 27px);
  letter-spacing: 0;
}

.payment-amount {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: clamp(7px, 1.2dvh, 12px);
  color: #fff;
  font-size: clamp(44px, 8.2dvh, 70px);
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 0 8px 26px rgba(255, 255, 255, .16);
}

.amount-accent {
  position: relative;
  z-index: 1;
  display: block;
  width: 48px;
  height: 4px;
  margin: clamp(8px, 1.55dvh, 16px) auto clamp(7px, 1.2dvh, 11px);
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(0, 119, 255, .8);
}

.payment-card p,
.payment-copy { position: relative; z-index: 1; display: block; margin: 0; color: #9bb2e0; font-size: clamp(12px, 1.7dvh, 15px); font-weight: 700; }

.tap-orbit {
  position: relative;
  z-index: 1;
  width: clamp(96px, 15.8dvh, 150px);
  height: clamp(96px, 15.8dvh, 150px);
  margin: clamp(8px, 1.45dvh, 16px) auto clamp(8px, 1.6dvh, 18px);
  display: grid;
  place-items: center;
}

.orbit-ring {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(0, 119, 255, .42);
  border-radius: 50%;
  animation: pulse-ring 2.6s ease-out infinite;
}

.ring-two { inset: 2px; animation-delay: .35s; }
.ring-three { inset: -12px; animation-delay: .7s; }
.tap-core { width: clamp(70px, 11.6dvh, 106px); height: clamp(70px, 11.6dvh, 106px); border-width: 3px; }
.tap-core svg { width: clamp(46px, 7.6dvh, 70px); height: clamp(46px, 7.6dvh, 70px); stroke: #f8fbff; }
.wave { animation: wave-glow 1.6s ease-in-out infinite; }
.wave-two { animation-delay: .15s; }
.wave-three { animation-delay: .3s; }
.card-line { stroke: #f8fbff; }

.primary-terminal-action,
.secondary-terminal-action,
.settings-card button:not(.password-toggle),
.gate-login button:not(.password-toggle),
#refreshOrdersButton,
.manual-card button {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 950;
}

.primary-terminal-action {
  min-height: clamp(50px, 6.9dvh, 62px);
  padding: 0 16px;
  display: grid;
  grid-template-columns: 58px 1fr 20px;
  align-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0077ff, #075fff);
  box-shadow: 0 12px 28px rgba(0, 95, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.primary-terminal-action.is-processing {
  background: linear-gradient(135deg, #00a6ff, #0048ff);
  animation: processing-button 1.2s ease-in-out infinite;
}

.charge-action-card.is-processing .charge-action-label {
  color: var(--cyan);
  background: transparent;
  animation: processing-button 1.2s ease-in-out infinite;
}

.charge-action-card:disabled .charge-action-label { opacity: .72; }

.charge-action-card:hover,
.charge-action-card:focus-visible {
  border-color: rgba(94, 231, 255, .92);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035), 0 0 42px rgba(0, 119, 255, .28), 0 18px 56px rgba(0, 0, 0, .32);
}

.charge-action-label {
  width: auto;
  min-height: auto;
  margin: clamp(4px, .9dvh, 8px) auto 0;
  padding: 0;
  display: inline-grid;
  grid-template-columns: 44px auto 16px;
  gap: 12px;
  color: #f8fbff;
  background: transparent;
  box-shadow: none;
}

.charge-action-label strong { font-size: clamp(18px, 2.65dvh, 24px); }

.tap-icon {
  justify-self: center;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .14);
}

.tap-icon i {
  position: absolute;
  width: 16px;
  height: 22px;
  border: 3px solid #fff;
  border-color: transparent #fff transparent transparent;
  border-radius: 50%;
}

.tap-icon i:nth-child(1) { transform: translateX(-8px) scale(.62); }
.tap-icon i:nth-child(2) { transform: translateX(-3px) scale(.82); }
.tap-icon i:nth-child(3) { transform: translateX(2px); }
.button-arrow { font-size: 22px; }

.secondary-terminal-action {
  min-height: clamp(42px, 5.7dvh, 52px);
  margin-top: clamp(6px, 1dvh, 9px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--blue);
  background: rgba(0, 18, 48, .5);
  border: 1px solid rgba(0, 119, 255, .7);
}

.manual-icon {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 5px;
  background: linear-gradient(currentColor, currentColor) 50% 33% / 14px 2px no-repeat, linear-gradient(currentColor, currentColor) 50% 66% / 14px 2px no-repeat;
}

.secure-note { margin-top: clamp(8px, 1.45dvh, 16px) !important; justify-content: center; gap: 8px; font-size: 13px !important; }
.secure-note strong { color: #776aff; font-size: 16px; }
.shield-icon { width: 20px; height: 22px; border: 2px solid rgba(141, 162, 203, .65); border-radius: 10px 10px 12px 12px; }

.orders-dock { flex: 0 0 auto; margin-top: 0; padding: clamp(10px, 1.4dvh, 13px); border-radius: 18px; }
.orders-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.orders-dock-head strong,
.section-head strong { display: block; color: #fff; }

#refreshOrdersButton { width: auto; min-height: 34px; padding: 0 12px; color: #0ad6ff; background: rgba(0, 119, 255, .15); }

.order-list,
.history-list,
.activity-feed { margin-top: clamp(8px, 1.25dvh, 11px); display: grid; gap: clamp(7px, 1dvh, 10px); overflow: visible; }

.order-list {
  max-height: clamp(92px, 17dvh, 180px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-color: rgba(94, 231, 255, .55) rgba(1, 12, 42, .22);
  scrollbar-width: thin;
}
.history-list,
.activity-feed { max-height: none; }

body.terminal-history-mode .history-list {
  align-content: start;
  grid-auto-rows: min-content;
}

body.terminal-history-mode .history-item {
  align-self: start;
  min-height: clamp(50px, 6.7dvh, 62px);
}

.order-list::-webkit-scrollbar { width: 5px; }
.order-list::-webkit-scrollbar-track { background: rgba(1, 12, 42, .22); }
.order-list::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(94, 231, 255, .55); }

.order-chip,
.history-item,
.activity-feed > div {
  width: 100%;
  min-height: clamp(50px, 6.7dvh, 62px);
  padding: clamp(9px, 1.35dvh, 12px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
}

.order-chip { border: 1px solid rgba(0, 119, 255, .26); color: #dce9ff; background: rgba(0, 14, 39, .62); cursor: pointer; }
.order-chip:disabled { cursor: default; opacity: .75; }
.order-chip.active { border-color: rgba(94, 231, 255, .7); box-shadow: 0 0 20px rgba(0, 119, 255, .2); }

.order-chip-wrap {
  display: grid;
  gap: 6px;
}

.order-chip-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.order-chip-menu-trigger {
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 9px;
  color: #b8e7ff;
  background: rgba(0, 28, 68, .62);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
}

.order-chip-menu-trigger:hover,
.order-chip-menu-trigger:focus-visible {
  border-color: rgba(94, 231, 255, .72);
  background: rgba(8, 120, 255, .34);
  outline: none;
}

.order-chip span,
.history-item span,
.activity-grid span,
.activity-feed span,
.section-head span,
.terminal-overview-grid span,
.settings-card span,
.manual-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-chip strong,
.history-item strong,
.activity-feed strong { display: block; color: #fff; font-size: 14px; }
.order-chip em,
.history-item em { color: #fff; font-style: normal; font-weight: 950; }

.invoice-row-btn {
  border: 1px solid rgba(0, 119, 255, .26);
  color: #dce9ff;
  background: rgba(0, 14, 39, .62);
  cursor: pointer;
  text-align: left;
}

.invoice-row-btn:hover,
.invoice-row-btn:focus-visible {
  border-color: rgba(94, 231, 255, .62);
  box-shadow: 0 0 18px rgba(8, 120, 255, .22);
  outline: none;
}

.section-head { margin: 0 0 clamp(10px, 1.8dvh, 16px); }
.section-head strong { font-size: clamp(20px, 3dvh, 24px); }

.section-head-history {
  display: grid;
  gap: 6px;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-title-row strong {
  margin: 0;
  line-height: 1.1;
}

.history-total-amount {
  margin-left: auto;
  color: var(--amber);
  font-size: clamp(16px, 2.5dvh, 20px) !important;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 138, 25, .35);
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: 10px;
}

.activity-grid > div {
  min-height: clamp(56px, 8.2dvh, 72px);
  padding: clamp(10px, 1.45dvh, 13px);
  border-radius: 16px;
}

.activity-grid strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: clamp(16px, 2.4dvh, 20px);
}

.activity-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 0;
  padding: clamp(9px, 1.35dvh, 12px);
}

.activity-inline-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.activity-inline-metrics span {
  display: inline;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-inline-metrics strong {
  display: inline;
  margin-top: 0;
  color: #fff;
  font-size: clamp(17px, 2.5dvh, 21px);
}

.settings-card,
.manual-card { padding: clamp(13px, 1.9dvh, 16px); border-radius: 18px; display: grid; gap: clamp(9px, 1.4dvh, 12px); }
.settings-card label,
.manual-card label { display: grid; gap: 7px; }
.settings-card input,
.manual-card input { min-height: clamp(42px, 5.5dvh, 46px); width: 100%; border: 1px solid rgba(0, 119, 255, .28); border-radius: 12px; padding: 0 13px; color: #f8fbff; background: rgba(0, 7, 24, .8); outline: none; }
.settings-card input:focus,
.manual-card input:focus { border-color: rgba(94, 231, 255, .7); }
.settings-card button:not(.password-toggle),
.gate-login button:not(.password-toggle),
.manual-card button,
.terminal-gmail-actions button { min-height: clamp(44px, 5.8dvh, 48px); color: #fff; background: linear-gradient(135deg, #0878ff, #075fff); }
.ghost-action,
#cancelManualButton { border: 1px solid rgba(0, 119, 255, .5) !important; color: #8fc8ff !important; background: rgba(0, 14, 39, .56) !important; }

#logoutButton {
  border: 1px solid rgba(255, 90, 112, .62) !important;
  color: #ffc8d0 !important;
  background: rgba(98, 12, 34, .58) !important;
  box-shadow: 0 10px 24px rgba(255, 90, 112, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

#logoutButton:hover,
#logoutButton:focus-visible {
  border-color: rgba(255, 122, 140, .78) !important;
  color: #ffe3e7 !important;
  background: rgba(122, 18, 44, .72) !important;
}

.settings-utility { gap: clamp(10px, 1.5dvh, 14px); }
.settings-session-card,
.settings-session-card {
  padding: clamp(12px, 1.7dvh, 15px);
  border: 1px solid rgba(0, 119, 255, .28);
  border-radius: 14px;
  background: rgba(0, 14, 39, .62);
}
.settings-session-card strong,
.settings-session-card strong { display: block; margin-top: 6px; color: #fff; }
.settings-session-card p { margin: 6px 0 0; color: #a9bbdf; font-size: 13px; }
.settings-actions { display: grid; gap: 10px; }

.processor-connect-card {
  width: 100%;
  min-height: clamp(76px, 9.8dvh, 92px);
  margin-top: clamp(10px, 1.5dvh, 14px);
  padding: clamp(10px, 1.55dvh, 14px);
  display: grid;
  grid-template-columns: clamp(46px, 6.1dvh, 56px) minmax(0, 1fr) minmax(82px, auto);
  align-items: center;
  gap: clamp(10px, 1.6dvh, 14px);
  border-radius: 14px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 100% 15%, rgba(94, 231, 255, .18), transparent 34%),
    linear-gradient(135deg, rgba(2, 18, 58, .92), rgba(2, 10, 32, .94));
}

.processor-connect-card.is-ready { border-color: rgba(39, 246, 109, .58); box-shadow: 0 0 0 1px rgba(39, 246, 109, .14), 0 12px 28px rgba(39, 246, 109, .09); }
.processor-connect-card.is-pending { border-color: rgba(255, 138, 25, .56); }
.processor-connect-card.is-error { border-color: rgba(255, 90, 112, .62); }
.processor-connect-card.is-disabled { opacity: .78; }

.processor-icon {
  width: clamp(46px, 6.1dvh, 56px);
  height: clamp(46px, 6.1dvh, 56px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 231, 255, .28);
  border-radius: 14px;
  background: rgba(0, 14, 39, .66);
}

.processor-icon span {
  position: relative;
  width: 29px;
  height: 21px;
  border: 3px solid #8fc8ff;
  border-radius: 8px;
  box-shadow: inset 0 -7px 0 rgba(8, 120, 255, .22);
}

.processor-icon span::before,
.processor-icon span::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.processor-icon span::before { top: 5px; color: var(--cyan); }
.processor-icon span::after { bottom: 4px; color: var(--blue); }

.processor-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.processor-copy small {
  color: #9fb4dc;
  font-size: clamp(10px, 1.45dvh, 12px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.processor-copy strong {
  color: #f8fbff;
  font-size: clamp(15px, 2.1dvh, 18px);
  line-height: 1.05;
}

.processor-copy em {
  color: #93a8cf;
  font-size: clamp(11px, 1.55dvh, 13px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.15;
}

.processor-connect-card.is-ready .processor-copy em { color: var(--green); }
.processor-connect-card.is-pending .processor-copy em { color: #ffc178; }
.processor-connect-card.is-error .processor-copy em { color: #ff9aaa; }

.processor-connect-card button {
  min-height: clamp(38px, 5dvh, 44px);
  min-width: 82px;
  padding: 0 12px;
  border: 1px solid rgba(0, 119, 255, .62);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #0878ff, #075fff);
  font-size: clamp(12px, 1.7dvh, 14px);
  font-weight: 950;
  cursor: pointer;
}

.processor-connect-card button:disabled {
  color: #8fa7cf;
  background: rgba(0, 14, 39, .62);
  cursor: not-allowed;
}

.settings-support-button {
  width: 100%;
  min-height: clamp(86px, 11.2dvh, 104px);
  margin-top: auto;
  padding: clamp(12px, 1.8dvh, 16px) clamp(14px, 2.2dvh, 18px);
  display: grid;
  grid-template-columns: clamp(58px, 7.7dvh, 70px) minmax(0, 1fr) 24px;
  align-items: center;
  gap: clamp(12px, 1.9dvh, 16px);
  border: 1px solid rgba(0, 119, 255, .78);
  border-radius: 14px;
  color: #f8fbff;
  text-align: left;
  text-decoration: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 138, 25, .64), transparent 22%),
    radial-gradient(circle at 0% 100%, rgba(8, 120, 255, .28), transparent 34%),
    linear-gradient(135deg, rgba(2, 18, 58, .98), rgba(2, 12, 38, .96));
  box-shadow: 0 0 0 1px rgba(0, 119, 255, .2), 0 14px 34px rgba(0, 119, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .07);
  cursor: pointer;
}

.settings-support-button:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .9);
  outline-offset: 3px;
}

.support-avatar {
  position: relative;
  width: clamp(58px, 7.7dvh, 70px);
  height: clamp(58px, 7.7dvh, 70px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 119, 255, .28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 119, 255, .18), rgba(1, 10, 31, .9));
  box-shadow: inset 0 0 18px rgba(0, 119, 255, .18);
}

.support-headset {
  position: relative;
  width: 30px;
  height: 30px;
  border: 4px solid var(--amber);
  border-bottom-color: transparent;
  border-radius: 50% 50% 42% 42%;
}

.support-headset::before,
.support-headset::after {
  content: "";
  position: absolute;
  background: var(--amber);
}

.support-headset::before {
  left: -5px;
  top: 12px;
  width: 8px;
  height: 13px;
  border-radius: 999px;
  box-shadow: 32px 0 0 var(--amber);
}

.support-headset::after {
  right: -5px;
  bottom: 0;
  width: 14px;
  height: 4px;
  border-radius: 999px;
  transform: rotate(-28deg);
}

.support-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.support-copy strong {
  display: block;
  color: #f8fbff;
  font-size: clamp(16px, 2.35dvh, 19px);
  line-height: 1.1;
}

.support-copy span {
  display: block;
  color: #94a8cf;
  font-size: clamp(12px, 1.8dvh, 14px);
  font-weight: 700;
  line-height: 1.15;
}

.support-copy small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: clamp(12px, 1.8dvh, 14px);
  font-weight: 900;
  line-height: 1;
}

.support-copy i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(39, 246, 109, .86);
}

.support-arrow {
  width: 18px;
  height: 18px;
  border-top: 4px solid var(--blue);
  border-right: 4px solid var(--blue);
  transform: rotate(45deg);
  justify-self: end;
  filter: drop-shadow(0 0 9px rgba(8, 120, 255, .72));
}

.password-field { position: relative; display: grid; }
.settings-card .password-field input,
.gate-login .password-field input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #8fc8ff;
  background: rgba(0, 119, 255, .1);
  transform: translateY(-50%);
  cursor: pointer;
}
.password-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-slash { opacity: 0; }
.password-toggle.is-visible { color: var(--cyan); background: rgba(94, 231, 255, .16); }
.password-toggle.is-visible .eye-slash { opacity: 1; }

.manual-sheet {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  place-items: end center;
  padding: 24px 26px 108px;
  background: rgba(0, 4, 16, .66);
  backdrop-filter: blur(12px);
}

.manual-sheet.is-open { display: grid; }
.manual-card { width: 100%; }
.manual-actions { gap: 10px; }

.invoice-action-sheet,
.invoice-viewer-sheet,
.invoice-gmail-sheet,
.terminal-gmail-sheet {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: none;
  place-items: end center;
  padding: 24px 26px 108px;
  background: rgba(0, 4, 16, .7);
  backdrop-filter: blur(12px);
}

.invoice-action-sheet.is-open,
.invoice-viewer-sheet.is-open,
.invoice-gmail-sheet.is-open,
.terminal-gmail-sheet.is-open {
  display: grid;
}

.invoice-action-card,
.invoice-viewer-card,
.invoice-gmail-card,
.terminal-gmail-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(3, 16, 52, .92), rgba(2, 8, 30, .9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03), 0 18px 50px rgba(0, 0, 0, .28);
}

.invoice-action-card,
.invoice-gmail-card,
.terminal-gmail-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.invoice-action-card > button,
.invoice-gmail-actions button {
  min-height: 42px;
}

.invoice-viewer-sheet {
  place-items: stretch;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(1, 7, 23, .98), rgba(0, 3, 12, .98)),
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .2), transparent 42%);
}

.invoice-viewer-card {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.invoice-viewer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 131px;
  padding: max(83px, calc(env(safe-area-inset-top) + 73px)) max(10px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(94, 231, 255, .18);
  background: rgba(1, 8, 28, .86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  backdrop-filter: blur(16px);
}

.invoice-viewer-head strong {
  min-width: 0;
  overflow: hidden;
  color: #f8fbff;
  font-size: .88rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-viewer-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.invoice-viewer-head button {
  min-height: 34px;
  border: 1px solid rgba(94, 231, 255, .36);
  border-radius: 10px;
  color: #e8f3ff;
  background: rgba(6, 28, 78, .65);
  cursor: pointer;
}

.invoice-viewer-head button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

#invoiceViewerGmailButton,
#invoiceViewerDownloadButton {
  padding: 0 13px;
  font-size: .82rem;
  letter-spacing: .02em;
}

#invoiceViewerCloseButton {
  width: 36px;
  padding: 0;
  font-weight: 950;
}

.invoice-viewer-stage {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  display: grid;
  place-items: start center;
  padding: clamp(8px, 1.7dvh, 14px) max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.invoice-viewer-stage img {
  box-sizing: border-box;
  width: min(100%, 484px);
  max-width: 100%;
  max-height: 80%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(94, 231, 255, .2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
}

.invoice-viewer-status {
  margin: 0;
  padding: 18px;
  display: none;
  color: #dbeafe;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 12px;
  background: rgba(2, 10, 32, .7);
  line-height: 1.45;
}

.invoice-viewer-status.is-visible {
  display: block;
}

.invoice-viewer-status.is-error {
  color: #ffd7d7;
  border-color: rgba(248, 113, 113, .34);
  background: rgba(64, 8, 18, .45);
}

.invoice-gmail-card label {
  display: grid;
  gap: 6px;
}

.invoice-gmail-card input,
.invoice-gmail-card textarea {
  width: 100%;
  border: 1px solid rgba(0, 119, 255, .28);
  border-radius: 12px;
  padding: 10px 12px;
  color: #f8fbff;
  background: rgba(0, 7, 24, .8);
  outline: none;
}

.invoice-gmail-card textarea {
  min-height: 96px;
  resize: vertical;
}

.invoice-gmail-status {
  margin: 0;
  min-height: 18px;
  color: #8da2cb;
  font-size: 12px;
  font-weight: 700;
}

.invoice-gmail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.terminal-gmail-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.terminal-gmail-head img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(94, 231, 255, .38));
}

.terminal-gmail-head strong {
  display: block;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.1;
}

.terminal-gmail-head span {
  display: block;
  margin-top: 3px;
  color: #9fb6da;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.28;
}

.terminal-gmail-status,
.terminal-gmail-account {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(94, 231, 255, .22);
  border-radius: 12px;
  color: #dbeafe;
  background: rgba(2, 10, 32, .58);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
}

.terminal-gmail-status.is-error {
  color: #ffd7d7;
  border-color: rgba(248, 113, 113, .34);
  background: rgba(64, 8, 18, .45);
}

.terminal-gmail-account {
  color: #a7f3d0;
  border-color: rgba(45, 212, 191, .28);
  background: rgba(6, 78, 59, .24);
}

.terminal-gmail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.terminal-gmail-actions button {
  min-height: 42px;
}

#terminalGmailCloseButton {
  grid-column: 1 / -1;
}

.terminal-gmail-shell {
  position: absolute;
  inset: 0;
  z-index: 31;
  min-height: 100%;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding:
    calc(max(18px, env(safe-area-inset-top)) + 60px)
    max(15px, env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom))
    max(15px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 18% 12%, rgba(8, 120, 255, .22), transparent 28%),
    radial-gradient(circle at 74% 28%, rgba(45, 212, 191, .13), transparent 30%),
    linear-gradient(180deg, rgba(2, 12, 36, .98) 0%, rgba(0, 4, 18, .99) 100%);
  overflow: hidden;
}

.terminal-gmail-shell.is-open {
  display: grid;
}

.terminal-gmail-shell [hidden] {
  display: none !important;
}

.terminal-gmail-menu-button,
.terminal-gmail-shell-close,
.terminal-gmail-shell-trash,
.terminal-gmail-shell-restore {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  z-index: 4;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .34);
  background: rgba(3, 16, 52, .86);
  color: #f8fbff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1);
  cursor: pointer;
}

.terminal-gmail-menu-button {
  left: max(16px, env(safe-area-inset-left));
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.terminal-gmail-shell-close,
.terminal-gmail-shell-trash,
.terminal-gmail-shell-restore {
  right: max(16px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.terminal-gmail-shell-close {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 2.1rem;
  font-weight: 950;
  line-height: 1;
}

.terminal-gmail-shell-restore {
  right: calc(max(16px, env(safe-area-inset-right)) + 50px);
}

.terminal-gmail-menu-button:hover,
.terminal-gmail-menu-button:focus-visible,
.terminal-gmail-shell-close:hover,
.terminal-gmail-shell-close:focus-visible,
.terminal-gmail-shell-trash:hover,
.terminal-gmail-shell-trash:focus-visible,
.terminal-gmail-shell-restore:hover,
.terminal-gmail-shell-restore:focus-visible {
  border-color: rgba(94, 231, 255, .72);
  background: rgba(6, 29, 82, .96);
  outline: none;
}

.terminal-gmail-shell-trash {
  background: rgba(46, 7, 20, .92);
  border-color: rgba(248, 113, 113, .44);
}

.terminal-gmail-shell-trash:disabled {
  opacity: .55;
  cursor: default;
}

.terminal-gmail-shell-restore {
  background: rgba(2, 40, 57, .92);
  border-color: rgba(94, 231, 255, .44);
}

.terminal-gmail-shell-restore:disabled {
  opacity: .55;
  cursor: default;
}

.terminal-gmail-trash-icon {
  position: relative;
  width: 17px;
  height: 19px;
  display: block;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px 3px 6px 6px;
  color: #ffe1e1;
}

.terminal-gmail-trash-icon::before,
.terminal-gmail-trash-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.terminal-gmail-trash-icon::before {
  top: -6px;
  width: 22px;
  height: 3px;
  box-shadow: 0 -5px 0 -1px currentColor;
}

.terminal-gmail-trash-icon::after {
  top: 4px;
  width: 2px;
  height: 10px;
  box-shadow: -5px 0 0 currentColor, 5px 0 0 currentColor;
  opacity: .82;
}

.terminal-gmail-restore-icon {
  position: relative;
  width: 21px;
  height: 21px;
  display: block;
  color: #d8fbff;
}

.terminal-gmail-restore-icon::before {
  content: "";
  position: absolute;
  inset: 4px 3px 3px 4px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  transform: rotate(-18deg);
}

.terminal-gmail-restore-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.terminal-gmail-menu-icon {
  position: relative;
  width: 19px;
  height: 14px;
  display: block;
}

.terminal-gmail-menu-icon::before,
.terminal-gmail-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-gmail-menu-icon::before {
  top: 0;
  box-shadow: 0 6px 0 currentColor;
}

.terminal-gmail-menu-icon::after {
  bottom: 0;
}

.terminal-gmail-menu-panel {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 56px);
  bottom: 0;
  left: 0;
  z-index: 6;
  width: min(80%, 340px);
  display: block;
  padding-left: env(safe-area-inset-left);
  animation: terminalGmailCurtainInSlow 1120ms cubic-bezier(.14, .72, .18, 1) both;
  will-change: transform, opacity;
}

.terminal-gmail-menu-panel[hidden] {
  display: none !important;
}

.terminal-gmail-menu-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 14px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid rgba(94, 231, 255, .28);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background:
    radial-gradient(circle at 4% 8%, rgba(94, 231, 255, .18), transparent 28%),
    linear-gradient(180deg, rgba(2, 12, 38, .98), rgba(0, 5, 19, .98));
  box-shadow: 24px 0 54px rgba(0, 0, 0, .42), inset -1px 0 0 rgba(94, 231, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}

.terminal-gmail-menu-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: -1px;
  bottom: 18px;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(94, 231, 255, .8), transparent);
  box-shadow: 0 0 18px rgba(94, 231, 255, .52);
  pointer-events: none;
}

@keyframes terminalGmailCurtainInSlow {
  from {
    opacity: .55;
    transform: translateX(-105%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.terminal-gmail-shell-header {
  position: absolute;
  top: max(15px, env(safe-area-inset-top));
  left: 50%;
  z-index: 3;
  width: min(260px, calc(100% - 156px));
  min-width: 0;
  display: block;
  transform: translateX(-50%);
  text-align: center;
}

.terminal-gmail-shell-header strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fbff;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 13px rgba(94, 231, 255, .38), 0 1px 8px rgba(0, 0, 0, .55);
}

.terminal-gmail-shell.is-selecting .terminal-gmail-shell-header strong {
  display: none;
}

.terminal-gmail-select-all {
  min-width: 118px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  margin: 0 auto 3px;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(3, 16, 52, .82);
  font-size: .76rem;
  font-weight: 950;
  padding: 0 12px;
  white-space: nowrap;
}

.terminal-gmail-empty-trash {
  min-width: 132px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  margin: 0 auto 3px;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 999px;
  color: #ffe7e7;
  background: rgba(64, 8, 18, .54);
  font-size: .74rem;
  font-weight: 950;
  padding: 0 12px;
  white-space: nowrap;
}

.terminal-gmail-empty-trash:disabled {
  opacity: .52;
}

.terminal-gmail-shell-header small {
  display: block;
  color: #d8e7ff;
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
}

.terminal-gmail-search-shell {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 999px;
  background: rgba(3, 16, 52, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.terminal-gmail-search-shell span {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(215, 239, 255, .82);
  border-radius: 50%;
  position: relative;
}

.terminal-gmail-search-shell span::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -2px;
  border-radius: 999px;
  background: rgba(215, 239, 255, .82);
  transform: rotate(45deg);
}

.terminal-gmail-search-shell input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
  font-size: .92rem;
  font-weight: 800;
}

.terminal-gmail-search-shell input::placeholder {
  color: rgba(241, 247, 255, .76);
}

.terminal-gmail-tabs {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}

.terminal-gmail-tabs button {
  width: fit-content;
  min-width: 158px;
  max-width: min(100%, 218px);
  min-height: 36px;
  display: inline-grid;
  grid-template-columns: 30px minmax(76px, auto) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 0 999px 999px 0;
  padding: 0 14px 0 6px;
  color: #e8f3ff;
  background: transparent;
  font-size: .82rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.terminal-gmail-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-gmail-tab-count {
  min-width: 22px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(94, 231, 255, .16);
  border-radius: 999px;
  color: rgba(232, 243, 255, .78);
  background: rgba(2, 11, 32, .48);
  font-size: .66rem;
  font-weight: 900;
  line-height: 1;
}

.terminal-gmail-tabs button.is-count-pending .terminal-gmail-tab-count {
  color: rgba(232, 243, 255, .5);
  border-color: rgba(94, 231, 255, .1);
  background: rgba(2, 11, 32, .28);
}

.terminal-gmail-tabs button.is-count-empty .terminal-gmail-tab-count {
  visibility: hidden;
}

.terminal-gmail-tabs button::before {
  content: attr(data-terminal-gmail-short);
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #b9d8ff;
  background: rgba(4, 22, 64, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  font-size: .64rem;
  font-weight: 950;
  letter-spacing: .02em;
}

.terminal-gmail-tabs button:hover,
.terminal-gmail-tabs button:focus-visible {
  color: #ffffff;
  border-color: rgba(94, 231, 255, .22);
  background: rgba(3, 16, 52, .58);
  outline: none;
}

.terminal-gmail-tabs button.is-active {
  color: #f8fbff;
  border-color: rgba(94, 231, 255, .34);
  background: linear-gradient(90deg, rgba(0, 119, 255, .48), rgba(2, 28, 74, .76));
  box-shadow: 0 10px 24px rgba(0, 119, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.terminal-gmail-tabs button.is-active::before {
  color: #ffffff;
  background: rgba(0, 119, 255, .52);
  box-shadow: 0 0 13px rgba(94, 231, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.terminal-gmail-tabs button.is-active .terminal-gmail-tab-count {
  color: #ffffff;
  border-color: rgba(94, 231, 255, .34);
  background: rgba(0, 119, 255, .34);
}

.terminal-gmail-message-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 1px 92px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.terminal-gmail-compose-button {
  position: absolute;
  right: max(15px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px);
  z-index: 5;
  min-width: 116px;
  min-height: 44px;
  display: inline-grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 5px 13px 5px 7px;
  border: 1px solid rgba(94, 231, 255, .42);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(0, 102, 190, .92), rgba(2, 21, 66, .96) 58%, rgba(0, 11, 36, .98));
  box-shadow:
    0 12px 26px rgba(0, 0, 0, .34),
    0 0 18px rgba(19, 186, 255, .24),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  cursor: pointer;
  transform-origin: center;
  animation: terminalGmailComposeFloat 2.7s ease-in-out infinite;
}

.terminal-gmail-compose-button img {
  width: 33px;
  height: 33px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 9px rgba(94, 231, 255, .42));
  justify-self: start;
}

.terminal-gmail-compose-button span {
  max-width: 100%;
  overflow: hidden;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-align: left;
  order: 2;
  text-shadow: 0 0 8px rgba(94, 231, 255, .55), 0 1px 6px rgba(0, 0, 0, .55);
  white-space: nowrap;
}

.terminal-gmail-compose-button img {
  order: 1;
}

.terminal-gmail-compose-button:hover,
.terminal-gmail-compose-button:focus-visible {
  outline: none;
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.035);
}

.terminal-gmail-compose-button:hover img,
.terminal-gmail-compose-button:focus-visible img {
  filter: drop-shadow(0 0 15px rgba(94, 231, 255, .68));
}

@keyframes terminalGmailComposeFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.025);
  }
}

.terminal-gmail-state,
.terminal-gmail-message-card {
  border: 1px solid rgba(94, 231, 255, .18);
  border-radius: 15px;
  background: rgba(2, 10, 32, .74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.terminal-gmail-state {
  padding: 15px;
  color: #eef7ff;
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.35;
}

.terminal-gmail-state.is-error {
  color: #ffd7d7;
  border-color: rgba(248, 113, 113, .34);
  background: rgba(64, 8, 18, .42);
}

.terminal-gmail-message-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 11px 10px;
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.terminal-gmail-shell.is-selecting .terminal-gmail-message-card {
  grid-template-columns: 26px minmax(0, 1fr) auto;
}

.terminal-gmail-message-card.is-unread {
  border-color: rgba(94, 231, 255, .38);
  background: rgba(4, 23, 66, .88);
}

.terminal-gmail-message-card.is-selected {
  border-color: rgba(94, 231, 255, .64);
  background: rgba(5, 33, 88, .92);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.terminal-gmail-select-dot {
  width: 22px;
  height: 22px;
  display: none;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .32);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(3, 16, 52, .7);
  font-size: .74rem;
  font-weight: 950;
}

.terminal-gmail-shell.is-selecting .terminal-gmail-select-dot {
  display: grid;
}

.terminal-gmail-message-card.is-selected .terminal-gmail-select-dot {
  border-color: rgba(94, 231, 255, .82);
  background: rgba(0, 119, 255, .72);
}

.terminal-gmail-message-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.terminal-gmail-message-main strong,
.terminal-gmail-message-main span,
.terminal-gmail-message-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-gmail-message-main strong {
  color: #ffffff;
  font-size: .86rem;
  font-weight: 950;
}

.terminal-gmail-message-main span {
  color: #f3f8ff;
  font-size: .79rem;
  font-weight: 850;
}

.terminal-gmail-message-main small {
  color: #d8e7ff;
  font-size: .72rem;
  font-weight: 750;
}

.terminal-gmail-message-meta {
  display: grid;
  justify-items: end;
  align-items: center;
  gap: 5px;
}

.terminal-gmail-message-card time {
  color: #cddfff;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}

.terminal-gmail-star-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .18);
  border-radius: 999px;
  color: rgba(232, 243, 255, .78);
  background: rgba(2, 11, 32, .42);
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.terminal-gmail-star-button.is-active {
  color: #ffd76a;
  border-color: rgba(255, 215, 106, .42);
  background: rgba(94, 66, 0, .28);
  text-shadow: 0 0 11px rgba(255, 215, 106, .45);
}

.terminal-gmail-star-button:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .72);
  outline-offset: 2px;
}

.terminal-gmail-reader-panel {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .18), transparent 36%),
    linear-gradient(180deg, #020817 0%, #000512 100%);
  overflow: hidden;
}

.terminal-gmail-reader-panel[hidden] {
  display: none !important;
}

.terminal-gmail-reader-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  background: transparent;
}

.terminal-gmail-reader-head {
  flex: 0 0 auto;
  min-height: calc(58px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(94, 231, 255, .16);
  background: rgba(2, 10, 32, .86);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.terminal-gmail-reader-back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .22);
  border-radius: 13px;
  color: #ffffff;
  background: rgba(3, 16, 52, .76);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}

.terminal-gmail-reader-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.terminal-gmail-reader-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 950;
}

.terminal-gmail-reader-head small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d8e7ff;
  font-size: .68rem;
  font-weight: 780;
}

.terminal-gmail-reader-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(0, 5, 18, .72);
}

.terminal-gmail-reader-actions button {
  min-height: 34px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 999px;
  padding: 0 14px;
  color: #ffffff;
  background: rgba(3, 16, 52, .76);
  font-size: .78rem;
  font-weight: 920;
  cursor: pointer;
}

.terminal-gmail-reader-actions button:first-child {
  border-color: rgba(94, 231, 255, .44);
  background: linear-gradient(90deg, rgba(0, 119, 255, .5), rgba(2, 28, 74, .76));
}

.terminal-gmail-reader-actions button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.terminal-gmail-reader-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px max(16px, env(safe-area-inset-right)) 86px max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: #f9fcff;
  font-size: .94rem;
  font-weight: 760;
  line-height: 1.52;
  overflow-wrap: anywhere;
  white-space: normal;
}

.terminal-gmail-reader-body a {
  color: #6ee7ff;
}

.terminal-gmail-reader-loading {
  padding: 14px;
  border: 1px solid rgba(94, 231, 255, .18);
  border-radius: 15px;
  color: #eef7ff;
  background: rgba(2, 10, 32, .74);
  font-weight: 900;
}

.terminal-gmail-reader-loading.is-error {
  color: #ffd7d7;
  border-color: rgba(248, 113, 113, .34);
  background: rgba(64, 8, 18, .42);
}

.terminal-gmail-reader-status {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
  color: #d8e7ff;
  font-size: .72rem;
  font-weight: 850;
  pointer-events: none;
}

.terminal-gmail-reader-status:empty {
  display: none;
}

.terminal-gmail-reader-status.is-error {
  color: #ffd7d7;
}

.terminal-gmail-compose-panel {
  position: absolute;
  inset: 0;
  z-index: 18;
  min-height: 100%;
  height: min(100%, var(--terminal-compose-panel-height, 100dvh));
  max-height: min(100%, var(--terminal-compose-panel-height, 100dvh));
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #000512;
  overflow: hidden;
  overscroll-behavior: contain;
  isolation: isolate;
}

.terminal-gmail-compose-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .2), transparent 36%),
    linear-gradient(180deg, #020817 0%, #000512 100%);
}

.terminal-gmail-compose-panel[hidden] {
  display: none !important;
}

.terminal-gmail-compose-card {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #020817 0%, #000512 100%);
  box-shadow: none;
  overflow: hidden;
}

.terminal-gmail-compose-head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: calc(58px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(94, 231, 255, .16);
  background: rgba(2, 10, 32, .78);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

.terminal-gmail-compose-head strong {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 950;
}

.terminal-gmail-compose-head button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 239, 255, .22);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(3, 16, 52, .76);
  font-weight: 950;
}

.terminal-gmail-compose-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 11px;
  padding: 14px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .12), transparent 40%),
    linear-gradient(180deg, rgba(2, 8, 23, .96) 0%, #000512 100%);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.terminal-gmail-compose-card label {
  display: grid;
  gap: 5px;
  color: #eaf5ff;
  font-size: .78rem;
  font-weight: 900;
}

.terminal-gmail-compose-card input,
.terminal-gmail-compose-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(94, 231, 255, .22);
  border-radius: 13px;
  padding: 10px 11px;
  color: #ffffff;
  background: rgba(2, 10, 32, .78);
  font: inherit;
  font-size: .88rem;
  outline: 0;
}

.terminal-gmail-compose-card textarea {
  resize: none;
  min-height: 210px;
}

.terminal-gmail-compose-card input:focus,
.terminal-gmail-compose-card textarea:focus {
  border-color: rgba(94, 231, 255, .62);
  box-shadow: 0 0 0 2px rgba(94, 231, 255, .12);
}

.terminal-gmail-compose-tools {
  display: grid;
  gap: 9px;
}

.terminal-gmail-signature-tool,
.terminal-gmail-attachment-tool {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(94, 231, 255, .18);
  border-radius: 15px;
  background: rgba(2, 10, 32, .54);
}

.terminal-gmail-tool-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
}

.terminal-gmail-tool-head strong {
  color: #ffffff;
  font-size: .82rem;
  font-weight: 950;
}

.terminal-gmail-tool-head small {
  min-width: 0;
  color: #cfe3ff;
  font-size: .68rem;
  font-weight: 760;
  text-align: right;
}

.terminal-gmail-signature-modes,
.terminal-gmail-signature-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.terminal-gmail-signature-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.terminal-gmail-signature-modes button,
.terminal-gmail-signature-actions button,
.terminal-gmail-attachment-tool > button,
.terminal-gmail-attachment-pill button {
  border: 1px solid rgba(215, 239, 255, .2);
  border-radius: 12px;
  color: #f8fbff;
  background: rgba(3, 16, 52, .72);
  font-weight: 900;
  cursor: pointer;
}

.terminal-gmail-signature-modes button {
  min-height: 34px;
  padding: 7px 5px;
  font-size: .7rem;
}

.terminal-gmail-signature-modes button.is-active {
  border-color: rgba(94, 231, 255, .62);
  background: rgba(8, 120, 255, .32);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.terminal-gmail-signature-actions button,
.terminal-gmail-attachment-tool > button {
  min-height: 36px;
  padding: 8px 10px;
  font-size: .74rem;
}

.terminal-gmail-signature-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.terminal-gmail-signature-preview {
  min-height: 46px;
  display: grid;
  align-items: center;
  padding: 8px;
  border: 1px dashed rgba(215, 239, 255, .2);
  border-radius: 13px;
  background: rgba(0, 5, 20, .42);
}

.terminal-gmail-signature-preview span {
  color: #cfe3ff;
  font-size: .72rem;
  font-weight: 780;
}

.terminal-gmail-signature-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.terminal-gmail-signature-preview.is-logo img {
  max-height: 64px;
  border-radius: 9px;
}

.terminal-gmail-signature-preview.is-banner img {
  width: 100%;
  max-height: 92px;
  border-radius: 11px;
}

.terminal-gmail-attachment-list {
  display: grid;
  gap: 6px;
}

.terminal-gmail-attachment-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(94, 231, 255, .16);
  border-radius: 12px;
  background: rgba(0, 5, 20, .42);
}

.terminal-gmail-attachment-pill span {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: .74rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-gmail-attachment-pill small {
  color: #cfe3ff;
  font-size: .66rem;
  font-weight: 780;
  white-space: nowrap;
}

.terminal-gmail-attachment-pill button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: .68rem;
  line-height: 1;
}

.terminal-gmail-compose-status {
  min-height: 18px;
  margin: 0;
  color: #bde8ff;
  font-size: .76rem;
  font-weight: 850;
}

.terminal-gmail-compose-status.is-error {
  color: #ffd7d7;
}

.terminal-gmail-compose-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border-top: 1px solid rgba(94, 231, 255, .16);
  background: linear-gradient(180deg, rgba(2, 10, 32, .94) 0%, #000512 100%);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .28);
}

.terminal-gmail-compose-actions button {
  min-height: 42px;
}

.terminal-ai-shell {
  position: absolute;
  inset: 0;
  z-index: 30;
  min-height: 100%;
  display: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .18), transparent 34%),
    linear-gradient(180deg, #020817 0%, #000512 100%);
  overflow: hidden;
}

.terminal-ai-shell.is-open {
  display: block;
}

.terminal-ai-menu-button {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 24;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .36);
  border-radius: 13px;
  background: rgba(3, 16, 52, .86);
  color: #f8fbff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .1);
  cursor: pointer;
}

.terminal-ai-menu-button:hover,
.terminal-ai-menu-button:focus-visible,
.terminal-ai-menu-button[aria-expanded="true"] {
  border-color: rgba(94, 231, 255, .74);
  background: rgba(6, 29, 82, .96);
  outline: none;
}

.terminal-ai-menu-icon {
  position: relative;
  width: 19px;
  height: 14px;
  display: block;
}

.terminal-ai-menu-icon::before,
.terminal-ai-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-menu-icon::before {
  top: 0;
  box-shadow: 0 6px 0 currentColor;
}

.terminal-ai-menu-icon::after {
  bottom: 0;
}

.terminal-ai-menu {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 50px);
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 23;
  width: min(306px, calc(100% - 20px));
  max-height: none;
  display: none;
}

.terminal-ai-menu.is-open {
  display: block;
}

.terminal-ai-menu-card {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 14px;
  background: #020a1f;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.terminal-ai-history-title,
.terminal-ai-history-row span {
  color: rgba(215, 239, 255, .56);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
}

.terminal-ai-menu-action,
.terminal-ai-history-row {
  min-width: 0;
  min-height: 31px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(215, 239, 255, .13);
  border-radius: 11px;
  background: #061638;
  color: #d7efff;
  cursor: pointer;
}

.terminal-ai-menu-action {
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 6px;
  padding: 0 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
}

.terminal-ai-menu-action small {
  display: block;
  min-width: 0;
  margin-top: 1px;
  overflow: hidden;
  color: rgba(215, 239, 255, .62);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-models-button[aria-expanded="true"] {
  border-color: rgba(41, 209, 255, .36);
  background: rgba(10, 39, 84, .88);
}

.terminal-ai-model-panel {
  display: grid;
  gap: 5px;
  margin: -3px 0 5px;
  padding: 6px;
  border: 1px solid rgba(145, 204, 255, .16);
  border-radius: 8px;
  background: #020f2d;
}

.terminal-ai-model-panel[hidden] {
  display: none;
}

.terminal-ai-model-callouts {
  display: grid;
  gap: 4px;
  padding: 2px 2px 4px;
}

.terminal-ai-model-callouts span {
  min-width: 0;
  overflow: hidden;
  color: #f8fbff;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-model-table-head {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 6px;
  padding: 0 8px 1px;
  color: rgba(215, 239, 255, .55);
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.terminal-ai-model-table-head span:last-child {
  text-align: right;
}

.terminal-ai-model-option {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(215, 239, 255, .12);
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
  color: #eef8ff;
  cursor: pointer;
  text-align: left;
}

.terminal-ai-model-option strong,
.terminal-ai-model-option span,
.terminal-ai-model-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-model-option strong {
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.1;
}

.terminal-ai-model-option span {
  color: rgba(215, 239, 255, .66);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.05;
  text-align: right;
}

.terminal-ai-model-option small {
  grid-column: 1 / -1;
  color: rgba(215, 239, 255, .52);
  font-size: 8.5px;
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
  white-space: normal;
}

.terminal-ai-model-option:hover,
.terminal-ai-model-option:focus-visible {
  border-color: rgba(41, 209, 255, .38);
  background: rgba(41, 209, 255, .12);
  outline: none;
}

.terminal-ai-model-option.is-active {
  border-color: rgba(79, 246, 255, .54);
  background: rgba(41, 209, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(79, 246, 255, .16);
}

.terminal-ai-menu-action:hover,
.terminal-ai-menu-action:focus-visible,
.terminal-ai-history-row:hover,
.terminal-ai-history-row:focus-visible,
.terminal-ai-history-row.is-active {
  border-color: rgba(94, 231, 255, .36);
  background: rgba(8, 120, 255, .16);
  outline: none;
}

.terminal-ai-menu-divider {
  height: 1px;
  margin: 1px 3px;
  background: linear-gradient(90deg, transparent, rgba(94, 231, 255, .28), transparent);
}

.terminal-ai-history-title {
  padding: 0 5px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.terminal-ai-history-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 0 8px;
  text-align: left;
}

.terminal-ai-history-list {
  min-height: 0;
  max-height: none;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 3px 4px 0;
}

.terminal-ai-history-list::-webkit-scrollbar {
  width: 4px;
}

.terminal-ai-history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(94, 231, 255, .32);
}

.terminal-ai-history-state {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(215, 239, 255, .16);
  border-radius: 9px;
  color: rgba(215, 239, 255, .56);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.terminal-ai-history-chat {
  position: relative;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 6px;
}

.terminal-ai-history-open,
.terminal-ai-history-more {
  min-width: 0;
  border: 1px solid rgba(215, 239, 255, .13);
  border-radius: 9px;
  background: #07183d;
  color: #eef8ff;
  cursor: pointer;
}

.terminal-ai-history-open {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 7px 9px;
  text-align: left;
}

.terminal-ai-history-open strong,
.terminal-ai-history-open span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-ai-history-open span {
  white-space: nowrap;
}

.terminal-ai-history-open strong {
  display: -webkit-box;
  color: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.14;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.terminal-ai-history-open span {
  color: rgba(215, 239, 255, .52);
  font-size: 9.5px;
  font-weight: 850;
  line-height: 1;
}

.terminal-ai-history-more {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: .03em;
}

.terminal-ai-history-chat:hover .terminal-ai-history-open,
.terminal-ai-history-chat.is-active .terminal-ai-history-open,
.terminal-ai-history-open:focus-visible,
.terminal-ai-history-more:focus-visible {
  border-color: rgba(94, 231, 255, .36);
  background: rgba(8, 120, 255, .16);
  outline: none;
}

.terminal-ai-history-actions-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 8;
  width: 176px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 10px;
  background: #020a1f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .36);
}

.terminal-ai-history-actions-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(238, 248, 255, .92);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.terminal-ai-history-actions-menu button:hover,
.terminal-ai-history-actions-menu button:focus-visible {
  background: rgba(41, 209, 255, .14);
  outline: none;
}

#terminalAiNewChatButton {
  position: sticky;
  bottom: 0;
  min-height: 40px;
  background: #07183d;
  box-shadow: 0 -8px 14px rgba(1, 9, 32, .55);
}

.terminal-ai-history-row strong {
  min-width: 0;
  overflow: hidden;
  color: #f8fbff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-gallery-icon,
.terminal-ai-docs-icon,
.terminal-ai-model-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  color: #d7efff;
}

.terminal-ai-gallery-icon {
  border: 2px solid currentColor;
  border-radius: 5px;
}

.terminal-ai-gallery-icon::before,
.terminal-ai-gallery-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-gallery-icon::before {
  right: 3px;
  top: 3px;
  width: 4px;
  height: 4px;
}

.terminal-ai-gallery-icon::after {
  left: 3px;
  bottom: 4px;
  width: 11px;
  height: 2px;
  transform: rotate(-32deg);
  transform-origin: left center;
}

.terminal-ai-docs-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.terminal-ai-model-icon {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.terminal-ai-model-icon::before,
.terminal-ai-model-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-model-icon::before {
  inset: 4px;
}

.terminal-ai-model-icon::after {
  right: -2px;
  bottom: 1px;
  width: 7px;
  height: 2px;
  transform: rotate(42deg);
  transform-origin: center;
}

.terminal-ai-docs-icon::before,
.terminal-ai-docs-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-docs-icon::before {
  top: 6px;
}

.terminal-ai-docs-icon::after {
  top: 11px;
}

.terminal-ai-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 5;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .44);
  border-radius: 14px;
  background: rgba(3, 16, 52, .86);
  color: #f8fbff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
}

.terminal-ai-close span {
  display: block;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-2px);
}

.terminal-ai-close:hover,
.terminal-ai-close:focus-visible {
  border-color: rgba(94, 231, 255, .82);
  background: rgba(6, 29, 82, .96);
  outline: none;
}

.terminal-ai-usage-meter {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 39px);
  left: 50%;
  right: auto;
  z-index: 5;
  width: min(228px, calc(100% - 112px));
  max-width: calc(100% - 112px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(94, 231, 255, .28);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(5, 28, 78, .76), rgba(0, 112, 255, .22));
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28), 0 0 22px rgba(41, 209, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .09);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transform: translateX(-50%);
}

.terminal-ai-usage-meter span {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 3px;
  justify-content: center;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(2, 13, 42, .46);
  color: rgba(215, 239, 255, .82);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
}

.terminal-ai-usage-meter b,
.terminal-ai-usage-meter em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-usage-meter b {
  color: rgba(94, 231, 255, .86);
  font-style: normal;
}

.terminal-ai-usage-meter em {
  max-width: 54px;
  color: rgba(248, 251, 255, .94);
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.terminal-ai-usage-meter span.is-balance {
  grid-template-columns: auto minmax(0, auto) 16px;
  background: rgba(22, 163, 255, .18);
}

.terminal-ai-usage-meter span.is-balance em {
  max-width: 78px;
}

.terminal-ai-usage-meter span.is-balance i {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(94, 231, 255, .18);
  color: rgba(248, 251, 255, .96);
  font-style: normal;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .24);
}

.terminal-ai-usage-meter:hover,
.terminal-ai-usage-meter:focus-visible {
  border-color: rgba(94, 231, 255, .56);
  background: linear-gradient(135deg, rgba(6, 38, 98, .84), rgba(0, 142, 255, .28));
  outline: none;
}

.terminal-ai-usage-meter:hover span.is-balance i,
.terminal-ai-usage-meter:focus-visible span.is-balance i {
  background: rgba(94, 231, 255, .3);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .42), 0 0 12px rgba(94, 231, 255, .18);
}

.terminal-ai-file-input {
  display: none;
}

.terminal-ai-body {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 85px);
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--terminal-ai-composer-offset, 66px));
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 10px 2px 12px 0;
  scrollbar-color: rgba(94, 231, 255, .42) transparent;
  scrollbar-width: thin;
}

.terminal-ai-shell.has-attachments .terminal-ai-body {
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--terminal-ai-composer-offset, 66px) + 128px);
}

.terminal-ai-body::-webkit-scrollbar {
  width: 5px;
}

.terminal-ai-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-ai-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(94, 231, 255, .38);
}

.terminal-ai-message {
  max-width: 88%;
  display: grid;
  gap: 6px;
}

.terminal-ai-message.is-user {
  justify-self: end;
}

.terminal-ai-message.is-assistant {
  justify-self: start;
  max-width: 76%;
}

.terminal-ai-bubble {
  padding: 10px 12px;
  border: 1px solid rgba(215, 239, 255, .16);
  border-radius: 14px;
  background: rgba(3, 16, 52, .78);
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.terminal-ai-message.is-user .terminal-ai-bubble {
  border-color: rgba(94, 231, 255, .3);
  background: rgba(8, 120, 255, .24);
}

.terminal-ai-message.is-assistant .terminal-ai-bubble {
  color: rgba(248, 251, 255, .94);
}

.terminal-ai-message.is-pending .terminal-ai-bubble {
  color: rgba(241, 247, 255, .82);
}

.terminal-ai-message.is-thinking-status .terminal-ai-bubble {
  border-color: rgba(94, 231, 255, .14);
  background: rgba(3, 16, 52, .58);
  color: rgba(215, 239, 255, .48);
  font-style: italic;
  font-weight: 680;
}

.terminal-ai-message.is-thinking-status .terminal-ai-bubble::after {
  content: "";
  display: inline-block;
  width: 15px;
  height: 3px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(94, 231, 255, .5);
  vertical-align: middle;
  animation: terminalAiThinkingPulse 1.1s ease-in-out infinite;
}

@keyframes terminalAiThinkingPulse {
  0%, 100% {
    opacity: .25;
    transform: translateY(-1px) scaleX(.55);
  }
  50% {
    opacity: .82;
    transform: translateY(-1px) scaleX(1);
  }
}

.terminal-ai-message.is-error .terminal-ai-bubble {
  border-color: rgba(255, 90, 112, .36);
  background: rgba(98, 12, 34, .46);
  color: #ffe3e7;
}

.terminal-ai-message-actions {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
}

.terminal-ai-message-provider {
  max-width: min(178px, calc(100vw - 190px));
  overflow: hidden;
  color: rgba(215, 239, 255, .5);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-message-action {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .12);
  border-radius: 8px;
  background: rgba(1, 10, 31, .34);
  color: rgba(215, 239, 255, .68);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.terminal-ai-message-action:hover,
.terminal-ai-message-action:focus-visible,
.terminal-ai-message-action.is-active {
  border-color: rgba(94, 231, 255, .36);
  background: rgba(8, 120, 255, .18);
  color: #f8fbff;
  outline: none;
}

.terminal-ai-copy-icon {
  position: relative;
  width: 12px;
  height: 14px;
  display: block;
}

.terminal-ai-copy-icon::before,
.terminal-ai-copy-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.terminal-ai-copy-icon::before {
  left: 1px;
  top: 3px;
  opacity: .58;
}

.terminal-ai-copy-icon::after {
  right: 1px;
  top: 0;
  background: rgba(1, 10, 31, .9);
}

.terminal-ai-speak-icon {
  position: relative;
  width: 14px;
  height: 14px;
  display: block;
}

.terminal-ai-speak-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  width: 5px;
  height: 6px;
  border-radius: 2px 0 0 2px;
  background: currentColor;
  box-shadow: 4px -3px 0 -1px currentColor, 4px 3px 0 -1px currentColor;
}

.terminal-ai-speak-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 2px;
  width: 7px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
}

.terminal-ai-like-icon,
.terminal-ai-dislike-icon {
  display: block;
  font-size: 12px;
  line-height: 1;
}

.terminal-ai-like-icon::before {
  content: "\1F44D";
}

.terminal-ai-dislike-icon::before {
  content: "\1F44E";
}

.terminal-ai-message-files {
  display: grid;
  gap: 4px;
}

.terminal-ai-message-image {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(94, 231, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
}

.terminal-ai-message-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #fff;
}

.terminal-ai-message-files span {
  min-width: 0;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid rgba(215, 239, 255, .12);
  border-radius: 9px;
  background: rgba(1, 10, 31, .72);
  color: rgba(215, 239, 255, .72);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-voice-review {
  width: 100%;
  max-width: 100%;
}

.terminal-ai-voice-review-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 12px;
  background: rgba(3, 16, 52, .86);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.terminal-ai-voice-review-card strong {
  color: #f8fbff;
  font-size: 13px;
  font-weight: 950;
}

.terminal-ai-voice-review-card span {
  color: rgba(215, 239, 255, .64);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.terminal-ai-voice-review-card textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid rgba(215, 239, 255, .18);
  border-radius: 10px;
  padding: 9px 10px;
  color: #f8fbff;
  background: rgba(1, 10, 31, .82);
  outline: none;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.38;
}

.terminal-ai-voice-review-card textarea:focus {
  border-color: rgba(94, 231, 255, .56);
  box-shadow: 0 0 0 3px rgba(94, 231, 255, .12);
}

.terminal-ai-voice-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.terminal-ai-voice-review-actions button {
  min-height: 34px;
  border: 1px solid rgba(215, 239, 255, .18);
  border-radius: 9px;
  padding: 0 12px;
  color: #d7efff;
  background: rgba(1, 10, 31, .72);
  font-size: 12px;
  font-weight: 900;
}

.terminal-ai-voice-review-actions button[data-terminal-ai-voice-review-action="send"] {
  border-color: rgba(94, 231, 255, .48);
  color: #f8fbff;
  background: rgba(8, 120, 255, .36);
}

.terminal-ai-attachments {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px);
  z-index: 4;
  max-height: min(124px, 22vh);
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding-right: 2px;
}

.terminal-ai-attachments[hidden] {
  display: none;
}

.terminal-ai-attachment-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 14px;
  background: rgba(2, 10, 31, .9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}

.terminal-ai-attachment-open {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 5px 0 5px 8px;
  background: transparent;
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.terminal-ai-attachment-open:focus-visible,
.terminal-ai-attachment-remove:focus-visible,
.terminal-ai-preview-close-button:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .62);
  outline-offset: 2px;
}

.terminal-ai-attachment-label {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.terminal-ai-attachment-label strong,
.terminal-ai-attachment-label small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-attachment-label strong {
  font-size: 12px;
  font-weight: 900;
}

.terminal-ai-attachment-label small {
  color: rgba(215, 239, 255, .58);
  font-size: 10px;
  font-weight: 800;
}

.terminal-ai-attachment-remove,
.terminal-ai-preview-close-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 95, 114, .36);
  border-radius: 10px;
  background: rgba(68, 8, 18, .66);
  color: #ffd7dd;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.terminal-ai-preview-close-button {
  border-color: rgba(215, 239, 255, .28);
  background: rgba(3, 16, 52, .84);
  color: #f8fbff;
}

.terminal-ai-attachment-remove {
  margin-right: 6px;
}

.terminal-ai-attachment-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: block;
  border: 1px solid rgba(215, 239, 255, .3);
  border-radius: 9px;
  background: rgba(8, 120, 255, .16);
  color: #d7efff;
}

.terminal-ai-attachment-icon::before,
.terminal-ai-attachment-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.terminal-ai-attachment-icon-image::before {
  right: 6px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
}

.terminal-ai-attachment-icon-image::after {
  left: 6px;
  bottom: 7px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-30deg);
  transform-origin: left center;
}

.terminal-ai-attachment-icon-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.terminal-ai-attachment-icon-image.has-preview::before,
.terminal-ai-attachment-icon-image.has-preview::after {
  display: none;
}

.terminal-ai-attachment-icon-pdf::before,
.terminal-ai-attachment-icon-doc::before {
  left: 7px;
  right: 7px;
  top: 8px;
  height: 2px;
  border-radius: 999px;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.terminal-ai-preview {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  place-items: center;
  padding: max(72px, env(safe-area-inset-top)) 14px max(92px, env(safe-area-inset-bottom));
  background: rgba(0, 5, 18, .58);
  backdrop-filter: blur(8px);
}

.terminal-ai-preview.is-open {
  display: grid;
}

.terminal-ai-preview-card {
  width: min(100%, 420px);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(94, 231, 255, .26);
  border-radius: 16px;
  background: rgba(2, 10, 31, .96);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.terminal-ai-preview-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
}

.terminal-ai-preview-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.terminal-ai-preview-head strong,
.terminal-ai-preview-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-preview-head strong {
  color: #f8fbff;
  font-size: 13px;
  font-weight: 900;
}

.terminal-ai-preview-head span {
  color: rgba(215, 239, 255, .58);
  font-size: 10.5px;
  font-weight: 800;
}

.terminal-ai-preview-body {
  min-height: 156px;
  max-height: min(58vh, 520px);
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .12);
  border-radius: 13px;
  background: rgba(1, 8, 24, .76);
}

.terminal-ai-preview-image,
.terminal-ai-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 156px;
  border: 0;
  border-radius: 12px;
}

.terminal-ai-preview-image {
  object-fit: contain;
}

.terminal-ai-preview-file {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.terminal-ai-preview-file .terminal-ai-attachment-icon {
  width: 40px;
  height: 40px;
}

.terminal-ai-preview-file strong,
.terminal-ai-preview-file span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.terminal-ai-preview-file strong {
  color: #f8fbff;
  font-size: 13px;
  font-weight: 900;
}

.terminal-ai-preview-file span {
  color: rgba(215, 239, 255, .62);
  font-size: 11px;
  font-weight: 800;
}

.terminal-ai-composer {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3;
  min-height: 44px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(94, 231, 255, .22);
  border-radius: 16px;
  background: rgba(3, 16, 52, .88);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
  overscroll-behavior: contain;
}

.terminal-ai-composer.has-text,
.terminal-ai-composer.is-recording {
  background: rgba(3, 16, 52, .98);
}

.terminal-ai-composer.is-voice-mode {
  border-color: rgba(94, 231, 255, .38);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36), 0 0 0 1px rgba(94, 231, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.terminal-ai-composer.has-text {
  z-index: 5;
}

.terminal-ai-tool {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .22);
  border-radius: 12px;
  background: rgba(1, 10, 31, .78);
  color: #d7efff;
  cursor: pointer;
}

.terminal-ai-tool:hover,
.terminal-ai-tool:focus-visible {
  border-color: rgba(94, 231, 255, .68);
  background: rgba(6, 29, 82, .92);
  outline: none;
}

.terminal-ai-input {
  width: 100%;
  height: 36px;
  min-height: 36px;
  max-height: 156px;
  border: 0;
  border-radius: 12px;
  padding: 9px 3px;
  color: #ffffff;
  background: transparent;
  outline: none;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  resize: none;
  font-size: 14.5px;
  line-height: 1.2;
}

.terminal-ai-input::-webkit-scrollbar {
  display: none;
}

.terminal-ai-input::placeholder {
  color: rgba(241, 247, 255, .7);
  font-size: 13px;
  line-height: 1.15;
}

.terminal-ai-voice-meter {
  min-width: 0;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(94, 231, 255, .18);
  border-radius: 12px;
  background: rgba(1, 10, 31, .48);
  overflow: hidden;
}

.terminal-ai-composer.is-recording .terminal-ai-input {
  display: none;
}

.terminal-ai-composer.is-recording .terminal-ai-voice-meter {
  display: flex;
  border-color: rgba(94, 231, 255, .42);
  background: rgba(1, 10, 31, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 18px rgba(94, 231, 255, .16);
}

.terminal-ai-voice-meter span {
  width: 3px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5ee7ff, #ff5a70);
  box-shadow: 0 0 12px rgba(94, 231, 255, .34);
  animation: terminalAiVoiceMeter 1s ease-in-out infinite;
}

.terminal-ai-voice-meter span:nth-child(2) { animation-delay: .1s; }
.terminal-ai-voice-meter span:nth-child(3) { animation-delay: .2s; }
.terminal-ai-voice-meter span:nth-child(4) { animation-delay: .3s; }
.terminal-ai-voice-meter span:nth-child(5) { animation-delay: .4s; }
.terminal-ai-voice-meter span:nth-child(6) { animation-delay: .5s; }

.terminal-ai-voice-actions {
  display: inline-grid;
  grid-template-columns: 36px 48px 36px;
  align-items: center;
  gap: 5px;
  position: relative;
}

.terminal-ai-wake-dot {
  display: none !important;
}

.terminal-ai-budget-button {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 34;
  height: 30px;
  width: auto;
  max-width: min(210px, calc(100% - 128px));
  padding: 0 9px 0 12px;
  transform: translateX(-50%);
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto) 22px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  place-items: center;
  border: 1px solid rgba(94, 231, 255, .44);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(5, 28, 78, .94), rgba(0, 112, 255, .3));
  color: #d7efff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .34), 0 0 20px rgba(41, 209, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  cursor: pointer;
  overflow: hidden;
}

.terminal-ai-budget-button span,
.terminal-ai-budget-button em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.terminal-ai-budget-button span {
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.terminal-ai-budget-button em {
  color: rgba(248, 251, 255, .96);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.terminal-ai-budget-button i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(94, 231, 255, .18);
  color: rgba(248, 251, 255, .96);
  font-style: normal;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .34), 0 0 10px rgba(94, 231, 255, .14);
}

.terminal-ai-budget-button:hover,
.terminal-ai-budget-button:focus-visible {
  border-color: rgba(94, 231, 255, .72);
  background: rgba(6, 29, 82, .94);
  outline: none;
}

.terminal-ai-budget-button:hover i,
.terminal-ai-budget-button:focus-visible i {
  background: rgba(94, 231, 255, .3);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .42), 0 0 12px rgba(94, 231, 255, .18);
}

body.terminal-charge-mode:not(.terminal-ai-active) .terminal-ai-budget-button {
  display: none;
}

.terminal-ai-budget-modal[hidden] {
  display: none;
}

.terminal-ai-budget-modal {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding: calc(max(16px, env(safe-area-inset-top)) + 66px) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(1, 8, 26, .54);
  backdrop-filter: blur(10px);
}

.terminal-ai-budget-card {
  width: min(334px, calc(100vw - 34px));
  max-width: 100%;
  border: 1px solid rgba(94, 231, 255, .36);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(5, 23, 68, .96), rgba(1, 10, 31, .97));
  color: #f8fbff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .1);
  padding: 14px;
}

.terminal-ai-budget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.terminal-ai-budget-head strong,
.terminal-ai-budget-head span {
  display: block;
}

.terminal-ai-budget-head strong {
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
}

.terminal-ai-budget-head span {
  margin-top: 3px;
  color: rgba(215, 239, 255, .72);
  font-size: 12px;
  font-weight: 700;
}

.terminal-ai-budget-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 255, .24);
  border-radius: 10px;
  background: rgba(1, 10, 31, .68);
  color: #f8fbff;
  cursor: pointer;
}

.terminal-ai-budget-close span {
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.terminal-ai-budget-field {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  color: rgba(215, 239, 255, .82);
  font-size: 12px;
  font-weight: 850;
}

.terminal-ai-budget-input-wrap {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(94, 231, 255, .38);
  border-radius: 13px;
  background: rgba(1, 10, 31, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}

.terminal-ai-budget-input-wrap b {
  padding-left: 12px;
  color: rgba(94, 231, 255, .92);
  font-size: 18px;
  font-weight: 950;
}

.terminal-ai-budget-input-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f8fbff;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.terminal-ai-budget-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.terminal-ai-budget-presets button,
.terminal-ai-budget-cancel,
.terminal-ai-budget-confirm {
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 10px;
  background: rgba(8, 33, 83, .76);
  color: rgba(248, 251, 255, .94);
  font-weight: 950;
  cursor: pointer;
}

.terminal-ai-budget-presets button {
  min-height: 34px;
  font-size: 12px;
}

.terminal-ai-budget-status {
  min-height: 18px;
  margin: 9px 0 0;
  color: rgba(215, 239, 255, .72);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.terminal-ai-budget-status.is-error {
  color: #ffb8c2;
}

.terminal-ai-budget-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9px;
  margin-top: 9px;
}

.terminal-ai-budget-cancel,
.terminal-ai-budget-confirm {
  min-height: 42px;
  padding: 0 12px;
  font-size: 13px;
}

.terminal-ai-budget-cancel {
  background: rgba(1, 10, 31, .68);
}

.terminal-ai-budget-confirm {
  border-color: rgba(94, 231, 255, .58);
  background: linear-gradient(135deg, rgba(92, 226, 255, .95), rgba(22, 150, 255, .95));
  color: #031034;
  box-shadow: 0 12px 24px rgba(22, 150, 255, .2);
}

.terminal-ai-budget-presets button:hover,
.terminal-ai-budget-presets button:focus-visible,
.terminal-ai-budget-cancel:hover,
.terminal-ai-budget-cancel:focus-visible,
.terminal-ai-budget-close:hover,
.terminal-ai-budget-close:focus-visible {
  border-color: rgba(94, 231, 255, .52);
  outline: none;
}

.terminal-ai-budget-confirm:hover,
.terminal-ai-budget-confirm:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.terminal-ai-budget-confirm:disabled,
.terminal-ai-budget-cancel:disabled,
.terminal-ai-budget-presets button:disabled {
  cursor: wait;
  opacity: .72;
}

.terminal-ai-wake-dot span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(94, 231, 255, .48);
  box-shadow: 0 0 0 rgba(94, 231, 255, 0);
}

.terminal-ai-wake-dot:hover,
.terminal-ai-wake-dot:focus-visible {
  border-color: rgba(94, 231, 255, .72);
  outline: none;
}

.terminal-ai-wake-dot.is-wake-on {
  border-color: rgba(94, 231, 255, .72);
  background: rgba(4, 26, 72, .92);
}

.terminal-ai-wake-dot.is-wake-on span {
  background: #5ee7ff;
  box-shadow: 0 0 14px rgba(94, 231, 255, .76);
}

.terminal-ai-wake-dot.is-wake-listening::after,
.bottom-nav .ai-chat-tab.is-wake-listening::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(94, 231, 255, .5);
  border-radius: inherit;
  opacity: .82;
  animation: terminalAiMicPulse 1.45s ease-in-out infinite;
  pointer-events: none;
}

.terminal-ai-wake-dot.is-wake-busy {
  animation: terminalAiMicPulse 1.18s ease-in-out infinite;
}

.terminal-ai-voice-select {
  width: 48px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.terminal-ai-voice-select span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-voice-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  width: min(238px, calc(100vw - 40px));
  max-height: 238px;
  padding: 6px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(94, 231, 255, .28);
  border-radius: 12px;
  background: rgba(1, 10, 31, .98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-ai-voice-menu[hidden] {
  display: none;
}

.terminal-ai-voice-option {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(215, 239, 255, .14);
  border-radius: 9px;
  padding: 6px 8px;
  background: rgba(6, 29, 82, .42);
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.terminal-ai-voice-option:hover,
.terminal-ai-voice-option:focus-visible,
.terminal-ai-voice-option.is-active {
  border-color: rgba(94, 231, 255, .62);
  background: rgba(94, 231, 255, .14);
  outline: none;
}

.terminal-ai-voice-option strong,
.terminal-ai-voice-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-ai-voice-option strong {
  font-size: 12px;
  line-height: 1.05;
}

.terminal-ai-voice-option span {
  color: rgba(215, 239, 255, .58);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.terminal-ai-send {
  display: none;
  border-color: rgba(94, 231, 255, .42);
  background: rgba(94, 231, 255, .16);
  color: #f8fbff;
}

.terminal-ai-send[hidden] {
  display: none;
}

.terminal-ai-composer.has-submit .terminal-ai-voice-actions {
  display: none;
}

.terminal-ai-composer.has-submit .terminal-ai-send:not([hidden]) {
  display: grid;
}

.terminal-ai-composer.is-busy .terminal-ai-tool {
  cursor: wait;
  opacity: .72;
}

.terminal-ai-composer.is-recording {
  border-color: rgba(255, 90, 112, .46);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36), 0 0 0 1px rgba(255, 90, 112, .16), inset 0 1px 0 rgba(255, 255, 255, .08);
  z-index: 5;
  touch-action: none;
}

.terminal-ai-tool.is-discard {
  border-color: rgba(255, 90, 112, .48);
  background: rgba(98, 12, 34, .46);
  color: #ffe3e7;
}

.terminal-ai-tool.is-recording {
  border-color: rgba(255, 90, 112, .7);
  background: rgba(255, 90, 112, .16);
  color: #ffe3e7;
  animation: terminalAiMicPulse 1.05s ease-in-out infinite;
}

.terminal-ai-tool.is-voice-mode {
  border-color: rgba(94, 231, 255, .66);
  background: rgba(94, 231, 255, .14);
  color: #f8fbff;
}

.terminal-ai-tool.is-speaking {
  animation: terminalAiMicPulse 1.28s ease-in-out infinite;
}

.terminal-ai-send:disabled,
.terminal-ai-tool:disabled {
  cursor: wait;
}

.terminal-ai-plus {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.terminal-ai-plus::before,
.terminal-ai-plus::after {
  content: "";
  position: absolute;
  inset: 9px 1px auto;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-plus::after {
  transform: rotate(90deg);
}

.terminal-ai-send-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.terminal-ai-send-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 2px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-send-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.terminal-ai-wave {
  position: relative;
  width: 21px;
  height: 16px;
  display: block;
  border-left: 3px solid currentColor;
  border-radius: 999px;
}

.terminal-ai-wave::before,
.terminal-ai-wave::after {
  content: "";
  position: absolute;
  top: 50%;
  border: 2px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
  transform: translateY(-50%);
}

.terminal-ai-wave::before {
  left: 5px;
  width: 8px;
  height: 12px;
}

.terminal-ai-wave::after {
  left: 11px;
  width: 10px;
  height: 18px;
  opacity: .72;
}

.terminal-ai-trash-icon {
  position: relative;
  width: 17px;
  height: 19px;
  display: block;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.terminal-ai-trash-icon::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -5px;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.terminal-ai-trash-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: -9px;
  width: 7px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.terminal-ai-mic-icon {
  position: relative;
  width: 15px;
  height: 21px;
  display: block;
  border: 3px solid currentColor;
  border-radius: 999px 999px 8px 8px;
}

.terminal-ai-mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.terminal-ai-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

@keyframes terminalAiMicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes terminalAiVoiceMeter {
  0%, 100% { transform: scaleY(.55); opacity: .58; }
  50% { transform: scaleY(1.95); opacity: 1; }
}

.bottom-nav {
  position: relative;
  grid-row: 5;
  z-index: 6;
  min-height: clamp(70px, 8.8dvh, 84px);
  padding: 8px clamp(12px, 4.2vw, 20px) max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) clamp(56px, 16vw, 68px) repeat(3, minmax(0, 1fr));
  gap: 2px;
  border-top: 1px solid rgba(0, 119, 255, .24);
  background: rgba(1, 8, 26, .9);
  backdrop-filter: blur(18px);
}

.bottom-nav .ai-chat-tab {
  position: relative;
  justify-self: center;
  width: clamp(56px, 16vw, 68px);
  align-self: stretch;
  align-content: center;
  color: #d7efff;
}

.bottom-nav .ai-chat-tab:hover,
.bottom-nav .ai-chat-tab:focus-visible {
  filter: saturate(1.04);
  outline: none;
}

.bottom-nav .ai-chat-tab.is-locked {
  cursor: default;
  opacity: .48;
  filter: grayscale(.2) saturate(.7);
}

.bottom-nav .ai-chat-tab.is-locked:hover,
.bottom-nav .ai-chat-tab.is-locked:focus-visible {
  filter: grayscale(.2) saturate(.7);
}

.bottom-nav .ai-chat-tab.is-locked .nav-ai-icon {
  opacity: .62;
}

.bottom-nav .ai-chat-tab.is-wake-on:not(.is-locked) {
  color: #f8fbff;
  filter: drop-shadow(0 0 12px rgba(94, 231, 255, .24));
}

.bottom-nav .ai-chat-tab.is-wake-listening:not(.is-locked)::after {
  inset: 8px;
  border-radius: 18px;
}

.bottom-nav .create-invoice-fab {
  position: absolute;
  left: 50%;
  top: -62px;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border: 1px solid rgba(126, 238, 255, .78);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(92, 226, 255, 1), rgba(22, 150, 255, 1));
  box-shadow: 0 14px 28px rgba(2, 77, 160, .34), 0 0 0 2px rgba(8, 120, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .42);
  color: #f0fdff;
  opacity: 1;
  display: grid;
  place-items: center;
  z-index: 8;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  display: none;
  animation: fabBreath 5.8s ease-in-out infinite;
}

body.terminal-activity-mode .bottom-nav .create-invoice-fab {
  display: grid;
}

.tap-quick-wrap {
  width: 100%;
  margin-top: 34px;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.tap-quick-copy {
  display: grid;
  justify-items: center;
  gap: 0;
}

.tap-quick-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #cfe5ff;
}

.tap-quick-subtitle {
  margin-top: 0;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .015em;
  text-transform: none;
  color: var(--muted);
  opacity: .98;
}

@media (max-width: 520px) {
  .tap-quick-wrap {
    margin-top: 68px;
  }
}

.tap-quick-fab {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #ecfff0;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform .16s ease, filter .16s ease;
}

.tap-quick-fab::before,
.tap-quick-fab::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  opacity: .88;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(46, 245, 107, .45));
  animation: tapArrowBlink 1.6s ease-in-out infinite;
}

.tap-quick-fab::before {
  border-left: 14px solid #8df8ac;
  left: -34px;
}

.tap-quick-fab::after {
  border-right: 14px solid #8df8ac;
  right: -34px;
  animation-delay: .2s;
}

.tap-quick-plus {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
}

.tap-quick-plus img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(15, 148, 55, .32));
}

.tap-quick-fab:hover,
.tap-quick-fab:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.06);
  outline: none;
}

@keyframes tapArrowBlink {
  0%,
  100% {
    opacity: .42;
    transform: translateY(-50%) scale(.94);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.06);
  }
}

@media (max-width: 520px) {
  .tap-quick-fab::before,
  .tap-quick-fab::after {
    border-top-width: 9px;
    border-bottom-width: 9px;
  }
  .tap-quick-fab::before {
    border-left-width: 13px;
    left: -30px;
  }
  .tap-quick-fab::after {
    border-right-width: 13px;
    right: -30px;
  }
}

.bottom-nav .create-invoice-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 1px solid rgba(120, 237, 255, .35);
  opacity: .9;
  animation: fabPulse 6.2s ease-out infinite;
}

.bottom-nav .create-invoice-fab:hover,
.bottom-nav .create-invoice-fab:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 18px 40px rgba(2, 99, 206, .52), 0 0 0 3px rgba(126, 238, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .62);
  filter: saturate(1.08);
  opacity: 1;
  outline: none;
}

.bottom-nav .create-invoice-fab:active {
  transform: translateX(-50%) translateY(0);
}

.bottom-nav .create-invoice-fab span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-2px);
}

@keyframes fabPulse {
  0% { transform: scale(.93); opacity: .75; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1.08); opacity: 0; }
}

@keyframes fabBreath {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    filter: saturate(1);
  }
  50% {
    transform: translateX(-50%) translateY(-1px) scale(1.03);
    filter: saturate(1.05);
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    filter: saturate(1);
  }
}

.bottom-nav button {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 22px auto;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: #6f84b2;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.bottom-nav button span {
  width: 100%;
  display: block;
  text-align: center;
  color: #d7efff;
  font-size: 9px;
  line-height: 1.08;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: anywhere;
}
.bottom-nav button.active { color: var(--blue); }
.bottom-nav button.active::before { content: ""; position: absolute; top: -11px; width: 48px; height: 3px; border-radius: 999px; background: var(--blue); box-shadow: 0 0 14px rgba(0, 119, 255, .8); }
.bottom-nav .create-invoice-fab,
.bottom-nav .create-invoice-fab.active {
  position: absolute;
  color: #f0fdff;
  background: linear-gradient(160deg, rgba(75, 215, 255, .56), rgba(18, 141, 255, .62));
}
.bottom-nav .create-invoice-fab.active::before {
  content: "";
  position: absolute;
  inset: -4px;
  top: auto;
  width: auto;
  height: auto;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  border: 1px solid rgba(120, 237, 255, .35);
  animation: fabPulse 6.2s ease-out infinite;
}
.bottom-nav i { width: 22px; height: 22px; display: block; opacity: .92; }
.bottom-nav .ai-chat-tab i { opacity: 1; }
@keyframes palpitate {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

.bottom-nav .ai-chat-tab .nav-ai-icon {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  margin-top: -14px;
  animation: none;
}
.nav-home { border: 3px solid currentColor; border-top: 0; border-radius: 4px; transform: translateY(2px) rotate(45deg); }
.nav-pay { position: relative; border: 3px solid currentColor; border-radius: 8px; }
.nav-pay::before { content: ""; position: absolute; left: 5px; right: 5px; top: 8px; height: 3px; border-radius: 999px; background: currentColor; }
.nav-pay::after { content: ""; position: absolute; right: -5px; top: 4px; width: 8px; height: 12px; border: 2px solid currentColor; border-left: 0; border-radius: 0 999px 999px 0; }
.nav-clock { border: 3px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) 50% 50% / 2px 9px no-repeat; }
.nav-bars { background: linear-gradient(currentColor, currentColor) 15% 70% / 4px 30% no-repeat, linear-gradient(currentColor, currentColor) 50% 50% / 4px 52% no-repeat, linear-gradient(currentColor, currentColor) 85% 30% / 4px 74% no-repeat; }
.nav-gear { border: 3px solid currentColor; border-radius: 50%; box-shadow: 0 -8px 0 -5px currentColor, 0 8px 0 -5px currentColor, 8px 0 0 -5px currentColor, -8px 0 0 -5px currentColor; }
.nav-document {
  border: 2px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(currentColor, currentColor) 50% 30% / 12px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 50% / 12px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 70% / 9px 2px no-repeat;
}
.nav-ai {
  border: 2px solid currentColor;
  border-radius: 50% 50% 44% 44%;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .24), 0 0 0 1px rgba(255, 255, 255, .16);
  position: relative;
}
.nav-ai::before,
.nav-ai::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}
.nav-ai::before { left: 5px; }
.nav-ai::after { right: 5px; }

.developer-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2dvh, 18px);
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .32), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(255, 138, 25, .12), transparent 28%),
    linear-gradient(180deg, #020817 0%, #000512 100%);
  overflow: auto;
  overscroll-behavior: contain;
}

body.terminal-gate-open .phone-shell { visibility: hidden; }

.developer-gate.is-hidden { display: none; }

.terminal-billing-gate {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(1, 7, 22, .78);
  backdrop-filter: blur(14px);
}

.terminal-billing-gate.is-hidden {
  display: none;
}

.terminal-billing-card {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(94, 231, 255, .24);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(7, 21, 54, .96), rgba(3, 10, 31, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .58), inset 0 0 0 1px rgba(255, 255, 255, .04);
  text-align: center;
}

.terminal-billing-kicker {
  color: #fb7185;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.terminal-billing-card strong {
  color: #f8fbff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.05;
}

.terminal-billing-card p {
  margin: 0;
  color: #a9bbdf;
  font-size: 14px;
  line-height: 1.4;
}

.terminal-billing-status:empty {
  display: none;
}

.terminal-billing-status.is-error {
  color: #fecdd3;
}

.terminal-billing-actions {
  display: grid;
  gap: 9px;
}

.terminal-billing-actions button {
  min-height: 44px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}

.terminal-billing-primary {
  border: 0;
  background: linear-gradient(135deg, #0077ff, #00d2ff);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 119, 255, .32);
}

.terminal-billing-secondary {
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(2, 8, 23, .44);
  color: #dbeafe;
}

.gate-card {
  width: min(100%, 390px);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: clamp(14px, 2.1dvh, 18px);
  border: 1px solid rgba(94, 231, 255, .35);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 119, 255, .22), transparent 42%),
    linear-gradient(145deg, #041034, #000618);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 32px rgba(0, 119, 255, .18);
}

.gate-logo-wrap {
  position: relative;
  overflow: hidden;
  width: clamp(82px, 13.8dvh, 112px);
  height: clamp(82px, 13.8dvh, 112px);
  margin: 0 auto clamp(7px, 1.1dvh, 10px);
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 24px;
  background: #010817;
  box-shadow: 0 0 28px rgba(0, 119, 255, .24), inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.gate-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gate-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
}

.gate-brand-row span,
.gate-brand-row strong {
  min-height: 26px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 119, 255, .26);
  border-radius: 999px;
  color: #cfe5ff;
  background: rgba(0, 119, 255, .1);
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.gate-brand-row strong {
  color: var(--cyan);
  border-color: rgba(94, 231, 255, .35);
}

.gate-brand-row .gate-processor-badge {
  gap: 5px;
  color: #cfe5ff;
  border-color: rgba(99, 91, 255, .42);
  background: linear-gradient(135deg, rgba(99, 91, 255, .2), rgba(0, 119, 255, .08));
  text-transform: none;
}

.gate-processor-badge small {
  color: #b8c7ef;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
}

.gate-processor-badge b {
  color: #776aff;
  font-size: 15px;
  font-weight: 950;
  line-height: .9;
  letter-spacing: 0;
}

.gate-kicker { display: block; color: var(--cyan); font-size: 12px; font-weight: 950; text-transform: uppercase; }
.gate-card > strong { display: block; margin-top: 6px; font-size: clamp(24px, 3.8dvh, 27px); text-align: center; }
.gate-card p { color: #a9bbdf; font-size: 14px; line-height: 1.35; }
.gate-card > p { margin: 6px 0 9px; text-align: center; }

.install-panel {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 31;
  display: inline-grid;
  grid-template-columns: auto;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.install-panel[data-install-mode="available"] { border-color: rgba(39, 246, 109, .42); }
.install-panel[data-install-mode="installed"] { border-color: rgba(94, 231, 255, .58); }

.install-panel > div:first-child { min-width: 0; display: grid; gap: 4px; }

.install-panel [data-install-badge] {
  width: fit-content;
  min-height: 22px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(39, 246, 109, .24);
  border-radius: 999px;
  color: #b9ffcd;
  background: rgba(0, 120, 62, .1);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.install-panel [data-install-title] {
  display: block;
  color: #fff;
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-panel [data-install-status] {
  margin: 0;
  color: #a9bbdf;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.install-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.install-actions button {
  min-height: 34px !important;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.install-actions button[hidden] {
  display: none !important;
}

.install-actions button[data-action="install-app"] {
  border: 1px solid rgba(39, 246, 109, .46);
  background: linear-gradient(135deg, #0878ff, #075fff);
  box-shadow: 0 10px 24px rgba(0, 95, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.install-actions button[data-action="share-app"] {
  border: 1px solid rgba(94, 231, 255, .38);
  color: var(--cyan);
  background: rgba(3, 16, 52, .82);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
}

.install-actions button:disabled {
  opacity: .52;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.install-icon,
.share-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}

.install-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px 2px 4px 4px;
}

.install-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 5px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.share-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.share-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.gate-login { display: grid; gap: 8px; }
.gate-login label { display: grid; gap: 5px; }
.gate-login span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 900; text-transform: uppercase; }
.gate-login input { min-height: clamp(42px, 5.7dvh, 46px); width: 100%; border: 1px solid rgba(0, 119, 255, .32); border-radius: 11px; padding: 0 12px; color: #f8fbff; background: rgba(0, 7, 24, .82); outline: none; }
.gate-login .password-field input { padding-right: 48px; }
.gate-login .password-toggle { right: 7px; width: 36px; height: 36px; }
.gate-login button:not(.password-toggle) { min-height: clamp(42px, 5.6dvh, 46px); border-radius: 11px; }
.gate-login input:focus { border-color: rgba(94, 231, 255, .74); }
.gate-login button:disabled {
  opacity: .48;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.gate-account-divider {
  position: relative;
  min-height: 18px;
  display: grid;
  place-items: center;
  color: #7891bf;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gate-account-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 231, 255, .24), transparent);
}

.gate-account-divider span {
  position: relative;
  padding: 0 10px;
  color: #8da2cb;
  background: #020b23;
  font-size: inherit;
  letter-spacing: inherit;
}

.gate-free-account-btn {
  position: relative;
  isolation: isolate;
  min-height: 54px !important;
  display: grid;
  align-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid rgba(39, 246, 109, .48);
  border-radius: 13px;
  color: #eafff0;
  background:
    radial-gradient(circle at 18% 0%, rgba(39, 246, 109, .24), transparent 38%),
    linear-gradient(135deg, rgba(0, 164, 86, .46), rgba(0, 119, 255, .2));
  box-shadow: 0 16px 32px rgba(0, 0, 0, .28), 0 0 24px rgba(39, 246, 109, .14), inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
}

.gate-free-account-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(94, 231, 255, .24), rgba(39, 246, 109, .12) 42%, transparent 70%);
  box-shadow: 0 0 0 0 rgba(39, 246, 109, .3), 0 0 24px rgba(94, 231, 255, .12);
  opacity: .22;
  transform: scale(.96);
  animation: free-account-slow-pulse 3.8s ease-in-out infinite;
}

.gate-free-account-btn strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.gate-free-account-btn small {
  position: relative;
  z-index: 1;
  color: #bcffd0;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.gate-free-account-btn:focus-visible,
.gate-free-account-btn:hover {
  outline: none;
  border-color: rgba(94, 231, 255, .7);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .34), 0 0 0 3px rgba(39, 246, 109, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
}

@media (prefers-reduced-motion: reduce) {
  .gate-free-account-btn::before {
    animation: none;
    opacity: .18;
    transform: none;
  }

  .terminal-gmail-icon {
    animation: none;
    transform: none;
  }
}

.terminal-signup-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 0%, rgba(39, 246, 109, .16), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(8, 120, 255, .22), transparent 30%),
    rgba(0, 3, 13, .82);
  backdrop-filter: blur(16px);
}

.terminal-signup-modal.is-open {
  display: grid;
}

.terminal-signup-card {
  position: relative;
  width: min(100%, 410px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(14px, 2.4dvh, 18px);
  border: 1px solid rgba(94, 231, 255, .34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(8, 120, 255, .24), transparent 36%),
    linear-gradient(145deg, rgba(3, 16, 52, .98), rgba(0, 6, 22, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .62), 0 0 36px rgba(0, 119, 255, .18);
}

.terminal-signup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  color: #dcecff;
  background: rgba(3, 14, 42, .84);
  font-weight: 950;
  cursor: pointer;
}

.terminal-signup-kicker {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(39, 246, 109, .36);
  border-radius: 999px;
  color: #bcffd0;
  background: rgba(39, 246, 109, .1);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.terminal-signup-card h2 {
  margin: 9px 40px 8px 0;
  color: #ffffff;
  font-size: clamp(23px, 6vw, 28px);
  line-height: 1.05;
}

.terminal-signup-form,
.terminal-signup-grid {
  display: grid;
  gap: 9px;
}

.terminal-signup-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.terminal-signup-type button {
  min-height: 34px;
  border: 1px solid rgba(94, 231, 255, .26);
  border-radius: 12px;
  color: #c9d8f5;
  background: rgba(0, 14, 39, .64);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.terminal-signup-type button.is-active {
  border-color: rgba(39, 246, 109, .58);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(39, 246, 109, .22), rgba(0, 119, 255, .28));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px rgba(0, 119, 255, .18);
}

.terminal-signup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal-signup-grid label,
.terminal-signup-wide {
  display: grid;
  gap: 5px;
}

.terminal-signup-grid label[hidden] {
  display: none;
}

.terminal-signup-wide {
  grid-column: 1 / -1;
}

.terminal-signup-grid label span {
  color: #8da2cb;
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.terminal-signup-grid input {
  min-height: 40px;
  width: 100%;
  border: 1px solid rgba(0, 119, 255, .32);
  border-radius: 10px;
  padding: 0 10px;
  color: #f8fbff;
  background: rgba(0, 7, 24, .82);
  outline: none;
}

.terminal-signup-grid input:focus {
  border-color: rgba(94, 231, 255, .74);
}

.terminal-signup-trial {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(39, 246, 109, .36);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(39, 246, 109, .12), rgba(0, 119, 255, .08));
}

.terminal-signup-trial strong {
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 950;
}

.terminal-signup-trial span {
  color: #bfe8cc;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
}

.terminal-signup-legal {
  display: grid;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid rgba(94, 231, 255, .25);
  border-radius: 12px;
  background: rgba(0, 14, 39, .62);
}

.terminal-signup-legal label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.terminal-signup-legal input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 0;
  accent-color: var(--blue);
}

.terminal-signup-legal a {
  color: var(--cyan);
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal-signup-status {
  min-height: 17px;
  margin: 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
}

.terminal-signup-status:empty { display: none; }

.terminal-signup-status.is-error { color: #ff9a72; }
.terminal-signup-status.is-success { color: #a7ffbe; }

.terminal-signup-actions {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 8px;
}

.terminal-signup-actions button {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.terminal-signup-secondary {
  border: 1px solid rgba(94, 231, 255, .34);
  color: var(--cyan);
  background: rgba(0, 119, 255, .1);
}

.terminal-signup-primary {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #11a85f, #0878ff);
  box-shadow: 0 14px 30px rgba(0, 119, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.terminal-signup-primary:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-height: 680px) {
  .terminal-signup-modal {
    padding: max(4px, env(safe-area-inset-top)) 6px max(4px, env(safe-area-inset-bottom));
  }

  .terminal-signup-card {
    max-height: calc(100vh - 8px);
    max-height: calc(100dvh - 8px);
    padding: 10px;
    border-radius: 19px;
  }

  .terminal-signup-card h2 {
    margin-top: 7px;
    margin-bottom: 6px;
    font-size: clamp(20px, 6.2vw, 24px);
  }

  .terminal-signup-form,
  .terminal-signup-grid {
    gap: 6px;
  }

  .terminal-signup-type {
    gap: 6px;
  }

  .terminal-signup-type button {
    min-height: 29px;
    border-radius: 10px;
    font-size: 11px;
  }

  .terminal-signup-grid input {
    min-height: 34px;
    font-size: 13px;
  }

  .terminal-signup-trial {
    padding: 7px 9px;
  }

  .terminal-signup-legal {
    gap: 5px;
    padding: 7px 9px;
  }

  .terminal-signup-actions button {
    min-height: 36px;
  }
}

.gate-legal {
  padding: 9px 12px;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 11px;
  background: rgba(0, 14, 39, .62);
}

.terms-check {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
}

.terms-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--blue);
}

.terms-copy {
  display: block;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1.18;
  text-transform: none;
}

.terms-copy label {
  display: inline;
  color: #ffffff;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-transform: none;
}

.terms-check a {
  display: inline-block;
  min-height: 24px;
  padding: 4px 0 0;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  touch-action: manipulation;
}

.terms-check a:focus-visible {
  outline: 2px solid rgba(94, 231, 255, .88);
  outline-offset: 3px;
  border-radius: 6px;
}
.gate-status { min-height: 18px; margin: 0 !important; color: var(--cyan) !important; font-size: 12.5px; font-weight: 850; line-height: 1.2; }
.gate-status:empty { display: none; }
.gate-status.is-error { color: #ff9a72 !important; }

@media (max-height: 620px) {
  .developer-gate {
    padding: clamp(8px, 1.5dvh, 12px);
  }

  .gate-card {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: clamp(10px, 1.6dvh, 14px);
    border-radius: 18px;
  }

  .gate-logo-wrap {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .gate-brand-row {
    display: none;
  }

  .gate-card > strong {
    margin-top: 3px;
    font-size: 20px;
  }

  .gate-card p {
    font-size: 12px;
    line-height: 1.2;
  }

  .gate-card > p {
    margin: 2px 0 4px;
  }

  .gate-login {
    gap: 6px;
  }

  .gate-login label {
    gap: 4px;
  }

  .gate-login input,
  .gate-login button:not(.password-toggle) {
    min-height: 36px;
  }

  .gate-legal {
    padding: 7px 10px;
    border-radius: 10px;
  }

  .gate-account-divider {
    min-height: 14px;
    font-size: 9.5px;
    letter-spacing: .04em;
  }

  .gate-free-account-btn {
    min-height: 42px !important;
  }

  .gate-free-account-btn strong {
    font-size: 13px;
  }

  .gate-free-account-btn small,
  .terms-copy {
    font-size: 10px;
  }
}

@keyframes pulse-ring {
  0% { opacity: .75; transform: scale(.72); }
  100% { opacity: 0; transform: scale(1.18); }
}

@keyframes wave-glow {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .85)); }
}

@keyframes free-account-slow-pulse {
  0%, 100% {
    opacity: .18;
    transform: scale(.96);
    box-shadow: 0 0 0 0 rgba(39, 246, 109, .22), 0 0 20px rgba(94, 231, 255, .1);
  }
  50% {
    opacity: .5;
    transform: scale(1.04);
    box-shadow: 0 0 0 7px rgba(39, 246, 109, .08), 0 0 34px rgba(94, 231, 255, .24);
  }
}

@keyframes spark {
  0%, 100% { opacity: .15; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes processing-button {
  0%, 100% { box-shadow: 0 12px 28px rgba(0, 95, 255, .38); }
  50% { box-shadow: 0 12px 40px rgba(94, 231, 255, .48); }
}

@media (max-width: 520px) {
  .terminal-stage { padding: 0; }

  .terminal-language-switch {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }

  .phone-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--terminal-viewport-height, 100dvh);
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
}

@media (max-height: 760px) {
  .phone-shell { grid-template-rows: 32px auto auto minmax(0, 1fr) auto; }

  .status-bar {
    height: 32px;
    padding-top: 5px;
  }

  .status-left { gap: 8px; }
  .top-menu-button { width: 30px; height: 30px; }
  .top-menu-button span { width: 22px; }

  .terminal-header {
    min-height: 68px;
    padding-top: 0;
    padding-bottom: 2px;
  }

  body.terminal-activity-mode .terminal-header {
    min-height: 188px;
    grid-template-rows: auto auto auto;
    padding-bottom: 6px;
  }

  .invoice-hero-copy strong { font-size: clamp(28px, 4.6dvh, 34px); }
  .invoice-hero-copy span { font-size: 12px; }
  .invoice-filter-btn { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .invoice-refresh-btn { width: 32px; height: 32px; }
  .bottom-nav .create-invoice-fab {
    top: -52px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .bottom-nav .create-invoice-fab span { font-size: 29px; }

  .terminal-brand { gap: 2px; }
  .terminal-brand strong { font-size: 16px; }
  .terminal-brand small { font-size: 11px; }
  .terminal-gmail-button {
    width: 44px;
    height: 44px;
  }
  .terminal-gmail-icon {
    width: 42px;
    height: 42px;
  }

  .merchant-card { margin-bottom: 7px; }
  .merchant-top {
    min-height: 58px;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
  }

  .merchant-bottom > div { padding-top: 7px; padding-bottom: 7px; }
  .connected-pill { min-height: 27px; padding: 0 9px; font-size: 11px; }

  .payment-kicker { font-size: 12px; }
  .payment-card h1 { font-size: clamp(18px, 2.8dvh, 23px); }
  .payment-amount { font-size: clamp(38px, 7.8dvh, 58px); }
  .tap-orbit {
    width: clamp(82px, 14.5dvh, 120px);
    height: clamp(82px, 14.5dvh, 120px);
  }

  .tap-core {
    width: clamp(62px, 10.4dvh, 88px);
    height: clamp(62px, 10.4dvh, 88px);
  }

  .tap-core svg {
    width: clamp(40px, 6.8dvh, 58px);
    height: clamp(40px, 6.8dvh, 58px);
  }

  .secondary-terminal-action { min-height: 42px; }
  .secure-note { margin-top: 8px !important; font-size: 12px !important; }

  .bottom-nav {
    min-height: 72px;
    padding-top: 8px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

@media (max-height: 680px) {
  .terminal-header { min-height: 70px; }
  body.terminal-activity-mode .terminal-header { min-height: 178px; }
  .merchant-bottom { display: grid; }
  .merchant-bottom > div { padding-top: 6px; padding-bottom: 6px; }
  .payment-card { min-height: 390px; padding-top: 12px; padding-bottom: 12px; }
  .document-icon {
    display: grid;
    width: 44px;
    height: 44px;
  }
  .orders-dock-head strong { font-size: 13px; }
  .order-list { max-height: 112px; }
}

@media (max-width: 390px) {
  .merchant-card { margin-left: 18px; margin-right: 18px; }
  .screen-panel { padding-left: 18px; padding-right: 18px; }
  .payment-amount { font-size: clamp(38px, 7.8dvh, 58px); }
}
