@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #f2f5fa;
  --bg-accent: #e8eef9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-muted: #475569;
  --brand: #0f4c81;
  --brand-strong: #0b3a63;
  --brand-soft: #dbeafe;
  --border: #d5dde8;
  --danger: #b91c1c;
  --focus: #0f4c81;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 100% -10%, var(--bg-accent), transparent 65%),
    linear-gradient(180deg, var(--surface-soft) 0%, var(--bg) 72%);
}

.skip-link {
  position: absolute;
  left: 0.6rem;
  top: -40px;
  background: var(--brand-strong);
  color: #ffffff;
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.6rem;
}

.top-bar {
  background: linear-gradient(90deg, #0b223f 0%, #123a63 55%, #0f4c81 100%);
  color: #f9fafb;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(2, 8, 23, 0.18);
}

.top-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  color: #f8fafc;
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.2rem;
  border-radius: 0.45rem;
}

.logo.is-active {
  background: rgba(255, 255, 255, 0.12);
}

.nav a {
  color: #dbeafe;
  text-decoration: none;
  margin-left: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.nav a:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.nav a.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav-auth a {
  color: #e6f0ff;
  text-decoration: none;
}

.nav-auth a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.35rem;
  border-right: 1px solid rgba(191, 219, 254, 0.5);
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  border: 1px solid #7fa8d1;
  background: #1c4e80;
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
}

.lang-link:hover {
  background: #2767a2;
  border-color: #bfdbfe;
  color: #ffffff;
  text-decoration: none;
}

.lang-link.is-active {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0b3a63;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(15, 58, 99, 0.12);
}

.page-content {
  max-width: 1280px;
  margin: 1.8rem auto;
  padding: 0 1rem 4rem 1rem;
}

.panel {
  background: var(--surface);
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  padding: 1.05rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.panel h1, .panel h2 {
  margin-top: 0;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.workspace-hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(15, 76, 129, 0.16), transparent 36%),
    linear-gradient(135deg, #f8fbff 0%, #edf5ff 48%, #ffffff 100%);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.workspace-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.workspace-copy h1,
.workspace-copy h2 {
  margin: 0 0 0.75rem 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.workspace-copy p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.workspace-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 76, 129, 0.14);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.workspace-hero-side {
  display: grid;
  gap: 0.75rem;
}

.workspace-highlight-card {
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #0b223f 0%, #123a63 60%, #153d66 100%);
  color: #f8fafc;
  box-shadow: 0 20px 38px rgba(11, 34, 63, 0.22);
}

.workspace-highlight-card h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
}

.workspace-highlight-card p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.55;
}

.workspace-highlight-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.workspace-highlight-meta > div {
  padding: 0.75rem 0.8rem;
  border-radius: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
}

.workspace-highlight-meta strong {
  display: block;
  font-size: 1rem;
}

.workspace-highlight-meta span {
  display: block;
  margin-bottom: 0.2rem;
  color: #bfdbfe;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-login .page-content {
  max-width: 1180px;
  padding-bottom: 4.5rem;
}

.login-shell {
  display: flex;
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.92fr);
  gap: 1.15rem;
  width: 100%;
  padding: 1.2rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(15, 76, 129, 0.14), transparent 38%),
    linear-gradient(135deg, #f8fbff 0%, #edf5ff 48%, #ffffff 100%);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.08);
}

.login-stage,
.login-copy {
  display: grid;
  gap: 0.95rem;
  min-width: 0;
}

.login-eyebrow {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-highlight-card .login-eyebrow {
  color: #bfdbfe;
}

.login-highlight-card {
  display: grid;
  gap: 0.7rem;
  min-height: 240px;
}

.login-highlight-card h1,
.login-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.login-subtitle {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.68;
}

.login-highlight-card .login-subtitle {
  color: #dbeafe;
}

.login-guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 0.85rem;
}

.login-guide-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border-radius: 1.05rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.login-guide-card-compact {
  align-content: start;
}

.login-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.login-guide-kicker {
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.login-step-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
}

.login-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  border: 1px solid rgba(15, 76, 129, 0.14);
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.login-step-item strong {
  display: block;
  margin-bottom: 0.16rem;
  font-size: 0.95rem;
}

.login-step-item p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.login-benefit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.login-benefit-list li {
  display: grid;
  gap: 0.18rem;
}

.login-benefit-list strong {
  font-size: 0.92rem;
}

.login-benefit-list span {
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.login-pill-row {
  margin-top: 0;
}

.login-destination-note {
  display: grid;
  gap: 0.35rem;
  max-width: 34rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.login-destination-label {
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-destination-note code {
  word-break: break-word;
  white-space: normal;
  color: var(--ink);
}

.login-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.login-access-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 28rem;
}

.login-card {
  align-self: stretch;
  margin: 0;
  padding: 1.15rem 1.15rem 1.1rem 1.15rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
}

.login-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.68rem;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  border: 1px solid rgba(15, 76, 129, 0.12);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.login-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(15, 76, 129, 0.06);
}

.login-card-header {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.95rem;
}

.login-mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  color: var(--brand-strong);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.login-mode-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.84);
}

.login-mode-link.is-active {
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.login-form-subtitle {
  margin: 0;
  line-height: 1.6;
}

.login-inline-note {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 0.98rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.78) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.login-inline-note strong {
  color: var(--brand-strong);
  font-size: 0.92rem;
}

.login-alert {
  margin-top: 0.9rem;
  padding: 0.78rem 0.9rem;
  border-radius: 0.85rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-alert.is-success,
.login-alert.is-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.login-alert.is-warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 1rem;
}

.login-fields {
  display: grid;
  gap: 0.8rem;
}

.login-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.login-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0.2rem 0.18rem 0.78rem;
  border-radius: 0.92rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.login-fields input {
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  min-width: 0;
}

.login-fields input:focus {
  outline: none;
}

.login-input-action {
  flex: 0 0 auto;
  min-width: 4.6rem;
  padding: 0.48rem 0.72rem;
  border: 0;
  border-radius: 0.75rem;
  background: rgba(15, 76, 129, 0.08);
  color: var(--brand-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.login-code-input {
  letter-spacing: 0.22em;
  text-align: center;
  font-weight: 700;
}

.login-helper-note {
  margin-top: -0.15rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.login-remember-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.55) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.login-remember-row input {
  margin-top: 0.18rem;
}

.login-remember-copy {
  display: grid;
  gap: 0.18rem;
}

.login-remember-title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-remember-help {
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.login-form-actions {
  display: grid;
  gap: 0.7rem;
}

.login-primary-actions {
  display: grid;
}

.login-form-actions .btn-primary {
  width: 100%;
  min-height: 2.8rem;
  font-size: 0.96rem;
}

.login-signup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.login-signup-copy {
  display: grid;
  gap: 0.2rem;
}

.login-signup-copy strong {
  color: var(--brand-strong);
  font-size: 0.92rem;
}

.login-signup-copy span {
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.login-signup-cta {
  width: auto;
  min-height: 2.55rem;
  border-color: rgba(15, 76, 129, 0.22);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-signup-cta:hover {
  background: linear-gradient(180deg, #eef6ff 0%, #e0efff 100%);
  text-decoration: none;
}

.login-secondary-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.15rem;
}

.login-secondary-link {
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 600;
}

.login-bootstrap-hint {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(15, 76, 129, 0.08);
}

.login-bootstrap-hint summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-bootstrap-hint p {
  margin: 0.55rem 0 0 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.password-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.workspace-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.workspace-stat-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.workspace-stat-card strong {
  display: block;
  margin-top: 0.28rem;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.15;
}

.workspace-stat-card span {
  display: block;
}

.workspace-stat-label {
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-stat-note {
  margin-top: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.workspace-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.workspace-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 76, 129, 0.12);
  color: var(--brand-strong);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.workspace-nav a:hover {
  border-color: rgba(15, 76, 129, 0.28);
  background: #ffffff;
}

.workspace-section {
  padding: 1.15rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.workspace-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}

.workspace-section-head h2,
.workspace-section-head h3 {
  margin: 0.08rem 0 0.3rem 0;
}

.workspace-section-head p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.workspace-note {
  padding: 0.78rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid #cfe2ff;
  background: #eff6ff;
  color: var(--brand-strong);
}

.workspace-note.is-warn {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.workspace-note.is-danger {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.workspace-note.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.workspace-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.workspace-kpi-card {
  padding: 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.workspace-kpi-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  line-height: 1.15;
}

.workspace-kpi-card .muted {
  font-size: 0.82rem;
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.workspace-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.workspace-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.workspace-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.workspace-table-shell {
  overflow: hidden;
  border-radius: 0.95rem;
  border: 1px solid #dbe4ef;
  background: #ffffff;
}

.workspace-table-shell table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.workspace-table-shell th,
.workspace-table-shell td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.workspace-table-shell th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
}

.workspace-empty {
  padding: 1rem;
  border-radius: 0.95rem;
  border: 1px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-muted);
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filters-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 180px;
}

.filters-row input,
.filters-row select,
.filters-row textarea {
  padding: 0.35rem 0.45rem;
  border-radius: 0.7rem;
  border: 1px solid #cbd5e1;
  min-width: 120px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.filters-fieldset {
  border-radius: 0.95rem;
  border: 1px solid #dbe4ef;
  padding: 0.8rem 0.95rem 0.95rem 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.filters-fieldset legend {
  padding: 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-strong);
}

.filters-actions {
  margin-top: 0.5rem;
}

.filters-actions button {
  padding: 0.55rem 1rem;
  border-radius: 0.7rem;
  border: none;
  background-color: var(--brand);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.filters-actions button:hover {
  background-color: var(--brand-strong);
}

.summary-list {
  list-style: none;
  padding-left: 0;
}

.summary-list li {
  margin-bottom: 0.25rem;
  line-height: 1.55;
}

.footer {
  text-align: center;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Buttons used in templates */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background-color: var(--brand);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--brand-strong);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.72rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.btn-icon:hover {
  background: #f3f4f6;
}

.btn-icon-danger {
  color: #b91c1c;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .top-bar-inner {
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
  }

  .nav a {
    margin-left: 0;
  }

  .login-hero {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .login-guide-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 1rem;
  }

  .password-recovery-grid {
    grid-template-columns: 1fr;
  }

  .login-hero-actions {
    align-items: stretch;
  }

  .login-hero-actions .btn-primary,
  .login-hero-actions .btn-secondary {
    width: 100%;
  }

  .login-signup-panel {
    grid-template-columns: 1fr;
  }

  .login-signup-cta {
    width: 100%;
  }

  .login-input-row {
    padding-right: 0.18rem;
  }

  .login-input-action {
    min-width: 4.15rem;
  }
}

.warning-inline {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-left: 0.75rem;
}

.input-warning {
  border-color: #ef4444 !important;
}

/* Scroll windows */
.scroll-window {
  overflow-y: scroll;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  scrollbar-width: auto;
  scrollbar-color: #94a3b8 #e2e8f0;
  scrollbar-gutter: stable both-edges;
}

.scroll-window::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.scroll-window::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-left: 1px solid #cbd5e1;
}

.scroll-window::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.scroll-window::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

.scroll-window-30 {
  max-height: 900px; /* ~30 rows */
}

.scroll-window-10 {
  max-height: 320px; /* ~10 rows */
}

.scroll-window-6 {
  max-height: 760px; /* tuned so scraper sources usually expose ~3 full source rows */
}

.scroll-window thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.scraper-sources-shell {
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #ffffff;
  overflow: hidden;
}

.scraper-sources-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #dbe4ef;
}

.scraper-sources-title {
  font-weight: 700;
  color: var(--ink);
}

.scraper-sources-hint {
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.scraper-sources-window {
  overflow-y: scroll;
  overflow-x: auto;
  scrollbar-width: auto;
  scrollbar-color: #475569 #dbe4ef;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

.scraper-sources-window::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.scraper-sources-window::-webkit-scrollbar-track {
  background: #dbe4ef;
  border-left: 1px solid #cbd5e1;
}

.scraper-sources-window::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  border-radius: 999px;
  border: 2px solid #dbe4ef;
}

.scraper-sources-window::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
}

.scraper-sources-table {
  min-width: 1280px;
}

.scraper-settings-group {
  margin: 1rem 0 1.25rem;
  border: 1px solid #dbe4ef;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
}

.scraper-settings-group[open] {
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.scraper-settings-group summary {
  list-style: none;
}

.scraper-settings-group summary::-webkit-details-marker {
  display: none;
}

.scraper-settings-group-head {
  padding: 0.9rem 1rem 0.85rem;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.scraper-settings-group-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.scraper-settings-group-head p {
  margin: 0;
}

.scraper-settings-group-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}

.scraper-settings-group:not([open]) .scraper-settings-group-toggle::before {
  content: "Expand";
}

.scraper-settings-group[open] .scraper-settings-group-toggle::before {
  content: "Collapse";
}

.scraper-setting-list,
.scraper-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scraper-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.95fr);
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
}

.scraper-setting-list .scraper-setting-row:first-child,
.scraper-toggle-list .scraper-toggle-row:first-child {
  border-top: none;
}

.scraper-setting-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.scraper-setting-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.scraper-setting-label {
  font-weight: 700;
  color: var(--ink);
}

.scraper-setting-default {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.76rem;
  font-weight: 700;
}

.scraper-setting-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.scraper-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.scraper-toggle-main,
.scraper-toggle-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scraper-toggle-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.scraper-toggle-main {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.scraper-setting-current {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
}

.scraper-setting-current.is-on {
  background: #dcfce7;
  color: #166534;
}

.scraper-setting-current.is-off {
  background: #fee2e2;
  color: #991b1b;
}

.scraper-setting-control-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.scraper-setting-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.96rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.scraper-setting-input::placeholder {
  color: #94a3b8;
}

.scraper-setting-help {
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
}

.scraper-setting-range {
  display: block;
  font-size: 0.78rem;
}

.scraper-setting-control-note {
  display: block;
  font-size: 0.79rem;
  line-height: 1.35;
}

.scraper-toggle-row input[type="checkbox"] {
  margin: 0;
}

@media (max-width: 900px) {
  .workspace-hero-grid,
  .workspace-grid-2,
  .workspace-grid-3,
  .workspace-grid-4,
  .workspace-stat-grid {
    grid-template-columns: 1fr;
  }

  .scraper-setting-row {
    grid-template-columns: 1fr;
  }

  .scraper-toggle-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .scraper-sources-shell-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .scraper-toggle-main {
    justify-content: flex-start;
  }
}

.history-links-window {
  max-height: 420px;
}

.history-links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-links-table th,
.history-links-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.history-links-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  z-index: 1;
}

.history-links-url {
  display: inline-block;
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-edit-form {
  margin: 0.6rem 0;
  padding: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fafafa;
}

.keyword-edit-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.keyword-edit-hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion details {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
}

.accordion summary {
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accordion .accordion-inner {
  padding: 0.75rem 0.8rem;
}

/* Make logo link look like a logo */
.logo {
  color: #f9fafb;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}


/* Small X button for row deletion */
.btn-x {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 0.45rem;
  line-height: 1.2;
  font-size: 1rem;
  cursor: pointer;
}

.btn-x:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}


/* Inline warning for empty inputs (Add supported model) */
.inline-warning {
  color: #b91c1c;
  font-weight: 600;
}

.input-empty-warning {
  border-color: #ef4444 !important;
  background: #fff1f2;
}


/* Inline form (settings row) */
.inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.inline-form label {
  margin-bottom: 0.1rem;
}

.page-history .panel,
.page-deal .panel,
.page-database .panel,
.page-market-map .panel,
.page-models .panel,
.page-scraper .panel {
  border-radius: 1rem;
  border-color: rgba(15, 76, 129, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.page-history .panel h1,
.page-deal .panel h1,
.page-database .panel h1,
.page-market-map .panel h1,
.page-models .panel h1,
.page-scraper .panel h1 {
  font-size: 1.65rem;
}

.database-json-block {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  border: 1px solid #dbe4ef;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  font-size: 0.84rem;
  line-height: 1.55;
  max-height: 260px;
  overflow: auto;
}

.database-group-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.database-group-a {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.database-group-b {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.database-group-c {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.database-group-d {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #334155;
}

.database-era-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.database-era-pill.is-legacy {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.database-era-pill.is-current {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.database-era-pill.is-unknown {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}

.database-table-preview-window {
  max-height: 440px;
  overflow: auto;
}

.database-preview-table {
  min-width: 720px;
}

.database-preview-cell {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.database-accordion-window {
  max-height: 440px;
  overflow: auto;
  border: 1px solid #dbe4ef;
  border-radius: 0.95rem;
  background: #ffffff;
}

.database-selection-window {
  max-height: 240px;
  overflow: auto;
}

.database-diagnostics-window {
  max-height: 540px;
  overflow: auto;
  padding-right: 0.2rem;
}

.database-diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.database-diagnostic-pack {
  border: 1px solid #dbe4ef;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 0.95rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.database-diagnostic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.database-diagnostic-head h3 {
  margin: 0;
  font-size: 1rem;
}

.database-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.database-status-pill.is-pass {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.database-status-pill.is-warn {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.database-status-pill.is-fail {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.database-table-health-window {
  max-height: 540px;
  overflow: auto;
}

.database-profile-window {
  max-height: 520px;
  overflow: auto;
}

.database-relations-window {
  max-height: 520px;
  overflow: auto;
}

.database-query-shell {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #dbe4ef;
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.72) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.database-query-editor {
  width: 100%;
  min-height: 8.5rem;
  resize: vertical;
  padding: 0.9rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.9rem;
  background: #0f172a;
  color: #e2e8f0;
  font: 0.92rem/1.5 "Cascadia Code", "Consolas", monospace;
}

.database-query-editor:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  border-color: #60a5fa;
}

.database-query-hints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.database-query-examples {
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.86rem/1.5 "Cascadia Code", "Consolas", monospace;
  color: #0f172a;
}

.database-query-reference-window {
  max-height: 280px;
  overflow: auto;
  margin-top: 0.85rem;
}

.database-access-note {
  margin-bottom: 1rem;
}

.database-user-card,
.database-user-table-shell {
  padding: 1rem;
}

.database-user-form {
  display: grid;
  gap: 0.85rem;
}

.database-user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.database-user-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: #0f172a;
}

.database-user-form input[type="text"],
.database-user-form input[type="password"] {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.database-user-form input[type="text"]:focus,
.database-user-form input[type="password"]:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: #60a5fa;
}

.database-user-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  color: #334155;
}

.database-user-form-actions {
  display: flex;
  justify-content: flex-start;
}

.database-user-table-shell {
  margin-top: 1rem;
}

.database-user-table-window {
  max-height: 520px;
  overflow: auto;
}

.database-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.database-user-actions form {
  margin: 0;
}

.database-user-guard {
  margin-top: 0.45rem;
  max-width: 26rem;
}

.database-user-email-form {
  display: grid;
  gap: 0.4rem;
}

.database-user-email-form input[type="email"] {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

[data-database-cleaner-panel].is-loading {
  opacity: 0.65;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.database-inline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.database-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 700;
}

.database-mini-badge.is-accent {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.database-top-values-cell {
  min-width: 220px;
  max-width: 340px;
  white-space: normal;
  word-break: break-word;
}

.database-note-cell {
  min-width: 220px;
}

.inline-status {
  margin-left: 0.5rem;
  font-weight: 600;
  color: #065f46;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.95fr);
  gap: 1.2rem;
  padding: 1.45rem;
  background:
    radial-gradient(circle at top right, rgba(15, 76, 129, 0.16), transparent 35%),
    linear-gradient(135deg, #f8fbff 0%, #eff6ff 45%, #ffffff 100%);
  overflow: hidden;
}

.home-hero-copy,
.home-hero-status,
.home-hero-chat {
  min-width: 0;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.1);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 11ch;
}

.home-lead {
  max-width: 62ch;
  margin: 0 0 1.1rem 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.home-cta-primary,
.home-cta-secondary {
  text-decoration: none;
}

.home-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.home-mini-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 92px;
  padding: 0.9rem 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 76, 129, 0.28);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.home-mini-card strong {
  font-size: 0.95rem;
}

.home-mini-card span {
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.home-status-shell {
  height: 100%;
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #0b223f 0%, #123a63 55%, #153d66 100%);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(11, 34, 63, 0.24);
}

.home-assistant-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background:
    radial-gradient(circle at top right, rgba(148, 197, 255, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.1);
}

.home-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.home-assistant-head strong {
  display: block;
  max-width: 26ch;
  line-height: 1.4;
}

.home-assistant-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background: rgba(15, 76, 129, 0.08);
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.home-assistant-feed {
  flex: 1;
  max-height: none;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.1);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.9) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.home-assistant-chip-row {
  margin-top: 0;
}

.home-assistant-composer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.home-assistant-input-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.home-assistant-placeholder {
  color: var(--ink-muted);
  line-height: 1.5;
}

.home-assistant-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.home-status-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
}

.home-status-kicker {
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.home-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.78rem 0.82rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(191, 219, 254, 0.18);
}

.home-stat-label,
.home-band-label {
  color: #bfdbfe;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-stat-value {
  font-size: 1.08rem;
  line-height: 1.2;
}

.home-stat-value.is-good {
  color: #86efac;
}

.home-stat-value.is-bad {
  color: #fca5a5;
}

.home-stat-note {
  color: #dbeafe;
  font-size: 0.82rem;
  line-height: 1.4;
}

.home-status-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.home-status-band > div {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.75rem 0.82rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
}

.home-section {
  margin-top: 1.15rem;
}

.assistant-handoff-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.assistant-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.assistant-banner-copy strong {
  color: var(--brand-strong);
}

.assistant-shell {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
}

.assistant-shell-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.72rem 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0b223f 0%, #123a63 55%, #0f4c81 100%);
  color: #f8fafc;
  box-shadow: 0 18px 34px rgba(11, 34, 63, 0.24);
  cursor: pointer;
  font-weight: 700;
}

.assistant-panel {
  width: min(420px, calc(100vw - 2rem));
  height: min(80vh, 760px);
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid rgba(15, 76, 129, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

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

.assistant-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1rem 0.9rem 1rem;
  border-bottom: 1px solid rgba(15, 76, 129, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.92) 100%);
}

.assistant-panel-subtitle {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.assistant-feed {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1rem 0.85rem 1rem;
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.3), transparent 28%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.52) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.assistant-message {
  max-width: 88%;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 76, 129, 0.1);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.assistant-message-assistant {
  align-self: flex-start;
  border-top-left-radius: 0.45rem;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.assistant-message-user {
  align-self: flex-end;
  border-top-right-radius: 0.45rem;
  border-color: rgba(15, 76, 129, 0.22);
  background: linear-gradient(135deg, #0f4c81 0%, #123a63 100%);
  color: #f8fafc;
  box-shadow: 0 18px 34px rgba(15, 76, 129, 0.18);
}

.assistant-message-meta {
  margin-bottom: 0.35rem;
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.assistant-message-user .assistant-message-meta {
  color: #bfdbfe;
}

.assistant-message-body {
  line-height: 1.55;
}

.assistant-message-note {
  margin-top: 0.55rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.assistant-message-note.is-warn {
  color: #9a3412;
}

.assistant-message-user .assistant-message-note {
  color: #dbeafe;
}

.assistant-message-user .assistant-message-note.is-warn {
  color: #fed7aa;
}

.assistant-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.assistant-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 129, 0.14);
  background: #ffffff;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
}

.assistant-chip:hover {
  text-decoration: none;
  background: #eff6ff;
}

.assistant-chip-row-prompts {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 1rem 0.35rem 1rem;
}

.assistant-chip-row-prompts .assistant-chip {
  padding: 0.28rem 0.56rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.assistant-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.72rem 1rem 0.9rem 1rem;
  border-top: 1px solid rgba(15, 76, 129, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.assistant-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assistant-input {
  width: 100%;
  min-height: 4.2rem;
  max-height: 8.2rem;
  resize: vertical;
  box-sizing: border-box;
  padding: 0.65rem 0.78rem;
  border-radius: 0.9rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  font: 0.88rem/1.4 "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.assistant-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.assistant-status {
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.assistant-status[data-kind="error"] {
  color: #991b1b;
}

.assistant-status[data-kind="ok"] {
  color: #166534;
}

.page-home .assistant-panel {
  width: min(450px, calc(100vw - 2rem));
}

.home-section-head {
  margin-bottom: 0.9rem;
}

.home-section-head h2 {
  margin: 0.1rem 0 0.45rem 0;
}

.home-section-head p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.home-feature-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.09);
}

.home-feature-card.is-buyer:hover { border-color: #2563eb; }
.home-feature-card.is-history:hover { border-color: #0f766e; }
.home-feature-card.is-map:hover { border-color: #9333ea; }
.home-feature-card.is-models:hover { border-color: #d97706; }
.home-feature-card.is-scraper:hover { border-color: #dc2626; }

.home-feature-tag {
  align-self: flex-start;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-feature-card h3 {
  margin: 0.9rem 0 0.5rem 0;
}

.home-feature-card p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
  flex: 1;
}

.home-feature-link {
  margin-top: 0.9rem;
  font-weight: 700;
  color: var(--brand-strong);
}

.home-workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.home-workflow-step {
  position: relative;
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.home-workflow-index {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.home-workflow-step h3 {
  margin: 0 0 0.4rem 0;
}

.home-workflow-step p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.home-workflow-step a {
  color: var(--brand-strong);
  font-weight: 600;
}

/* Muted text helper */
.muted {
  color: #6b7280;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-assistant-head {
    flex-direction: column;
  }

  .home-mini-grid,
  .home-status-grid,
  .home-status-band,
  .home-workflow {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .workspace-hero,
  .workspace-section {
    padding: 1rem;
  }

  .home-feature-grid,
  .home-mini-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 1.1rem;
  }

  .home-hero h1 {
    max-width: none;
  }

  .home-assistant-input-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .assistant-shell {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
  }

  .assistant-shell-toggle {
    width: 100%;
  }

  .assistant-panel {
    width: 100%;
  }
}

.workspace-save-panel {
  display: grid;
  gap: 1rem;
}

.workspace-save-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.workspace-save-form {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.03);
}

.workspace-save-helper {
  margin: 0.35rem 0 0;
  color: #475569;
}

.workspace-save-notice {
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  font-weight: 600;
}

.workspace-save-notice.is-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: #166534;
}

.workspace-save-notice.is-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #991b1b;
}

.home-guest-note {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: #475569;
  font-size: 0.98rem;
}

.home-saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.home-saved-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.home-saved-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.11);
}

.home-saved-kind {
  display: inline-flex;
  width: fit-content;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-saved-card p,
.home-saved-empty p {
  margin: 0;
  color: #475569;
}

.home-saved-meta {
  color: #64748b;
  font-size: 0.82rem;
}

.home-saved-empty {
  display: grid;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .workspace-save-form {
    flex-direction: column;
    align-items: stretch;
  }
}
