:root {
  /* Sales Intel Bot — dark foliage + leaf green */
  --bg: #0f1411;
  --bg-elevated: #1a221c;
  --sidebar-bg: #121a15;
  --surface: #243028;
  --surface-hover: #2d3a32;
  --border: #2a3d30;
  --border-soft: #1e2b22;
  --text: #e8f0ea;
  --text-secondary: #9cb0a3;
  --muted: #7a9084;
  --leaf: #66bb6a;
  --leaf-dim: rgba(102, 187, 106, 0.14);
  --accent: #66bb6a;
  --accent-soft: rgba(102, 187, 106, 0.22);
  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.14);
  --green-bright: #81c784;
  --green-dark: #1b5e20;
  --danger: #e57373;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.main-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* ——— Sidebar (Recents) ——— */
.thread-sidebar {
  flex-shrink: 0;
  width: min(280px, 26vw);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #152019 0%, var(--sidebar-bg) 55%, #0c120e 100%);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.65rem;
}

.sidebar-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo-img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(76, 175, 80, 0.25));
}

.sidebar-wordmark-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
  min-width: 0;
}

.sidebar-wordmark {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--green-dark);
}

.sidebar-bot {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--leaf);
}

.sidebar-section-label {
  margin: 0 1rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn-new {
  font-size: 1.4rem;
}

.icon-btn-quiet {
  background: transparent;
  font-size: 1.35rem;
}

.thread-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-nav-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}

.thread-nav-row.is-pinned .thread-nav-item {
  font-weight: 600;
}

.thread-nav-pin {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  opacity: 0.95;
}

.thread-nav-pin svg {
  width: 15px;
  height: 15px;
  display: block;
}

.thread-nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
}

.thread-nav-item-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.thread-nav-item.is-active {
  background: var(--leaf-dim);
  box-shadow: inset 3px 0 0 0 var(--gold);
}

.thread-nav-more {
  position: relative;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

.thread-nav-kebab {
  width: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.05em;
  cursor: pointer;
  opacity: 0.75;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.thread-nav-kebab:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.thread-nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  min-width: 11rem;
  padding: 0.35rem 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 80;
}

.thread-nav-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.thread-nav-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.thread-nav-menu-item.is-danger {
  color: #f5a5a5;
}

.thread-nav-menu-item.is-danger:hover {
  background: rgba(229, 115, 115, 0.15);
  color: #ffcdd2;
}

.thread-nav-menu-sep {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border-soft);
}

.thread-nav-empty {
  padding: 0.65rem 0.75rem;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.85rem;
}

.sidebar-account[hidden] {
  display: none !important;
}

.account-email {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-text {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
}

.btn-text:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-logout {
  flex-shrink: 0;
}

/* ——— Main stage ——— */
.main-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.tab-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem 0.35rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}

.tab-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.tab-new {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
}

.tab-chip-wrap {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  max-width: min(200px, 28vw);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  overflow: hidden;
}

.tab-chip-wrap:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tab-chip-wrap.is-selected {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
}

.tab-chip-wrap.is-streaming {
  border-color: rgba(102, 187, 106, 0.5);
  box-shadow: 0 0 0 1px rgba(102, 187, 106, 0.2);
}

.tab-chip-main {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem 0.35rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.tab-chip-wrap.is-selected .tab-chip-main {
  color: var(--text);
}

.tab-chip-main .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close {
  flex-shrink: 0;
  width: 1.75rem;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border-soft);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tab-close:hover {
  color: var(--danger);
}

/* ——— Chat canvas + hero ——— */
.chat-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-hero {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
  pointer-events: none;
}

.chat-hero[hidden] {
  display: none !important;
}

.chat-hero-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 4px 18px rgba(76, 175, 80, 0.35));
}

.chat-hero-tag {
  margin: 0;
  max-width: 36ch;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.chat-hero-greeting {
  margin: 0;
  max-width: 28ch;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.thread-panels {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.thread-panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

.thread-panel.active {
  display: flex;
}

.thread {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 1rem clamp(1rem, 5vw, 3rem) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bubble-wrap {
  max-width: min(720px, 100%);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bubble-wrap.user {
  align-self: flex-end;
}

.bubble {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  word-break: break-word;
}

.bubble.user {
  border-color: var(--border);
  background: var(--surface);
}

.bubble.assistant {
  border-left: 3px solid var(--gold);
  box-shadow: inset 3px 0 0 0 rgba(212, 168, 83, 0.25);
}

.bubble.error {
  border-color: rgba(229, 115, 115, 0.4);
  color: #ffcdd2;
}

.bubble.cancelled {
  border-left-color: #666;
  opacity: 0.92;
}

.bubble.user .body {
  white-space: pre-wrap;
}

.formatted {
  line-height: 1.62;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
}

.formatted .slack-p {
  margin: 0 0 0.65rem;
}

.formatted .slack-p:last-child {
  margin-bottom: 0;
}

.formatted .slack-ul {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.35rem;
  list-style-type: disc;
}

.formatted .slack-ul li {
  margin: 0.25rem 0;
}

.formatted .slack-spacer {
  height: 0.45rem;
}

.formatted strong {
  color: #fff;
  font-weight: 600;
}

.formatted a {
  color: var(--green-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.formatted a:hover {
  color: #a5d6a7;
}

.thinking-panel {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--green-bright);
}

.thinking-panel[hidden] {
  display: none !important;
}

.thinking-panel .thinking-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.thinking-line {
  margin: 0.2rem 0;
  padding-left: 0.35rem;
  border-left: 2px solid var(--green-dark);
}

.thinking-line.tool {
  color: #b2dfdb;
}

.thinking-line.turn {
  color: var(--muted);
}

.bubble .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-soft);
}

/* ——— Composer (Claude-style) ——— */
.composer-outer {
  flex-shrink: 0;
  padding: 0.75rem clamp(1rem, 5vw, 3rem) 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.composer.composer-claude {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.composer-claude {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-claude:focus-within {
  border-color: rgba(102, 187, 106, 0.45);
  box-shadow: 0 0 0 2px var(--leaf-dim);
}

.composer-claude textarea {
  width: 100%;
  resize: none;
  min-height: 52px;
  max-height: 200px;
  padding: 0.95rem 1.1rem 0.35rem;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: transparent;
  border: none;
}

.composer-claude textarea::placeholder {
  color: var(--muted);
}

.composer-claude textarea:focus {
  outline: none;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem 0.6rem;
}

.composer-toolbar-left,
.composer-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.composer-toolbar-right {
  flex: 1;
  justify-content: flex-end;
}

.composer-status {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.composer-status.working {
  color: var(--green-bright);
}

.composer-toolbar-right .composer-status {
  max-width: min(240px, 55vw);
}

.btn-stop-inline {
  font-size: 11px;
  color: var(--danger);
}

.btn-stop-inline:disabled {
  opacity: 0.35;
}

.composer-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green-bright) 0%, var(--green-dark) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(27, 94, 32, 0.45);
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.composer-send:hover:not(:disabled) {
  transform: scale(1.05);
  filter: brightness(1.06);
}

.composer-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.qa-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.qa-pill:hover {
  color: var(--text);
  border-color: rgba(102, 187, 106, 0.45);
  background: var(--leaf-dim);
}

.qa-icon {
  font-size: 13px;
  opacity: 0.9;
}

.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 0.35rem 1rem 0.65rem;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.footer-attribution {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.footer-highlight {
  font-weight: 500;
  opacity: 0.85;
}

.footer-link {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ——— Narrow screens: stack Recents above chat (always visible) ——— */
@media (max-width: 720px) {
  .main-shell {
    flex-direction: column;
  }

  .thread-sidebar {
    width: 100%;
    min-width: 0;
    max-height: min(40vh, 320px);
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding-left: max(0, env(safe-area-inset-left));
    padding-right: max(0, env(safe-area-inset-right));
  }

  .thread-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .thread-nav-row {
    width: 100%;
  }

  .thread-nav-item {
    flex: 1;
    min-width: 0;
  }

  .main-stage {
    min-height: 0;
    flex: 1;
  }

  .tab-bar {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  .thread {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  .composer-outer {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .site-footer {
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
  }
}

/* Very small phones: reduce iOS input zoom + slightly larger tap targets */
@media (max-width: 480px) {
  .composer-claude textarea,
  .auth-input {
    font-size: 16px;
  }

  .composer-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .icon-btn.icon-btn-new {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* ——— Large desktops ——— */
@media (min-width: 1280px) {
  .bubble-wrap {
    max-width: min(800px, 100%);
  }

  .thread {
    padding-left: clamp(1.5rem, 6vw, 4rem);
    padding-right: clamp(1.5rem, 6vw, 4rem);
  }

  .composer-outer {
    padding-left: clamp(1.5rem, 6vw, 4rem);
    padding-right: clamp(1.5rem, 6vw, 4rem);
  }
}

/* Buttons used in auth card */
.btn {
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(180deg, #5a9e56 0%, var(--green-dark) 100%);
  color: #fff;
  border-color: #3d7a3d;
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn.danger {
  background: linear-gradient(180deg, #c75c5c 0%, #8e3a3a 100%);
  color: #fff;
  border-color: #6d2d2d;
}

.btn.danger:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--green-bright);
  border-color: var(--border);
}

.btn.ghost:hover:not(:disabled) {
  border-color: var(--green-bright);
}

/* Auth gate */
/* Rename chat (in-app modal) */
.rename-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 18, 14, 0.85);
  backdrop-filter: blur(10px);
}

.rename-overlay[hidden] {
  display: none !important;
}

.rename-dialog {
  width: min(400px, 100%);
  margin: 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(165deg, #1a241e 0%, var(--bg-elevated) 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.rename-dialog-title {
  margin: 0 0 0.85rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.rename-input {
  margin-top: 0.25rem;
}

.rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.rename-actions .btn {
  min-width: 5.5rem;
}

.delete-overlay {
  z-index: 210;
}

.delete-confirm-desc {
  margin: 0 0 0.75rem;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.delete-confirm-error {
  margin: 0 0 0.75rem;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger);
}

.delete-confirm-error[hidden] {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 18, 14, 0.94);
  backdrop-filter: blur(12px);
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-card {
  width: min(420px, 100%);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(165deg, #1a241e 0%, var(--bg-elevated) 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.auth-logo {
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(76, 175, 80, 0.25));
}

.auth-title {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.auth-sub {
  margin: 0 0 1rem;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.is-active {
  color: var(--text);
  border-color: rgba(106, 191, 105, 0.45);
  background: rgba(106, 191, 105, 0.08);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(106, 191, 105, 0.55);
}

.auth-input.auth-code {
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
}

.auth-submit {
  margin-top: 0.35rem;
  width: 100%;
}

.auth-back {
  margin-top: 0.15rem;
  width: 100%;
}

.auth-hint {
  margin: 0 0 0.25rem;
  font-size: 12px;
  color: var(--muted);
}

.auth-message {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-message.auth-message-error {
  color: var(--danger);
}
