* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
}

#auth-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 128, 92, 0.22), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(93, 176, 255, 0.18), transparent 24%),
    linear-gradient(145deg, #071018 0%, #0d1117 42%, #16120f 100%);
}

#auth-view::before,
#auth-view::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}

#auth-view::before {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -60px;
  background: rgba(255, 128, 92, 0.22);
}

#auth-view::after {
  width: 320px;
  height: 320px;
  right: -90px;
  bottom: -90px;
  background: rgba(93, 176, 255, 0.18);
}

.auth-layout {
  position: relative;
  width: min(100%, 1040px);
  min-height: calc(100dvh - 2rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.1rem;
  align-items: stretch;
}

.auth-showcase,
.auth-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(13, 18, 25, 0.95), rgba(9, 13, 19, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.auth-showcase::before,
.auth-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), transparent 32%),
    linear-gradient(0deg, rgba(255,255,255,0.02), transparent 36%);
  pointer-events: none;
}

.auth-showcase {
  padding: clamp(1.4rem, 4vw, 2.4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-kicker {
  margin-bottom: 0.8rem;
  color: #ffae8e;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-showcase h2 {
  max-width: 10ch;
  margin-bottom: 0.9rem;
  color: #f7fafc;
  font-family: 'Azeret Mono', 'IBM Plex Mono', 'SFMono-Regular', monospace;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.auth-copy {
  max-width: 34ch;
  margin-bottom: 1.4rem;
  color: #a9b7c4;
  font-size: 1rem;
  line-height: 1.65;
}

.auth-preview {
  margin: 1.3rem 0;
  padding: 1rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    rgba(6, 9, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  color: #d7e1ea;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff845c;
}

.auth-preview-dot:nth-child(2) {
  background: #ffcc66;
}

.auth-preview-dot:nth-child(3) {
  background: #68d391;
}

.auth-preview-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-preview-row:first-of-type {
  border-top: 0;
}

.auth-preview-label {
  color: #7f8ea0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-preview-value {
  color: #edf2f7;
  font-size: 0.95rem;
}

.auth-benefits {
  display: grid;
  gap: 0.7rem;
}

.auth-benefit {
  padding: 0.8rem 0.95rem;
  border-left: 2px solid rgba(255, 128, 92, 0.76);
  background: rgba(255, 255, 255, 0.03);
  color: #d0dae4;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(93, 176, 255, 0.14);
  border: 1px solid rgba(93, 176, 255, 0.28);
  color: #d9ecff;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-hint {
  color: #8ea0b0;
  font-size: 0.86rem;
  text-align: right;
}

.auth-label {
  display: block;
  margin-bottom: 0.45rem;
  color: #8ea0b0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.auth-form input {
  width: 100%;
  min-height: 52px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 9, 14, 0.75);
  color: #dce5ed;
  font-size: 16px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.auth-form input:focus {
  border-color: rgba(93, 176, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(93, 176, 255, 0.12);
  transform: translateY(-1px);
}

.auth-primary,
.auth-secondary,
.auth-tertiary {
  min-height: 50px;
  border-radius: 16px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s, color 0.14s;
}

.auth-primary:active,
.auth-secondary:active,
.auth-tertiary:active {
  transform: translateY(1px);
}

.auth-busy .auth-panel {
  opacity: 0.82;
}

.auth-primary,
.auth-secondary {
  margin-top: 0.8rem;
}

.auth-primary {
  border: 0;
  color: #fff6f2;
  background: linear-gradient(135deg, #ff845c, #ff5d90);
  box-shadow: 0 14px 30px rgba(255, 93, 144, 0.22);
}

.auth-secondary {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e4edf5;
}

.auth-passkey-login {
  background: linear-gradient(135deg, rgba(93, 176, 255, 0.18), rgba(93, 176, 255, 0.08));
  border-color: rgba(93, 176, 255, 0.32);
  color: #dceefe;
}

.auth-passkey-register {
  border-style: dashed;
  color: #ffd7c6;
}

.auth-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.auth-tertiary {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 20, 0.72);
  color: #c2cfdb;
}

.auth-danger {
  color: #ffb4ae;
}

.auth-primary:disabled,
.auth-secondary:disabled,
.auth-tertiary:disabled,
.auth-form input:disabled {
  cursor: wait;
  opacity: 0.66;
}

.auth-footer-note {
  margin-top: 1rem;
  color: #8fa0af;
  font-size: 0.9rem;
  line-height: 1.55;
}

#auth-view[data-mode="bootstrap"] .auth-passkey-login,
#auth-view[data-mode="bootstrap"] .auth-passkey-register,
#auth-view[data-mode="bootstrap"] .auth-inline-actions,
#auth-view[data-mode="login"] .auth-passkey-register,
#auth-view[data-mode="login"] .auth-inline-actions,
#auth-view[data-mode="setup"] #token-form,
#auth-view[data-mode="setup"] .auth-passkey-login {
  display: none;
}

#auth-view[data-mode="setup"] .auth-panel {
  background: linear-gradient(180deg, rgba(28, 19, 14, 0.95), rgba(15, 11, 9, 0.98));
}

#auth-view[data-mode="login"] .auth-badge {
  background: rgba(93, 176, 255, 0.18);
}

#auth-view[data-mode="setup"] .auth-badge {
  background: rgba(255, 128, 92, 0.16);
  border-color: rgba(255, 128, 92, 0.28);
  color: #ffd7c6;
}

@media (max-width: 840px) {
  .auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .auth-showcase h2 {
    max-width: none;
  }
}

@media (max-width: 540px) {
  #auth-view {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .auth-layout {
    gap: 0.75rem;
  }

  .auth-showcase,
  .auth-panel {
    border-radius: 18px;
  }

  .auth-showcase {
    padding: 1.1rem;
  }

  .auth-showcase h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
  }

  .auth-copy {
    font-size: 0.88rem;
    margin-bottom: 0.8rem;
  }

  .auth-preview {
    margin: 0.8rem 0;
    padding: 0.75rem;
    border-radius: 14px;
  }

  .auth-preview-bar {
    font-size: 0.72rem;
    margin-bottom: 0.6rem;
  }

  .auth-preview-dot {
    width: 7px;
    height: 7px;
  }

  .auth-preview-row {
    grid-template-columns: 56px 1fr;
    gap: 0.6rem;
    padding: 0.4rem 0;
  }

  .auth-preview-label {
    font-size: 0.68rem;
  }

  .auth-preview-value {
    font-size: 0.82rem;
  }

  .auth-benefit {
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
  }

  .auth-panel {
    padding: 1rem;
  }

  .auth-panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
  }

  .auth-hint {
    text-align: left;
  }

  .auth-form input {
    min-height: 46px;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
  }

  .auth-primary,
  .auth-secondary,
  .auth-tertiary {
    min-height: 44px;
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .auth-primary,
  .auth-secondary {
    margin-top: 0.6rem;
  }

  .auth-inline-actions {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.6rem;
  }

  .auth-footer-note {
    margin-top: 0.75rem;
    font-size: 0.78rem;
  }

  .auth-kicker {
    font-size: 0.68rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 380px) {
  .auth-showcase {
    display: none;
  }

  .auth-panel {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .auth-inline-actions {
    grid-template-columns: 1fr;
  }
}

/* --- Picker View --- */

#picker-view {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  -webkit-user-select: none;
}

/* --- Header --- */

header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #21262d;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

h1 .h1-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #58a6ff 0%, #3b82f6 100%);
  color: #fff;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0;
  flex-shrink: 0;
  animation: icon-glow 3s ease-in-out infinite;
}

@keyframes icon-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(88, 166, 255, 0.35); }
}

h1 .h1-accent {
  color: #58a6ff;
  font-weight: 300;
}

h1 .h1-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #58a6ff;
  margin-left: 0.1rem;
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.subtitle {
  color: #6e7681;
  font-size: 0.8rem;
}

/* --- Header Row --- */

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Notification Button --- */

.btn-notify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #484f58;
  cursor: pointer;
  -webkit-appearance: none;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn-notify:active {
  transform: scale(0.92);
  background: #21262d;
}

.notify-icon {
  width: 16px;
  height: 16px;
}

.notify-slash {
  opacity: 1;
  transition: opacity 0.15s;
}

.btn-notify.notify-on {
  background: #0d1929;
  border-color: #1a3050;
  color: #58a6ff;
}

.btn-notify.notify-on .notify-slash {
  opacity: 0;
}

.btn-notify.notify-on:active {
  background: #1a3050;
}

.btn-notify.notify-denied {
  background: #161b22;
  border-color: #21262d;
  color: #30363d;
  cursor: default;
}

.btn-notify.is-loading .notify-icon {
  animation: header-spin 0.85s linear infinite;
}

@keyframes header-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Create Session --- */

.create-session {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.create-session input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.create-session input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px #58a6ff18;
}

.create-session input::placeholder {
  color: #484f58;
}

.create-session button {
  padding: 0.6rem 1rem;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  transition: background 0.15s;
}

.create-session button:active {
  background: #2ea043;
}

.passkey-panel {
  padding: 0.9rem;
  border: 1px solid #21262d;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 24, 32, 0.7), rgba(13, 17, 23, 0.92));
  margin-bottom: 1rem;
}

.passkey-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.passkey-title {
  margin: 0 0 0.15rem;
  color: #e6edf3;
  font-size: 0.98rem;
}

.passkey-subtitle {
  color: #7d8894;
  font-size: 0.8rem;
  line-height: 1.45;
}

.passkey-add {
  width: auto;
  min-width: 102px;
  padding-inline: 0.9rem;
}

.passkey-feedback {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.82rem;
}

.passkey-feedback[data-tone="success"] {
  background: rgba(46, 160, 67, 0.12);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.28);
}

.passkey-feedback[data-tone="error"] {
  background: rgba(248, 81, 73, 0.1);
  color: #ff7b72;
  border: 1px solid rgba(248, 81, 73, 0.24);
}

.passkey-feedback[data-tone="info"] {
  background: rgba(88, 166, 255, 0.1);
  color: #79c0ff;
  border: 1px solid rgba(88, 166, 255, 0.22);
}

.passkeys-list {
  display: grid;
  gap: 0.65rem;
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.passkey-item-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.passkey-item-label {
  color: #e6edf3;
  font-size: 0.88rem;
}

.passkey-item-meta {
  color: #7d8894;
  font-size: 0.75rem;
  line-height: 1.4;
}

.passkey-remove {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 81, 73, 0.25);
  background: rgba(248, 81, 73, 0.08);
  color: #ff938b;
  font-size: 0.8rem;
  font-weight: 600;
}

.passkey-empty {
  color: #7d8894;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.2rem 0.1rem;
}

/* --- Buttons --- */

.btn-secondary {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:active {
  background: #21262d;
  border-color: #484f58;
}

/* --- Error --- */

.error {
  background: #1a0d0d;
  border: 1px solid #f8514933;
  color: #f85149;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

/* --- Section Label --- */

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #484f58;
  margin-bottom: 0.5rem;
}

/* --- Session Search --- */

.session-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.session-search:focus {
  border-color: #58a6ff;
}

.session-search::placeholder {
  color: #484f58;
}

/* --- Sessions List --- */

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.loading {
  color: #6e7681;
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

/* --- Session Card --- */

.session-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  background: #161b22;
  border: 1px solid #21262d;
  border-left: 3px solid #21262d;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.1s;
  min-height: 3rem;
  touch-action: manipulation;
}

.session-card:active {
  background: #1c2333;
  border-color: #58a6ff;
  border-left-color: #58a6ff;
  transform: scale(0.985);
}

/* Left accent bar colors based on Claude status */
.session-card.claude-running-border {
  border-left-color: #3fb950;
}

.session-card.claude-ready-border {
  border-left-color: #58a6ff;
  background: #0c1520;
}

.session-card.claude-done-border {
  border-left-color: #56d4dd;
  background: #0c151a;
}

/* Agent type pill — top-right corner */
.agent-type-pill {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  line-height: 1.3;
  opacity: 0.85;
}
.agent-type-claude {
  background: rgba(212, 165, 116, 0.18);
  color: #d4a574;
}
.agent-type-codex {
  background: rgba(188, 140, 255, 0.18);
  color: #bc8cff;
}
.agent-type-other {
  background: rgba(110, 118, 129, 0.18);
  color: #6e7681;
}

/* --- Swipe Actions --- */

.swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.swipe-action {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.swipe-left-action {
  justify-content: flex-end;
  padding-right: 1.2rem;
  background: #f85149;
  color: #fff;
}

.swipe-right-action {
  justify-content: flex-start;
  padding-left: 1.2rem;
  background: #58a6ff;
  color: #fff;
}

.swipe-container.show-left-action .swipe-left-action {
  opacity: 1;
}

.swipe-container.show-right-action .swipe-right-action {
  opacity: 1;
}

.swipe-container .session-card {
  position: relative;
  z-index: 1;
}

/* --- Drag Handle --- */

.drag-handle {
  color: #30363d;
  font-size: 1.1rem;
  cursor: grab;
  padding: 0.35rem 0.2rem;
  line-height: 1;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  min-width: 32px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-handle:active {
  cursor: grabbing;
  color: #58a6ff;
}

.session-group.dragging {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Floating ghost while dragging */
.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.75;
  transform: scale(1) rotate(0deg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.drag-ghost.drag-ghost-active {
  opacity: 0.92;
  transform: scale(1.03) rotate(0.5deg);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px #58a6ff50;
}
.drag-ghost.drag-ghost-drop {
  opacity: 0;
  transform: scale(0.98) rotate(0deg);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Placeholder gap */
.drag-placeholder {
  border: 2px dashed #30363d;
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.04);
  margin-bottom: 0.4rem;
  animation: placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes placeholder-pulse {
  0%, 100% { border-color: #30363d; background: rgba(88, 166, 255, 0.04); }
  50% { border-color: #58a6ff60; background: rgba(88, 166, 255, 0.08); }
}

/* --- Session Icon --- */

.session-icon {
  min-width: 32px;
  height: 32px;
  padding: 0 0.35rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  flex-shrink: 0;
  line-height: 1;
}

.session-icon.default {
  background: #21262d;
  color: #6e7681;
}

.session-icon.running {
  background: #0d2818;
  color: #3fb950;
  font-size: 0.6rem;
  overflow: hidden;
}

.icon-gear {
  display: inline-block;
  font-size: 1.4rem;
  animation: gear-spin 4s linear infinite;
}

@keyframes gear-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.icon-zzz {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  font-weight: 700;
  font-size: 0.95rem;
  color: inherit;
  animation: zzz-float 2.5s ease-in-out infinite;
}
.icon-zzz small {
  font-size: 0.55rem;
  opacity: 0.6;
}
.icon-zzz small:last-child {
  font-size: 0.4rem;
  opacity: 0.35;
}

@keyframes zzz-float {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.session-icon.waiting {
  background: #2d1f04;
  color: #d29922;
  font-size: 0.95rem;
  font-weight: 800;
}

.session-icon.ready {
  background: #0c1929;
  color: #58a6ff;
}

.session-icon.done {
  background: #0c1f2a;
  color: #56d4dd;
}

.icon-ready,
.icon-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-ready {
  font-size: 0.75rem;
}

.icon-done {
  font-size: 0.95rem;
}


.session-icon.standby {
  background: #0c1929;
  color: #58a6ff;
}

.agent-name {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.56rem;
  font-weight: 700;
}

/* --- Session Info --- */

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.session-name-row {
  display: flex;
  align-items: center;
  gap: 0.25rem 0.6rem;
  flex-wrap: wrap;
}

.session-name {
  font-weight: 600;
  color: #e6edf3;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.session-meta {
  font-size: 0.7rem;
  color: #484f58;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-sessions {
  text-align: center;
  color: #6e7681;
  padding: 2rem;
  font-size: 0.85rem;
}

/* --- Claude Status Badges --- */

.session-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.badge-claude {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.badge-claude .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-claude.running {
  background: #0d2818;
  color: #3fb950;
}
.badge-claude.running .status-dot {
  background: #3fb950;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.badge-claude.waiting {
  background: #d29922;
  color: #1c1200;
}
.badge-claude.waiting .status-dot {
  background: #1c1200;
  animation: pulse-dot 1s ease-in-out infinite;
}

.badge-claude.ready {
  background: #0c1929;
  color: #58a6ff;
}
.badge-claude.ready .status-dot {
  background: #58a6ff;
}

.badge-claude.done {
  background: #0c1f2a;
  color: #56d4dd;
}
.badge-claude.done .status-dot {
  background: #56d4dd;
}

/* --- Session Card: Claude Waiting State --- */

.session-card.claude-waiting {
  border-color: #3d2a06;
  border-left-color: #d29922;
  background: #13100a;
  animation: pulse-border 2.5s ease-in-out infinite;
}

.session-card.claude-waiting:active {
  background: #2d1f04;
}

/* --- Flash Overlay --- */

.flash-overlay {
  position: fixed;
  inset: 0;
  background: #58a6ff;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.15s ease-out;
}

.flash-overlay.flash-active {
  opacity: 0.15;
}

.session-question {
  font-size: 0.75rem;
  color: #d29922;
  margin-top: 0.3rem;
  line-height: 1.35;
  opacity: 0.85;
}
.sq-header {
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.sq-details {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.7rem;
  color: #c9d1d9;
  padding: 0.2rem 0 0.2rem 0.5rem;
  margin: 0.1rem 0;
  border-left: 2px solid #30363d;
  white-space: pre-wrap;
  word-break: break-all;
}
.sq-desc {
  font-size: 0.68rem;
  color: #8b949e;
  margin-top: 0.1rem;
}
.sq-context {
  font-size: 0.68rem;
  color: #8b949e;
  margin-top: 0.2rem;
  font-style: italic;
}
.sq-text {
  margin-top: 0.25rem;
}

/* --- Session Group (card + action bar) --- */

.session-group {
  display: flex;
  flex-direction: column;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  background: #13100a;
  border: 1px solid #3d2a06;
  border-top: none;
  border-radius: 0 0 10px 10px;
  margin-top: -4px;
  padding-top: calc(0.45rem + 4px);
}

.session-group.has-actions .session-card {
  border-radius: 10px 10px 0 0;
}

.session-option {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.45rem 0.8rem;
  background: #1c1600;
  color: #d29922;
  border: 1px solid #3d2a06;
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  touch-action: manipulation;
  position: relative;
  z-index: 10;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.session-option:active {
  background: #d29922;
  color: #0d1117;
  transform: scale(0.95);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

@keyframes pulse-border {
  0%, 100% { border-color: #3d2a06; }
  50% { border-color: #6b4d0e; }
}

/* --- Picker Actions --- */

.picker-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 1rem;
}

.picker-actions .btn-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  color: #8b949e;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.picker-actions .btn-secondary:active {
  background: #21262d;
  border-color: #484f58;
  color: #e6edf3;
  transform: scale(0.97);
}

.picker-actions .btn-secondary .btn-icon {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.6;
}
.btn-spinner {
  display: inline-block;
  animation: gear-spin 0.8s linear infinite;
}
.btn-spinning {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.btn-dual.active-mode {
  background: #0d1929 !important;
  color: #58a6ff !important;
  border-color: #58a6ff !important;
  font-weight: 600;
}

.btn-dual.active-mode .btn-icon {
  opacity: 1;
}

/* --- Dual Select Mode --- */

.session-card .dual-check {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid #30363d;
  border-radius: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.dual-select-mode .session-card .dual-check {
  display: flex;
}

.session-card.dual-selected .dual-check {
  background: #58a6ff;
  border-color: #58a6ff;
  color: #fff;
}

.session-card.dual-selected {
  border-color: #58a6ff;
  border-left-color: #58a6ff;
  background: #0d1929;
}

/* --- Usage Bar --- */

.usage-bar {
  margin-top: 0.75rem;
  padding: 0.5rem 0.7rem;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  font-size: 0.7rem;
  color: #6e7681;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.usage-bar:empty {
  display: none;
}

.usage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
}

.usage-row-main {
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #21262d;
}

.usage-row-detail {
  opacity: 0.7;
}

.usage-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.usage-stat .usage-label {
  color: #484f58;
}

.usage-cost {
  color: #d29922 !important;
}

.usage-progress-bar {
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  overflow: hidden;
}

.usage-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.usage-cost-green { color: #3fb950 !important; }
.usage-cost-green.usage-progress-fill { background: #3fb950; }
.usage-cost-yellow { color: #d29922 !important; }
.usage-cost-yellow.usage-progress-fill { background: #d29922; }
.usage-cost-red { color: #f85149 !important; }
.usage-cost-red.usage-progress-fill { background: #f85149; }

.usage-stat .usage-value {
  color: #8b949e;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
}

/* --- Terminal View --- */

#terminal-view {
  display: flex;
  flex-direction: column;
  height: var(--vh, 100dvh);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
  min-height: 2.6rem;
}

.terminal-header-left,
.terminal-header-right {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  min-width: 2.5rem;
}

.terminal-header-right {
  justify-content: flex-end;
}

.terminal-header-left button,
.terminal-header-right button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  color: #6e7681;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.terminal-header-left button:active,
.terminal-header-right button:active {
  background: #161b22;
  color: #e6edf3;
  border-color: #484f58;
  transform: scale(0.95);
}

.terminal-header-left .btn-icon,
.terminal-header-right .btn-icon {
  font-size: 0.85rem;
  line-height: 1;
}

#session-label {
  font-weight: 600;
  color: #58a6ff;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  flex: 1;
}

/* --- Panes Container --- */

#panes-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.pane.active {
  border-color: #58a6ff;
}

/* Pane tab — visible only when 2 panes open */
.pane-tab {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.5rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
  min-height: 1.6rem;
}

.pane-tab .pane-tab-name {
  font-size: 0.7rem;
  color: #6e7681;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane.active .pane-tab .pane-tab-name {
  color: #58a6ff;
}

.pane-tab .btn-close-pane {
  background: none;
  border: none;
  color: #484f58;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  -webkit-appearance: none;
  transition: color 0.15s;
}

.pane-tab .btn-close-pane:active {
  color: #f85149;
}

#panes-container.dual .pane-tab {
  display: flex;
}

.terminal-container {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  touch-action: none;
  overscroll-behavior: contain;
}

/* --- Quick Commands --- */

.quick-commands-wrapper {
  flex-shrink: 0;
  background: #0d1117;
  border-top: 1px solid #21262d;
  padding: 0.25rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  user-select: none;
  -webkit-user-select: none;
}

.quick-commands {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.quick-commands button {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  color: #8b949e;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  cursor: pointer;
  -webkit-appearance: none;
  white-space: nowrap;
  min-width: 2.2rem;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.1s;
}

.quick-commands button:active {
  transform: scale(0.92);
}

/* Number keys — blue */
.quick-commands button.qc-num {
  background: #0d1929;
  border-color: #1a3050;
  color: #58a6ff;
  font-weight: 600;
  flex: 1;
}
.quick-commands button.qc-num:active {
  background: #58a6ff;
  color: #0d1117;
}

/* Enter — green */
.quick-commands button.qc-enter {
  background: #0d2818;
  border-color: #1a4028;
  color: #3fb950;
  font-weight: 600;
}
.quick-commands button.qc-enter:active {
  background: #3fb950;
  color: #0d1117;
}

/* C-c — red/danger */
.quick-commands button.qc-danger {
  background: #1a0d0d;
  border-color: #3d1515;
  color: #f85149;
  font-weight: 600;
}
.quick-commands button.qc-danger:active {
  background: #f85149;
  color: #0d1117;
}

/* Esc, Tab — neutral special */
.quick-commands button.qc-special {
  background: #161b22;
  border-color: #30363d;
  color: #c9d1d9;
  font-size: 0.7rem;
}
.quick-commands button.qc-special:active {
  background: #30363d;
  color: #e6edf3;
}

/* Mic — orange accent */
.quick-commands button.qc-mic {
  background: #291a0d;
  border-color: #50381a;
  color: #f0a040;
  font-size: 1rem;
}
.quick-commands button.qc-mic:active {
  background: #f0a040;
  color: #0d1117;
}

/* /usage command — purple */
.quick-commands button.qc-cmd {
  background: #1a0d29;
  border-color: #2d1a50;
  color: #bc8cff;
  font-weight: 600;
  font-size: 0.7rem;
}
.quick-commands button.qc-cmd:active {
  background: #bc8cff;
  color: #0d1117;
}

/* Arrow keys */
/* Arrow grid — inverted T layout */
.arrow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  flex-shrink: 0;
}

.arrow-grid button.qc-arrow {
  background: #0d1929;
  border-color: #1a3050;
  color: #58a6ff;
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  min-width: 1.8rem;
  min-height: 1.5rem;
}
.arrow-grid button.qc-arrow:active {
  background: #58a6ff;
  color: #0d1117;
}

.quick-commands .qc-separator {
  width: 1px;
  background: #21262d;
  flex-shrink: 0;
  margin: 0.2rem 0.1rem;
}

/* --- Pull-to-refresh --- */

.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 3rem;
  transform: translateY(0);
  opacity: 0;
  z-index: 9000;
  pointer-events: none;
}

.ptr-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid #21262d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.ptr-indicator.ptr-ready .ptr-spinner {
  border-top-color: #3fb950;
  transform: rotate(180deg);
}

.ptr-indicator.ptr-refreshing .ptr-spinner {
  animation: spin 0.7s linear infinite;
}

/* --- Session Overlay --- */

#session-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#session-overlay[hidden] {
  display: none;
}

.overlay-content {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 1rem;
  width: 100%;
  max-width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.overlay-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #e6edf3;
}

#btn-overlay-close {
  background: none;
  border: none;
  color: #484f58;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  -webkit-appearance: none;
  transition: color 0.15s;
}

#btn-overlay-close:active {
  color: #f85149;
}

/* --- Connection Spinner --- */

#connect-spinner {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #0d1117;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #6e7681;
  font-size: 0.85rem;
}

.spinner-ring {
  width: 32px;
  height: 32px;
  border: 2.5px solid #21262d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Command History Overlay --- */

.cmd-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cmd-history-panel {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 1rem;
  width: 100%;
  max-width: 400px;
  max-height: 60vh;
  overflow-y: auto;
}

.cmd-history-panel .overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cmd-history-close {
  background: none;
  border: none;
  color: #484f58;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.3rem;
  -webkit-appearance: none;
}

.cmd-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cmd-history-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  color: #c9d1d9;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background 0.15s, border-color 0.15s;
}

.cmd-history-item:active {
  background: #21262d;
  border-color: #58a6ff;
}

/* --- Dictation Overlay --- */

.dictation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dictation-panel {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 1rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.terminal-clipboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.terminal-clipboard-panel {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 1rem;
  width: 100%;
  max-width: 720px;
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.terminal-clipboard-close {
  background: none;
  border: none;
  color: #484f58;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.3rem;
  -webkit-appearance: none;
}

.terminal-clipboard-hint {
  margin: 0;
  color: #8b949e;
  font-size: 0.82rem;
  line-height: 1.5;
}

.terminal-clipboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 0.75rem;
  min-height: 0;
}

.terminal-clipboard-card {
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.96), rgba(13, 17, 23, 0.84));
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
}

.terminal-clipboard-card.is-focused {
  border-color: #58a6ff;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.22);
}

.terminal-clipboard-card-head h3 {
  margin: 0;
  color: #e6edf3;
  font-size: 0.92rem;
  font-weight: 650;
}

.terminal-clipboard-card-head p {
  margin: 0.3rem 0 0;
  color: #8b949e;
  font-size: 0.78rem;
  line-height: 1.45;
}

.terminal-clipboard-text {
  width: 100%;
  min-height: 260px;
  max-height: 42vh;
  resize: vertical;
  padding: 0.9rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  color: #c9d1d9;
  font: 0.82rem/1.45 'JetBrains Mono', 'Fira Code', monospace;
  -webkit-appearance: none;
}

.terminal-clipboard-compose {
  width: 100%;
  min-height: 170px;
  max-height: 32vh;
  resize: vertical;
  padding: 0.9rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  color: #c9d1d9;
  font: 0.82rem/1.45 'JetBrains Mono', 'Fira Code', monospace;
  -webkit-appearance: none;
}

.terminal-clipboard-text:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.32);
}

.terminal-clipboard-compose:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.32);
}

.terminal-clipboard-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.terminal-clipboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.terminal-clipboard-btn:active {
  background: #161b22;
  border-color: #58a6ff;
}

.terminal-clipboard-status {
  font-size: 0.78rem;
  color: #8b949e;
}

.terminal-clipboard-status[data-tone="success"] {
  color: #3fb950;
}

.terminal-clipboard-status[data-tone="error"] {
  color: #ff7b72;
}

@media (max-width: 720px) {
  .terminal-clipboard-panel {
    max-height: calc(100dvh - 1.5rem);
    padding: 0.85rem;
  }

  .terminal-clipboard-grid {
    grid-template-columns: 1fr;
  }

  .terminal-clipboard-text {
    min-height: 220px;
    max-height: 32vh;
  }

  .terminal-clipboard-compose {
    min-height: 150px;
    max-height: 26vh;
  }
}

.dictation-close {
  background: none;
  border: none;
  color: #484f58;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.3rem;
  -webkit-appearance: none;
}

.dictation-status {
  font-size: 0.8rem;
  color: #3fb950;
  text-align: center;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.dictation-text {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  resize: vertical;
  padding: 0.75rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  -webkit-appearance: none;
}

.dictation-text:focus {
  border-color: #58a6ff;
}

.dictation-actions {
  display: flex;
  gap: 0.5rem;
}

.dictation-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background 0.15s, transform 0.1s;
}

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

.dictation-cancel {
  background: #21262d;
  color: #8b949e;
}

.dictation-cancel:active {
  background: #30363d;
}

.dictation-send {
  background: #238636;
  color: #fff;
}

.dictation-send:active {
  background: #2ea043;
}

/* --- Mobile keyboard open: hide inactive pane --- */

body.keyboard-open #panes-container.dual .pane:not(.active) {
  display: none;
}

body.keyboard-open #panes-container.dual .pane.active {
  flex: 1;
}

/* --- Mobile breakpoint --- */

@media (max-width: 480px) {
  #picker-view {
    padding: 1rem 0.75rem 2rem;
  }

  h1 {
    font-size: 1.15rem;
  }

  h1 .h1-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 0.6rem;
  }

  .btn-notify {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .notify-icon {
    width: 14px;
    height: 14px;
  }

  header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .session-card {
    padding: 0.65rem 0.7rem;
    gap: 0.5rem;
    border-radius: 8px;
  }

  .swipe-container {
    border-radius: 8px;
  }

  .session-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.6rem;
  }

  .session-icon.waiting {
    font-size: 0.85rem;
  }

  .session-name {
    font-size: 0.88rem;
  }

  .session-meta {
    font-size: 0.65rem;
  }

  .badge-claude {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }

  .session-question {
    font-size: 0.7rem;
  }

  .sq-details {
    font-size: 0.65rem;
  }

  .sessions-list {
    gap: 0.35rem;
  }

  .section-label {
    font-size: 0.65rem;
  }

  .picker-actions {
    margin-top: 0.75rem;
  }

  .picker-actions .btn-secondary {
    padding: 0.5rem 0.7rem;
    font-size: 0.75rem;
  }

  .create-session input {
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
  }

  .create-session button {
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
  }

  .passkey-panel {
    padding: 0.75rem;
    border-radius: 10px;
  }

  .passkey-panel-head {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }

  .passkey-title {
    font-size: 0.9rem;
  }

  .passkey-subtitle {
    font-size: 0.72rem;
  }

  .passkey-add {
    min-width: auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }

  .passkey-item {
    padding: 0.6rem 0.65rem;
    border-radius: 8px;
    gap: 0.5rem;
  }

  .passkey-item-label {
    font-size: 0.8rem;
  }

  .passkey-item-meta {
    font-size: 0.68rem;
  }

  .passkey-remove {
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    min-height: 32px;
    border-radius: 8px;
  }

  .usage-bar {
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    font-size: 0.65rem;
  }

  .terminal-header {
    padding: 0.35rem 0.5rem;
    min-height: 2.3rem;
  }

  #session-label {
    font-size: 0.8rem;
  }

  .terminal-header-left button,
  .terminal-header-right button {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
  }

  .quick-commands button {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    min-width: 2rem;
    border-radius: 5px;
  }

  .session-actions {
    padding: 0.35rem 0.55rem;
    border-radius: 0 0 8px 8px;
  }

  .session-option {
    padding: 0.35rem 0.65rem;
    font-size: 0.7rem;
  }

  .drag-handle {
    font-size: 1.1rem;
    padding: 0.4rem 0.25rem;
  }
}
