@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --primary: #F97316;
  --primary-dark: #EA6C0A;
  --navy: #050816;
  --background: #080b12;
  --app-background:
    radial-gradient(circle at 16% 0%, rgba(249, 115, 22, 0.14), transparent 28rem),
    radial-gradient(circle at 84% 12%, rgba(59, 130, 246, 0.13), transparent 26rem),
    linear-gradient(180deg, #080b12 0%, #0c111d 48%, #090c14 100%);
  --white: #111827;
  --surface: #111827;
  --surface-elevated: #151f32;
  --surface-muted: #1e293b;
  --success: #22c55e;
  --warning: #f97316;
  --danger: #ef4444;
  --heading: #f8fafc;
  --text-primary: #e5edf7;
  --text-secondary: #a8b3c7;
  --text-inverse: #ffffff;
  --border: #283449;
  --card-border: rgba(148, 163, 184, 0.18);
  --blue: #3b82f6;
  --purple: #a78bfa;
  --gray: #64748b;
  --soft-orange: rgba(249, 115, 22, 0.16);
  --soft-green: rgba(34, 197, 94, 0.16);
  --soft-blue: rgba(59, 130, 246, 0.16);
  --soft-red: rgba(239, 68, 68, 0.16);
  --soft-purple: rgba(167, 139, 250, 0.16);
  --shadow-sm: 0 14px 34px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 26px 70px rgba(0, 0, 0, 0.42);
  --nav-shadow: 0 1px 0 rgba(148, 163, 184, 0.15), 0 18px 36px rgba(0, 0, 0, 0.22);
  --overlay: rgba(3, 7, 18, 0.72);
  --loading-overlay-bg: rgba(8, 11, 18, 0.72);
  --navbar-height: 64px;
}

html[data-theme="light"] {
  color-scheme: light;
  --navy: #1a1a2e;
  --background: #f8f9fa;
  --app-background: #f8f9fa;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #f3f4f6;
  --heading: #1a1a2e;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-inverse: #ffffff;
  --border: #e5e7eb;
  --card-border: rgba(229, 231, 235, 0.76);
  --blue: #2563eb;
  --purple: #7c3aed;
  --gray: #6b7280;
  --soft-orange: #ffedd5;
  --soft-green: #dcfce7;
  --soft-blue: #dbeafe;
  --soft-red: #fee2e2;
  --soft-purple: #ede9fe;
  --shadow-sm: 0 4px 14px rgba(26, 26, 46, 0.08);
  --shadow-md: 0 16px 40px rgba(26, 26, 46, 0.12);
  --nav-shadow: 0 1px 12px rgba(26, 26, 46, 0.08);
  --overlay: rgba(26, 26, 46, 0.58);
  --loading-overlay-bg: rgba(255, 255, 255, 0.76);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  opacity: 0;
  min-height: 100%;
  margin: 0;
  padding-top: var(--navbar-height);
  overflow-x: hidden;
  background: var(--app-background);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: opacity 300ms ease, background 180ms ease, color 180ms ease;
}

body.page-ready {
  opacity: 1;
}

body.chat-page-body {
  padding-top: 0;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

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

h1,
h2,
h3,
h4 {
  color: var(--heading);
  font-weight: 800;
  line-height: 1.12;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.section-header {
  max-width: 680px;
  margin: 0 auto 32px;
  text-align: center;
}

.section-header h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

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

.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(14px);
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.nav-actions,
.nav-links,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.chat-header .theme-toggle-btn {
  margin-left: auto;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 160ms ease;
}

.nav-link:hover {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.mobile-menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-menu-toggle span + span {
  margin-top: 4px;
}

.mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  display: none;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.navbar.is-menu-open .mobile-menu,
.chat-header.is-menu-open .mobile-menu {
  display: grid;
  gap: 10px;
}

.mobile-menu .nav-actions,
.mobile-menu .nav-links,
.mobile-menu .navbar-right,
.mobile-menu .tab-nav {
  display: grid;
  width: 100%;
  max-width: none;
  height: auto;
  gap: 10px;
  overflow: visible;
}

.mobile-menu .btn-primary,
.mobile-menu .btn-secondary,
.mobile-menu .btn-danger,
.mobile-menu .btn-ghost,
.mobile-menu .tab-button,
.mobile-menu-link {
  width: 100%;
  min-height: 42px;
}

.mobile-menu .tab-button {
  height: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  text-align: left;
}

.mobile-menu .tab-button::after {
  display: none;
}

.mobile-menu .tab-button.is-active {
  border-color: var(--primary);
  background: var(--soft-orange);
}

.mobile-menu .switch-wrap {
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
}

.mobile-menu-link {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  font-weight: 800;
  text-align: left;
}

.quick-image-trigger {
  cursor: pointer;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline-danger,
.btn-success,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading,
.btn-outline-danger.is-loading,
.btn-success.is-loading,
.btn-ghost.is-loading {
  gap: 8px;
  pointer-events: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-outline-danger:hover,
.btn-success:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.22);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: var(--soft-orange);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline-danger {
  background: var(--white);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--soft-red);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
}

.btn-success:hover {
  background: #16a34a;
}

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

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
    var(--surface-elevated);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

html[data-theme="light"] .card {
  background: var(--surface-elevated);
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--navbar-height) - 86px);
  padding: 86px 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(26, 26, 46, 0.9), rgba(26, 26, 46, 0.56), rgba(26, 26, 46, 0.12)),
    url('https://images.unsplash.com/photo-1621905252507-b35492cc74b4?auto=format&fit=crop&w=1800&q=80') center / cover;
}

.hero-content {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  margin-left: max(16px, calc((100% - 1180px) / 2));
  color: var(--text-inverse);
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--text-inverse);
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.98;
}

.hero p {
  max-width: 670px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, 0.94);
}

.steps-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.step-number,
.feature-icon,
.option-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--soft-orange);
  color: var(--primary-dark);
  font-weight: 800;
}

.feature-icon svg,
.option-icon svg,
.ai-float-btn svg,
.empty-icon svg {
  width: 24px;
  height: 24px;
}

.site-footer {
  padding: 28px 0;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
}

.site-footer .page-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer strong {
  color: var(--text-inverse);
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--navbar-height));
  padding: 48px 16px;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.auth-subtitle {
  margin-bottom: 24px;
  color: var(--text-secondary);
}

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

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  color: var(--text-primary);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  padding: 12px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.field-error-message {
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 700;
}

.input-help {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.role-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.role-option {
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--text-primary);
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.role-option.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 12px 26px rgba(249, 115, 22, 0.25);
}

.skill-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.skills-picker {
  display: grid;
  gap: 16px;
}

.skill-group {
  display: grid;
  gap: 10px;
}

.skill-group-title {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 800;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-primary);
  font-weight: 600;
}

.checkbox-card input {
  width: auto;
  accent-color: var(--primary);
}

.auth-footer {
  margin-top: 20px;
  color: var(--text-secondary);
  text-align: center;
}

.auth-footer a,
.text-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  padding: 0;
}

.forgot-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

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

.otp-input {
  max-width: 220px;
  margin: 0 auto 16px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.dashboard {
  padding: 28px 0 96px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-title h1 {
  margin-bottom: 6px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

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

.tab-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
}

.tab-button {
  position: relative;
  height: var(--navbar-height);
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
  white-space: nowrap;
}

.tab-button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: '';
}

.tab-button.is-active {
  color: var(--primary);
}

.tab-button.is-active::after {
  background: var(--primary);
}

.section-panel {
  display: grid;
  gap: 22px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  align-items: end;
}

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

.electrician-card,
.job-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.electrician-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 800;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
}

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

.location-line,
.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

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

.skill-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft-orange);
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.rating {
  color: var(--primary);
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-inverse);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge-neutral,
.badge-status-pending {
  background: var(--gray);
}

.badge-severity-low,
.badge-status-accepted,
.badge-available {
  background: var(--success);
}

.badge-severity-medium,
.badge-warning {
  background: var(--warning);
}

.badge-severity-high,
.badge-status-rejected,
.badge-unavailable {
  background: var(--danger);
}

.badge-status-matched {
  background: var(--blue);
}

.badge-status-completed {
  background: var(--purple);
}

.badge-soft {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.modal-action-row {
  margin-top: 20px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.option-stack {
  display: grid;
  gap: 16px;
}

.option-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.option-card.is-primary {
  border-color: var(--primary);
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.16);
}

.option-card .btn-full + .btn-full {
  margin-top: 10px;
}

.image-preview {
  display: none;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
}

.image-preview.is-visible {
  display: block;
}

.image-preview-wrap {
  display: none;
  gap: 12px;
  margin-top: 10px;
}

.image-preview-wrap.is-visible {
  display: grid;
}

.image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.image-preview-text {
  min-width: 0;
}

.image-preview-name {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-size {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.image-remove-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--danger);
  font-size: 1.1rem;
  font-weight: 800;
}

.diagnosis-card {
  border-left: 5px solid var(--primary);
}

.matches-list,
.jobs-list,
.modal-matches {
  display: grid;
  gap: 16px;
}

.match-card {
  display: grid;
  gap: 12px;
}

.match-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 800;
}

.match-score-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.match-score-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 220ms ease;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 32px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--soft-orange);
  color: var(--primary);
}

.empty-illustration {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.22), transparent 14px),
    var(--soft-orange);
  color: var(--primary);
}

.empty-illustration svg {
  width: 38px;
  height: 38px;
}

.ai-float-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.36);
  transition: transform 160ms ease, background 160ms ease;
}

.ai-float-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.modal-box.modal-wide {
  width: min(820px, 100%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-row strong {
  color: var(--heading);
}

.job-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-weight: 800;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  transition: background 160ms ease;
}

.switch-slider::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-inverse);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease;
  content: '';
}

.switch input:checked + .switch-slider {
  background: var(--success);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

.line-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-container {
  display: flex;
  min-height: 100vh;
  background: var(--app-background);
}

.chat-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 72px;
  padding: 0 20px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(14px);
}

.chat-title-wrap {
  min-width: 0;
}

.chat-title-wrap h1 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  width: min(900px, 100%);
  height: 100vh;
  margin: 0 auto;
  overflow-y: auto;
  padding: 92px 16px 108px;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 70%;
}

.chat-bubble-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-row.other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  max-width: 100%;
  border-radius: 16px;
  padding: 10px 16px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-bubble-mine {
  margin-left: auto;
  background: var(--primary);
  color: var(--text-inverse);
}

.chat-bubble-other {
  margin-right: auto;
  background: var(--surface-muted);
  color: var(--text-primary);
}

.chat-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.message-status-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1;
}

.message-status-pending {
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.message-status-pending::before,
.message-status-pending::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5px;
  border-radius: 999px;
  background: currentColor;
  content: '';
  transform-origin: 50% 0;
}

.message-status-pending::before {
  height: 4px;
  transform: translate(-50%, -100%);
}

.message-status-pending::after {
  height: 3px;
  transform: translate(-50%, -100%) rotate(90deg);
}

.chat-input-area {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}

.chat-form {
  display: flex;
  flex-wrap: wrap;
  width: min(900px, 100%);
  margin: 0 auto;
  gap: 10px;
}

.chat-form textarea {
  flex: 1 1 260px;
  min-height: 46px;
  max-height: 120px;
  resize: none;
}

.chat-form .field-error-message {
  flex-basis: 100%;
  order: 3;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 40px));
}

.toast {
  padding: 14px 20px;
  border-radius: 8px;
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
  animation: toast-slide-in 220ms ease both;
}

.toast-action {
  width: 100%;
  border: 0;
  text-align: left;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-hide {
  animation: toast-slide-out 220ms ease both;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--loading-overlay-bg);
  backdrop-filter: blur(3px);
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, calc(100% - 32px));
  padding: 24px 30px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.loading-message {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 800;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--soft-orange);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loading-progress {
  display: none;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.loading-progress span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: progress-slide 1200ms ease-in-out infinite;
}

.loading-overlay.is-cold-start .loading-progress {
  display: block;
}

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

@keyframes progress-slide {
  0% {
    transform: translateX(-110%);
  }

  50% {
    transform: translateX(80%);
  }

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

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(36px);
  }

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

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(36px);
  }
}

@media (max-width: 980px) {
  .catalog-grid,
  .steps-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar .btn-primary {
    grid-column: 1 / -1;
  }

  .navbar-inner {
    width: min(100% - 20px, 1180px);
  }

  .tab-nav {
    max-width: 58vw;
    overflow-x: auto;
  }
}

@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: grid;
  }

  .navbar-inner > .nav-actions,
  .navbar-inner > .navbar-right,
  .navbar-inner > .tab-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    padding-top: 60px;
  }

  :root {
    --navbar-height: 60px;
  }

  .navbar-inner {
    width: calc(100% - 16px);
    gap: 10px;
  }

  .logo {
    max-width: 138px;
    font-size: 0.95rem;
    white-space: normal;
  }

  .nav-actions,
  .navbar-right {
    min-width: 0;
    gap: 8px;
  }

  .tab-nav {
    gap: 12px;
    max-width: 46vw;
  }

  .tab-button {
    min-width: max-content;
    padding: 0 2px;
    font-size: 0.86rem;
  }

  .nav-actions .btn-secondary,
  .nav-actions .btn-primary,
  .navbar-right .btn-danger,
  .navbar-right .btn-secondary,
  .theme-toggle-btn {
    padding: 9px 12px;
  }

  .theme-toggle-btn {
    min-width: 42px;
    width: 42px;
  }

  .theme-toggle-label {
    display: none;
  }

  .hero {
    min-height: 620px;
    background-position: center;
  }

  .hero-content {
    margin-left: 16px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 4.2rem);
  }

  .site-footer .page-shell,
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .role-toggle,
  .skill-checkbox-grid,
  .filter-bar,
  .catalog-grid,
  .steps-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .modal-box {
    padding: 20px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .chat-bubble-row {
    max-width: 86%;
  }

  .chat-form {
    align-items: stretch;
  }

  .chat-header {
    gap: 10px;
    padding: 0 10px;
  }

  .chat-title-wrap h1 {
    max-width: 150px;
  }

  .messages-area {
    padding-right: 10px;
    padding-left: 10px;
  }

  .image-preview-meta,
  .card-actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form .btn-primary {
    padding: 10px 14px;
  }

  .ai-float-btn {
    right: 18px;
    bottom: 18px;
  }
}
