/* ==========================================================================
   Review Butler — Production-Grade Design System (2026 Standards)
   ========================================================================== */

:root {
  color-scheme: light;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Semantic Color System */
  --surface-canvas: #f6f8f7;
  --surface-panel: #ffffff;
  --surface-card: #ffffff;
  --surface-subtle: #f8faf9;
  --surface-hover: #f1f5f3;
  --surface-active: #e8f0eb;

  /* Deep Forest Sidebar Palette */
  --sidebar-bg-start: #0e2219;
  --sidebar-bg-end: #071510;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-surface: rgba(255, 255, 255, 0.04);
  --sidebar-surface-hover: rgba(255, 255, 255, 0.08);
  --sidebar-surface-active: rgba(255, 255, 255, 0.14);
  --sidebar-text: #f7fbf8;
  --sidebar-text-muted: rgba(247, 251, 248, 0.65);

  /* Primary Brand (Emerald Heritage) */
  --brand-primary: #059669;
  --brand-hover: #047857;
  --brand-active: #065f46;
  --brand-surface: #ecfdf5;
  --brand-border: #a7f3d0;
  --brand-text: #065f46;

  /* Neutrals & Borders */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* Status Tokens */
  --green: #059669;
  --green-dark: #064e3b;
  --mist: #ecfdf5;
  --gold: #d97706;
  --amber: #b45309;
  --rose: #dc2626;
  --blue: #2563eb;

  /* Shadows (Multi-layered 2026 Lighting) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Micro-interactions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  font-family: var(--font-sans);
}
/* ==========================================================================
   Base & Reset
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

h1, h2, h3, h4, h5, h6, p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: inherit;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: currentColor;
  opacity: 0.72;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   App Shell & Architecture
   ========================================================================== */

.app-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 270px minmax(0, 1fr);
}

/* ==========================================================================
   Sidebar Navigation & Context
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 20px;
  background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
}

.sidebar .brand .eyebrow {
  color: #34d399;
  opacity: 1;
  font-weight: 800;
}

.sidebar .brand h1 {
  font-size: 22px;
  color: #ffffff;
}

/* Organization Block */
.tenant-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
}

.tenant-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tenant-header-row .label {
  margin: 0;
  font-size: 10.5px;
}

.tenant-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  max-width: 130px;
  padding: 3px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.tenant-select:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.tenant-block strong {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-place-label {
  color: var(--sidebar-text-muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.active-place-label strong {
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

/* Sidebar Connector & Google Integration */
.sidebar-connector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-connector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-connector-header .label {
  margin: 0;
  color: #94a3b8;
}

.connection-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.35;
  background: var(--sidebar-surface);
}

.connection-pill::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  flex-shrink: 0;
}

.diagnostic-box {
  padding: 8px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.diagnostic-copy {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.diagnostic-copy:hover {
  background: var(--sidebar-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.diagnostic-copy:active {
  transform: translateY(1px);
}

.google-connect-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.google-connect-button:hover {
  background: #f8fafd;
  border-color: #c6c9cc;
  box-shadow: var(--shadow-md);
  color: #202124;
}

.google-connect-button:active {
  transform: translateY(1px);
  background: #f1f3f4;
}

.google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Places Sidebar Section */
.places-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.places-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.places-header .label {
  margin: 0;
}

.add-place-trigger {
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: #a7f3d0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  transition: all var(--transition-fast);
}

.add-place-trigger:hover {
  background: var(--sidebar-surface-hover);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.places-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.place-item-chip {
  align-items: center;
  background: var(--sidebar-surface);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
  cursor: pointer;
  display: flex;
  font-size: 12.5px;
  justify-content: space-between;
  padding: 7px 10px;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.place-item-chip:hover {
  background: var(--sidebar-surface-hover);
  color: #ffffff;
}

.place-item-chip.active {
  background: var(--sidebar-surface-active);
  border-color: rgba(255, 255, 255, 0.15);
  border-left-color: #34d399;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.place-chip-badge {
  background: rgba(5, 150, 105, 0.4);
  color: #a7f3d0;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.place-item-chip:not(.has-mapping) .place-chip-badge {
  background: rgba(217, 119, 6, 0.35);
  color: #fde68a;
}

.place-empty-hint {
  color: var(--sidebar-text-muted);
  font-size: 11.5px;
  line-height: 1.4;
  padding: 8px 4px;
}

/* Views Navigation */
.side-nav {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.nav-item {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text-muted);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--sidebar-surface-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-surface-active);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Workspace Main Layout
   ========================================================================== */

.workspace {
  min-width: 0;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Topbar Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-place-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.place-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.place-heading-row h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.active-place-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--brand-surface);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
}

.active-place-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Topbar Actions Toolbar */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-actions .secondary-button {
  min-height: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.refresh-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Joined User Profile Widget & Avatar Trigger */
.user-avatar-trigger,
.user-profile-badge.joined {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: var(--shadow-xs);
  padding: 0 12px 0 6px;
  cursor: pointer;
  color: var(--ink);
  transition: all var(--transition-fast);
}

.user-avatar-trigger:hover,
.user-profile-badge.joined:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.user-avatar-trigger:focus-visible,
.user-profile-badge.joined:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.user-avatar-trigger .chevron-icon {
  color: var(--muted);
  transition: transform var(--transition-fast);
  margin-left: 2px;
}

.user-avatar-trigger:hover .chevron-icon {
  color: var(--ink);
  transform: translateY(1px);
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: transparent;
  user-select: none;
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8f0ec;
  border: 1.5px solid #a7d3b6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar-icon {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
}

.user-display-name {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.user-signout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.user-signout-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.user-signout-btn:active {
  background: #fee2e2;
}

.user-signout-btn:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

.signout-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.google-signin-btn:hover {
  background: #f8fafd;
  border-color: #c6c9cc;
  box-shadow: var(--shadow-sm);
  color: #202124;
}

.google-signin-btn:active {
  transform: translateY(1px);
  background: #f1f3f4;
}

/* ==========================================================================
   Metrics Section (Cards Grid)
   ========================================================================== */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
  transition: background var(--transition-fast);
}

.metric:nth-child(1)::after { background: #3b82f6; } /* Prepared */
.metric:nth-child(2)::after { background: #f59e0b; } /* Caution */
.metric:nth-child(3)::after { background: #ef4444; } /* Critical */
.metric:nth-child(4)::after { background: #10b981; } /* Approved */

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.metric-value {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   3-Column Review Layout Panels
   ========================================================================== */

.review-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(380px, 1.35fr) minmax(240px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.review-list-panel,
.detail-panel,
.audit-panel {
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  min-height: 600px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.panel-heading h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.panel-heading span {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafbfb;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.search-input-wrapper input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-wrapper input[type="search"]:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.filter-controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-select {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.filter-select:hover {
  border-color: var(--line-strong);
}

.filter-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

/* Review List */
.review-list {
  display: flex;
  flex-direction: column;
}

.review-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.review-row:hover {
  background: var(--surface-subtle);
}

.review-row.answered {
  background: #f0fdf4;
  border-left-color: #86efac;
}

.review-row.answered:hover {
  background: #e2f9eb;
}

.review-row.answered.active {
  background: #dcfce7;
  border-left-color: #15803d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.review-row.unanswered {
  background: #fef2f2;
  border-left-color: #fca5a5;
}

.review-row.unanswered:hover {
  background: #fee7e7;
}

.review-row.unanswered.active {
  background: #fee2e2;
  border-left-color: #b91c1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.review-stars-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #d97706;
  line-height: 1;
}

.review-stars-badge .rating-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  margin-left: 2px;
}

.review-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.review-row p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.row-meta,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: var(--radius-full);
  padding: 0 8px;
  background: var(--mist);
  color: var(--brand-text);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip.critical {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.chip.caution {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.chip.safe {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.star-chip {
  color: #d97706;
  font-weight: 700;
  background: #fef3c7;
  border-color: #fde68a;
}

.review-date-chip {
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 500;
  margin-left: auto;
}

.list-empty {
  padding: 36px 20px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

/* ==========================================================================
   Detail Panel (Response Studio)
   ========================================================================== */

.detail-panel {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-state,
.empty-detail {
  display: grid;
  min-height: 520px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}

.review-timestamp {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.stars {
  color: #f59e0b;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.review-copy {
  border-left: 3px solid #cbd5e1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

/* AI Analysis & Routing Card */
.internal-note,
.routing-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.internal-note strong,
.routing-box strong {
  color: var(--ink);
}

/* Draft Editor */
.draft-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.draft-editor label {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

.draft-editor textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all var(--transition-fast);
}

.draft-editor textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
  outline: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.primary-button {
  background: var(--brand-primary);
  border: 1px solid var(--brand-hover);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: var(--shadow-md);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-xs);
}

.secondary-button:hover {
  background: #f8faf9;
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary-button:active {
  transform: translateY(1px);
}

.danger-button {
  background: #ffffff;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.danger-button:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.safety-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ==========================================================================
   Activity Log Timeline Panel
   ========================================================================== */

.activity-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  list-style: none;
}

.activity-log li {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.activity-log li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid #ffffff;
}

.activity-log strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   Toast Notification Component
   ========================================================================== */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  transform: translateY(16px);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9999;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Modals & Dialogs (Glassmorphic 2026 Polish)
   ========================================================================== */

.modal-backdrop,
.wizard-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal-backdrop[hidden],
.wizard-modal-backdrop[hidden] {
  display: none !important;
}

.wizard-dialog,
.wizard-modal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-height: 90dvh;
  max-width: 640px;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  width: 100%;
}

.auth-dialog {
  max-width: 680px;
}

/* User Section Protected Modal / Drawer */
.user-section-card {
  max-width: 560px;
  width: 100%;
}

.user-section-profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.user-section-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8f0ec;
  border: 2px solid #a7d3b6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-section-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-section-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.user-section-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-section-email {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-section-tags {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.user-section-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.user-section-tag.org {
  background: #e0e7ff;
  color: #3730a3;
}

.user-section-tag.role {
  background: #dcfce7;
  color: #15803d;
}

.user-section-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.user-section-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-section-card .sidebar-connector {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-section-card .sidebar-connector-header .label {
  color: var(--ink-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-section-card .connection-pill {
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  padding: 9px 12px;
}

.user-section-card .connection-pill::before {
  background: var(--brand-primary);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.6);
}

.user-section-card .diagnostic-box {
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.user-section-card .connector-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.user-section-card .connector-actions-row .diagnostic-copy {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-section-card .connector-actions-row .diagnostic-copy:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
}

.user-section-card .connector-actions-row .google-connect-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: #3c4043;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-section-card .connector-actions-row .google-connect-button:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
}

.wizard-header,
.wizard-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.wizard-header h2,
.wizard-modal-title-group h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 0;
}

.wizard-modal-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-primary);
  letter-spacing: 0.05em;
}

.close-btn,
.wizard-close-button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.close-btn:hover,
.wizard-close-button:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.wizard-stepper {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  padding-bottom: 12px;
}

.step-badge {
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
}

.step-badge.active {
  background: var(--brand-primary);
  color: #fff;
}

.step-badge.completed {
  background: #e1ede6;
  color: var(--brand-text);
}

.wizard-alert,
.wizard-alert-box {
  background: #fdf2f1;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--rose);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  padding: 12px 16px;
}

.wizard-alert.info,
.wizard-alert-box.info {
  background: var(--brand-surface);
  border-color: var(--brand-border);
  color: var(--brand-text);
}

.wizard-alert[hidden] {
  display: none !important;
}

.wizard-form,
.token-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.form-group label .required {
  color: var(--rose);
}

.form-group input,
.form-group select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
  outline: none;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 {
  flex: 1;
}

.field-error {
  color: var(--rose);
  font-size: 12px;
  min-height: 16px;
}

.wizard-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
}

.wizard-footer.center {
  justify-content: center;
}

.wizard-loading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: center;
  padding: 30px 10px;
}

.wizard-loading[hidden] {
  display: none !important;
}

.spinner {
  animation: spin 0.8s linear infinite;
  border: 3px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--brand-primary);
  height: 20px;
  width: 20px;
}

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

.selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}

.google-import-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.google-import-panel .primary-button {
  align-self: flex-start;
  text-decoration: none;
}

.google-import-panel .wizard-footer {
  margin-top: 4px;
}

.wizard-dialog > .wizard-stepper,
.wizard-dialog > #wizardStep1,
.wizard-dialog > #wizardStep2,
.wizard-dialog > #wizardStep3,
.wizard-dialog > #wizardStep4 {
  display: none !important;
}

.selection-item {
  background: var(--surface-panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  transition: all var(--transition-fast);
}

.selection-item:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
}

.selection-item.selected {
  background: var(--brand-surface);
  border-color: var(--brand-primary);
}

.selection-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.selection-meta {
  color: var(--muted);
  font-size: 12px;
}

.selection-badge {
  background: var(--brand-surface);
  border-radius: 4px;
  color: var(--brand-text);
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  padding: 2px 6px;
  width: fit-content;
}

.match-summary-card {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 14px;
  padding: 18px;
}

.match-col h4 {
  font-size: 12.5px;
  margin: 0 0 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.match-divider {
  align-items: center;
  color: var(--brand-primary);
  display: flex;
  font-size: 24px;
  font-weight: 700;
  justify-content: center;
}

.match-dl {
  display: grid;
  gap: 6px;
  grid-template-columns: 90px 1fr;
  margin: 0;
}

.match-dl dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.match-dl dd {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
  word-break: break-word;
}

.code-font {
  font-family: var(--font-mono);
  font-size: 11px;
}

.success-banner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 10px;
  text-align: center;
}

.success-icon {
  align-items: center;
  background: var(--brand-primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 26px;
  height: 52px;
  justify-content: center;
  width: 52px;
}

/* Google Guidance Tabs & Modal */
.auth-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
}

.tab-button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.tab-button:hover {
  color: var(--ink);
}

.tab-button.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-content[hidden] {
  display: none !important;
}

.auth-instruction-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.auth-instruction-box p {
  margin: 0 0 10px;
}

.auth-instruction-box p:last-child {
  margin-bottom: 0;
}

.setup-steps {
  margin: 10px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-steps li {
  line-height: 1.45;
}

.external-link {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: underline;
}

.scope-copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 6px 0 2px;
  gap: 10px;
}

.scope-copy-box code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-hover);
  word-break: break-all;
}

.copy-scope-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-scope-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
}

.env-code-block {
  background: #0f172a;
  color: #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 6px 0 2px;
  overflow-x: auto;
  line-height: 1.5;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.auth-signin-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.auth-divider span {
  padding: 0 10px;
}

.local-login-form {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.signed-out-inbox {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.signed-out-card {
  max-width: 440px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-md);
}

.signed-out-icon {
  font-size: 40px;
  margin-bottom: 14px;
  display: inline-block;
}

.signed-out-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.signed-out-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.signed-out-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    overflow-y: visible;
  }

  .sidebar-connector {
    grid-column: 1 / -1;
  }

  .side-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .review-list-panel,
  .detail-panel,
  .audit-panel {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .sidebar,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .filter-controls-row {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }
}

/* ==========================================================================
   Onboarding & First-Screen Login View
   ========================================================================== */
.onboarding-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-canvas);
  padding: 32px 20px;
}

.onboarding-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.onboarding-container {
  max-width: 520px;
  width: 100%;
}

.onboarding-card {
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.onboarding-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.onboarding-logo-icon {
  font-size: 42px;
  margin-bottom: 12px;
  line-height: 1;
}

.onboarding-brand-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
}

.onboarding-subtitle {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.onboarding-description {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--slate-600);
  text-align: center;
  margin: 0 0 24px 0;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-dev-btn {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

.onboarding-custom-login {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.onboarding-custom-login summary {
  cursor: pointer;
  text-align: center;
  user-select: none;
}

.onboarding-custom-form {
  margin-top: 14px;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.onboarding-steps-preview {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.onboarding-step-item .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-surface);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.onboarding-step-item strong {
  font-size: 13px;
  color: var(--ink);
}

.onboarding-step-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.user-avatar-trigger > * {
  pointer-events: none;
}

.empty-inbox-connect-card {
  padding: 36px 24px;
  background: var(--surface-card, #ffffff);
  border: 1px dashed var(--line, #cbd5e1);
  border-radius: var(--radius-lg, 12px);
  text-align: center;
  margin: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-connect-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.empty-inbox-connect-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.empty-inbox-connect-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 8px;
  max-width: 320px;
}

.empty-connect-sub {
  font-size: 12px !important;
  color: var(--muted) !important;
}

.auth-flow-guidance-box {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 24px;
}

.auth-flow-guidance-box > p {
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.5;
}

.auth-flow-steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.auth-flow-step-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.auth-flow-step-row .step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-surface, #e8f0fe);
  color: var(--brand-primary, #1a73e8);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-flow-step-row strong {
  font-size: 14px;
  color: var(--ink);
}

.auth-flow-step-row p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

/* ==========================================================================
   Response Steering & Business Control Center Styles
   ========================================================================== */

/* Steering Controls Card */
.steering-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.steering-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.steering-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.steering-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.steering-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.steering-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.steering-field select,
.steering-field input,
.steering-field textarea {
  width: 100%;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
  transition: all var(--transition-fast);
}

.steering-field select:focus,
.steering-field input:focus,
.steering-field textarea:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.steering-field textarea {
  min-height: 60px;
  resize: vertical;
}

.critical-lock-indicator {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Active Grounding & Conditional Rules Badges */
.grounding-info-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
}

.grounding-info-title {
  font-weight: 700;
  color: var(--ink-secondary);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-active);
  color: var(--ink);
}

.badge-tag.rule-active {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.badge-tag.knowledge-active {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.badge-tag.voice-active {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #6b21a8;
}

/* Validation Badges and Banners */
.validation-banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.validation-banner.valid {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.validation-banner.invalid {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.validation-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.validation-violations-list {
  margin: 4px 0 0 16px;
  padding: 0;
}

.validation-violations-list li {
  margin-bottom: 2px;
}

/* Control Center Panelled Views (Profile, Knowledge, Rules) */
.control-center-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px;
}

.control-center-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.control-center-header h3 {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}

.control-center-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.profile-form-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-form-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* Knowledge & Rules Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.item-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.item-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.item-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.item-card-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
  white-space: pre-wrap;
}

.item-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--surface-canvas);
  font-size: 12px;
  color: var(--muted);
}

.item-card-actions {
  display: flex;
  gap: 6px;
}

.sm-button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sm-button:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.sm-button.danger {
  color: #b91c1c;
}

.sm-button.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.pill-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.pill-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Spinner Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning-icon {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ==========================================================================
   Refresh Progress Round Meter Modal (Large Circular Gauge)
   ========================================================================== */

.refresh-meter-dialog {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  width: 100%;
  padding: 32px 28px;
  position: relative;
  text-align: center;
  animation: meterPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes meterPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.refresh-meter-header {
  margin-bottom: 20px;
}

.refresh-meter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-primary);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.refresh-meter-badge .pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.6);
  animation: meterPulse 1.6s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes meterPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

.refresh-meter-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px 0;
  letter-spacing: -0.015em;
}

.refresh-meter-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.round-meter-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 8px auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-meter-svg {
  filter: drop-shadow(0 4px 12px rgba(5, 150, 105, 0.12));
}

.round-meter-track {
  stroke: #f1f5f9;
}

.round-meter-progress {
  transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.round-meter-center {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.round-meter-percent {
  font-size: 40px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.round-meter-stage {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 4px;
  transition: color 0.3s ease;
}

.round-meter-status-box {
  width: 100%;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.round-meter-status-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.round-meter-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.meter-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border-radius: 6px;
  transition: all 0.3s ease;
  opacity: 0.45;
}

.meter-step.active {
  opacity: 1;
  background: rgba(5, 150, 105, 0.08);
}

.meter-step.completed {
  opacity: 0.9;
}

.meter-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-light);
  transition: background 0.3s ease, transform 0.3s ease;
}

.meter-step.active .meter-step-dot {
  background: var(--brand-primary);
  transform: scale(1.25);
}

.meter-step.completed .meter-step-dot {
  background: #10b981;
}

.meter-step-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-align: center;
  line-height: 1.2;
}

.refresh-meter-footer {
  margin-top: 16px;
  width: 100%;
}

.refresh-meter-footer button {
  width: 100%;
}



/* Wizard sections must respect their hidden state despite layout display rules. */
#placeWizardModal [hidden] {
  display: none !important;
}
