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

:root {
  --bg: #f7fbff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fbff;
  --bg-sidebar: rgba(255, 255, 255, 0.88);
  --border: rgba(229, 238, 248, 0.96);
  --border-hover: rgba(79, 124, 255, 0.22);
  --text: #211f2f;
  --text-muted: #6f6a85;
  --accent: #4f7cff;
  --accent-hover: #315bdc;
  --accent-glow: rgba(79, 124, 255, 0.10);
  --accent-light: #4f7cff;
  --danger: #d63031;
  --danger-bg: rgba(214, 48, 49, 0.08);
  --success: #00a878;
  --warning: #d9822b;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f6;
    --bg-sidebar: rgba(244, 244, 246, 0.95);
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f4;
    --text: #1a1a2e;
    --text-muted: #6b6b80;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --accent: #4f7cff;
    --accent-hover: #315bdc;
    --accent-glow: rgba(229, 238, 248, 0.96);
    --accent-light: #4f7cff;
    --danger: #d63031;
    --danger-bg: rgba(214, 48, 49, 0.08);
    --success: #00b894;
    --warning: #e17055;
  }

  .form__input {
    background: rgba(0, 0, 0, 0.04);
  }

  .post-full-text {
    background: rgba(0, 0, 0, 0.02);
  }

  .analysis-card {
    background: rgba(0, 0, 0, 0.02);
  }

  .copy-textarea {
    background: rgba(0, 0, 0, 0.03);
  }

  .btn--secondary {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.10);
  }

  .btn--secondary:hover {
    background: rgba(0, 0, 0, 0.10);
    border-color: rgba(0, 0, 0, 0.18);
  }

  .generated-image__preview {
    background: rgba(0, 0, 0, 0.05);
  }

  .banner-note--muted {
    background: rgba(0, 0, 0, 0.04);
  }

  .badge--red {
    background: rgba(214, 48, 49, 0.12);
    color: #c0392b;
  }

  .badge--yellow {
    background: rgba(225, 112, 85, 0.12);
    color: #c05a2c;
  }

  .badge--green {
    background: rgba(0, 184, 148, 0.12);
    color: #00856a;
  }

  .alert--warning {
    background: rgba(225, 112, 85, 0.08);
    border-color: rgba(225, 112, 85, 0.20);
    color: #c05a2c;
  }

  .alert--success {
    background: rgba(0, 184, 148, 0.08);
    border-color: rgba(0, 184, 148, 0.20);
    color: #00856a;
  }

  .analysis-done-note {
    color: #00856a;
  }

  .generation-error {
    background: rgba(214, 48, 49, 0.06);
    border-color: rgba(214, 48, 49, 0.20);
    color: #c0392b;
  }

  .image-error {
    background: rgba(214, 48, 49, 0.06);
    border-color: rgba(214, 48, 49, 0.20);
    color: #c0392b;
  }
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 10% 0%, #e5f4ff 0, transparent 34%), radial-gradient(circle at 90% 4%, rgba(95, 200, 180, 0.18) 0, transparent 28%), linear-gradient(180deg, #f9fdff 0%, #f7fbff 58%, #ffffff 100%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}

code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-light);
}

/* --- Layout --- */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0 24px 24px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 24px;
}

.sidebar__brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: block;
}

.sidebar__brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}

.sidebar__link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}

.sidebar__link:hover {
  background: var(--bg-card);
  color: var(--text);
}

.sidebar__link.active {
  background: var(--accent-glow);
  color: var(--text);
  font-weight: 600;
}

.sidebar__footer {
  padding: 16px 24px 0;
  border-top: 1px solid var(--border);
}

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  overflow-x: auto;
}

/* --- Page titles --- */

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1rem;
}

/* --- Cards --- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card__icon {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.card__value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card__label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* --- Info box --- */

.info-box {
  background: var(--accent-glow);
  border: 1px solid rgba(79, 124, 255, 0.16);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Form --- */

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.form-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.form__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form__input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

.form__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.btn--danger:hover {
  background: rgba(231, 76, 60, 0.2);
}

.btn--sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.eivo-cell {
  white-space: nowrap;
  text-align: center;
}

/* --- Table --- */

.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

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

.table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--bg-card-hover);
}

.post-text {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Feed note --- */

.feed-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* --- Date cell --- */

.date-cell {
  white-space: nowrap;
  min-width: 120px;
  font-variant-numeric: tabular-nums;
}

/* --- Competitor cell --- */

.competitor-cell {
  white-space: nowrap;
  min-width: 120px;
}

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--red {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.badge--yellow {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.badge--green {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.badge--default {
  background: var(--bg-card);
  color: var(--text-muted);
}

/* --- Empty state --- */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.empty__sub {
  font-size: 0.9rem;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Alert / Warning --- */

.alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.alert--warning {
  background: rgba(241, 196, 15, 0.08);
  border: 1px solid rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.alert--warning span {
  flex: 1;
}

.alert--success {
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  margin-bottom: 24px;
}

.alert--success span {
  flex: 1;
}

/* --- Action bar --- */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 124, 255, 0.16);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.action-bar__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-bar__info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Button group --- */

.btn-group {
  display: flex;
  gap: 6px;
}

/* --- Profile summary card --- */

.profile-banner {
  margin-bottom: 24px;
}

.profile-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.profile-summary__header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-summary__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.profile-summary__item {
  font-size: 0.95rem;
}

.profile-summary__item strong {
  color: var(--text);
}

/* --- Profile page card --- */

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.profile-card__header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-card__row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-card__row:last-child {
  border-bottom: none;
}

.profile-card__label {
  min-width: 100px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.profile-card__value {
  font-size: 0.95rem;
}

/* --- Helper text --- */

.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Link button --- */

.btn--link {
  background: none;
  color: var(--accent-light);
  padding: 4px 0;
  font-size: 0.85rem;
}

.btn--link:hover {
  color: var(--accent);
  opacity: 1;
}

/* --- Detail grid --- */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* --- Card title --- */

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* --- Detail rows --- */

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-row__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-row__value {
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-full-text {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Analysis grid --- */

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.analysis-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition);
}

.analysis-card:hover {
  border-color: var(--border-hover);
}

.analysis-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analysis-card__value {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

/* --- Muted card (empty state) --- */

.muted-card {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.muted-card__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.muted-card__title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.muted-card__sub {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto;
}

/* --- Primary action button --- */

.eivo-action-button {
  width: 100%;
  padding: 12px 24px;
  font-size: 1rem;
  margin-top: 16px;
}

.analyze-form {
  margin-top: 0;
}

/* --- Back link --- */

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 8px 0;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

.analysis-done-note {
  font-size: 0.85rem;
  color: #2ecc71;
  margin-bottom: 16px;
  font-weight: 500;
}

/* --- Analysis section --- */

.analysis-section {
  margin-bottom: 20px;
}

/* --- Generated post --- */

.generated-post {
  text-align: left;
}

.generated-post__title {
  margin-bottom: 20px;
}

.generation-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.copy-box {
  margin-bottom: 0;
}

.copy-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.copy-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.copy-textarea:read-only {
  cursor: text;
  color: var(--text);
}

.generation-actions {
  margin-top: 8px;
}

.image-prompt-box {
  margin-bottom: 0;
}

/* --- Generation error --- */

.generation-error {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #e74c3c;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* --- Generated image --- */

.generated-image {
  text-align: left;
}

.generated-image__preview {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(79, 124, 255, 0.14);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 20px;
  line-height: 0;
  box-shadow: 0 0 24px rgba(31, 73, 125, 0.05);
}

.generated-image__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.image-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.image-error {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #e74c3c;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.download-link {
  text-decoration: none;
}

.image-actions .btn--secondary {
  background: rgba(79, 124, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(79, 124, 255, 0.20);
  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.10);
  font-weight: 600;
}

.image-actions .btn--secondary:hover {
  background: rgba(79, 124, 255, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 124, 255, 0.22);
  opacity: 1;
}

.image-actions .kit-download {
  background: linear-gradient(135deg, #4f7cff, #5fc8b4);
  color: #fff;
  border: 1px solid rgba(79, 124, 255, 0.20);
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.24);
  font-weight: 600;
  text-decoration: none;
}

.image-actions .kit-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(79, 124, 255, 0.30);
  opacity: 1;
}

/* --- Banner note --- */

.banner-note {
  font-size: 0.78rem;
  margin-bottom: 16px;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 500;
}

.banner-note--accent {
  color: #5fc8b4;
  background: rgba(79, 124, 255, 0.10);
  border: 1px solid rgba(79, 124, 255, 0.16);
}

.banner-note--muted {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

/* --- Content actions --- */

.content-actions {
  margin-bottom: 16px;
}

.content-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.copy-button {
  cursor: pointer;
}

.kit-download {
  text-decoration: none;
}

.content-actions .btn {
  background: linear-gradient(135deg, #4f7cff, #5fc8b4);
  color: #fff;
  border: 1px solid rgba(79, 124, 255, 0.20);
  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.18);
  font-weight: 600;
}

.content-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 124, 255, 0.24);
  opacity: 1;
}

.content-actions .kit-download {
  background: linear-gradient(135deg, #4f7cff, #5fc8b4);
  color: #fff;
  border: 1px solid rgba(79, 124, 255, 0.20);
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.24);
  font-weight: 600;
}

.content-actions .kit-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(79, 124, 255, 0.30);
  opacity: 1;
}

/* --- Brandbook --- */

.brand-section {
  margin-top: 8px;
  margin-bottom: 8px;
}

.brand-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.logo-preview {
  margin-top: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-block;
  line-height: 0;
}

.logo-preview__img {
  max-width: 120px;
  max-height: 60px;
  display: block;
  border-radius: 4px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.color-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

.form__file {
  padding: 8px 12px;
  cursor: pointer;
}

.form__color {
  width: 48px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.brand-textarea {
  resize: vertical;
  min-height: 48px;
  font-family: inherit;
}

/* --- Onboarding checklist --- */

.onboarding {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.onboarding__header {
  margin-bottom: 20px;
}

.onboarding__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.onboarding__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.onboarding__progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-glow);
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.onboarding__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color var(--transition), background var(--transition);
}

.onboarding-step:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.onboarding-step--done {
  border-color: rgba(46, 204, 113, 0.18);
  background: rgba(46, 204, 113, 0.04);
  opacity: 0.85;
}

.onboarding-step__marker {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  color: var(--accent);
}

.onboarding-step--done .onboarding-step__marker {
  color: var(--success);
}

.onboarding-step__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.onboarding-step__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.onboarding-step--done .onboarding-step__title {
  color: var(--text-muted);
}

.onboarding-step__description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.onboarding-step__action {
  flex-shrink: 0;
  white-space: nowrap;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar__logo {
    padding: 0 16px 0 0;
    white-space: nowrap;
  }

  .sidebar__brand {
    padding: 0 16px 0 0;
  }

  .sidebar__nav {
    flex-direction: row;
    padding: 0;
    flex: 1;
  }

  .sidebar__link {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .sidebar__footer {
    display: none;
  }

  .main {
    padding: 20px 16px;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

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


/* --- Unified generated content action buttons --- */

.generated-post .content-actions .btn,
.generated-post .generation-actions .btn,
.generated-image .image-actions .btn,
.generated-image .generation-actions .btn {
  background: linear-gradient(135deg, #4f7cff, #5fc8b4) !important;
  color: #fff !important;
  border: 1px solid rgba(79, 124, 255, 0.20) !important;
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.24) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  min-height: 44px !important;
  padding: 0 22px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.generated-post .content-actions .btn:hover,
.generated-post .generation-actions .btn:hover,
.generated-image .image-actions .btn:hover,
.generated-image .generation-actions .btn:hover {
  background: linear-gradient(135deg, #4f7cff, #5fc8b4) !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(79, 124, 255, 0.30) !important;
  opacity: 1 !important;
}

/* --- Loading spinner --- */

.eivo-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: eivo-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

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

.btn.is-loading {
  opacity: 0.95;
  cursor: wait;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

/* --- Eivo Radar orb loader --- */

.eivo-radar-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
}

.eivo-radar-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.12) 0%, rgba(11,11,18,0.9) 100%);
  border: 2px solid rgba(108,92,231,0.15);
}

.eivo-radar-loader::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent, #4f7cff);
  box-shadow: 0 0 10px rgba(108,92,231,0.3);
  animation: eivo-spin 1.5s linear infinite;
}

.eivo-radar-loader__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #4f7cff);
  box-shadow: 0 0 6px var(--accent-glow);
  z-index: 1;
  animation: eivo-pulse 1.5s ease-in-out infinite;
}

@keyframes eivo-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}


/* --- Eivo Radar brand visibility fix --- */

.sidebar__brand {
  gap: 12px;
}

.sidebar__brand-mark {
  width: 46px !important;
  height: 46px !important;
  box-shadow: 0 12px 28px rgba(79, 124, 255, 0.18);
}

.sidebar__brand-text {
  font-size: 1.22rem;
}


/* --- Own page --- */

.own-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.own-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.own-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}

.own-card:hover {
  border-color: var(--border-hover);
}

.own-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.stale-topic {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
}

.own-category {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(79, 124, 255, 0.14);
}

.topic-badge {
  display: inline-block;
  white-space: nowrap;
}

.own-recommendations {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.own-recommendation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  border: 1px solid var(--border);
}


/* --- Weekly plan --- */

.weekly-plan {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.weekly-plan__header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.weekly-plan__summary-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.weekly-plan__summary {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.weekly-plan__items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.weekly-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition);
}

.weekly-item:hover {
  border-color: var(--border-hover);
}

.weekly-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.weekly-item__day {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.weekly-item__category {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(79, 124, 255, 0.14);
}

.weekly-item__reason {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.weekly-item__reason strong {
  color: var(--text);
}

.weekly-item__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.weekly-item__body {
  width: 100%;
  min-height: 120px;
}

.weekly-item__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.weekly-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.weekly-empty__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.weekly-empty__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.weekly-empty__sub {
  font-size: 0.9rem;
  max-width: 500px;
  margin: 0 auto;
}

.weekly-item__banners {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.banner-variants {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.banner-variant {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  width: 200px;
  transition: border-color var(--transition);
}

.banner-variant:hover {
  border-color: var(--border-hover);
}

.banner-variant--chosen {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.04);
}

.banner-variant__preview {
  width: 100%;
  line-height: 0;
  cursor: pointer;
}

.banner-variant__preview img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.banner-variant__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.banner-variant__error {
  font-size: 0.8rem;
  color: var(--danger);
  padding: 4px 8px;
}

.banner-variant__chosen-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(46, 204, 113, 0.1);
  padding: 2px 10px;
  border-radius: 4px;
}

.weekly-plan__bundle-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weekly-plan__bundle-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.3;
}

/* --- Light premium dental theme --- */

.main {
  max-width: 1180px;
}

.sidebar {
  box-shadow: 10px 0 30px rgba(31, 73, 125, 0.05);
}

.card,
.own-card,
.weekly-item,
.weekly-plan__header,
.profile-summary,
.profile-card,
.form-card,
.onboarding,
.table-wrapper {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 45px rgba(55, 89, 130, 0.07);
}

.card:hover,
.own-card:hover,
.weekly-item:hover {
  background: #ffffff;
  border-color: rgba(79, 124, 255, 0.22);
  box-shadow: 0 22px 55px rgba(55, 89, 130, 0.10);
}

.action-bar,
.info-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 255, 0.92));
  border-color: rgba(79, 124, 255, 0.14);
  box-shadow: 0 16px 40px rgba(31, 73, 125, 0.08);
}

.table tbody tr:hover {
  background: rgba(79, 124, 255, 0.035);
}

.analysis-card,
.muted-card,
.post-full-text,
.copy-textarea,
.form__input {
  background: rgba(248, 251, 255, 0.86);
  border-color: rgba(229, 238, 248, 0.96);
}

.generated-image__preview {
  background: linear-gradient(135deg, #ffffff, #f4f9ff);
  border-color: rgba(79, 124, 255, 0.14);
  box-shadow: 0 18px 45px rgba(55, 89, 130, 0.08);
}

.banner-variant {
  background: #ffffff;
  border-color: rgba(79, 124, 255, 0.10);
  box-shadow: 0 12px 30px rgba(55, 89, 130, 0.08);
}

.banner-variant__preview img,
.generated-image__img {
  border-radius: 10px;
}

.banner-variant--chosen {
  border-color: rgba(0, 168, 120, 0.45);
  background: rgba(0, 168, 120, 0.055);
}

.btn--secondary {
  background: rgba(31, 73, 125, 0.08);
  border-color: rgba(79, 124, 255, 0.14);
  color: var(--text);
}

.btn--secondary:hover {
  background: rgba(79, 124, 255, 0.14);
  border-color: rgba(79, 124, 255, 0.24);
}

.weekly-item__banners {
  border-top-color: rgba(229, 238, 248, 0.96);
}

/* --- Lightbox --- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox--open {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox__close:hover {
  opacity: 1;
}


/* --- Weekly Plan banner selection polish v1 --- */

.weekly-item__banners {
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid rgba(229, 238, 248, 0.96);
}

.weekly-banners__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(79, 124, 255, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(244,249,255,0.86));
  box-shadow: 0 16px 38px rgba(31, 73, 125, 0.06);
}

.weekly-banners__title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 850;
}

.weekly-banners__hint {
  margin: 0;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.weekly-banners__empty {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px dashed rgba(79, 124, 255, 0.22);
  border-radius: 22px;
  background: rgba(248, 251, 255, 0.86);
}

.weekly-banners__empty p {
  margin: 0;
  color: var(--text-muted);
}

.banner-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 12px;
}

.banner-variant {
  width: auto;
  padding: 14px;
  gap: 12px;
  align-items: stretch;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.08);
}

.banner-variant:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 124, 255, 0.24);
  box-shadow: 0 24px 58px rgba(55, 89, 130, 0.12);
}

.banner-variant--chosen {
  border-color: rgba(0, 168, 120, 0.38);
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.15), transparent 32%),
    linear-gradient(180deg, #ffffff, #f3fffb);
  box-shadow: 0 24px 62px rgba(0, 168, 120, 0.12);
}

.banner-variant__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.banner-variant__label {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-size: 0.8rem;
  font-weight: 850;
}

.banner-variant__preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f9ff;
  cursor: zoom-in;
  box-shadow: 0 16px 40px rgba(31, 73, 125, 0.10);
}

.banner-variant__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.banner-variant__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.banner-variant__size {
  font-size: 0.78rem;
  color: #98a2b3;
  font-weight: 700;
}

.banner-variant__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 36px;
}

.banner-variant__actions .inline-form {
  width: 100%;
}

.banner-variant__actions .btn {
  width: 100%;
}

.banner-variant__chosen-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: #00856a;
  background: rgba(0, 168, 120, 0.10);
  border: 1px solid rgba(0, 168, 120, 0.16);
  font-size: 0.78rem;
  font-weight: 850;
}

.banner-variant__selected-button,
.banner-variant__selected-button:disabled {
  opacity: 1;
  color: #00856a;
  background: rgba(233, 251, 246, 0.92);
  border-color: rgba(0, 168, 120, 0.18);
  cursor: default;
}

.lightbox {
  background: rgba(14, 24, 40, 0.82);
}

.lightbox__img {
  max-width: min(94vw, 1280px);
  max-height: 88vh;
  border-radius: 22px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
}

.lightbox__close {
  width: 48px;
  height: 48px;
  top: 22px;
  right: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 2rem;
}

@media (max-width: 760px) {
  .weekly-banners__header,
  .weekly-banners__empty {
    flex-direction: column;
    align-items: stretch;
  }

  .banner-variants {
    grid-template-columns: 1fr;
  }

  .banner-variant {
    padding: 12px;
  }
}


/* --- Onboarding Wizard v1 --- */

.onboarding-wizard {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.wizard-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid rgba(79, 124, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(244,249,255,0.9));
  box-shadow: 0 22px 58px rgba(31, 73, 125, 0.08);
}

.wizard-hero__eyebrow {
  margin-bottom: 8px;
  color: #4f7cff;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.wizard-hero__progress {
  min-width: 132px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 14px 34px rgba(55, 89, 130, 0.08);
  text-align: right;
}

.wizard-hero__progress span {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.wizard-hero__progress strong {
  color: var(--text);
  font-size: 1.35rem;
}

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

.wizard-progress__step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-muted);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(55, 89, 130, 0.05);
}

.wizard-progress__step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-weight: 850;
  font-size: 0.82rem;
}

.wizard-progress__step small {
  font-size: 0.78rem;
  font-weight: 750;
}

.wizard-progress__step--active {
  border-color: rgba(79, 124, 255, 0.28);
  background: linear-gradient(135deg, #ffffff, #f3f7ff);
  color: var(--text);
}

.wizard-progress__step--done span {
  background: rgba(0, 168, 120, 0.10);
  color: #00856a;
}

.wizard-card {
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 24px 62px rgba(55, 89, 130, 0.08);
}

.wizard-card__header {
  margin-bottom: 22px;
}

.wizard-card__header h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.wizard-card__header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}

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

.wizard-note {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(244, 249, 255, 0.92), rgba(236, 255, 249, 0.72));
  border: 1px solid rgba(79, 124, 255, 0.12);
  color: var(--text-muted);
  line-height: 1.55;
}

.wizard-safety {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 247, 225, 0.78);
  border: 1px solid rgba(218, 165, 32, 0.22);
  color: #7a5a10;
  line-height: 1.55;
  font-size: 0.92rem;
}

.wizard-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-list__title {
  color: var(--text);
  font-weight: 850;
}

.wizard-list__item,
.wizard-list__empty {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.88);
  border: 1px solid rgba(229, 238, 248, 0.96);
  color: var(--text-muted);
}

.wizard-list__item strong {
  color: var(--text);
}

.wizard-finish {
  text-align: center;
  padding: 12px 0 4px;
}

.wizard-finish__mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: rgba(0, 168, 120, 0.10);
  color: #00856a;
  font-size: 2rem;
  font-weight: 850;
}

.wizard-finish h2 {
  margin: 0 0 10px;
}

.wizard-finish p {
  max-width: 620px;
  margin: 0 auto 20px;
  color: var(--text-muted);
  line-height: 1.65;
}

.wizard-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.wizard-checklist div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(229, 238, 248, 0.96);
  font-weight: 750;
}

.wizard-checklist .is-done {
  color: #00856a;
  background: rgba(0, 168, 120, 0.08);
  border-color: rgba(0, 168, 120, 0.16);
}

@media (max-width: 860px) {
  .wizard-hero {
    flex-direction: column;
  }

  .wizard-hero__progress {
    width: 100%;
    text-align: left;
  }

  .wizard-progress,
  .wizard-checklist {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    justify-content: stretch;
  }

  .wizard-actions .btn,
  .wizard-actions form,
  .wizard-actions button {
    width: 100%;
  }

  .wizard-list__item {
    flex-direction: column;
  }
}


/* --- Onboarding clinic hub --- */

.clinic-hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.clinic-folder {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 26px;
  text-decoration: none;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.08);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.clinic-folder:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 124, 255, 0.26);
  box-shadow: 0 26px 64px rgba(55, 89, 130, 0.13);
}

.clinic-folder--featured {
  background:
    radial-gradient(circle at top right, rgba(79, 124, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #ffffff, #f4f8ff);
}

.clinic-folder__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(237, 244, 255, 0.92);
  font-size: 1.35rem;
}

.clinic-folder__label {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.09);
  color: #315bdc;
  font-size: 0.75rem;
  font-weight: 850;
}

.clinic-folder h3 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.clinic-folder p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.clinic-folder strong {
  color: #4f7cff;
  font-size: 0.9rem;
}

.clinic-section {
  padding: 22px;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.08);
}

.clinic-section__back {
  display: inline-block;
  margin-bottom: 16px;
  color: #4f7cff;
  text-decoration: none;
  font-weight: 750;
}

.clinic-section__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.clinic-section__header h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.clinic-section__header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.doctor-card-mock {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px dashed rgba(79, 124, 255, 0.26);
}

.doctor-card-mock__photo {
  min-height: 160px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(237, 244, 255, 0.92);
  color: var(--text-muted);
  font-weight: 850;
}

.doctor-card-mock__title {
  font-weight: 850;
  margin-bottom: 12px;
}

.doctor-card-mock__grid,
.clinic-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.doctor-card-mock__grid span,
.clinic-placeholder-grid div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(229, 238, 248, 0.96);
  color: var(--text-muted);
}

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

  .clinic-section__header,
  .doctor-card-mock {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .doctor-card-mock__grid,
  .clinic-placeholder-grid {
    grid-template-columns: 1fr;
  }
}


/* --- Specialists frontend page inside onboarding --- */

.specialist-section__header {
  align-items: center;
}

.specialist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.specialist-form-card,
.specialist-preview-card {
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.07);
}

.specialist-form-card {
  padding: 20px;
}

.specialist-form-card__title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  margin-bottom: 4px;
}

.specialist-form-card__sub {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.specialist-editor {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.specialist-photo-drop {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(95, 200, 180, 0.12), transparent 42%),
    rgba(237, 244, 255, 0.78);
  border: 1px dashed rgba(79, 124, 255, 0.34);
  color: var(--text-muted);
}

.specialist-photo-drop__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #ffffff;
  color: #4f7cff;
  font-size: 1.7rem;
  box-shadow: 0 14px 32px rgba(55, 89, 130, 0.08);
}

.specialist-photo-drop strong {
  color: var(--text);
}

.specialist-photo-drop span {
  font-size: 0.84rem;
  line-height: 1.35;
}

.specialist-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.specialist-chips {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.specialist-chips span {
  padding: 8px 11px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-size: 0.82rem;
  font-weight: 800;
}

.specialist-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.specialist-preview-card {
  padding: 20px;
  height: fit-content;
}

.specialist-preview-card__label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 168, 120, 0.10);
  color: #00856a;
  font-size: 0.76rem;
  font-weight: 850;
}

.specialist-preview-card h4 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.specialist-preview-card p {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.specialist-preview-card__list {
  display: grid;
  gap: 8px;
}

.specialist-preview-card__list span {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(229, 238, 248, 0.96);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 750;
}

@media (max-width: 980px) {
  .specialist-layout,
  .specialist-editor {
    grid-template-columns: 1fr;
  }
}


/* --- Specialist multi-specialty picker --- */

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

.specialty-picker label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(229, 238, 248, 0.96);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
}

.specialty-picker label:hover {
  border-color: rgba(79, 124, 255, 0.24);
  background: #ffffff;
}

.specialty-picker input {
  width: 16px;
  height: 16px;
  accent-color: #4f7cff;
}

.specialty-picker input:checked + span {
  color: #315bdc;
}

@media (max-width: 760px) {
  .specialty-picker {
    grid-template-columns: 1fr;
  }
}


/* --- Specialists active frontend list --- */

.specialist-photo-drop {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.specialist-photo-drop__preview {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 16px 38px rgba(55, 89, 130, 0.14);
}

.specialists-list-area {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(229, 238, 248, 0.96);
}

.specialists-list-area__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.specialists-list-area__header h4 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.specialists-list-area__header span {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.specialists-list {
  display: grid;
  gap: 10px;
}

.specialists-list__empty {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px dashed rgba(79, 124, 255, 0.24);
  color: var(--text-muted);
}

.specialist-person {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 12px 30px rgba(55, 89, 130, 0.06);
}

.specialist-person__avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #edf4ff, #eafff7);
  color: #315bdc;
  font-weight: 900;
}

.specialist-person__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specialist-person__body {
  min-width: 0;
}

.specialist-person__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
}

.specialist-person__top strong {
  color: var(--text);
  font-size: 0.96rem;
}

.specialist-person__top span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.specialist-person__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.specialist-person__specs span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-size: 0.75rem;
  font-weight: 800;
}

.specialist-person__meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .specialist-person {
    grid-template-columns: 48px 1fr;
  }

  .specialist-person__avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }
}


/* --- VK-like clickable specialist rows --- */

.specialist-person {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(229, 238, 248, 0.96);
  cursor: pointer;
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.specialist-person:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 255, 0.24);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(55, 89, 130, 0.10);
}

.specialist-person:focus-visible {
  outline: 3px solid rgba(79, 124, 255, 0.28);
  outline-offset: 2px;
}

.specialist-person__arrow {
  align-self: center;
  justify-self: end;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(237, 244, 255, 0.92);
  color: #315bdc;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 700;
}

.specialist-detail-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(79, 124, 255, 0.16);
  box-shadow: 0 20px 48px rgba(55, 89, 130, 0.09);
}

.specialist-detail-panel__header {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.specialist-detail-panel__avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #edf4ff, #eafff7);
  color: #315bdc;
  font-size: 1.2rem;
  font-weight: 900;
}

.specialist-detail-panel__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specialist-detail-panel__eyebrow {
  color: #4f7cff;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.specialist-detail-panel h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.2rem;
}

.specialist-detail-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.specialist-detail-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.specialist-detail-panel__chips span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-size: 0.78rem;
  font-weight: 850;
}

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

.specialist-detail-panel__grid div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.specialist-detail-panel__grid small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 5px;
}

.specialist-detail-panel__grid strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .specialist-detail-panel__header,
  .specialist-detail-panel__grid {
    grid-template-columns: 1fr;
  }

  .specialist-person__arrow {
    display: none;
  }
}


/* --- Specialist drill-down profile view --- */

.specialist-section--profile-open .specialist-section__header,
.specialist-section--profile-open .specialist-editor,
.specialist-section--profile-open .specialists-list-area__header,
.specialist-section--profile-open .specialists-list,
.specialist-section--profile-open .specialist-preview-card,
.specialist-section--profile-open .specialist-detail-panel,
.specialist-section--profile-open .specialist-form-card__title,
.specialist-section--profile-open .specialist-form-card__sub {
  display: none !important;
}

.specialist-section--profile-open .specialist-layout {
  grid-template-columns: 1fr;
}

.specialist-section--profile-open .specialist-form-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.specialist-person__arrow {
  display: none !important;
}

.specialist-profile-view {
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.16), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(79, 124, 255, 0.16);
  box-shadow: 0 24px 64px rgba(55, 89, 130, 0.10);
}

.specialist-profile-view__back {
  appearance: none;
  border: 0;
  background: transparent;
  color: #4f7cff;
  font-weight: 850;
  cursor: pointer;
  padding: 0;
  margin-bottom: 22px;
}

.specialist-profile-view__hero {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.specialist-profile-view__avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(135deg, #edf4ff, #eafff7);
  color: #315bdc;
  font-size: 1.8rem;
  font-weight: 950;
  box-shadow: 0 18px 44px rgba(55, 89, 130, 0.12);
}

.specialist-profile-view__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specialist-profile-view__eyebrow {
  color: #4f7cff;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}

.specialist-profile-view h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.specialist-profile-view p {
  margin: 0;
  color: var(--text-muted);
}

.specialist-profile-view__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.specialist-profile-view__chips span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315bdc;
  font-size: 0.84rem;
  font-weight: 850;
}

.specialist-profile-view__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.specialist-profile-view__grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.specialist-profile-view__wide {
  grid-column: 1 / -1;
}

.specialist-profile-view__grid small {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.specialist-profile-view__grid strong {
  display: block;
  color: var(--text);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .specialist-profile-view__hero,
  .specialist-profile-view__grid {
    grid-template-columns: 1fr;
  }
}


/* --- Specialist profile edit and materials folder --- */

.specialist-profile-view__actions {
  justify-self: end;
}

.specialist-profile-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.specialist-materials {
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.specialist-materials__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.specialist-materials__header h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.05rem;
}

.specialist-materials__header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

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

.specialist-materials__empty {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px dashed rgba(79, 124, 255, 0.24);
  color: var(--text-muted);
}

.specialist-material {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.specialist-material__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #edf4ff;
  color: #315bdc;
  font-weight: 900;
}

.specialist-material__body {
  min-width: 0;
}

.specialist-material__body strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.specialist-material__body span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

@media (max-width: 760px) {
  .specialist-profile-view__actions {
    justify-self: start;
  }

  .specialist-materials__header {
    flex-direction: column;
  }

  .specialist-materials__grid {
    grid-template-columns: 1fr;
  }
}


/* --- Onboarding safety polish --- */

.specialist-materials__empty span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

#specialist-materials-add:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}


/* --- Sidebar Navigation v2 / Product Architecture --- */

.sidebar-nav-v2 {
  gap: 14px;
  padding-right: 6px;
  overflow-y: auto;
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(229, 238, 248, 0.72);
}

.sidebar__group:last-child {
  border-bottom: 0;
}

.sidebar__group-title {
  padding: 8px 12px 4px;
  color: #8a94a8;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav-v2 .sidebar__link {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.2;
}

.sidebar-nav-v2 .sidebar__link.active {
  background: rgba(79, 124, 255, 0.10);
  color: #172033;
  font-weight: 850;
  box-shadow: inset 3px 0 0 rgba(79, 124, 255, 0.48);
}

.sidebar-nav-v2 .sidebar__link--disabled {
  color: #a2aabd;
  cursor: default;
  pointer-events: none;
  background: transparent;
}

.sidebar-nav-v2 .sidebar__link--disabled:hover {
  background: transparent;
  color: #a2aabd;
}

.sidebar__badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.08);
  color: #7180a1;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.sidebar__footer {
  border-top: 1px solid rgba(229, 238, 248, 0.72);
  padding-top: 12px;
}

@media (max-width: 860px) {
  .sidebar-nav-v2 {
    max-height: none;
    overflow: visible;
  }

  .sidebar__group {
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .sidebar__group-title {
    display: none;
  }

  .sidebar__badge {
    display: none;
  }
}


/* --- Sidebar Navigation v2 accordion polish --- */

.sidebar-nav-v2 {
  gap: 8px;
}

.sidebar__group {
  border-bottom: 1px solid rgba(229, 238, 248, 0.72);
  padding: 0 0 8px;
}

.sidebar__group-toggle {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  color: #8a94a8;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.sidebar__group-toggle:hover {
  background: rgba(79, 124, 255, 0.06);
  color: #526178;
}

.sidebar__group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(237, 244, 255, 0.9);
  color: #7180a1;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.sidebar__group--open .sidebar__group-chevron {
  transform: rotate(90deg);
  color: #315bdc;
}

.sidebar__group-body {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0 0;
}

.sidebar__group--open .sidebar__group-body {
  display: flex;
}

.sidebar__group--open .sidebar__group-toggle {
  color: #526178;
}

.sidebar-nav-v2 .sidebar__link {
  margin-left: 0;
}

.sidebar-nav-v2 .sidebar__link--disabled {
  opacity: 0.72;
}

.sidebar-nav-v2 .sidebar__group-title {
  display: none;
}


/* --- Sidebar accordion group title juice polish --- */

.sidebar__group-toggle {
  position: relative;
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 16px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.105em;
  background: rgba(255, 255, 255, 0.42);
}

.sidebar__group-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f7cff, #5fc8b4);
  box-shadow: 0 0 0 5px rgba(79, 124, 255, 0.08);
  opacity: 0.55;
  margin-right: 2px;
}

.sidebar__group-toggle span:first-child {
  flex: 1;
}

.sidebar__group-toggle:hover {
  background: rgba(79, 124, 255, 0.075);
  color: #334155;
}

.sidebar__group--open .sidebar__group-toggle {
  color: #315bdc;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.14), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(237,244,255,0.86));
  box-shadow: 0 12px 28px rgba(55, 89, 130, 0.08);
}

.sidebar__group--open .sidebar__group-toggle::before {
  opacity: 1;
}

.sidebar__group-chevron {
  background: rgba(79, 124, 255, 0.11);
  color: #315bdc;
  font-weight: 950;
}

.sidebar__group--open .sidebar__group-chevron {
  background: #4f7cff;
  color: #ffffff;
}

.sidebar__group {
  padding-bottom: 10px;
}

.sidebar__group:not(.sidebar__group--open) .sidebar__group-toggle {
  box-shadow: none;
}


/* --- Sidebar disabled roadmap links readability polish --- */

.sidebar-nav-v2 .sidebar__link--disabled {
  opacity: 1;
  color: #6f7890;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(229, 238, 248, 0.52);
}

.sidebar-nav-v2 .sidebar__link--disabled:hover {
  background: rgba(255, 255, 255, 0.34);
  color: #6f7890;
}

.sidebar-nav-v2 .sidebar__link--disabled .sidebar__badge {
  background: rgba(79, 124, 255, 0.13);
  color: #6072a4;
  border: 1px solid rgba(79, 124, 255, 0.10);
  font-weight: 900;
}

.sidebar__group--open .sidebar__link--disabled {
  color: #68748a;
  background: rgba(248, 251, 255, 0.72);
}

.sidebar__group--open .sidebar__link--disabled .sidebar__badge {
  background: rgba(79, 124, 255, 0.16);
  color: #4f63a0;
}


/* --- Sidebar disabled roadmap links final tone polish --- */

.sidebar-nav-v2 .sidebar__link--disabled {
  color: #4f5d75;
  font-weight: 500;
  background: transparent;
  border-color: rgba(229, 238, 248, 0.42);
}

.sidebar-nav-v2 .sidebar__link--disabled:hover {
  color: #4f5d75;
  background: transparent;
}

.sidebar__group--open .sidebar__link--disabled {
  color: #46566f;
  font-weight: 500;
  background: rgba(248, 251, 255, 0.42);
}

.sidebar-nav-v2 .sidebar__link--disabled .sidebar__badge {
  color: #536488;
  background: rgba(79, 124, 255, 0.12);
  border-color: rgba(79, 124, 255, 0.08);
  font-weight: 750;
}

.sidebar__group--open .sidebar__link--disabled .sidebar__badge {
  color: #4c5f86;
  background: rgba(79, 124, 255, 0.14);
}


/* --- Costing frontend foundation --- */

.costing-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.costing-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(79, 124, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(244,249,255,0.9));
  box-shadow: 0 22px 58px rgba(31, 73, 125, 0.08);
}

.costing-eyebrow {
  margin-bottom: 8px;
  color: #4f7cff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.costing-hero__card {
  min-width: 220px;
  padding: 16px 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 16px 38px rgba(55, 89, 130, 0.08);
}

.costing-hero__card span,
.costing-hero__card small {
  display: block;
  color: var(--text-muted);
}

.costing-hero__card strong {
  display: block;
  margin: 5px 0;
  color: var(--text);
  font-size: 1.1rem;
}

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

.costing-kpi,
.costing-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.07);
}

.costing-kpi {
  padding: 18px;
  border-radius: 22px;
}

.costing-kpi span,
.costing-kpi small {
  display: block;
  color: var(--text-muted);
}

.costing-kpi strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.costing-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr) 320px;
  gap: 18px;
  align-items: start;
}

.costing-panel {
  border-radius: 26px;
  padding: 22px;
}

.costing-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.costing-panel__header h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 1.16rem;
  letter-spacing: -0.03em;
}

.costing-panel__header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.costing-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248,251,255,0.96), rgba(236,255,249,0.58));
  border: 1px dashed rgba(79, 124, 255, 0.24);
}

.costing-empty__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #ffffff;
  color: #4f7cff;
  font-size: 1.8rem;
  box-shadow: 0 16px 36px rgba(55, 89, 130, 0.08);
}

.costing-empty strong {
  color: var(--text);
}

.costing-empty span {
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-service-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.costing-cost-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-cost-box span,
.costing-cost-box small {
  display: block;
  color: var(--text-muted);
}

.costing-cost-box strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-size: 1.3rem;
}

.costing-material-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(244,249,255,0.86));
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-material-row strong,
.costing-material-row span {
  display: block;
}

.costing-material-row span {
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.4;
}

.costing-margin-card {
  text-align: center;
  padding: 22px 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-margin-card__circle {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(237, 244, 255, 0.9);
  color: #315bdc;
  font-size: 2rem;
  font-weight: 900;
}

.costing-margin-card h3 {
  margin: 0 0 8px;
}

.costing-margin-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.costing-status-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.costing-status-list div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px solid rgba(229, 238, 248, 0.96);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.cost-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.cost-dot--green { background: #00a878; }
.cost-dot--yellow { background: #f2b84b; }
.cost-dot--red { background: #e85d75; }

.costing-roadmap-note {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 247, 225, 0.76);
  border: 1px solid rgba(218, 165, 32, 0.22);
  color: #7a5a10;
  line-height: 1.55;
}

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

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

@media (max-width: 760px) {
  .costing-hero,
  .costing-panel__header,
  .costing-material-row {
    flex-direction: column;
  }

  .costing-kpis,
  .costing-service-grid {
    grid-template-columns: 1fr;
  }

  .costing-hero__card {
    width: 100%;
  }
}


/* --- Costing frontend first polish --- */

.costing-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-areas:
    "directions service"
    "directions margin";
}

.costing-panel--directions {
  grid-area: directions;
}

.costing-panel--service {
  grid-area: service;
}

.costing-panel--margin {
  grid-area: margin;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.costing-panel--margin .costing-panel__header {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.costing-panel__header h2 {
  font-size: 1.28rem;
}

.costing-empty {
  min-height: 320px;
  padding: 28px;
}

.costing-empty strong {
  font-size: 1.08rem;
}

.costing-empty span {
  max-width: 260px;
}

.costing-roadmap-note {
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.10), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(244,249,255,0.86));
  border-color: rgba(79, 124, 255, 0.12);
  color: var(--text-muted);
}

.costing-roadmap-note strong {
  color: var(--text);
}

@media (max-width: 1180px) {
  .costing-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "directions"
      "service"
      "margin";
  }

  .costing-panel--margin {
    grid-template-columns: 1fr;
  }
}


/* --- Costing frontend interactivity --- */

.costing-page [hidden],
.costing-page .is-hidden {
  display: none !important;
}

.costing-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-inline-form--material {
  grid-template-columns: minmax(0, 1fr) 160px auto;
  margin-top: 12px;
}

.costing-directions-list,
.costing-materials-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.costing-direction-item {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px 15px;
  border-radius: 18px;
  cursor: pointer;
  color: var(--text);
}

.costing-direction-item:hover {
  border-color: rgba(79, 124, 255, 0.24);
  box-shadow: 0 14px 34px rgba(55, 89, 130, 0.08);
}

.costing-direction-item--active {
  border-color: rgba(79, 124, 255, 0.34);
  background: linear-gradient(135deg, #ffffff, #edf4ff);
  box-shadow: inset 3px 0 0 rgba(79, 124, 255, 0.5);
}

.costing-direction-item strong,
.costing-direction-item span {
  display: block;
}

.costing-direction-item span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.costing-mini-empty {
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px dashed rgba(79, 124, 255, 0.22);
  color: var(--text-muted);
}

.costing-material-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-material-item strong,
.costing-material-item span {
  display: block;
}

.costing-material-item span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.costing-material-item b {
  color: var(--text);
}

@media (max-width: 760px) {
  .costing-inline-form,
  .costing-inline-form--material {
    grid-template-columns: 1fr;
  }
}


/* --- Costing direction autocomplete polish --- */

.costing-direction-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.costing-inline-form .costing-direction-input-wrap .form__input {
  width: 100%;
}

.costing-inline-form .form__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}


/* --- Costing top margin dashboard gauges --- */

.costing-margin-dashboard {
  min-width: 420px;
  max-width: 560px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 238, 248, 0.96);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.08);
}

.costing-margin-dashboard__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.costing-margin-dashboard__header span,
.costing-margin-dashboard__header small {
  display: block;
  color: var(--text-muted);
}

.costing-margin-dashboard__header strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.costing-margin-dashboard__header small {
  max-width: 250px;
  line-height: 1.45;
  font-size: 0.82rem;
}

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

.costing-gauges__empty {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px dashed rgba(79, 124, 255, 0.22);
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-gauge-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-gauge-card strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.2;
}

.costing-gauge-card span {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.costing-gauge {
  --gauge-value: 0;
  position: relative;
  width: 88px;
  height: 48px;
  overflow: hidden;
  border-radius: 88px 88px 0 0;
  background:
    conic-gradient(from 270deg at 50% 100%,
      #e85d75 0deg 42deg,
      #f2b84b 42deg 90deg,
      #00a878 90deg 180deg,
      transparent 180deg 360deg);
}

.costing-gauge::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 34px;
  border-radius: 70px 70px 0 0;
  background: #f8fbff;
}

.costing-gauge__needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 40px;
  background: #315bdc;
  border-radius: 999px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(calc(-90deg + (var(--gauge-value) * 1.8deg)));
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(49, 91, 220, 0.08);
}

.costing-gauge__center {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #315bdc;
  z-index: 3;
  border: 3px solid #ffffff;
}

@media (max-width: 1180px) {
  .costing-margin-dashboard {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .costing-gauges {
    grid-template-columns: 1fr;
  }
}


/* --- Costing KPI strip hidden after margin dashboard redesign --- */

.costing-kpis {
  display: none !important;
}


/* --- Costing direction checkbox picker --- */

.costing-direction-picker {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(95, 200, 180, 0.10), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(79, 124, 255, 0.16);
  box-shadow: 0 18px 46px rgba(55, 89, 130, 0.08);
}

.costing-direction-picker__header {
  margin-bottom: 14px;
}

.costing-direction-picker__header strong,
.costing-direction-picker__header span {
  display: block;
}

.costing-direction-picker__header strong {
  color: var(--text);
  font-size: 1.05rem;
}

.costing-direction-picker__header span {
  margin-top: 5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-direction-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.costing-direction-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(229, 238, 248, 0.96);
  cursor: pointer;
  color: var(--text);
  font-weight: 750;
}

.costing-direction-check:hover {
  border-color: rgba(79, 124, 255, 0.24);
  background: #ffffff;
}

.costing-direction-check input {
  width: 16px;
  height: 16px;
  accent-color: #4f7cff;
}

.costing-direction-custom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.costing-direction-picker__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .costing-direction-checks {
    grid-template-columns: 1fr;
  }
}

/* --- Costing premium dashboard reset --- */

.costing-hero {
  display: flex !important;
  flex-direction: column !important;
  gap: 28px !important;
  padding: 36px 40px 42px !important;
  min-height: auto !important;
}

.costing-hero > div:first-child {
  display: block !important;
  max-width: 760px !important;
}

.costing-margin-dashboard {
  width: 100% !important;
  max-width: none !important;
  min-height: 320px !important;
  padding: 38px 42px 44px !important;
  border-radius: 34px !important;
  background: #ffffff !important;
  border: 1px solid rgba(218, 232, 248, 0.95) !important;
  box-shadow: 0 24px 70px rgba(70, 96, 130, 0.09) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.costing-margin-dashboard__header {
  display: none !important;
}

.costing-margin-dashboard__title {
  display: block !important;
  margin: 0 0 36px !important;
  text-align: center !important;
  font-size: 1.7rem !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
  color: var(--text) !important;
}

.costing-gauges {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 24px !important;
  align-items: stretch !important;
  justify-content: center !important;
}

.costing-gauge-card {
  min-width: 0 !important;
  min-height: 170px !important;
  padding: 26px 22px !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, #ffffff, #f9fbff) !important;
  border: 1px solid rgba(218, 232, 248, 0.95) !important;
  box-shadow: 0 16px 42px rgba(70, 96, 130, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.costing-gauge-card strong,
.costing-gauge-card span {
  display: none !important;
}

.costing-gauge {
  transform: scale(1.32) !important;
  transform-origin: center !important;
  margin: 0 auto !important;
}

.costing-gauges__empty {
  grid-column: 1 / -1 !important;
  text-align: center !important;
  padding: 28px !important;
}

@media (max-width: 900px) {
  .costing-hero {
    padding: 28px 22px 32px !important;
  }

  .costing-margin-dashboard {
    padding: 30px 22px 34px !important;
  }

  .costing-gauges {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .costing-gauges {
    grid-template-columns: 1fr !important;
  }
}


/* --- Costing persistence v1 premium flow --- */

.costing-hero__intro {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.costing-save-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.costing-save-status--saved {
  border-color: rgba(0, 168, 120, 0.18);
  background: rgba(237, 252, 247, 0.92);
  color: #087a5b;
}

.costing-save-status--saving,
.costing-save-status--pending {
  border-color: rgba(79, 124, 255, 0.18);
  background: rgba(237, 244, 255, 0.94);
  color: #315bdc;
}

.costing-save-status--error {
  border-color: rgba(232, 93, 117, 0.2);
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f;
}

.costing-save-status--readonly {
  border-color: rgba(156, 170, 194, 0.2);
  background: rgba(248, 251, 255, 0.96);
  color: #64748b;
}

.costing-margin-dashboard {
  justify-content: flex-start !important;
  min-height: auto !important;
}

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

.costing-margin-dashboard .costing-margin-dashboard__title {
  margin: 0 0 7px !important;
  text-align: left !important;
  font-size: 1.45rem !important;
}

.costing-margin-dashboard__top p {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.costing-margin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.costing-direction-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.costing-direction-summary--single {
  grid-template-columns: 1fr;
}

.costing-margin-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-height: 150px;
  place-items: center;
  text-align: center;
  padding: 26px;
  border-radius: 26px;
  border: 1px dashed rgba(79, 124, 255, 0.22);
  background: linear-gradient(135deg, #ffffff, rgba(244, 249, 255, 0.86));
}

.costing-margin-empty strong,
.costing-margin-empty span {
  display: block;
}

.costing-margin-empty strong {
  color: var(--text);
  font-size: 1.02rem;
}

.costing-margin-empty span {
  max-width: 470px;
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-margin-service-card {
  appearance: none;
  display: grid;
  gap: 14px;
  width: 100%;
  min-height: 170px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 42px rgba(70, 96, 130, 0.06);
}

.costing-margin-service-card:hover {
  border-color: rgba(79, 124, 255, 0.24);
  transform: translateY(-1px);
}

.costing-margin-service-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.costing-margin-service-card__header strong,
.costing-margin-service-card__header span {
  display: block;
}

.costing-margin-service-card__header strong {
  color: var(--text);
  line-height: 1.25;
}

.costing-margin-service-card__header span,
.costing-margin-service-card p {
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-margin-service-card p {
  margin: 0;
}

.costing-margin-badge {
  flex: 0 0 auto;
  max-width: 150px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.costing-margin-badge--green {
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
}

.costing-margin-badge--yellow {
  background: rgba(255, 248, 232, 0.96);
  color: #93620f;
}

.costing-margin-badge--red {
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f;
}

.costing-margin-badge--muted {
  background: rgba(241, 245, 249, 0.96);
  color: #64748b;
}

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

.costing-margin-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.96);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-margin-metrics span,
.costing-margin-metrics strong {
  display: block;
}

.costing-margin-metrics span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.costing-margin-metrics strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.costing-overall-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: center;
  min-height: 220px;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background:
    radial-gradient(circle at 100% 0%, rgba(95, 200, 180, 0.11), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 22px 58px rgba(70, 96, 130, 0.08);
}

.costing-overall-card__gauge {
  width: 178px;
  height: 100px;
}

.costing-overall-card__body {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.costing-overall-card__eyebrow {
  color: #087a5b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.costing-overall-card__title {
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1.18;
}

.costing-overall-card__body p {
  max-width: 520px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.costing-overall-card__metrics div {
  min-width: 0;
  padding: 12px;
  border-radius: 17px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: rgba(255, 255, 255, 0.82);
}

.costing-overall-card__metrics span,
.costing-overall-card__metrics strong {
  display: block;
}

.costing-overall-card__metrics span {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.costing-overall-card__metrics strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.costing-overall-card--green .costing-direction-gauge__needle,
.costing-overall-card--green .costing-direction-gauge__center {
  background: #087a5b;
}

.costing-overall-card--yellow .costing-direction-gauge__needle,
.costing-overall-card--yellow .costing-direction-gauge__center {
  background: #93620f;
}

.costing-overall-card--red .costing-direction-gauge__needle,
.costing-overall-card--red .costing-direction-gauge__center {
  background: #b4233f;
}

.costing-direction-summary-card {
  appearance: none;
  width: 100%;
  min-height: 220px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 46px rgba(70, 96, 130, 0.07);
}

.costing-direction-summary-card:hover {
  border-color: rgba(79, 124, 255, 0.26);
  transform: translateY(-1px);
}

.costing-direction-summary-card--featured {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  min-height: 170px;
  padding: 24px;
}

.costing-direction-summary-card--featured .costing-direction-gauge {
  width: 156px;
  height: 88px;
}

.costing-direction-summary-card--featured .costing-direction-summary-card__body strong {
  font-size: 1.25rem;
}

.costing-direction-gauge {
  --gauge-value: 0;
  position: relative;
  width: 132px;
  height: 74px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 132px 132px 0 0;
  background:
    conic-gradient(from 270deg at 50% 100%,
      #e85d75 0deg 45deg,
      #f2b84b 45deg 90deg,
      #00a878 90deg 180deg,
      transparent 180deg 360deg);
}

.costing-direction-gauge::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 52px;
  border-radius: 104px 104px 0 0;
  background: #ffffff;
}

.costing-direction-gauge--empty {
  background:
    conic-gradient(from 270deg at 50% 100%,
      #dbe6f3 0deg 180deg,
      transparent 180deg 360deg);
}

.costing-direction-gauge__needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 58px;
  border-radius: 999px;
  background: #315bdc;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(calc(-90deg + (var(--gauge-value) * 1.8deg)));
  z-index: 2;
  box-shadow: 0 0 0 4px rgba(49, 91, 220, 0.08);
}

.costing-direction-gauge--empty .costing-direction-gauge__needle {
  display: none;
}

.costing-direction-gauge__center {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 16px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #315bdc;
  border: 3px solid #ffffff;
  z-index: 3;
}

.costing-direction-gauge--empty .costing-direction-gauge__center {
  background: #94a3b8;
}

.costing-direction-gauge__value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 4;
  color: var(--text);
  text-align: center;
  font-size: 1.15rem;
  font-weight: 900;
}

.costing-direction-summary-card__body {
  display: grid;
  gap: 7px;
  justify-items: start;
}

.costing-direction-summary-card__body strong,
.costing-direction-summary-card__body span {
  display: block;
}

.costing-direction-summary-card__body strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.25;
}

.costing-direction-summary-card__body span {
  color: var(--text-muted);
  line-height: 1.4;
}

.costing-empty--directions {
  min-height: 190px;
  margin-top: 14px;
  padding: 26px;
  border-radius: 24px;
  border-color: rgba(205, 220, 235, 0.95);
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.costing-empty--directions .costing-empty__icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
  box-shadow: none;
}

.costing-directions-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

.costing-direction-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 118px;
  padding: 18px 20px;
  border-radius: 22px;
  background: #ffffff;
  border-color: rgba(218, 232, 248, 0.95);
  box-shadow: 0 14px 36px rgba(70, 96, 130, 0.06);
}

.costing-direction-item:hover {
  border-color: rgba(95, 200, 180, 0.36);
  box-shadow: 0 18px 42px rgba(70, 96, 130, 0.1);
}

.costing-direction-item--active {
  background: linear-gradient(135deg, #ffffff, #f6fbff);
  border-color: rgba(95, 200, 180, 0.38);
  box-shadow:
    inset 3px 0 0 rgba(95, 200, 180, 0.58),
    0 18px 42px rgba(70, 96, 130, 0.08);
}

.costing-direction-item__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.costing-direction-item__title {
  color: var(--text);
  font-size: 1.03rem;
  line-height: 1.25;
}

.costing-direction-item__meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.costing-direction-item__side {
  display: grid;
  grid-template-columns: minmax(0, auto) 34px;
  grid-template-rows: auto auto;
  column-gap: 13px;
  align-items: center;
  justify-items: end;
  min-width: 190px;
}

.costing-direction-item__margin {
  grid-column: 1;
  color: var(--text);
  font-size: 1.34rem;
  line-height: 1;
  font-weight: 900;
}

.costing-direction-item__caption {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.costing-direction-item__empty-note {
  grid-column: 1;
  max-width: 170px;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: right;
}

.costing-direction-item__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
}

.costing-direction-item__status {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 2px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem !important;
  font-weight: 900;
}

.costing-direction-item--green .costing-direction-item__margin {
  color: #087a5b;
}

.costing-direction-item--yellow .costing-direction-item__margin {
  color: #93620f;
}

.costing-direction-item--red .costing-direction-item__margin {
  color: #b4233f;
}

.costing-direction-item__status--green {
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b !important;
}

.costing-direction-item__status--yellow {
  background: rgba(255, 248, 232, 0.96);
  color: #93620f !important;
}

.costing-direction-item__status--red {
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f !important;
}

.costing-direction-item__status--muted {
  background: rgba(241, 245, 249, 0.96);
  color: #64748b !important;
}

.costing-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.costing-breadcrumb button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #315bdc;
  font: inherit;
  cursor: pointer;
}

.costing-breadcrumb strong {
  color: var(--text);
}

.costing-services-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.costing-services-catalog,
.costing-selected-services {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: rgba(248, 251, 255, 0.82);
}

.costing-services-catalog h3,
.costing-selected-services h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
}

.costing-services-catalog__header,
.costing-services-catalog__actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.costing-services-catalog__actions {
  justify-content: flex-end;
  align-items: center;
  margin: 14px 0 0;
}

.costing-services-catalog__header h3 {
  margin: 0 0 5px;
}

.costing-services-catalog__header span {
  display: block;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.costing-catalog-close {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(218, 232, 248, 0.95);
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  padding: 8px 11px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.costing-catalog-close:hover {
  border-color: rgba(95, 200, 180, 0.32);
  color: #087a5b;
}

.costing-service-search {
  margin: 0 0 14px;
}

.costing-service-options,
.costing-selected-services__list {
  display: grid;
  gap: 10px;
}

.costing-service-options {
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
  gap: 14px;
}

.costing-service-group {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: rgba(255, 255, 255, 0.84);
}

.costing-service-group__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 11px;
}

.costing-service-group__header h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
}

.costing-service-group__header span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.costing-service-group__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.costing-service-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: #ffffff;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.costing-service-option:hover {
  border-color: rgba(79, 124, 255, 0.24);
}

.costing-service-option input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  accent-color: #087a5b;
}

.costing-service-option span {
  min-width: 0;
  line-height: 1.32;
}

.costing-inline-form--custom-service {
  margin: 14px 0 0;
}

.costing-selected-services__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.costing-selected-services__header h3 {
  margin: 0;
}

.costing-selected-services__header span {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.costing-sort-button {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: #ffffff;
  color: #315bdc;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.costing-sort-button:hover {
  border-color: rgba(79, 124, 255, 0.26);
}

.costing-selected-service {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto) auto;
  gap: 16px;
  align-items: center;
  min-height: 106px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.costing-selected-service:hover {
  border-color: rgba(95, 200, 180, 0.34);
  box-shadow: 0 12px 28px rgba(55, 89, 130, 0.07);
}

.costing-selected-service__main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.costing-selected-service__title {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.costing-selected-service__status {
  width: fit-content;
  margin-top: 0 !important;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.96);
  color: #64748b !important;
  font-size: 0.72rem !important;
  font-weight: 900;
}

.costing-selected-service--green .costing-selected-service__status {
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b !important;
}

.costing-selected-service--yellow .costing-selected-service__status {
  background: rgba(255, 248, 232, 0.96);
  color: #93620f !important;
}

.costing-selected-service--red .costing-selected-service__status {
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f !important;
}

.costing-selected-service strong,
.costing-selected-service span {
  display: block;
}

.costing-selected-service span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.costing-selected-service__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 8px;
}

.costing-selected-service__metrics div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(229, 238, 248, 0.96);
  background: rgba(248, 251, 255, 0.96);
}

.costing-selected-service__metrics span,
.costing-selected-service__metrics strong {
  display: block;
}

.costing-selected-service__metrics span {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.costing-selected-service__metrics strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.costing-selected-service__side {
  display: grid;
  grid-template-columns: minmax(0, auto) 34px;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  justify-items: end;
  min-width: 170px;
}

.costing-selected-service__margin {
  grid-column: 1;
  color: var(--text);
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 900;
}

.costing-selected-service--green .costing-selected-service__margin {
  color: #087a5b;
}

.costing-selected-service--yellow .costing-selected-service__margin {
  color: #93620f;
}

.costing-selected-service--red .costing-selected-service__margin {
  color: #b4233f;
}

.costing-selected-service__caption {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.costing-selected-service__empty-note {
  grid-column: 1;
  max-width: 190px;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
}

.costing-selected-service__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
}

.costing-service-row-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.costing-service-row-metrics div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.96);
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-service-row-metrics span,
.costing-service-row-metrics strong {
  display: block;
}

.costing-service-row-metrics span {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.costing-service-row-metrics strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.9rem;
}

.costing-back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: #315bdc;
  font-weight: 900;
  cursor: pointer;
}

.costing-service-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  padding-bottom: 106px;
}

.costing-service-card {
  gap: 20px;
}

.costing-service-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 20px;
  align-items: stretch;
}

.costing-finance-card,
.costing-calculation-card,
.costing-materials-card {
  min-width: 0;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(70, 96, 130, 0.07);
}

.costing-card-section-title {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.costing-card-section-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.25;
}

.costing-card-section-title p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.costing-finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.costing-finance-grid .form__field:first-child {
  grid-column: 1 / -1;
}

.costing-finance-grid .form__input {
  min-height: 46px;
}

.costing-calculation-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.costing-calculation-card .costing-service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.costing-cost-box--materials {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.costing-cost-box--materials strong {
  margin: 0;
  white-space: nowrap;
}

.costing-calculation-card .costing-margin-card {
  margin-top: 0;
  padding: 20px 18px;
}

.costing-calculation-card .costing-status-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.costing-calculation-card .costing-status-list div {
  justify-content: center;
  text-align: center;
}

.costing-materials-card .costing-material-row {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.costing-sticky-summary {
  position: fixed;
  left: 280px;
  bottom: 18px;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr)) minmax(170px, auto);
  gap: 10px;
  align-items: stretch;
  width: min(calc(100vw - 320px), 1180px);
  max-width: calc(100vw - 320px);
  margin: 0;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid rgba(218, 232, 248, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 52px rgba(31, 73, 125, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.costing-sticky-summary__metric,
.costing-sticky-summary__actions {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(229, 238, 248, 0.86);
  background: rgba(248, 251, 255, 0.78);
}

.costing-sticky-summary__metric span,
.costing-sticky-summary__metric small,
.costing-sticky-summary__save-state {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.costing-sticky-summary__metric strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.costing-sticky-summary__metric small {
  font-size: 0.72rem;
  font-weight: 750;
}

.costing-sticky-summary__actions {
  justify-items: stretch;
  background: #ffffff;
}

.costing-sticky-summary__actions .btn {
  width: 100%;
  min-height: 42px;
  justify-content: center;
}

.costing-sticky-summary__save-state {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: #ffffff;
}

.costing-sticky-summary__save-state--saved {
  border-color: rgba(0, 168, 120, 0.18);
  background: rgba(237, 252, 247, 0.92);
  color: #087a5b;
}

.costing-sticky-summary__save-state--saving,
.costing-sticky-summary__save-state--pending {
  border-color: rgba(79, 124, 255, 0.18);
  background: rgba(237, 244, 255, 0.94);
  color: #315bdc;
}

.costing-sticky-summary__save-state--error {
  border-color: rgba(232, 93, 117, 0.2);
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f;
}

.costing-sticky-summary__save-state--readonly {
  border-color: rgba(156, 170, 194, 0.2);
  background: rgba(248, 251, 255, 0.96);
  color: #64748b;
}

.costing-sticky-summary--green {
  border-color: rgba(0, 168, 120, 0.2);
}

.costing-sticky-summary--green .costing-sticky-summary__metric:nth-child(4) {
  background: rgba(237, 252, 247, 0.92);
}

.costing-sticky-summary--green .costing-sticky-summary__metric:nth-child(4) strong,
.costing-sticky-summary--green .costing-sticky-summary__metric:nth-child(4) small {
  color: #087a5b;
}

.costing-sticky-summary--yellow {
  border-color: rgba(242, 184, 75, 0.26);
}

.costing-sticky-summary--yellow .costing-sticky-summary__metric:nth-child(4) {
  background: rgba(255, 248, 232, 0.92);
}

.costing-sticky-summary--yellow .costing-sticky-summary__metric:nth-child(4) strong,
.costing-sticky-summary--yellow .costing-sticky-summary__metric:nth-child(4) small {
  color: #93620f;
}

.costing-sticky-summary--red {
  border-color: rgba(232, 93, 117, 0.22);
}

.costing-sticky-summary--red .costing-sticky-summary__metric:nth-child(4) {
  background: rgba(255, 242, 245, 0.94);
}

.costing-sticky-summary--red .costing-sticky-summary__metric:nth-child(4) strong,
.costing-sticky-summary--red .costing-sticky-summary__metric:nth-child(4) small {
  color: #b4233f;
}

.costing-sticky-summary--muted .costing-sticky-summary__metric:nth-child(4) {
  background: rgba(241, 245, 249, 0.8);
}

.costing-panel--margin {
  display: block !important;
}

.costing-margin-card--green .costing-margin-card__circle {
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
}

.costing-margin-card--yellow .costing-margin-card__circle {
  background: rgba(255, 248, 232, 0.96);
  color: #93620f;
}

.costing-margin-card--red .costing-margin-card__circle {
  background: rgba(255, 242, 245, 0.96);
  color: #b4233f;
}

.costing-margin-card--muted .costing-margin-card__circle {
  background: rgba(241, 245, 249, 0.96);
  color: #64748b;
}

.costing-template-card {
  display: grid;
  gap: 13px;
  padding: 20px 22px;
  border-radius: 26px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background:
    radial-gradient(circle at 100% 0%, rgba(95, 200, 180, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff, #f9fbff);
  box-shadow: 0 14px 34px rgba(70, 96, 130, 0.06);
}

.costing-template-card--muted {
  border-style: dashed;
  background: rgba(248, 251, 255, 0.9);
  box-shadow: none;
}

.costing-template-card__header,
.costing-template-card__actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.costing-template-card__eyebrow,
.costing-template-card__title,
.costing-template-card__count {
  display: block;
}

.costing-template-card__eyebrow {
  margin-bottom: 4px;
  color: #087a5b;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.costing-template-card__title {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.25;
}

.costing-template-card__count {
  flex: 0 0 auto;
  max-width: 190px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(237, 252, 247, 0.96);
  color: #087a5b;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.costing-template-card__description,
.costing-template-card__note {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.costing-template-card__warning {
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(242, 184, 75, 0.22);
  background: rgba(255, 248, 232, 0.82);
  color: #7a5a10;
  font-size: 0.86rem;
  line-height: 1.45;
}

.costing-template-card__details {
  border-top: 1px solid rgba(229, 238, 248, 0.86);
  padding-top: 10px;
}

.costing-template-card__details summary {
  width: fit-content;
  cursor: pointer;
  color: #315bdc;
  font-size: 0.86rem;
  font-weight: 900;
}

.costing-template-card__note {
  max-width: 430px;
  font-size: 0.84rem;
}

.costing-materials-card .costing-materials-list {
  gap: 9px;
  margin-top: 16px;
}

.costing-materials-table-head {
  display: grid;
  grid-template-columns: minmax(320px, 1.75fr) 96px 82px 132px 112px 176px;
  gap: 10px;
  padding: 0 15px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.costing-material-item {
  display: grid;
  grid-template-columns: minmax(320px, 1.75fr) 96px 82px 132px 112px 176px;
  gap: 10px;
  align-items: start;
  min-height: 96px;
  padding: 12px 15px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(229, 238, 248, 0.96);
}

.costing-material-item--empty {
  background: linear-gradient(180deg, #ffffff, rgba(255, 248, 232, 0.48));
  border-color: rgba(242, 184, 75, 0.22);
}

.costing-table-field,
.costing-material-main-field,
.costing-material-step-field,
.costing-material-name-field,
.costing-material-total-cell {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.costing-table-field span,
.costing-material-main-field span,
.costing-material-total-cell span {
  display: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.costing-material-main-field {
  gap: 7px;
}

.costing-material-step-field {
  gap: 4px;
}

.costing-material-step-field span {
  display: block;
  color: #7a8aa6;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.costing-material-name-field span {
  display: none;
}

.costing-material-step-input.form__input {
  min-height: 36px;
  padding: 7px 11px;
  border-color: rgba(190, 207, 229, 0.78);
  background: rgba(244, 248, 253, 0.96);
  color: #4e6686;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
}

.costing-material-name-input.form__input {
  min-height: 46px;
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  text-overflow: ellipsis;
}

.costing-table-field .form__input {
  min-height: 42px;
  padding-left: 11px;
  padding-right: 11px;
}

.costing-material-total-cell {
  min-height: 42px;
  align-content: center;
  padding: 5px 0;
}

.costing-material-item__total {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.costing-material-item__empty {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.96);
  color: #93620f;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
}

.costing-material-item__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.costing-row-icon-button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(218, 232, 248, 0.95);
  background: #ffffff;
  color: #315bdc;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.costing-row-icon-button:hover {
  border-color: rgba(79, 124, 255, 0.28);
}

.costing-row-icon-button--muted {
  color: #64748b;
}

.costing-row-icon-button--muted:hover {
  border-color: rgba(232, 93, 117, 0.2);
  color: #b4233f;
}

.costing-row-icon-button:disabled {
  cursor: default;
  opacity: 0.56;
}

.costing-add-row-button {
  appearance: none;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(49, 91, 220, 0.24);
  background: rgba(248, 251, 255, 0.92);
  color: #315bdc;
  font-weight: 900;
  cursor: pointer;
}

.costing-add-row-button:hover {
  background: #ffffff;
  border-color: rgba(49, 91, 220, 0.36);
}

@media (max-width: 1040px) {
  .costing-overall-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .costing-overall-card__metrics {
    grid-column: 1 / -1;
  }

  .costing-services-layout,
  .costing-service-detail-grid,
  .costing-service-main-grid {
    grid-template-columns: 1fr;
  }

  .costing-sticky-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(calc(100vw - 320px), 1180px);
    max-width: calc(100vw - 320px);
  }

  .costing-sticky-summary__actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
    align-items: center;
  }
}

@media (max-width: 768px) {
  .costing-service-detail-grid {
    padding-bottom: 156px;
  }

  .costing-sticky-summary {
    left: 16px;
    right: 16px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .costing-margin-dashboard__top,
  .costing-services-catalog__header,
  .costing-margin-service-card__header,
  .costing-selected-services__header,
  .costing-template-card__header,
  .costing-template-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .costing-margin-summary,
  .costing-direction-summary,
  .costing-directions-list,
  .costing-finance-grid,
  .costing-margin-metrics,
  .costing-overall-card,
  .costing-overall-card__metrics,
  .costing-service-row-metrics,
  .costing-calculation-card .costing-service-grid,
  .costing-calculation-card .costing-status-list,
  .costing-materials-table-head,
  .costing-material-item {
    grid-template-columns: 1fr;
  }

  .costing-overall-card {
    justify-items: start;
    padding: 20px;
  }

  .costing-overall-card__gauge {
    justify-self: center;
    width: 156px;
    height: 88px;
  }

  .costing-service-options {
    max-height: 68vh;
    padding-right: 0;
  }

  .costing-service-group {
    padding: 12px;
  }

  .costing-service-group__header {
    flex-direction: column;
    gap: 4px;
  }

  .costing-service-group__list {
    grid-template-columns: 1fr;
  }

  .costing-direction-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .costing-direction-item__side {
    grid-template-columns: minmax(0, 1fr) 34px;
    min-width: 0;
    width: 100%;
    justify-items: start;
  }

  .costing-direction-item__empty-note {
    max-width: none;
    text-align: left;
  }

  .costing-direction-item__arrow {
    justify-self: end;
  }

  .costing-direction-summary-card--featured {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .costing-direction-summary-card--featured .costing-direction-gauge {
    justify-self: center;
  }

  .costing-selected-service {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .costing-selected-service__metrics {
    grid-template-columns: 1fr;
  }

  .costing-selected-service__side {
    grid-template-columns: minmax(0, 1fr) 34px;
    min-width: 0;
    width: 100%;
    justify-items: start;
  }

  .costing-selected-service__empty-note {
    max-width: none;
    text-align: left;
  }

  .costing-selected-service__arrow {
    justify-self: end;
  }

  .costing-save-status {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .costing-template-card__count {
    max-width: none;
    width: fit-content;
  }

  .costing-finance-card,
  .costing-calculation-card,
  .costing-materials-card,
  .costing-template-card {
    padding: 18px;
    border-radius: 22px;
  }

  .costing-service-detail-grid {
    padding-bottom: 156px;
  }

  .costing-sticky-summary {
    left: 16px;
    right: 16px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 9px;
    border-radius: 20px;
  }

  .costing-sticky-summary__metric,
  .costing-sticky-summary__actions {
    padding: 9px;
    border-radius: 15px;
  }

  .costing-sticky-summary__metric strong {
    font-size: 1rem;
  }

  .costing-sticky-summary__actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .costing-sticky-summary__save-state {
    width: 100%;
    text-align: center;
  }

  .costing-table-field span,
  .costing-material-main-field span,
  .costing-material-total-cell span {
    display: block;
  }

  .costing-material-main-field {
    gap: 10px;
  }

  .costing-material-step-input.form__input {
    min-height: 40px;
  }

  .costing-materials-table-head {
    display: none;
  }

  .costing-material-total-cell {
    padding: 0;
  }

  .costing-material-item__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
