html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 35%, #ffffff 100%);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ============================================================
   App navbar
   ============================================================ */
.app-navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gogo-line);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gogo-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-brand:hover {
  color: var(--gogo-primary);
}

.app-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--gogo-primary) 0%, var(--gogo-violet) 100%);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3);
}

.app-brand-mark .gogo-icon {
  width: 18px;
  height: 18px;
}

.app-brand-text {
  font-size: 1.1rem;
}

.app-brand-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gogo-muted);
  letter-spacing: 0.02em;
  padding-left: 0.55rem;
  margin-left: 0.15rem;
  border-left: 1px solid var(--gogo-line);
}

@media (max-width: 575.98px) {
  .app-brand-tag {
    display: none;
  }
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gogo-body);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 9px;
  padding: 0.4rem 0.7rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-nav-link:hover,
.app-nav-link:focus {
  color: var(--gogo-primary);
  background: var(--gogo-primary-soft);
}

.app-logout {
  color: var(--gogo-rose);
}

.app-logout:hover,
.app-logout:focus {
  color: #be123c;
  background: #fff1f2;
}

.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--gogo-muted);
  background: var(--gogo-canvas);
  border: 1px solid var(--gogo-line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  margin-right: 0.25rem;
}

/* ============================================================
   Design tokens — single source of truth for the app palette
   ============================================================ */
:root {
  /* Brand */
  --gogo-primary: #4f46e5;
  --gogo-primary-dark: #4338ca;
  --gogo-primary-soft: #eef2ff;
  --gogo-violet: #7c3aed;

  /* Section accents */
  --gogo-blue: #2563eb;
  --gogo-sky: #0ea5e9;
  --gogo-amber: #f59e0b;
  --gogo-emerald: #10b981;
  --gogo-rose: #f43f5e;

  /* Neutrals */
  --gogo-ink: #0f172a;
  --gogo-body: #334155;
  --gogo-muted: #64748b;
  --gogo-faint: #94a3b8;
  --gogo-line: #e2e8f0;
  --gogo-line-soft: #eef2f7;
  --gogo-surface: rgba(255, 255, 255, 0.92);
  --gogo-surface-solid: #ffffff;
  --gogo-canvas: #f6f7fb;

  /* Shape */
  --gogo-radius-lg: 22px;
  --gogo-radius: 16px;
  --gogo-radius-sm: 11px;

  /* Elevation */
  --gogo-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --gogo-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --gogo-ring: 0 0 0 4px rgba(79, 70, 229, 0.16);
}

/* Inline SVG icons inherit colour + align with text by default */
.gogo-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.18em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-page {
  min-height: calc(100vh - 150px);
}

.chat-shell {
  max-width: 980px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4f46e5;
  font-weight: 700;
}

.chat-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #111827;
}

.chat-subtitle {
  color: #6b7280;
}

.chat-panel,
.chat-compose {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f5;
  padding: 1rem 1.2rem;
}

.chat-panel-header-start {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.chat-panel-title {
  font-size: 1rem;
  font-weight: 600;
}

.chat-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.chat-status.sending {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
  animation: pulseStatus 1.1s ease-in-out infinite;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 1rem 1.2rem;
}

.chat-empty-state {
  text-align: center;
  color: #6b7280;
  padding: 2.4rem 1.2rem;
}

.chat-empty-state h3 {
  font-size: 1.2rem;
  color: #111827;
}

.chat-row {
  display: flex;
  margin-bottom: 0.9rem;
}

.chat-row-ai {
  justify-content: flex-start;
}

.chat-row-user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(85%, 720px);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble-ai {
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.chat-bubble-user {
  color: #fff;
  border: 1px solid #4f46e5;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

.chat-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.chat-thinking {
  margin: 0.4rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.chat-thinking-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b45309;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.chat-thinking-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  color: #7c2d12;
  font-family: inherit;
}

.chat-response-text {
  white-space: pre-wrap;
}

.chat-compose {
  padding: 1rem 1.2rem;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.compose-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.compose-default {
  padding-left: 0.2rem;
}

.compose-input-row {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 0.6rem;
}

.compose-model-select,
.compose-input-row .form-control {
  min-height: 50px;
  border-radius: 12px;
  border-color: #dbe3ef;
}

.compose-input-row .btn {
  border-radius: 12px;
  min-width: 120px;
}

.compose-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.compose-actions .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

.btn-stop {
  border-radius: 12px;
  min-width: 120px;
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.btn-stop:hover,
.btn-stop:focus {
  background-color: #bb2d3b;
  border-color: #bb2d3b;
  color: #fff;
}

.btn-stop:disabled {
  opacity: 0.65;
}

.stop-icon {
  margin-right: 0.35rem;
  font-size: 0.7em;
  line-height: 1;
}

.chat-stopped-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  display: inline-block;
  width: fit-content;
}

/* ============================================================
   Chat history — left rail on desktop, drawer on small screens
   ============================================================ */
.chat-layout {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  max-width: 1246px;
  margin: 0 auto;
}

.chat-history {
  flex: 0 0 250px;
  width: 250px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.chat-history-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #edf0f5;
}

.chat-history-icon {
  color: #4f46e5;
  display: inline-flex;
}

.chat-history-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-right: auto;
  white-space: nowrap;
}

.chat-history-new {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.chat-history-new:hover,
.chat-history-new:focus {
  background: #eef2ff;
  color: #3730a3;
}

.chat-history-close {
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 8px;
}

.chat-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem;
}

.chat-history-empty {
  margin: 0.75rem 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.chat-history-item {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border-radius: 10px;
  margin-bottom: 0.15rem;
}

.chat-history-item:hover {
  background: #f3f4f6;
}

.chat-history-item.is-active {
  background: #eef2ff;
}

.chat-history-link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0.55rem 0.6rem;
  font-size: 0.85rem;
  color: #374151;
  text-decoration: none;
  border-radius: 10px;
}

.chat-history-item.is-active .chat-history-link {
  color: #3730a3;
  font-weight: 600;
}

.chat-history-link-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-delete-form {
  display: flex;
  margin: 0;
  padding-right: 0.35rem;
}

.chat-history-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #9ca3af;
  padding: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
}

.chat-history-delete:hover,
.chat-history-delete:focus {
  color: #b91c1c;
  background: #fee2e2;
}

.chat-history-backdrop,
.chat-history-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  .chat-history {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 300px);
    height: 100vh;
    border-radius: 0;
    border-left: 0;
    z-index: 1060;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.3);
  }

  .chat-history.is-open {
    transform: translateX(0);
  }

  .chat-history-close {
    display: inline-flex;
    order: 4;
  }

  .chat-history-new {
    order: 3;
  }

  .chat-history-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1050;
  }

  .chat-history-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
  }

  .chat-history-toggle:hover,
  .chat-history-toggle:focus {
    background: #eef2ff;
    color: #3730a3;
  }
}

.compose-form.is-submitting .form-control,
.compose-form.is-submitting .form-select,
.compose-form.is-submitting .form-check-input {
  pointer-events: none;
  opacity: 0.8;
}

.markdown-body .md-inline-code {
  background: #e5e7eb;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.88em;
}

.markdown-body .md-code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 0.8rem;
  margin: 0.6rem 0;
  overflow-x: auto;
}

.markdown-body .md-code-block code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.86rem;
}

.markdown-body .code-kw {
  color: #93c5fd;
  font-weight: 700;
}

@media (max-width: 768px) {
  .chat-shell {
    height: calc(100vh - 105px);
  }

  .compose-input-row {
    grid-template-columns: 1fr;
  }

  .compose-input-row > .btn {
    width: 100%;
  }

  .compose-actions {
    width: 100%;
  }

  .compose-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }
}

/* ============================================================
   Login — split panel: brand story on the left, form on right
   ============================================================ */
.login-page {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  padding: 2.5rem 0;
}

.login-shell {
  width: 100%;
  max-width: 940px;
}

.login-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: var(--gogo-radius-lg);
  overflow: hidden;
  border: 1px solid var(--gogo-line);
  background: var(--gogo-surface-solid);
  box-shadow: var(--gogo-shadow);
}

/* --- Left brand panel --- */
.login-brand {
  position: relative;
  padding: 2.75rem 2.25rem;
  color: #fff;
  background: linear-gradient(150deg, #4f46e5 0%, #6d3ff0 52%, #7c3aed 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
}

.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.login-brand::before {
  width: 240px;
  height: 240px;
  top: -90px;
  right: -80px;
}

.login-brand::after {
  width: 180px;
  height: 180px;
  bottom: -70px;
  left: -60px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.login-logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
}

.login-logo-mark .gogo-icon {
  width: 22px;
  height: 22px;
}

.login-brand-copy {
  position: relative;
  z-index: 1;
}

.login-brand-title {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.login-brand-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.7rem;
  position: relative;
  z-index: 1;
}

.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}

.login-feature-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
}

.login-feature-icon .gogo-icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.login-brand-foot {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
  position: relative;
  z-index: 1;
}

/* --- Right form panel --- */
.login-main {
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  margin-bottom: 1.5rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gogo-ink);
  margin-bottom: 0.3rem;
}

.login-subtitle {
  color: var(--gogo-muted);
  font-size: 0.92rem;
  margin: 0;
}

.login-form {
  display: grid;
  gap: 1.1rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gogo-body);
  margin: 0;
}

.form-label .required-mark {
  color: var(--gogo-rose);
  margin-left: 0.15rem;
}

/* Input with leading icon */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--gogo-faint);
  pointer-events: none;
  transition: color 0.15s ease;
}

.input-icon-wrap:focus-within .input-icon {
  color: var(--gogo-primary);
}

.login-form .form-control,
.settings-form .form-control,
.settings-form .form-select {
  min-height: 46px;
  border-radius: var(--gogo-radius-sm);
  border: 1px solid var(--gogo-line);
  background: var(--gogo-canvas);
  color: var(--gogo-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form .form-control {
  padding-left: 2.6rem;
}

.login-form .form-control.has-trailing {
  padding-right: 2.9rem;
}

.login-form .form-control:focus,
.settings-form .form-control:focus,
.settings-form .form-select:focus {
  background: var(--gogo-surface-solid);
  border-color: var(--gogo-primary);
  box-shadow: var(--gogo-ring);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gogo-muted);
  margin: 0;
}

/* Password reveal toggle */
.reveal-toggle {
  position: absolute;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gogo-faint);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.reveal-toggle:hover {
  color: var(--gogo-primary);
  background: var(--gogo-primary-soft);
}

.reveal-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--gogo-ring);
}

/* Caps-lock warning */
.caps-warning {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
}

.caps-warning.is-visible {
  display: flex;
}

.btn-login {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--gogo-radius-sm);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--gogo-primary) 0%, var(--gogo-violet) 100%);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.34);
}

.btn-login:disabled {
  opacity: 0.7;
  transform: none;
  cursor: not-allowed;
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border-radius: var(--gogo-radius-sm);
  border-width: 1px;
  font-size: 0.88rem;
}

.alert-success {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.alert-danger {
  color: #9f1239;
  background: #fff1f2;
  border-color: #fecdd3;
}

.lockout-countdown {
  margin-left: auto;
  padding-left: 0.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

@media (max-width: 860px) {
  .login-card {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }

  .login-brand {
    padding: 1.85rem 1.6rem;
  }

  /* Keep the brand panel compact on phones */
  .login-features,
  .login-brand-text {
    display: none;
  }

  .login-main {
    padding: 1.85rem 1.6rem;
  }
}

/* ============================================================
   Settings — page header + sectioned cards with accent icons
   ============================================================ */
.settings-page {
  min-height: calc(100vh - 140px);
  padding: 2.5rem 0 3rem;
}

.settings-shell {
  max-width: 860px;
}

/* --- Page header --- */
.settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.settings-hero-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--gogo-primary) 0%, var(--gogo-violet) 100%);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.28);
}

.settings-hero-icon .gogo-icon {
  width: 26px;
  height: 26px;
}

.settings-hero-text {
  flex: 1;
  min-width: 0;
}

.settings-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gogo-primary);
  margin-bottom: 0.2rem;
}

.settings-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gogo-ink);
  margin-bottom: 0.25rem;
}

.settings-subtitle {
  color: var(--gogo-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* --- Section card --- */
.settings-section {
  border-radius: var(--gogo-radius);
  border: 1px solid var(--gogo-line);
  background: var(--gogo-surface-solid);
  box-shadow: var(--gogo-shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid var(--gogo-line-soft);
  background: var(--gogo-canvas);
}

.settings-section-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #fff;
}

.settings-section-icon .gogo-icon {
  width: 19px;
  height: 19px;
}

.settings-section-text {
  flex: 1;
  min-width: 0;
}

.settings-section-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--gogo-ink);
  margin: 0;
}

.settings-section-desc {
  font-size: 0.8rem;
  color: var(--gogo-muted);
  margin: 0.1rem 0 0;
}

/* Accent colour variants */
.accent-blue {
  background: linear-gradient(135deg, var(--gogo-blue) 0%, var(--gogo-sky) 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.accent-amber {
  background: linear-gradient(135deg, #d97706 0%, var(--gogo-amber) 100%);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.28);
}

.accent-slate {
  background: linear-gradient(135deg, #475569 0%, #64748b 100%);
  box-shadow: 0 8px 18px rgba(100, 116, 139, 0.26);
}

.settings-section-body {
  padding: 1.35rem;
}

.settings-form {
  display: grid;
  gap: 1.15rem;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--gogo-line-soft);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gogo-primary) 0%, var(--gogo-violet) 100%);
  border: 0;
  border-radius: var(--gogo-radius-sm);
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.3);
}

.btn-secondary-ghost {
  color: var(--gogo-body);
  background: var(--gogo-surface-solid);
  border: 1px solid var(--gogo-line);
  border-radius: var(--gogo-radius-sm);
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-secondary-ghost:hover {
  color: var(--gogo-primary);
  border-color: var(--gogo-primary);
  background: var(--gogo-primary-soft);
}

.btn-amber {
  color: #fff;
  background: linear-gradient(135deg, #d97706 0%, var(--gogo-amber) 100%);
  border: 0;
  border-radius: var(--gogo-radius-sm);
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.26);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-amber:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(217, 119, 6, 0.32);
}

/* --- Status pill --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

.status-pill.online {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-pill.offline {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

/* --- Password strength meter --- */
.strength-meter {
  display: grid;
  gap: 0.4rem;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.strength-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--gogo-line);
  transition: background 0.25s ease;
}

.strength-bar.is-on-weak {
  background: #ef4444;
}

.strength-bar.is-on-fair {
  background: #f59e0b;
}

.strength-bar.is-on-good {
  background: #10b981;
}

.strength-bar.is-on-strong {
  background: #059669;
}

.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gogo-muted);
}

.strength-label.is-weak {
  color: #b91c1c;
}

.strength-label.is-fair {
  color: #b45309;
}

.strength-label.is-good,
.strength-label.is-strong {
  color: #047857;
}

/* --- Info rows --- */
.info-grid {
  display: grid;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--gogo-line-soft);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-key {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gogo-body);
  font-size: 0.9rem;
  font-weight: 500;
}

.info-key .gogo-icon {
  color: var(--gogo-faint);
}

.info-value {
  font-size: 0.9rem;
  color: var(--gogo-muted);
  font-weight: 500;
  text-align: right;
}

@media (max-width: 640px) {
  .settings-hero {
    flex-direction: column;
  }

  .settings-section-body,
  .settings-section-head {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .settings-actions .btn,
  .settings-actions .btn-secondary-ghost {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@keyframes pulseStatus {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}