/* SF Pro — system font on Apple; fallbacks for other platforms */

/* ═══════════════════════════════════════════
   DESIGN SYSTEM — PAPERLESS COP
   Dark Earth Theme with Glassmorphism
   ═══════════════════════════════════════════ */

:root {
  /* Primary Colors */
  --earth-900: #0a1612;
  --earth-800: #0f2318;
  --earth-700: #162e21;
  --earth-600: #1d3d2c;
  --earth-500: #2a5a3f;
  --earth-400: #3d8a5f;
  --earth-300: #52b87a;
  --earth-200: #7dd3a0;
  --earth-100: #b5e8c8;
  --earth-50: #e0f5e9;

  /* Accent */
  --amber-500: #E6A817;
  --amber-400: #F0B928;
  --amber-300: #F5CB4D;
  --red-500: #ef4444;
  --red-400: #f87171;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-deep: #0369A1;
  --blue-deep-light: #0284C7;

  /* Surface */
  --surface-bg: #080f0b;
  --surface-card: rgba(15, 35, 24, 0.6);
  --surface-card-hover: rgba(22, 46, 33, 0.75);
  --surface-elevated: rgba(29, 61, 44, 0.5);
  --surface-glass: rgba(42, 90, 63, 0.15);
  --surface-glass-border: rgba(82, 184, 122, 0.15);

  /* Text */
  --text-primary: #e8f5ec;
  --text-secondary: #9cb8a8;
  --text-muted: #5f8472;
  --text-accent: #52b87a;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(82, 184, 122, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Fonts */
  --font-heading: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ═══════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ═══════════════════════════════════════════ */

[data-theme="light"] {
  --surface-bg: #f3f6f4;
  --surface-card: rgba(255, 255, 255, 0.9);
  --surface-card-hover: rgba(240, 248, 243, 0.95);
  --surface-elevated: rgba(230, 242, 235, 0.85);
  --surface-glass: rgba(42, 90, 63, 0.06);
  --surface-glass-border: rgba(42, 90, 63, 0.12);

  --text-primary: #1a2e23;
  --text-secondary: #475569;
  --text-muted: #475569;
  --text-accent: #2d7a4f;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(42, 90, 63, 0.06);
}

[data-theme="light"] .bg-grid {
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(42, 90, 63, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(82, 184, 122, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 40%);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(42, 90, 63, 0.06);
}

[data-theme="light"] .header-logo {
  background: rgba(82, 184, 122, 0.1);
  border-color: rgba(42, 90, 63, 0.12);
}

[data-theme="light"] .header-user-card {
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="light"] .tab-nav {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .phase-bar {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(42, 90, 63, 0.15);
}

[data-theme="light"] .modal {
  background: #f8faf9;
}

[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .chat-channels-horizontal {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .chat-input-bar {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .resolution-content {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .review-text {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .carbon-counter {
  background: linear-gradient(135deg, rgba(230, 245, 236, 0.9), rgba(220, 240, 230, 0.8));
  border-color: rgba(82, 184, 122, 0.2);
}

[data-theme="light"] .btn {
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-primary {
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.6), transparent 55%),
              linear-gradient(135deg, var(--earth-400), var(--earth-300));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(42, 90, 63, 0.25);
}

[data-theme="light"] .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(42, 90, 63, 0.3);
}

[data-theme="light"] .btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  border-color: rgba(42, 90, 63, 0.16);
}

[data-theme="light"] .btn-secondary:hover {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-amber {
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.55), transparent 55%),
              linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(248, 181, 0, 0.35);
}

[data-theme="light"] .btn-danger {
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.6), transparent 55%),
              linear-gradient(135deg, #f97373, #ef4444);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(248, 113, 113, 0.35);
}

[data-theme="light"] .btn-success {
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.6), transparent 55%),
              linear-gradient(135deg, var(--earth-400), var(--earth-300));
}

[data-theme="light"] .btn:focus-visible {
  outline: 2px solid var(--earth-400);
  outline-offset: 2px;
}

[data-theme="light"] .phase-btn-sm {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(42, 90, 63, 0.14);
  color: var(--text-secondary);
}

[data-theme="light"] .phase-btn-sm:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .spinner-tiny {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--earth-400);
}

[data-theme="light"] .text-gradient {
  background: linear-gradient(135deg, var(--earth-500), var(--earth-400), var(--amber-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle .theme-toggle-svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

.theme-toggle:hover {
  background: var(--surface-elevated);
  transform: scale(1.06);
  border-color: rgba(82, 184, 122, 0.35);
}

/* ═══ INLINE STYLE REPLACEMENTS ═══ */
.text-strikethrough {
  text-decoration: line-through;
  opacity: 0.6;
}

.border-left-accent {
  border-left: 3px solid var(--earth-400);
  padding-left: var(--sp-md);
}

.border-left-red {
  border-left: 3px solid var(--red-500);
  padding-left: var(--sp-md);
}

.border-left-amber {
  border-left: 3px solid var(--amber-500);
  padding-left: var(--sp-md);
}

.bg-error-subtle {
  background: rgba(239, 68, 68, 0.05);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
}

.bg-success-subtle {
  background: rgba(82, 184, 122, 0.05);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
}

.bg-warning-subtle {
  background: rgba(245, 158, 11, 0.05);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
}

.font-mono {
  font-family: 'SF Mono', 'SF Pro Text', monospace;
}

/* ═══ RESET ═══ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--surface-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ ICONS (SVG sprite) ═══ */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  color: currentColor;
  flex-shrink: 0;
  shape-rendering: geometricPrecision;
}

.icon use {
  /* Some browsers ignore currentColor without explicit fill/stroke */
  fill: none;
  stroke: currentColor;
}

.icon-fill use {
  fill: currentColor;
  stroke: none;
}

.icon-xs { width: 0.75em; height: 0.75em; }
.icon-sm { width: 0.95em; height: 0.95em; }
.icon-md { width: 1.15em; height: 1.15em; }
.icon-lg { width: 1.4em; height: 1.4em; }

/* ═══ ANIMATED BACKGROUND ═══ */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(ellipse at center, rgba(10, 22, 18, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%),
    radial-gradient(ellipse at 20% 50%, rgba(42, 90, 63, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(82, 184, 122, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 40%);
  animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.8;
  }
}

/* ═══ GLASS CARDS ═══ */
.glass-card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.glass-card:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.glass-card-static {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.glass-card-elevated {
  background: var(--surface-card-hover);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card-elevated:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.glass-card-modal {
  background: var(--surface-elevated);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ═══ TYPOGRAPHY ═══ */
h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

.text-gradient {
  background: linear-gradient(135deg, var(--earth-200), var(--earth-300), var(--amber-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--text-accent);
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 0 var(--sp-lg);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}

.btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--earth-500), var(--earth-400));
  color: #f9fafb;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--earth-400), var(--earth-300));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border-color: var(--surface-glass-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #7f1d1d, var(--red-500));
  color: #fef2f2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(127, 29, 29, 0.55);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--red-500), var(--red-400));
}

.btn-success {
  background: linear-gradient(135deg, var(--earth-600), var(--earth-400));
  color: #ecfdf3;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(22, 101, 52, 0.6);
}

.btn-amber {
  background: linear-gradient(135deg, #92400e, var(--amber-500));
  color: #fffbeb;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(146, 64, 14, 0.55);
}

.btn-amber:hover {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-400));
}

.btn-sm {
  padding: 0 var(--sp-md);
  font-size: 0.75rem;
  min-height: 32px;
}

.btn-lg {
  padding: 0 var(--sp-xl);
  font-size: 1rem;
  min-height: 44px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  box-shadow: none;
}

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

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--surface-glass-border);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--surface-glass);
}

.btn:focus-visible {
  outline: 2px solid var(--earth-300);
  outline-offset: 2px;
}

/* ═══ GLOBAL FOCUS & ACCESSIBILITY ═══ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--earth-300);
  outline-offset: 2px;
}

.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--earth-500);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-nav:focus {
  top: 16px;
}

/* ═══ FORM INPUTS ═══ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0 var(--sp-md);
  background: rgba(10, 22, 18, 0.7);
  border: 1px solid var(--surface-glass-border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 40px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--earth-400);
  box-shadow: 0 0 0 1px rgba(61, 138, 95, 0.4), 0 0 0 4px rgba(61, 138, 95, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  border-radius: var(--radius-md);
  padding-top: var(--sp-md);
  padding-bottom: var(--sp-md);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%239cb8a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ═══ FORM VALIDATION ═══ */
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--red-500);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.form-helper {
  font-size: 0.75rem;
  margin-top: 4px;
  line-height: 1.4;
}

.form-helper-error {
  color: var(--red-400);
}

/* ═══ BUTTON LOADING STATE ═══ */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn-loading .btn-text {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ═══ PIN INPUT (OTP-style) ═══ */
.pin-group {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-digit {
  width: 52px;
  height: 52px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: rgba(10, 22, 18, 0.7);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  padding: 0;
}

.pin-digit:focus {
  outline: none;
  border-color: var(--earth-400);
  box-shadow: 0 0 0 1px rgba(61, 138, 95, 0.4), 0 0 0 4px rgba(61, 138, 95, 0.15);
}

.pin-digit.error {
  border-color: var(--red-500);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .pin-digit {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(42, 90, 63, 0.15);
}

/* ═══ PROGRESS STEPPER ═══ */
.progress-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--sp-lg);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  border: 2px solid var(--surface-glass-border);
  color: var(--text-muted);
  background: var(--surface-card);
  transition: all var(--transition-base);
}

.progress-step.active .progress-step-circle {
  border-color: var(--earth-300);
  color: var(--earth-300);
  background: rgba(82, 184, 122, 0.15);
}

.progress-step.completed .progress-step-circle {
  border-color: var(--earth-400);
  background: var(--earth-400);
  color: #fff;
}

.progress-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: none;
}

.progress-step-line {
  width: 40px;
  height: 2px;
  background: var(--surface-glass-border);
  margin: 0 4px;
  transition: background var(--transition-base);
}

.progress-step-line.completed {
  background: var(--earth-400);
}

@media (min-width: 640px) {
  .progress-step-label {
    display: block;
  }
  .progress-step-line {
    width: 60px;
  }
}

/* ═══ LAYOUT ═══ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ═══ BREADCRUMBS ═══ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 12px 24px;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--text-primary);
}

.breadcrumbs .separator {
  opacity: 0.4;
  font-size: 0.75rem;
}

/* ═══ HEADER ═══ */
.header {
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(10, 22, 18, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  max-width: 1200px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  min-width: 0;
  flex: 1;
}

.header-logo {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(82, 184, 122, 0.08);
  border: 1px solid rgba(82, 184, 122, 0.18);
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Right cluster: theme | divider | identity | logout */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-actions-divider {
  width: 1px;
  height: 26px;
  background: var(--surface-glass-border);
  opacity: 0.85;
  flex-shrink: 0;
}

.header-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 10px;
  min-height: 44px;
  min-width: 0;
  max-width: min(320px, 46vw);
  background: var(--surface-glass);
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-glass-border);
}

.header-flag {
  font-size: 1.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.header-country {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-logout-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full) !important;
}

/* Light-mode header identity alignment polish */
[data-theme="light"] .header-actions {
  gap: 12px;
}

[data-theme="light"] .header-user-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(42, 90, 63, 0.16);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .header-flag {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(42, 90, 63, 0.06);
  border: 1px solid rgba(42, 90, 63, 0.12);
}

[data-theme="light"] .header-country {
  color: #1a3328;
}

[data-theme="light"] .header-role {
  color: rgba(31, 77, 53, 0.72);
}

[data-theme="light"] .header-logout-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(42, 90, 63, 0.16);
  color: #2a4e3b;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

/* ═══ TAB NAVIGATION ═══ */
.tab-nav {
  display: flex;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(10, 22, 18, 0.6);
  border-bottom: 1px solid var(--surface-glass-border);
  position: relative;
}

.tab-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--tab-left, 0);
  width: var(--tab-width, 0);
  height: 2px;
  background: var(--earth-300);
  border-radius: 2px 2px 0 0;
  transition: left var(--transition-base), width var(--transition-base);
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-sm) var(--sp-md);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-glass);
}

.tab-btn.active {
  color: var(--earth-200);
  background: var(--surface-elevated);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .tab-btn {
  color: var(--text-secondary);
}

[data-theme="light"] .tab-btn:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .tab-btn.active {
  background: #e5f2ea;
  color: var(--earth-600);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
  font-weight: 700;
  border: 1px solid rgba(42, 90, 63, 0.35);
}

.tab-btn .tab-icon {
  font-size: 1rem;
}

.tab-content {
  display: none;
  padding: var(--sp-lg) var(--sp-md);
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══ BADGE ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green {
  background: rgba(82, 184, 122, 0.15);
  color: var(--earth-200);
  border: 1px solid rgba(82, 184, 122, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-300);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-400);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ═══ SPEAKERS LIST ═══ */
.speaker-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin-bottom: var(--sp-sm);
}

.speaker-item:hover {
  background: var(--surface-card-hover);
}

.speaker-item.speaking {
  border-color: var(--earth-400);
  background: rgba(42, 90, 63, 0.2);
  box-shadow: var(--shadow-glow);
}

.phase-toggle-btn .phase-num {
  background: rgba(255, 255, 255, 0.1);
  color: #e8f5ec;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Support --- */
.support-card {
  border-left: 4px solid var(--earth-500);
}

.speaker-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-elevated);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-accent);
  flex-shrink: 0;
}

.speaker-info {
  flex: 1;
  min-width: 0;
}

.speaker-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.speaker-topic {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══ CHAT ═══ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 400px;
}

.chat-channels {
  display: flex;
  gap: var(--sp-xs);
  padding: var(--sp-sm) 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.chat-channels::-webkit-scrollbar {
  display: none;
}

.channel-btn {
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-glass);
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.channel-btn:hover {
  color: var(--text-secondary);
  border-color: var(--surface-glass-border);
}

.channel-btn.active {
  color: var(--earth-200);
  background: var(--surface-elevated);
  border-color: var(--earth-400);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.chat-bubble {
  max-width: 85%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  animation: slideIn 0.2s ease;
}

.chat-bubble.own {
  align-self: flex-end;
  background: rgba(42, 90, 63, 0.3);
  border-color: rgba(82, 184, 122, 0.2);
}

.chat-sender {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--earth-300);
  margin-bottom: 2px;
}

.chat-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}

.chat-time {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-input-bar {
  display: flex;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
  flex-shrink: 0;
}

.chat-input-bar .form-input {
  flex: 1;
}

/* ═══ RESOLUTION EDITOR ═══ */
.resolution-card {
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.resolution-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.resolution-meta {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}

.resolution-content {
  padding: var(--sp-md);
  background: rgba(10, 22, 18, 0.5);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.7;
}

.resolution-content h1,
.resolution-content h2,
.resolution-content h3 {
  color: var(--earth-200);
  margin: var(--sp-md) 0 var(--sp-sm);
}

.resolution-content p {
  margin-bottom: var(--sp-sm);
}

.sponsors-list {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-top: var(--sp-md);
}

.sponsor-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(82, 184, 122, 0.1);
  border: 1px solid rgba(82, 184, 122, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--earth-200);
}

/* ═══ VOTING ═══ */
.vote-panel {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
}

.vote-buttons {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  margin: var(--sp-xl) 0;
  flex-wrap: wrap;
}

.vote-btn {
  padding: var(--sp-lg) var(--sp-2xl);
  font-size: 1.125rem;
  border-radius: var(--radius-xl);
  min-width: 180px;
}

.vote-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
}

.vote-stat {
  padding: var(--sp-lg);
  text-align: center;
  border-radius: var(--radius-lg);
}

.vote-stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

.vote-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ═══ CARBON COUNTER ═══ */
.carbon-counter {
  background: linear-gradient(135deg, rgba(22, 46, 33, 0.8), rgba(29, 61, 44, 0.6));
  border: 1px solid rgba(82, 184, 122, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--sp-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.carbon-counter::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(82, 184, 122, 0.05) 0%, transparent 70%);
  animation: counterPulse 4s ease-in-out infinite;
}

@keyframes counterPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.carbon-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--earth-200);
  position: relative;
  z-index: 1;
}

.carbon-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.carbon-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-md);
  position: relative;
  z-index: 1;
}

.carbon-detail-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber-400);
}

.carbon-detail-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ═══ AWARD CARDS ═══ */
.award-card {
  text-align: center;
  padding: var(--sp-xl);
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.15), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.award-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-md);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
}

.award-category {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-400);
  margin-bottom: var(--sp-sm);
}

.award-winner {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══ ROADMAP ═══ */
.roadmap-timeline {
  position: relative;
  padding-left: var(--sp-xl);
}

.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--earth-400), var(--earth-700));
}

.roadmap-item {
  position: relative;
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.roadmap-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--earth-400);
  border: 2px solid var(--earth-800);
}

/* ═══ DOCUMENT LIST ═══ */
.doc-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-sm);
  cursor: pointer;
}

.doc-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.doc-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.doc-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══ LOGIN PAGE ═══ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--sp-2xl);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--sp-xl);
}

.login-logo-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--sp-md);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--sp-xs);
}

.login-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.login-error {
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--red-400);
  font-size: 0.8125rem;
  display: none;
}

.login-error.visible {
  display: block;
}

.login-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  position: relative;
  margin: var(--sp-md) 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--surface-glass-border);
}

.login-divider::before {
  left: 0;
}

.login-divider::after {
  right: 0;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-md);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
}

.empty-state-desc {
  font-size: 0.875rem;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

.empty-state-text {
  font-size: 0.875rem;
}

/* ═══ SKELETON LOADING ═══ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-card) 25%, var(--surface-elevated) 50%, var(--surface-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: var(--radius-sm);
}

.skeleton-text-sm {
  width: 60%;
}

.skeleton-text-lg {
  width: 90%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-stat {
  height: 80px;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══ STAT TRENDS ═══ */
.stat-trend {
  font-size: 0.6875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--sp-xs);
}

.stat-trend-up {
  color: var(--earth-300);
}

.stat-trend-down {
  color: var(--red-400);
}

/* ═══ LOADING SPINNER ═══ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface-glass-border);
  border-top-color: var(--earth-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: var(--sp-lg) auto;
}

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

/* ═══ GRID LAYOUTS ═══ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-md);
}

/* ═══ SECTION HEADER ═══ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast-container {
  position: fixed;
  bottom: var(--sp-lg);
  right: var(--sp-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.toast {
  padding: var(--sp-md) var(--sp-lg);
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: toastIn 0.3s ease;
  max-width: 350px;
}

.toast-success {
  border-left: 3px solid var(--earth-400);
}

.toast-error {
  border-left: 3px solid var(--red-500);
}

.toast-info {
  border-left: 3px solid var(--blue-500);
}

/* On-screen confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-overlay.visible {
  display: flex;
}

.confirm-modal {
  width: min(460px, 100%);
  background: var(--surface-card);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 20px;
}

.confirm-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.confirm-message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

[data-theme="light"] .confirm-overlay {
  background: rgba(15, 23, 42, 0.24);
}

[data-theme="light"] .confirm-modal {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(42, 90, 63, 0.14);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(42, 90, 63, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
  color: #203a2e;
}

[data-theme="light"] .toast-error {
  border-left-color: #d46a6a;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ═══ SECRETARIAT CONTROLS ═══ */
.control-panel {
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.control-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* ═══ MODAL ═══ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--earth-800);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-glass);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

/* Main resolution drafting workspace: larger modal */
.modal-resolution-main {
  max-width: 980px;
  min-height: min(82vh, 820px);
  padding: 20px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfbfa, #f6f6f4);
  border: 1px solid rgba(16, 24, 20, 0.08);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.95) inset;
  scrollbar-width: none;
}

.modal-resolution-main::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal-resolution-main #resolution-form-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-resolution-main #res-content-sec {
  min-height: clamp(360px, 56vh, 560px);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    repeating-linear-gradient(
      to bottom,
      #ffffff 0,
      #ffffff 31px,
      rgba(31, 77, 53, 0.08) 32px
    );
  line-height: 32px;
  padding: 10px 16px 14px;
  font-size: 0.98rem;
  color: #1f2f28;
  scrollbar-width: none;
}

.modal-resolution-main #res-content-sec::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal-resolution-main .modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-resolution-main .modal-header h3 {
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #1f2f28;
  margin: 0;
}

.modal-resolution-main .resolution-note-meta {
  margin-left: auto;
  margin-right: 6px;
  font-size: 0.78rem;
  color: rgba(31, 47, 40, 0.46);
  letter-spacing: 0.02em;
}

.modal-resolution-submit-top {
  min-height: 34px !important;
  padding: 0 13px !important;
  border-radius: 10px !important;
  background: rgba(55, 122, 87, 0.14) !important;
  border: 1px solid rgba(55, 122, 87, 0.22) !important;
  color: #295d42 !important;
  box-shadow: none !important;
  font-size: 0.8125rem;
  font-weight: 600;
}

.modal-resolution-submit-top:hover {
  background: rgba(55, 122, 87, 0.2) !important;
  border-color: rgba(55, 122, 87, 0.3) !important;
  transform: translateY(0) !important;
}

.modal-resolution-main .form-label {
  color: rgba(31, 47, 40, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.modal-resolution-main #res-title-sec,
.modal-resolution-main #res-tags-sec {
  min-height: 42px;
  border-radius: 12px;
  background: #fdfdfc;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #1f2f28;
}

.modal-resolution-main #res-title-sec {
  font-size: 1.02rem;
  font-weight: 500;
}

.modal-resolution-main #res-tags-sec::placeholder {
  color: rgba(31, 47, 40, 0.45);
}

.modal-resolution-main #res-content-sec:focus,
.modal-resolution-main #res-title-sec:focus,
.modal-resolution-main #res-tags-sec:focus {
  border-color: rgba(53, 97, 72, 0.32);
  box-shadow: 0 0 0 2px rgba(53, 97, 72, 0.1);
}

[data-theme="dark"] .modal-resolution-main {
  background: linear-gradient(180deg, #15211c, #101a16);
  border-color: rgba(82, 184, 122, 0.18);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

[data-theme="dark"] .modal-resolution-main .modal-header {
  border-bottom-color: rgba(82, 184, 122, 0.14);
}

[data-theme="dark"] .modal-resolution-main .modal-header h3,
[data-theme="dark"] .modal-resolution-main .form-label {
  color: #d7e8de;
}

[data-theme="dark"] .modal-resolution-main .resolution-note-meta {
  color: rgba(215, 232, 222, 0.58);
}

[data-theme="dark"] .modal-resolution-submit-top {
  background: rgba(82, 184, 122, 0.2) !important;
  border-color: rgba(82, 184, 122, 0.26) !important;
  color: #d6efdf !important;
}

[data-theme="dark"] .modal-resolution-submit-top:hover {
  background: rgba(82, 184, 122, 0.26) !important;
}

[data-theme="dark"] .modal-resolution-main #res-title-sec,
[data-theme="dark"] .modal-resolution-main #res-tags-sec {
  background: rgba(9, 16, 13, 0.82);
  border-color: rgba(82, 184, 122, 0.2);
  color: #e6f2eb;
}

[data-theme="dark"] .modal-resolution-main #res-content-sec {
  color: #e6f2eb;
  border-color: rgba(82, 184, 122, 0.2);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(9, 16, 13, 0.96) 0,
      rgba(9, 16, 13, 0.96) 31px,
      rgba(82, 184, 122, 0.12) 32px
    );
}

@media (max-width: 920px) {
  .modal-resolution-main {
    max-width: 100%;
    min-height: auto;
    padding: 20px;
  }

  .modal-resolution-main #res-content-sec {
    min-height: 220px;
  }

  .modal-resolution-main .resolution-note-meta {
    display: none;
  }

  .modal-resolution-submit-top {
    min-height: 32px;
    padding: 0 12px;
  }
}

/* Resolutions tab as Notes workspace */
#tab-resolutions.notes-workspace {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 248, 246, 0.92));
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  padding: 16px;
}

#tab-resolutions.notes-workspace .section-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 14px;
}

.resolution-note-card {
  background: linear-gradient(180deg, #ffffff, #fafbfa);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.resolution-note-card .resolution-title-block h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.resolution-note-item {
  padding: 18px 20px;
  border-radius: 14px;
}

.resolution-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.resolution-note-main {
  min-width: 0;
  flex: 1;
}

.resolution-note-item h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.resolution-note-sub {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.resolution-status-badge {
  align-self: flex-start;
  flex-shrink: 0;
}

.resolution-note-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

[data-theme="light"] .resolution-note-item {
  background: #ffffff;
  border-color: rgba(42, 90, 63, 0.1);
}

[data-theme="light"] .resolution-note-sub {
  color: rgba(31, 77, 53, 0.62);
}

[data-theme="dark"] #tab-resolutions.notes-workspace {
  background: linear-gradient(180deg, rgba(12, 20, 16, 0.95), rgba(10, 17, 14, 0.92));
  border-color: rgba(82, 184, 122, 0.14);
}

[data-theme="dark"] #tab-resolutions.notes-workspace .section-header {
  border-bottom-color: rgba(82, 184, 122, 0.14);
}

[data-theme="dark"] .resolution-note-card {
  background: linear-gradient(180deg, rgba(16, 27, 22, 0.95), rgba(12, 21, 17, 0.95));
  border-color: rgba(82, 184, 122, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 700px) {
  .resolution-note-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Mobile bottom tab navigation */
  .tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    justify-content: space-around;
    border-top: 1px solid var(--surface-glass-border);
    border-bottom: none;
    background: rgba(10, 22, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--sp-sm) 0;
  }

  .tab-nav::after {
    display: none;
  }

  .page-wrapper {
    padding-bottom: 60px;
  }

  .breadcrumbs {
    padding: 8px 16px;
    font-size: 0.75rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: var(--sp-sm);
  }

  .header-subtitle {
    display: none;
  }

  .login-card {
    padding: var(--sp-lg);
  }

  .login-title {
    font-size: 1.375rem;
  }

  .vote-buttons {
    flex-direction: column;
    align-items: center;
  }

  .vote-btn {
    width: 100%;
    min-width: auto;
  }

  .carbon-counter {
    padding: var(--sp-md);
  }

  .carbon-number {
    font-size: 2rem;
  }

  .vote-results {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tab-btn span:not(.tab-icon) {
    display: none;
  }

  .tab-btn {
    padding: var(--sp-sm);
  }

  .tab-btn .tab-icon {
    font-size: 1.25rem;
  }

  .header-user-card .header-country {
    display: none;
  }

  .header-user-card .header-role {
    display: none;
  }

  .header-user-card {
    max-width: none;
    padding: 6px 10px;
  }

  .header-actions-divider {
    height: 22px;
  }
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-sm);
  }

  .header-brand {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: var(--sp-sm);
    border-top: 1px solid rgba(82, 184, 122, 0.12);
  }

  .header-user-card {
    max-width: none;
    flex: 1;
    min-width: 0;
  }
}

/* ═══ UTILITY ═══ */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-sm {
  gap: var(--sp-sm);
}

.gap-md {
  gap: var(--sp-md);
}

.mt-sm {
  margin-top: var(--sp-sm);
}

.mt-md {
  margin-top: var(--sp-md);
}

.mt-lg {
  margin-top: var(--sp-lg);
}

.mb-md {
  margin-bottom: var(--sp-md);
}

.mb-lg {
  margin-bottom: var(--sp-lg);
}

.p-md {
  padding: var(--sp-md);
}

.p-lg {
  padding: var(--sp-lg);
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* ═══════════════════════════════════════════════ */
/* GENERAL CHANGE PACKAGE — NEW STYLES            */
/* ═══════════════════════════════════════════════ */

/* ═══ PHASE INDICATOR ═══ */
.phase-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(10, 22, 18, 0.9);
  border-bottom: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(14px);
}

[data-theme="light"] .phase-bar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(42, 90, 63, 0.08);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--earth-700);
  transition: all var(--transition-fast);
}

.phase-dot.active {
  background: var(--earth-400);
  box-shadow: 0 0 8px rgba(82, 184, 122, 0.5);
}

.phase-dot.past {
  background: var(--earth-500);
}

.phase-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phase-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--earth-200);
  margin-left: auto;
}

/* Phase buttons for Chairs/Secretariat */
.phase-btns-small {
  display: flex;
  gap: 4px;
}

.phase-btn-sm {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-glass-border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 60px;
  transition: all var(--transition-fast);
  min-height: 36px;
}

.phase-btn-sm span {
  font-size: 0.625rem;
  font-weight: 800;
  opacity: 0.5;
}

.phase-btn-sm strong {
  font-size: 0.625rem;
  text-transform: uppercase;
}

.phase-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.phase-btn-sm.active {
  background: var(--earth-900);
  border-color: var(--earth-400);
  color: var(--earth-400);
  box-shadow: 0 0 10px rgba(82, 184, 122, 0.2);
}

[data-theme="light"] .phase-btn-sm.active {
  background: linear-gradient(135deg, var(--earth-400), var(--earth-300));
  border-color: var(--earth-400);
  color: #f9fafb;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(42, 90, 63, 0.25);
}

.phase-btn-sm.active span {
  opacity: 1;
}

/* Header Gavel */
.btn-gavel-header {
  background: linear-gradient(135deg, #d97706, #92400e);
  border: none;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-left: var(--sp-sm);
  transition: transform 0.1s;
}

.btn-gavel-header:active {
  transform: scale(0.9);
}

/* Locked tabs */
.tab-btn.locked {
  opacity: 0.3;
  pointer-events: none;
  position: relative;
}

.tab-btn.locked::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.9;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A//www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%3E%3Cpath%20d%3D'M7%2011V8a5%205%200%200%201%2010%200v3'%20fill%3D'none'%20stroke%3D'%23e8f5ec'%20stroke-width%3D'2'%20stroke-linecap%3D'round'/%3E%3Cpath%20d%3D'M6%2011h12v10H6V11z'%20fill%3D'none'%20stroke%3D'%23e8f5ec'%20stroke-width%3D'2'%20stroke-linejoin%3D'round'/%3E%3C/svg%3E");
}

/* ═══ CONSENSUS HEATMAP ═══ */
.heatmap-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-elevated);
  margin-bottom: var(--sp-md);
}

.heatmap-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.heatmap-segment.sustain {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.heatmap-segment.object {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.heatmap-segment.neutral {
  background: var(--earth-700);
}

.heatmap-legend {
  display: flex;
  gap: var(--sp-lg);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
}

.heatmap-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heatmap-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.heatmap-legend .dot.green {
  background: #4ade80;
}

.heatmap-legend .dot.red {
  background: #f87171;
}

.heatmap-legend .dot.gray {
  background: var(--earth-600);
}

/* Paragraph feedback buttons */
.para-block {
  position: relative;
  padding: var(--sp-sm) var(--sp-md);
  padding-left: 50px;
  border-left: 3px solid var(--surface-glass-border);
  margin-bottom: var(--sp-xs);
  transition: border-color 0.3s ease;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.para-block:hover {
  background: rgba(42, 90, 63, 0.05);
}

.para-block.sustain-dominant {
  border-left-color: #22c55e;
}

.para-block.object-dominant {
  border-left-color: #ef4444;
}

.para-block.mixed {
  border-left-color: #f59e0b;
}

.para-line-num {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.625rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'SF Pro Text', monospace;
  width: 20px;
  text-align: right;
}

.para-feedback-btns {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.para-block:hover .para-feedback-btns {
  opacity: 1;
}

.para-fb-btn {
  padding: 2px 6px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.625rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.para-fb-btn.sustain {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.para-fb-btn.sustain:hover,
.para-fb-btn.sustain.active {
  background: rgba(34, 197, 94, 0.4);
}

.para-fb-btn.object {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.para-fb-btn.object:hover,
.para-fb-btn.object.active {
  background: rgba(239, 68, 68, 0.4);
}

/* ═══ AMENDMENT SIDEBAR ═══ */
.drafting-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-md);
}

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

.amendment-sidebar {
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  overflow: hidden;
  max-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
}

.amendment-sidebar-header {
  padding: var(--sp-md);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--surface-glass-border);
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.amendment-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-sm);
}

.amendment-item {
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-xs);
  font-size: 0.8125rem;
}

.amendment-item.addition {
  border-left: 3px solid #22c55e;
}

.amendment-item.deletion {
  border-left: 3px solid #ef4444;
}

.amendment-item.replacement {
  border-left: 3px solid #f59e0b;
}

.amendment-type {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.amendment-type.addition {
  color: #4ade80;
}

.amendment-type.deletion {
  color: #f87171;
}

.amendment-type.replacement {
  color: #fcd34d;
}

.amendment-form {
  padding: var(--sp-md);
  border-top: 1px solid var(--surface-glass-border);
  background: var(--surface-elevated);
}

.amendment-form select,
.amendment-form input,
.amendment-form textarea {
  width: 100%;
  margin-bottom: var(--sp-xs);
  font-size: 0.75rem;
  padding: 6px 8px;
}

/* ═══ 1.5°C TEMPERATURE GAUGE ═══ */
.temp-gauge {
  position: relative;
  width: 260px;
  height: 150px;
  margin: var(--sp-lg) auto;
}

.temp-gauge svg {
  width: 100%;
  height: 100%;
}

.temp-gauge-value {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.temp-gauge-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.temp-gauge-number.on-track {
  color: #4ade80;
}

.temp-gauge-number.needs-work {
  color: #fcd34d;
}

.temp-gauge-number.off-track {
  color: #f87171;
}

.temp-gauge-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.temp-gauge-target {
  font-size: 0.75rem;
  color: var(--earth-300);
  margin-top: var(--sp-sm);
  text-align: center;
}

/* ═══ GAVEL ANIMATION ═══ */
@keyframes gavelStrike {
  0% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.3) rotate(-10deg);
  }

  30% {
    transform: scale(0.9) rotate(5deg);
  }

  45% {
    transform: scale(1.1);
  }

  60% {
    transform: scale(1);
  }
}

.gavel-flash {
  position: fixed;
  inset: 0;
  background: rgba(245, 158, 11, 0.15);
  pointer-events: none;
  z-index: 9999;
  animation: gavelFlash 0.8s ease-out forwards;
}

@keyframes gavelFlash {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.gavel-btn {
  font-size: 1.5rem;
  padding: 0 var(--sp-xl);
  animation: none;
  border: 2px solid rgba(245, 158, 11, 0.3);
  min-height: 40px;
}

.gavel-btn:active {
  animation: gavelStrike 0.5s ease;
}

/* Secretariat phase bars: tighten alignment and sizing */
#phase-bar,
#committee-phase-bar {
  gap: 10px;
  padding: 10px 16px;
}

#phase-bar .phase-label,
#committee-phase-bar .phase-label {
  min-width: 150px;
}

#phase-bar .phase-btns-small,
#committee-phase-bar .phase-btns-small {
  gap: 10px;
}

#phase-bar .phase-btn-sm,
#committee-phase-bar .phase-btn-sm {
  min-height: 40px;
  min-width: 118px;
  padding: 0 16px;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
}

#phase-bar .phase-btn-sm span,
#committee-phase-bar .phase-btn-sm span {
  font-size: 0.625rem;
  font-weight: 700;
  opacity: 0.55;
  line-height: 1;
}

#phase-bar .phase-btn-sm strong,
#committee-phase-bar .phase-btn-sm strong {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* Phase pills: label-only minimal style */
#phase-bar .phase-btn-sm,
#committee-phase-bar .phase-btn-sm {
  min-width: 118px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

#phase-bar .phase-btn-sm span,
#committee-phase-bar .phase-btn-sm span {
  display: none;
}

#phase-bar .phase-btn-sm strong,
#committee-phase-bar .phase-btn-sm strong {
  font-size: 0.9rem;
  letter-spacing: 0.015em;
}

#phase-committee-select {
  width: 200px;
  min-height: 44px;
  border-radius: 14px;
  margin-right: 8px;
  font-size: 0.875rem;
  padding-left: 12px;
  padding-right: 34px;
}

#phase-bar .gavel-btn {
  min-height: 44px;
  min-width: 92px;
  padding: 0 18px;
  border-radius: 16px;
  margin-left: auto;
}

[data-theme="light"] #phase-bar,
[data-theme="light"] #committee-phase-bar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(42, 90, 63, 0.1);
}

[data-theme="light"] #phase-bar .phase-btn-sm,
[data-theme="light"] #committee-phase-bar .phase-btn-sm {
  background: #f9fbfa;
  border-color: rgba(42, 90, 63, 0.14);
  color: #41564c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

[data-theme="light"] #phase-bar .phase-btn-sm:hover,
[data-theme="light"] #committee-phase-bar .phase-btn-sm:hover {
  background: #ffffff;
  border-color: rgba(42, 90, 63, 0.2);
  color: #2f4a3d;
}

[data-theme="light"] #phase-bar .phase-btn-sm.active,
[data-theme="light"] #committee-phase-bar .phase-btn-sm.active {
  background: linear-gradient(135deg, #6daf86, #5ea67d);
  border-color: rgba(42, 90, 63, 0.2);
  color: #f8fbf9;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 6px 14px rgba(42, 90, 63, 0.2);
}

[data-theme="light"] #phase-committee-select {
  background: #ffffff;
  border-color: rgba(42, 90, 63, 0.18);
}

[data-theme="light"] #phase-bar .gavel-btn {
  box-shadow: 0 8px 18px rgba(234, 179, 8, 0.25);
}

/* Chair phase bar: refined, subtle and cleaner pills */
#phase-control-bar {
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

#phase-control-bar .phase-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

#phase-control-bar .phase-btns-small {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#phase-control-bar .phase-btns-small::-webkit-scrollbar {
  display: none;
}

#phase-control-bar .phase-btn-sm {
  flex: 0 0 auto;
  min-width: 110px;
  min-height: 42px;
  padding: 6px 14px;
  border-radius: 14px;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

#phase-control-bar .phase-btn-sm span {
  font-size: 0.58rem;
  opacity: 0.55;
  font-weight: 700;
  line-height: 1;
}

#phase-control-bar .phase-btn-sm strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.15;
}

#phase-control-bar .phase-btn-sm:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

#phase-control-bar .phase-btn-sm:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(125, 211, 155, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#phase-control-bar .phase-btn-sm.active {
  background: linear-gradient(180deg, rgba(87, 175, 124, 0.28), rgba(60, 126, 89, 0.24));
  border-color: rgba(129, 217, 168, 0.55);
  color: #d8f5e5;
  box-shadow:
    inset 0 1px 0 rgba(232, 255, 243, 0.22),
    0 8px 18px rgba(17, 54, 35, 0.28);
}

[data-theme="light"] #phase-control-bar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(42, 90, 63, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(15, 23, 42, 0.04);
}

[data-theme="light"] #phase-control-bar .phase-label {
  color: #5e7367;
}

[data-theme="light"] #phase-control-bar .phase-btn-sm {
  background: #f7faf8;
  border-color: rgba(42, 90, 63, 0.12);
  color: #41564c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

[data-theme="light"] #phase-control-bar .phase-btn-sm:hover {
  background: #ffffff;
  border-color: rgba(42, 90, 63, 0.22);
  color: #2f4a3d;
}

[data-theme="light"] #phase-control-bar .phase-btn-sm.active {
  background: linear-gradient(180deg, #6daf86, #5c9f79);
  border-color: rgba(55, 119, 83, 0.35);
  color: #f7fcf9;
  box-shadow:
    inset 0 1px 0 rgba(238, 255, 246, 0.6),
    0 8px 16px rgba(42, 90, 63, 0.2);
}

@media (max-width: 900px) {
  #phase-control-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  #phase-control-bar .phase-btns-small {
    width: 100%;
    padding-bottom: 4px;
  }

  #phase-control-bar .phase-btn-sm {
    min-width: 100px;
    padding: 6px 12px;
  }
}

@media (max-width: 520px) {
  #phase-control-bar {
    padding: 10px 12px;
  }

  #phase-control-bar .phase-btn-sm {
    min-width: 90px;
    min-height: 40px;
    padding: 5px 10px;
  }

  #phase-control-bar .phase-btn-sm strong {
    font-size: 0.72rem;
  }
}

/* ═══ OBJECTION CATEGORY PILLS ═══ */
.objection-cats {
  display: flex;
  gap: var(--sp-sm);
  margin: var(--sp-md) 0;
}

.obj-cat-btn {
  padding: var(--sp-sm) var(--sp-md);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: transparent;
  color: var(--red-400);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.obj-cat-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.obj-cat-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red-400);
}

/* ═══ PHASE TOGGLE (Secretariat) ═══ */
.phase-control {
  display: flex;
  gap: var(--sp-xs);
  padding: var(--sp-sm) 0;
}

.phase-toggle-btn {
  flex: 1;
  padding: var(--sp-md) var(--sp-sm);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-glass);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.phase-toggle-btn:hover {
  border-color: var(--surface-glass-border);
}

.phase-toggle-btn.active {
  color: var(--earth-200);
  background: var(--surface-elevated);
  border-color: var(--earth-400);
  box-shadow: inset 0 -2px 0 var(--earth-400);
}

.phase-toggle-btn .phase-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 2px;
}

/* ═══ EXPORT BUTTON ═══ */
.btn-export {
  background: linear-gradient(135deg, var(--earth-500), var(--earth-700));
  color: var(--earth-100);
  border: 1px solid var(--earth-400);
  padding: var(--sp-md) var(--sp-xl);
  font-size: 0.875rem;
  font-weight: 700;
}

.btn-export:hover {
  box-shadow: var(--shadow-glow);
}

/* ═══ RESOLUTION HEADER ACTIONS (Secretariat) ═══ */
.resolution-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}

.resolution-title-block {
  min-width: 0;
}

.resolution-title-block h3 {
  margin-bottom: 6px;
}

.resolution-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-shrink: 0;
}

.resolution-actions .btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
}

[data-theme="light"] .resolution-actions .btn-danger {
  background: linear-gradient(135deg, #f6d3d3, #efb8b8);
  color: #8f1d1d;
  border-color: rgba(143, 29, 29, 0.25);
  box-shadow: 0 6px 14px rgba(143, 29, 29, 0.16);
}

[data-theme="light"] .resolution-actions .btn-export {
  background: linear-gradient(135deg, #2f6a49, #24563b);
  color: #f4fbf7;
  border-color: rgba(36, 86, 59, 0.45);
  box-shadow: 0 8px 16px rgba(36, 86, 59, 0.28);
}

@media (max-width: 680px) {
  .resolution-top-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ═══ REVIEW QUEUE ═══ */
.review-item {
  padding: var(--sp-md);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-sm);
  animation: slideIn 0.3s ease;
}

.review-item .review-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  font-size: 0.75rem;
}

.review-item .review-text {
  padding: var(--sp-sm);
  background: rgba(10, 22, 18, 0.5);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'SF Pro Text', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.review-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
  align-items: center;
}

/* Digital energy cost */
.energy-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--sp-sm);
}

/* ═══════════════════════════════════════════
   v3 — BROADCAST BANNER (Scrolling Marquee)
   ═══════════════════════════════════════════ */
.broadcast-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  padding: var(--sp-xs) var(--sp-md);
  overflow: hidden;
  position: relative;
}

.broadcast-banner.hidden {
  display: none;
}

.broadcast-banner.active {
  display: block;
}

.broadcast-scroll {
  animation: marquee 20s linear infinite;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--amber-400);
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* ═══════════════════════════════════════════
   v3 — COMMITTEE BADGE
   ═══════════════════════════════════════════ */
.committee-badge {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-accent);
}

.committee-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--earth-300);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ═══════════════════════════════════════════
   v3 — TIMER PANEL (Chair Floor Control)
   ═══════════════════════════════════════════ */
.timer-panel {
  text-align: center;
  padding: var(--sp-lg);
}

.timer-display {
  margin-bottom: var(--sp-md);
}

.timer-value {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: 'SF Pro Text', monospace;
  color: var(--earth-100);
  letter-spacing: -0.02em;
}

.timer-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

.timer-controls {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.timer-controls .btn {
  min-width: 94px;
}

.timer-running-indicator {
  margin-top: 8px;
  display: none;
}

.timer-running-badge {
  animation: pulse-bar 1s ease-in-out infinite;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Inline Editable Timer Display */
.timer-value-editable {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.timer-inline-input {
  width: 80px;
  height: auto;
  padding: 4px 0;
  text-align: center;
  font-size: 3.5rem;
  font-weight: 800;
  font-family: 'SF Pro Text', system-ui, monospace;
  letter-spacing: -0.02em;
  color: var(--earth-100);
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  -moz-appearance: textfield;
  transition: all var(--transition-fast);
  caret-color: var(--earth-300);
}

.timer-inline-input::-webkit-outer-spin-button,
.timer-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-inline-input:hover {
  border-color: rgba(82, 184, 122, 0.25);
  background: rgba(82, 184, 122, 0.06);
}

.timer-inline-input:focus {
  outline: none;
  border-color: var(--earth-300);
  background: rgba(82, 184, 122, 0.1);
  box-shadow: 0 0 0 4px rgba(82, 184, 122, 0.12);
}

.timer-inline-input.invalid {
  color: var(--red-400);
  border-color: var(--red-400);
  background: rgba(239, 68, 68, 0.08);
}

.timer-inline-separator {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--earth-200);
  margin: 0 -2px;
  user-select: none;
}

.timer-validation-msg {
  min-height: 20px;
  margin-top: var(--sp-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--red-400);
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.timer-validation-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

.timer-validation-msg.success {
  color: var(--earth-300);
}

.timer-auto-next-label {
  font-size: 0.75rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  cursor: pointer;
}

.timer-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(82, 184, 122, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: var(--earth-300);
  border-radius: 3px;
  transition: width 1s linear;
}

.timer-bar.warning {
  background: var(--amber-400);
}

.timer-bar.critical {
  background: var(--red-400);
  animation: pulse-bar 0.5s infinite;
}

[data-theme="light"] .timer-inline-input {
  color: var(--earth-600);
}

[data-theme="light"] .timer-inline-input:hover {
  border-color: rgba(42, 90, 63, 0.3);
  background: rgba(42, 90, 63, 0.05);
}

[data-theme="light"] .timer-inline-input:focus {
  border-color: var(--earth-400);
  background: rgba(42, 90, 63, 0.08);
  box-shadow: 0 0 0 4px rgba(42, 90, 63, 0.1);
}

[data-theme="light"] .timer-inline-separator {
  color: var(--earth-500);
}

@media (max-width: 640px) {
  .timer-controls .btn {
    min-width: 82px;
  }

  .timer-inline-input {
    width: 60px;
    font-size: 2.5rem;
  }

  .timer-inline-separator {
    font-size: 2.5rem;
  }
}

@keyframes pulse-bar {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ═══════════════════════════════════════════
   COMMITTEE SHOWCASE (Landing) — Apple redesign
   ═══════════════════════════════════════════ */

/* ── Selector: pill-chip tabs ── */
.committee-seg {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cmte-sel-card {
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 11px;
  border-radius: var(--radius-full);
  background: rgba(82, 184, 122, 0.06);
  border: 1px solid rgba(82, 184, 122, 0.14);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.cmte-sel-card:hover:not(.active) {
  background: rgba(82, 184, 122, 0.12);
  border-color: rgba(82, 184, 122, 0.24);
}
.cmte-sel-card.active {
  background: rgba(52, 130, 88, 0.28);
  border-color: rgba(82, 184, 122, 0.45);
  cursor: default;
}
.cmte-sel-icon {
  width: 15px;
  height: 15px;
  color: var(--earth-300);
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.cmte-sel-card.active .cmte-sel-icon {
  color: var(--earth-200);
}
.cmte-sel-code {
  display: none;
}
.cmte-sel-name {
  font-family: var(--font-heading);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.cmte-sel-card.active .cmte-sel-name {
  color: var(--earth-200);
}
.cmte-sel-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(82, 184, 122, 0.10);
}
.cmte-sel-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--earth-300), var(--earth-200));
}
.cmte-sel-card.active .cmte-sel-fill {
  animation: cmteFill 4s linear forwards;
}
@keyframes cmteFill { from { width: 0% } to { width: 100% } }

/* ── Showcase panel ── */
.committee-showcase {
  position: relative;
}

.committee-showcase-inner {
  position: relative;
  overflow: hidden;
  padding: 60px 64px;
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  border: 1px solid var(--surface-glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow-lg), 0 0 0 0.5px rgba(82, 184, 122, 0.08);
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 52px;
  align-items: center;
  min-height: 360px;
  animation: showcaseIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.committee-showcase-inner::before {
  content: attr(data-num);
  position: absolute;
  bottom: -24px; right: 20px;
  font-family: var(--font-heading);
  font-size: 14rem; font-weight: 800;
  line-height: 1; letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--earth-300), var(--earth-200));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.10; pointer-events: none; user-select: none;
}

@keyframes showcaseIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.showcase-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.showcase-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: rgba(82, 184, 122, 0.10);
  border: 1px solid rgba(82, 184, 122, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--earth-300);
  box-shadow: 0 0 28px rgba(82, 184, 122, 0.15),
              inset 0 1px 0 rgba(255,255,255,0.06);
}
.showcase-icon-wrap svg { width: 36px; height: 36px; }

.showcase-number {
  font-family: var(--font-heading);
  font-size: 3.5rem; font-weight: 800;
  line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--earth-200) 0%, var(--earth-300) 60%, var(--earth-400) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.showcase-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.showcase-name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 4.5rem); font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.05; margin-bottom: 16px;
}

.showcase-tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
}
.showcase-tag {
  display: inline-block;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: .6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  background: rgba(82, 184, 122, 0.10);
  color: var(--text-accent);
  border: 1px solid rgba(82, 184, 122, 0.20);
}
.showcase-desc {
  font-size: 1rem; line-height: 1.85;
  color: var(--text-secondary); max-width: 520px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .committee-seg {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  }
  .committee-seg::-webkit-scrollbar { display: none; }
  .cmte-sel-card { flex: 0 0 auto; width: 100px; }
}
@media (max-width: 640px) {
  .committee-showcase-inner {
    grid-template-columns: 1fr;
    gap: 20px; padding: 32px 24px;
    min-height: auto;
  }
  .showcase-left { flex-direction: row; align-items: center; }
  .showcase-name { font-size: 1.875rem; letter-spacing: -0.03em; }
  .committee-showcase-inner::before { font-size: 8rem; }
}

/* ── Light mode ── */
[data-theme="light"] .cmte-sel-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(42, 90, 63, 0.14);
}
[data-theme="light"] .cmte-sel-card:hover:not(.active) {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(42, 90, 63, 0.24);
}
[data-theme="light"] .cmte-sel-card.active {
  background: var(--earth-300);
  border-color: var(--earth-300);
}
[data-theme="light"] .cmte-sel-card.active .cmte-sel-icon {
  color: #fff;
}
[data-theme="light"] .cmte-sel-card.active .cmte-sel-name {
  color: #fff;
}
[data-theme="light"] .committee-showcase-inner {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(42, 90, 63, 0.10);
  box-shadow: 0 8px 40px rgba(42, 90, 63, 0.08),
              0 0 0 0.5px rgba(42, 90, 63, 0.07);
}
[data-theme="light"] .showcase-icon-wrap {
  background: rgba(42, 90, 63, 0.07);
  border-color: rgba(42, 90, 63, 0.14);
  box-shadow: 0 0 20px rgba(42, 90, 63, 0.08);
}
[data-theme="light"] .showcase-name { color: #0f2318; }
[data-theme="light"] .showcase-number {
  background: linear-gradient(135deg, var(--earth-500) 0%, var(--earth-400) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .showcase-desc { color: #2f4a3d; }
[data-theme="light"] .showcase-tag {
  background: rgba(42, 90, 63, 0.07);
  border-color: rgba(42, 90, 63, 0.14);
  color: var(--earth-500);
}

/* Keep manager dashboard committee grid/card working */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
}

.committee-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.committee-card:hover {
  background: var(--surface-card-hover);
  transform: translateY(-2px);
}

.committee-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.committee-card-icon {
  font-size: 1.5rem;
}

.committee-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}

.cstat {
  text-align: center;
  padding: var(--sp-sm);
  background: var(--surface-glass);
  border-radius: var(--radius-md);
}

.cstat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-accent);
}

.cstat-label {
  display: block;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.current-speaker-badge {
  margin-top: var(--sp-md);
  padding: var(--sp-sm);
  background: rgba(82, 184, 122, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-accent);
  text-align: center;
}

.current-speaker-badge.muted {
  background: var(--surface-glass);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   v3 — SUPPORT TICKET CARDS
   ═══════════════════════════════════════════ */
.ticket-card {
  padding: var(--sp-lg);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-sm);
}

.ticket-cat {
  font-weight: 600;
  font-size: 0.875rem;
}

.ticket-body {
  margin-bottom: var(--sp-md);
}

.ticket-actions {
  display: flex;
  gap: var(--sp-sm);
}

.support-card {
  border: 1px dashed rgba(245, 158, 11, 0.3);
}

/* ═══════════════════════════════════════════
   v3 — MEDIA GALLERY
   ═══════════════════════════════════════════ */
.media-gallery-item {
  padding: var(--sp-md);
  margin-bottom: var(--sp-sm);
}

.media-card {
  padding: var(--sp-md);
}

/* ═══════════════════════════════════════════
   v3 — STATISTICS TABLE
   ═══════════════════════════════════════════ */
.stats-table-container {
  overflow-x: auto;
  width: 100%;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.stats-table th {
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-card);
  color: var(--text-accent);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--surface-glass-border);
  white-space: nowrap;
}

.stats-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid rgba(82, 184, 122, 0.07);
  color: var(--text-primary);
}

.stats-table tr:hover td {
  background: var(--surface-glass);
}

/* ═══════════════════════════════════════════
   v3 — SPEAKER ITEM (enhanced)
   ═══════════════════════════════════════════ */
.speaker-item.speaking {
  border-left: 3px solid var(--earth-300);
  background: rgba(82, 184, 122, 0.08);
}

.speaker-item.done {
  opacity: 0.5;
}

/* ═══════════════════════════════════════════
   v3 — CONTROL PANEL & FORMS
   ═══════════════════════════════════════════ */
.control-panel {
  padding: var(--sp-lg);
}

.control-row {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  flex-wrap: wrap;
}

/* Speakers panel: consistent alignment and sizing */
#tab-speakers .control-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

#speaker-country-select,
#speaker-topic {
  min-height: 44px;
  border-radius: 12px;
}

#speaker-country-select {
  width: 100%;
}

#speaker-topic {
  width: 100%;
}

#btn-add-speaker {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
}

/* Remove browser autofill blue tint in this section */
#speaker-topic:-webkit-autofill,
#speaker-topic:-webkit-autofill:hover,
#speaker-topic:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: 0 0 0 1000px rgba(10, 22, 18, 0.78) inset;
}

[data-theme="light"] #tab-speakers .control-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(42, 90, 63, 0.14);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] #tab-speakers .control-panel h4 {
  color: #1d3c2c;
}

[data-theme="light"] #speaker-country-select,
[data-theme="light"] #speaker-topic {
  background: #ffffff;
  border-color: rgba(42, 90, 63, 0.18);
  color: #173827;
}

[data-theme="light"] #speaker-topic::placeholder {
  color: rgba(31, 77, 53, 0.5);
}

[data-theme="light"] #speaker-topic:-webkit-autofill,
[data-theme="light"] #speaker-topic:-webkit-autofill:hover,
[data-theme="light"] #speaker-topic:-webkit-autofill:focus {
  -webkit-text-fill-color: #173827;
  box-shadow: 0 0 0 1000px #ffffff inset;
}

[data-theme="light"] .speaker-item {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(42, 90, 63, 0.12);
}

[data-theme="light"] .speaker-item:hover {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .speaker-item.speaking {
  background: rgba(82, 184, 122, 0.12);
  border-left-color: var(--earth-500);
}

@media (max-width: 920px) {
  #tab-speakers .control-row {
    grid-template-columns: 1fr;
  }

  #btn-add-speaker {
    width: 100%;
    justify-content: center;
  }
}

.form-select {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  font-family: 'SF Pro Text', sans-serif;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.form-select:focus {
  border-color: var(--earth-400);
  box-shadow: 0 0 0 3px rgba(61, 138, 95, 0.15);
}

/* ═══════════════════════════════════════════
   v3 — FLEX UTILITIES
   ═══════════════════════════════════════════ */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex {
  display: flex;
  align-items: center;
}

.gap-sm {
  gap: var(--sp-sm);
}

.p-md {
  padding: var(--sp-md);
}

.p-lg {
  padding: var(--sp-lg);
}

.mb-sm {
  margin-bottom: var(--sp-sm);
}

.mb-md {
  margin-bottom: var(--sp-md);
}

.mb-lg {
  margin-bottom: var(--sp-lg);
}

/* ═══════════════════════════════════════════
   v3 — REVIEW ITEM
   ═══════════════════════════════════════════ */
.review-item {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
  border: 1px solid var(--surface-glass-border);
}

.review-item.addition {
  border-left: 3px solid #4ade80;
}

.review-item.deletion {
  border-left: 3px solid #ef4444;
}

.review-item.replacement {
  border-left: 3px solid #fbbf24;
}

.review-meta {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-sm);
}

.review-text {
  font-size: 0.8125rem;
  padding: var(--sp-sm);
  background: var(--surface-glass);
  border-radius: var(--radius-sm);
  margin: var(--sp-sm) 0;
  white-space: pre-wrap;
}

.review-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}

/* ═══════════════════════════════════════════
   v3 — VOTE RESULTS
   ═══════════════════════════════════════════ */
.vote-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.vote-stat {
  text-align: center;
}

.vote-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
}

.vote-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.vote-actions {
  display: flex;
  gap: var(--sp-md);
}

/* ═══════════════════════════════════════════
   v3 — NEW CHAT UI (Horizontal Layout)
   ═══════════════════════════════════════════ */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-glass-border);
  overflow: hidden;
}

.chat-channels-horizontal {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--surface-glass-border);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  /* Hide scrollbar Firefox */
}

.chat-channels-horizontal::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar Chrome/Safari */
}

.chat-channels-horizontal .channel-btn {
  padding: 6px 14px;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-channels-horizontal .channel-btn:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.chat-channels-horizontal .channel-btn.active {
  background: var(--earth-900);
  border-color: var(--earth-400);
  color: var(--earth-400);
  box-shadow: 0 0 10px rgba(82, 184, 122, 0.15);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.chat-input-bar {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--surface-glass-border);
  display: flex;
  gap: var(--sp-sm);
  backdrop-filter: blur(10px);
}

.chat-message {
  max-width: 85%;
  align-self: flex-start;
  background: var(--surface-glass);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-glass-border);
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(82, 184, 122, 0.1);
  border-color: rgba(82, 184, 122, 0.2);
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.6875rem;
}

.chat-message-sender {
  font-weight: 700;
  color: var(--earth-300);
}

.chat-message-time {
  color: var(--text-muted);
  margin-left: 8px;
}

.chat-message-content {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
  word-break: break-word;
}

/* Tiny Spinner */
.spinner-tiny {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--earth-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ═══ COALITION DASHBOARD ═══ */
.coalition-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--sp-lg);
  align-items: start;
}

@media (max-width: 992px) {
  .coalition-grid {
    grid-template-columns: 1fr;
  }
}

.coalition-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.coalition-main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Chat Enhancements in Coalition — Aligned with Main Chat */
#co-chat-messages {
  font-size: 0.9375rem;
  scrollbar-width: thin;
  scrollbar-color: var(--earth-400) transparent;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-md);
}

#co-chat-messages .chat-bubble {
  max-width: 90%;
  animation: slideIn 0.2s ease;
}

#co-chat-messages .chat-bubble.own {
  align-self: flex-end;
}


/* Resolution Editor in Coalition */
#co-res-editor {
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(82, 184, 122, 0.2);
  color: var(--earth-100);
}

#co-res-editor:focus {
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 20px rgba(82, 184, 122, 0.1);
}

.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-xs);
  font-size: 0.8125rem;
}

.max-h-200 {
  max-height: 200px;
}

.overflow-y {
  overflow-y: auto;
}

/* Mobile View Adjustments */
@media (max-width: 600px) {
  .coalition-sidebar .glass-card {
    padding: var(--sp-md);
  }
}

/* ═══ MICRO-INTERACTIONS & ANIMATION ═══ */
@media (prefers-reduced-motion: no-preference) {
  /* Staggered card entrance */
  .fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
  }

  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Chat message slide-in */
  .chat-message {
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Vote result bar fill */
  .vote-bar-fill {
    transition: width 0.6s ease-out;
  }

  /* Phase dot pulse */
  .phase-dot.active {
    animation: phasePulse 2s ease-in-out infinite;
  }

  @keyframes phasePulse {
    0%, 100% {
      box-shadow: 0 0 0 0 rgba(82, 184, 122, 0.4);
    }
    50% {
      box-shadow: 0 0 0 6px rgba(82, 184, 122, 0);
    }
  }

  /* Countdown digit flip */
  .countdown-number .digit {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .countdown-number.flip,
  .countdown-number .digit.flip {
    animation: digitFlip 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes digitFlip {
    0%   { transform: translateY(50%) scale(0.85); opacity: 0; }
    55%  { transform: translateY(-6%) scale(1.04); opacity: 1; }
    75%  { transform: translateY(3%) scale(0.98); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
  }

  /* Card glow flash on digit change */
  @keyframes unitGlow {
    0%   { box-shadow: 0 0 30px rgba(82,184,122,0.08); border-color: rgba(82,184,122,0.25); }
    35%  { box-shadow: 0 0 45px rgba(82,184,122,0.55); border-color: rgba(82,184,122,0.75); }
    100% { box-shadow: 0 0 30px rgba(82,184,122,0.08); border-color: rgba(82,184,122,0.25); }
  }

  .countdown-unit.changed {
    animation: unitGlow 0.6s ease forwards;
  }

  /* Staggered entrance */
  @keyframes countdownEnter {
    from { opacity: 0; transform: translateY(28px) scale(0.88); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .countdown-unit:nth-child(1) { animation: countdownEnter 0.5s 0.05s cubic-bezier(0.34,1.56,0.64,1) both; }
  .countdown-unit:nth-child(2) { animation: countdownEnter 0.5s 0.15s cubic-bezier(0.34,1.56,0.64,1) both; }
  .countdown-unit:nth-child(3) { animation: countdownEnter 0.5s 0.25s cubic-bezier(0.34,1.56,0.64,1) both; }
  .countdown-unit:nth-child(4) { animation: countdownEnter 0.5s 0.35s cubic-bezier(0.34,1.56,0.64,1) both; }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}