/* Visual theme from design.md. Existing layout and interaction rules live in styles.css. */
:root {
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-soft: #f1f7f4;
  --surface-blue: #e7f3ed;
  --line: #dce8e1;
  --line-strong: #b8ccc0;
  --text: #233d32;
  --muted: #5c7065;
  --primary: #257355;
  --primary-strong: #1d6247;
  --primary-deep: #204d3a;
  --primary-dark: #183e2d;
  --cyan: #6b9f87;
  --green: #257355;
  --amber: #886329;
  --red: #af3e49;
  --site-width: 1280px;
  --text-h1: 36px;
  --text-h2: 28px;
  --text-h3: 20px;
  --text-body: 16px;
  --text-small: 14px;
  --text-button: 14px;
  --radius: 12px;
  --radius-md: 24px;
  --radius-lg: 36px;
  --shadow-sm: 0 2px 12px rgba(35, 61, 50, 0.06);
  --shadow-md: 0 16px 48px rgba(35, 61, 50, 0.1);
  --section-gap: clamp(64px, 8vw, 112px);
}

html { scroll-padding-top: 104px; }
body {
  height: auto;
  min-height: 100dvh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
body::before { content: none; }
::selection { color: var(--primary-dark); background: #d7ebdf; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.035em; line-height: 1.2; }
p, li { line-height: 1.6; }
.page-shell {
  flex: 1 0 auto;
  width: min(var(--site-width), calc(100% - 48px));
  min-height: auto;
  padding: 0 0 72px;
}
.ui-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-tile {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--primary);
  background: var(--surface-blue);
}

/* Navigation */
.site-top-panel {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 24px;
  overflow: visible;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  backdrop-filter: none;
}
.site-top-panel .site-header { display: contents; }
.logo-block { gap: 10px; color: inherit; text-decoration: none;}
.brand-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-title { max-width: none; font-size: 21px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.2; }
.top-nav { flex: 1; gap: 8px; padding: 0; }
.nav-left, .nav-right { gap: 2px; }
.session-box { gap: 10px; font-size: 13px; }
.session-box .secondary-btn { min-height: 40px; padding: 8px 14px; }
#sessionText { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-nav .nav-btn {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}
.top-nav .nav-btn:hover { color: var(--primary); background: var(--surface-blue); }
.top-nav .nav-btn.active { color: var(--primary); background: var(--surface-blue); box-shadow: none; }
.top-nav .nav-buy-highlight { color: #fff; background: var(--primary); }
.top-nav .nav-buy-highlight:hover { color: #fff; background: var(--primary-strong); }
.mobile-menu {
  z-index: 100;
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: none;
}
.mobile-menu-auth { background: var(--surface-soft); }
.mobile-menu-user { color: var(--primary-deep); background: var(--surface-blue); border-color: var(--line); }
.mobile-menu-link { min-height: 44px; color: var(--text); font-weight: 500; }
.mobile-menu-link:hover, .mobile-menu-link.active { color: var(--primary); background: var(--surface-blue); box-shadow: none; }
.mobile-menu-toggle { min-width: 44px; min-height: 44px; border-radius: 12px; box-shadow: none; }

/* Buttons retain the same actions and IDs. */
.primary-btn,
.guest-actions .primary-btn,
.hero .primary-btn,
.support-toggle,
.custom-file-button,
.custom-file-control.has-file .custom-file-button,
.hero-side-card .side-link,
.service-card.selected .service-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  box-shadow: none;
  font-size: var(--text-button);
  font-weight: 600;
  line-height: 1.45;
  transition: transform 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out;
}
.primary-btn:hover,
.guest-actions .primary-btn:hover,
.hero .primary-btn:hover,
.support-toggle:hover,
.custom-file-button:hover,
.hero-side-card .side-link:hover {
  border-color: var(--primary-strong);
  color: #fff;
  background: var(--primary-strong);
  box-shadow: 0 4px 12px rgba(35, 61, 50, 0.12);
  transform: translateY(-1px);
}
.primary-btn:active, .secondary-btn:active, .support-toggle:active { transform: translateY(1px); }
.primary-btn:disabled, .secondary-btn:disabled { cursor: default; opacity: .6; transform: none; box-shadow: none; }
.secondary-btn,
.service-btn,
.guest-actions .secondary-btn,
.hero .secondary-btn,
.hero .guest-actions .secondary-btn,
.buy-actions.guest-actions .secondary-btn,
.application-help .secondary-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--primary-deep);
  background: transparent;
  box-shadow: none;
  font-size: var(--text-button);
  font-weight: 600;
  line-height: 1.45;
}
.secondary-btn:hover,
.service-btn:hover,
.hero .secondary-btn:hover,
.hero .guest-actions .secondary-btn:hover,
.buy-actions.guest-actions .secondary-btn:hover,
.application-help .secondary-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-blue);
  box-shadow: none;
  transform: none;
}
.danger-btn { border-radius: var(--radius); background: var(--red); box-shadow: none; font-weight: 600; }
.danger-btn:hover { background: #953541; box-shadow: none; }
.tab-btn, .operator-type-tab, .operator-tab, .operator-request-tab { color: var(--muted); font-weight: 500; border-radius: 10px; }
.tab-btn:hover, .operator-type-tab:hover, .operator-tab:hover, .operator-request-tab:hover { background: var(--surface-soft); color: var(--primary); border-color: var(--line); }
.tab-btn.active, .operator-type-tab.active, .operator-tab.active, .operator-request-tab.active { color: var(--primary-deep); background: var(--surface-blue); box-shadow: none; }

/* Landing: existing hero, news, services, about, order and reviews. */
.hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px 64px;
  align-items: center;
  margin-top: 64px;
}
.hero-copy {
  min-height: 0;
  overflow: visible;
  padding: 0;
  color: var(--text);
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.hero-copy h1 {
  max-width: 700px;
  margin-bottom: 24px;
  font-size: clamp(40px, 4.5vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.045em;
  color: var(--text);
}
.hero-copy h1 span { color: var(--primary); }
.hero-copy p { max-width: 56ch; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-points { gap: 12px; margin-top: 24px; }
.hero-points li { align-items: flex-start; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero-points li::before { content: none; }
.hero-points .ui-icon { width: 20px; height: 20px; margin-top: 1px; color: var(--primary); }
.hero-actions { gap: 12px; margin-top: 32px; }
.hero-visual { position: relative; min-width: 0; padding: 24px; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 45% 55% 52% 48% / 45% 40% 60% 55%;
  background: #dceee3;
}
.hero-example-image {
  position: relative;
  right: auto;
  bottom: auto;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 8px solid var(--surface);
  border-radius: 36px 100px 36px 100px;
  box-shadow: var(--shadow-md);

}
.hero-side-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(160px, .45fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 0;
  gap: 8px 32px;
  overflow: visible;
  padding: 24px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
.hero-side-card::before, .hero-side-card::after { content: none; }
.news-title { grid-column: 1; margin: 0; padding: 0; border: 0; color: var(--primary); background: transparent; box-shadow: none; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.news-title::before { width: 7px; height: 7px; background: var(--primary); box-shadow: none; }
.hero-side-card .news-lead { grid-column: 1; grid-row: 2; max-width: 40ch; margin: 0; color: var(--text); font-size: 17px; font-weight: 600; line-height: 1.55; }
.hero-side-card .side-links { grid-column: 2; grid-row: 1 / 3; width: auto; margin: 0; }
.hero-side-card .side-link { width: 100%; }
.news-feature { grid-column: 3; grid-row: 1; display: flex; gap: 10px; align-items: center; margin: 0; padding: 0; border: 0; background: transparent; }
.news-feature span { color: var(--primary); font-size: 26px; line-height: 1.2; font-weight: 700; }
.news-feature strong { color: var(--text); font-size: 14px; font-weight: 600; }
.hero-side-card .news-note { grid-column: 3; grid-row: 2; margin: 0; padding-top: 12px; border-color: var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
.landing-main > .info-section,
.landing-main > .buy-section,
.landing-main > .reviews-section {
  margin-top: var(--section-gap);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.section-heading { margin-bottom: 28px; }
.section-heading h1 { font-size: var(--text-h1); line-height: 1.2; }
.section-heading h2 { font-size: var(--text-h2); line-height: 1.25; }
.section-heading p { max-width: 72ch; margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.landing-main .section-heading h2 { font-size: clamp(28px, 3vw, 36px); }
.landing-main .price-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; }
.landing-main .price-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-content: start;
  gap: 4px 20px;
  min-height: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.price-card::before, .service-card::before, .profile-card::before { content: none; }
.price-card .icon-tile { grid-row: 1 / 4; }
.landing-main .price-card h3 { grid-column: 2; margin: 0; color: var(--text); font-size: 20px; line-height: 1.3; }
.landing-main .price-card p { grid-column: 2; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.landing-main .price-card .price-value { margin: 6px 0; color: var(--primary); font-size: 19px; font-weight: 600; }
.landing-main .price-card:last-child { grid-column: 1 / -1; }
.catalog-intro { margin-top: 24px; padding: 24px 28px; border-color: var(--line); border-radius: var(--radius); background: var(--surface-blue); }
.catalog-intro h3 { margin-bottom: 8px; color: var(--primary-deep); font-size: 20px; }
.catalog-intro p { max-width: 72ch; color: var(--muted); line-height: 1.6; }
.landing-main .about-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; counter-reset: about-step; }
.about-card { position: relative; padding: 28px; border-color: var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); counter-increment: about-step; }
.about-card::before { content: "0" counter(about-step); display: block; margin-bottom: 24px; color: var(--primary); font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.about-card h3 { color: var(--text); font-size: 22px; }
.about-card p { max-width: 44ch; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.about-card:first-child { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: 40px; border-radius: var(--radius-md); background: var(--surface-blue); box-shadow: none; }
.about-card:first-child h3 { max-width: 12ch; font-size: 36px; }
.buy-card { padding: 36px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #e3f1e9; box-shadow: none; }
.buy-card h3 { font-size: 28px; color: var(--primary-deep); }
.buy-card p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.buy-card .primary-btn { flex: 0 0 auto; }
.questions-card { align-items: center; padding: 32px; background: var(--surface); }
.questions-card h2 { font-size: 28px; }
.landing-main > .questions-section { margin-top: 40px; }

/* Reviews keep their existing carousel and images. */
.landing-main > .reviews-section { overflow: visible; margin-right: 0; margin-left: 0; border-radius: 0; }
.reviews-heading p { display: block; color: var(--muted); font-size: 14px; }
.reviews-heading > div:first-child { margin-bottom: 28px; }
.reviews-carousel { padding: 24px 72px 48px; border-color: var(--line); border-radius: var(--radius-md); background: var(--surface); }
.reviews-viewport { width: min(100%, 800px); border-radius: var(--radius); }
.review-image { width: 100%; height: 360px; max-height: none; aspect-ratio: auto; object-fit: contain; border: 0; border-radius: 12px; background: var(--surface-soft); box-shadow: none; }
.reviews-controls { top: 64%; padding: 0 24px; }
.reviews-arrow { width: 44px; height: 44px; color: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.reviews-arrow:hover { color: var(--primary-deep); background: var(--surface-blue); box-shadow: none; }
.reviews-dots { gap: 10px; bottom: 18px; }
.reviews-dot { width: 8px; height: 8px; background: var(--line-strong); }
.reviews-dot.is-active { background: var(--primary); }
.reviews-track { position: relative; transition: transform 300ms ease-out; }

/* Forms and existing account screens */
.page-panel,
.services-section,
.application-section,
.profile-section,
.consultant-chat-section,
.operator-toolbar,
.operator-settings,
.operator-workspace,
.operator-thread-head,
.operator-reply-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
.page-panel, .services-section, .application-section, .profile-section, .consultant-chat-section { margin-top: 32px; padding: 32px; }
.narrow-panel { max-width: 520px; margin-top: 64px; padding: 40px; border-radius: var(--radius-md); }
.auth-form, .application-form { gap: 24px; }
.auth-form .primary-btn { width: 100%; margin-top: 8px; }
.narrow-panel .form-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.6; }
.page-links { color: var(--muted); }
label, .form-field, fieldset label { gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
input, textarea, select { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface); box-shadow: none; font-size: 16px; }
input:hover, textarea:hover, select:hover { border-color: var(--cyan); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: none; }
input::placeholder, textarea::placeholder { color: #718279; opacity: 1; }
.form-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.form-columns > *, .service-copy { min-width: 0; }
.application-heading { gap: 24px; }
.application-help { gap: 10px; }
.service-type-picker, .service-picker { padding: 24px; border-color: var(--line); border-radius: var(--radius); background: var(--surface-soft); box-shadow: none; }
.service-type-picker { gap: 12px; }
.service-type-picker legend, .service-picker legend { font-size: 14px; font-weight: 600; }
.service-type-picker label { flex: 1; min-height: 52px; padding: 12px 16px; border-radius: 12px; font-weight: 500; }
.service-type-picker label:has(input:checked), .service-picker label:has(input:checked) { color: var(--primary-deep); border-color: var(--primary); background: var(--surface-blue); }
.service-type-picker input:focus, .service-picker input:focus { outline: none; box-shadow: none; }
.service-type-picker label:has(input:focus-visible), .service-picker label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.service-picker label { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.service-picker label strong { font-size: 14px; font-weight: 600; }
.service-type-extra { padding: 24px; border-color: #e3d8b9; border-radius: var(--radius); background: #fbf8ef; box-shadow: none; }
.service-type-extra p, .discount-line, .savings-line { font-weight: 500; }
.lock-banner, .support-closed-card { padding: 16px 20px; border-color: #e3d8b9; border-radius: var(--radius); color: #785821; background: #fbf8ef; font-size: 14px; line-height: 1.6; }
.custom-file-control { min-height: 52px; gap: 12px; padding: 8px; border-radius: var(--radius); border-color: var(--line-strong); background: var(--surface); box-shadow: none; }
.custom-file-control:hover { border-color: var(--cyan); }
.custom-file-control:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: none; }
.custom-file-control.has-file { border-color: var(--primary); background: var(--surface-soft); }
.custom-file-button { min-height: 36px; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.custom-file-name { font-size: 13px; font-weight: 400; }
.total-box { position: static; width: auto; padding: 24px; border-color: var(--line); border-radius: var(--radius); background: var(--surface-blue); box-shadow: none; }
.total-details { font-size: 14px; }
.total-final strong { font-size: 30px; font-weight: 700; }
.date-picker-trigger, .date-picker-trigger.has-value { min-height: 52px; border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.date-picker-trigger:hover { border-color: var(--cyan); }
.date-picker-trigger:focus, .date-picker.is-open .date-picker-trigger { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: none; }
.date-picker-popover { z-index: 200; border-color: var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-md); }
.date-picker-jump { border-color: var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.date-picker-jump select, .date-picker-jump input { border-color: var(--line-strong); font-weight: 500; }
.date-picker-head strong, .date-picker-grid span { font-weight: 600; }
.date-picker-day, .date-picker-nav, .date-picker-actions button { border-radius: 8px; }
.date-picker-day:hover, .date-picker-nav:hover, .date-picker-actions button:hover { color: var(--primary); background: var(--surface-blue); border-color: var(--line-strong); }
.date-picker-day.is-selected { color: #fff; background: var(--primary); box-shadow: none; }
.date-picker-day.is-today { border-color: var(--primary); color: var(--primary); background: var(--surface-soft); }
.date-picker-day.is-selected.is-today { color: #fff; background: var(--primary); }
.profile-applications { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-card, .profile-summary, .profile-application-chat, .application-chat-box, .service-card, .operator-application-detail, .operator-photo-card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.profile-card { padding: 24px; }
.profile-card h3 { font-size: 20px; }
.profile-card p { font-size: 14px; }
.profile-summary { color: var(--primary-deep); background: var(--surface-blue); font-weight: 500; }
.profile-status { color: var(--primary-deep); background: var(--surface-blue); font-weight: 600; }
.profile-application-chat { background: var(--surface-soft); }
.service-card.selected { border-color: var(--primary); background: var(--surface-soft); box-shadow: none; }
.legal-panel { max-width: 900px; padding: 40px; }
.legal-panel p { max-width: 72ch; color: var(--muted); line-height: 1.7; }
.legal-panel h2 { margin-top: 32px; font-size: 24px; }

/* Existing chat and operator UI */
.support-widget { z-index: 200; right: 24px; bottom: 24px; left: auto; font-family: inherit; }
.support-toggle { width: auto; min-height: 48px; padding: 12px 20px; box-shadow: var(--shadow-md); }
.support-toggle .ui-icon { width: 20px; height: 20px; }
.support-panel, .consultant-chat-page { border-color: var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-md); }
.support-panel { bottom: 64px; }
.support-head { padding: 20px; background: var(--surface); }
.support-head h2 { font-size: 20px; letter-spacing: -.025em; }
.support-head p { color: var(--muted); font-size: 13px; }
.support-close, .modal-close-btn, .image-preview-close { min-height: 40px; width: 40px; height: 40px; border-radius: 12px; color: var(--primary-deep); background: var(--surface-soft); box-shadow: none; }
.support-messages, .operator-messages, .application-chat-messages { scrollbar-color: var(--line-strong) transparent; background: var(--surface-soft); }
.support-message { border-radius: 12px; font-size: 14px; line-height: 1.6; }
.support-message.client { color: #fff; background: var(--primary); }
.support-message-meta, .operator-delivery-status { font-size: 12px; opacity: .85; }
.support-empty { max-width: 44ch; padding: 20px; font-size: 14px; line-height: 1.7; }
.support-form, .consultant-page-form, .operator-reply-form { background: var(--surface); }
.consultant-chat-page { height: min(640px, calc(100dvh - 250px)); min-height: 360px; box-shadow: none; }
.consultant-page-form textarea, .operator-reply-form textarea, .support-widget .support-form textarea { border-color: var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 16px; }
.attach-btn { min-height: 44px; border-radius: 12px; color: var(--primary); background: var(--surface); box-shadow: none; }
.attach-btn .ui-icon { width: 22px; height: 22px; }
.attach-btn.has-file { color: var(--primary); background: var(--surface-blue); }
.consultant-page-form .attach-btn, .operator-reply-form .attach-btn, .support-widget .attach-btn { color: var(--primary); }
.consultant-page-form .attach-btn::before, .operator-reply-form .attach-btn::before, .support-widget .attach-btn::before { content: none; }
.consultant-page-form .attach-btn.has-file, .operator-reply-form .attach-btn.has-file, .support-widget .attach-btn.has-file { color: var(--primary); background: var(--surface-blue); }
.consultant-page-form .chat-send-actions .primary-btn, .operator-reply-form .chat-send-actions .primary-btn, .support-widget .chat-send-actions .primary-btn { background: var(--primary); border-color: var(--primary); box-shadow: none; }
.consultant-page-form .chat-send-actions .primary-btn:hover, .operator-reply-form .chat-send-actions .primary-btn:hover, .support-widget .chat-send-actions .primary-btn:hover { background: var(--primary-strong); }
.operator-page { margin-top: 32px; }
.operator-toolbar, .operator-settings { padding: 24px; }
.operator-toolbar h1 { font-size: 28px; }
.operator-toolbar p { font-size: 14px; }
.operator-toolbar-actions { gap: 12px; }
.operator-thread-head h2, .profile-chat-head h2 { font-size: 22px; }
.operator-sidebar, .operator-thread { background: var(--surface-soft); }
.operator-chat-item:hover { background: var(--surface-blue); }
.operator-chat-item.active { color: var(--primary-deep); background: #dceee3; }
.operator-chat-title { font-weight: 600; }
.operator-clients-head { color: var(--text); }
.operator-referral-display, .operator-registered-count { color: var(--text); }
.operator-referral-display strong, .operator-registered-count strong { border-color: var(--line); border-radius: var(--radius); color: var(--primary-deep); background: var(--surface-blue); font-weight: 500; }

/* Modal stacking follows the contract in design.md. */
.modal-overlay { z-index: 300; background: rgba(27, 48, 37, .46); backdrop-filter: blur(4px); }
.image-preview-overlay { z-index: 400; background: rgba(27, 48, 37, .75); }
.modal-window { border-color: var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.modal-window h2 { font-size: 24px; }
.modal-summary p { font-size: 16px; line-height: 1.6; }
.modal-summary .modal-saving { border-color: var(--line); color: var(--primary-deep); background: var(--surface-blue); font-weight: 500; }
.guide-list div, .example-request { border-color: var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.example-request p { color: var(--text); }
.modal-close-btn:hover { background: var(--surface-blue); }

/* Footer */
.site-footer-wrap { padding: 32px max(24px, calc((100vw - var(--site-width)) / 2)) 40px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-links { justify-content: flex-start; gap: 24px; padding: 0 0 20px; border: 0; background: transparent; font-size: 14px; }
.footer-links a { color: var(--primary-deep); font-weight: 500; }
.site-footer { min-height: 0; padding: 0; color: var(--muted); background: transparent; font-size: 13px; line-height: 1.6; }

@keyframes theme-entry { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .hero-visual { animation: theme-entry 420ms ease-out both; }
  .hero-visual { animation-delay: 80ms; }
}

@media (max-width: 1100px) {
  .site-top-panel .site-header { display: flex; width: 100%; align-items: center; flex-direction: row; gap: 16px; }
  .site-header .session-box { display: flex; width: auto; align-items: center; margin-left: auto; }
  .top-nav { display: none; }
  .mobile-menu-toggle { display: inline-flex; width: 44px; height: 44px; margin-left: 0; }
  .mobile-menu { position: absolute; top: calc(100% + 8px); right: 0; left: 0; max-height: calc(100dvh - 120px); overflow-y: auto; }
  .mobile-menu:not(.hidden) { display: block; }
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; }
  .hero-copy h1 { font-size: clamp(40px, 4.8vw, 54px); }
  .hero-side-card { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 12px 24px; }
  .hero-side-card .side-links { grid-column: 2; grid-row: 2; }
  .news-feature { grid-column: 2; grid-row: 1; }
  .hero-side-card .news-note { grid-column: 1 / -1; grid-row: 3; }
  .buy-card, .total-box { flex-direction: row; align-items: center; }
  .total-final { align-items: flex-end; }
  .profile-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  :root { --text-h1: 30px; --text-h2: 24px; --text-h3: 20px; --section-gap: 64px; }
  html { scroll-padding-top: 96px; }
  .page-shell { width: calc(100% - 40px); padding: 0 0 64px; }
  .site-top-panel { min-height: 76px; padding: 12px 0; }
  .site-top-panel .site-header { gap: 12px; }
  .logo-title { max-width: none; font-size: 19px; }
  .brand-mark { width: 38px; height: 38px; }
  .site-header .session-box { display: none; }
  .mobile-menu-toggle { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 32px; margin-top: 40px; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { max-width: 16ch; font-size: clamp(36px, 7vw, 52px); margin-bottom: 20px; }
  .hero-copy p { line-height: 1.7; }
  .hero-actions { width: auto; margin-top: 24px; gap: 10px; }
  .hero-actions .primary-btn, .hero-actions .secondary-btn { width: auto; }
  .hero-points { gap: 10px; }
  .hero-visual { width: min(100%, 480px); justify-self: center; padding: 20px; }
  .hero-example-image { display: block; border-width: 6px; border-radius: 24px 72px 24px 72px; }
  .hero-side-card { grid-template-columns: 1fr; gap: 16px; padding: 24px; }
  .news-title, .hero-side-card .news-lead, .hero-side-card .side-links, .news-feature, .hero-side-card .news-note { grid-column: 1; grid-row: auto; }
  .hero-side-card .news-lead { font-size: 17px; }
  .hero-side-card .side-links { max-width: 220px; }
  .hero-side-card .news-note { padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
  .landing-main .section-heading h2 { font-size: 30px; }
  .landing-main .price-grid, .landing-main .about-grid, .profile-applications, .form-columns, .application-guide-content { grid-template-columns: 1fr; }
  .landing-main .price-card { gap: 4px 16px; padding: 24px; }
  .landing-main .price-card:last-child, .about-card:first-child { grid-column: auto; grid-row: auto; }
  .about-card, .about-card:first-child { padding: 28px; border-radius: 12px; }
  .about-card:first-child h3 { max-width: none; font-size: 24px; }
  .about-card h3 { font-size: 22px; }
  .about-card::before { margin-bottom: 16px; }
  .catalog-intro { padding: 24px; }
  .buy-card, .questions-card, .total-box { flex-direction: column; align-items: flex-start; gap: 24px; padding: 28px; }
  .buy-card h3, .questions-card h2 { font-size: 24px; }
  .buy-card .primary-btn { width: 100%; }
  .total-final { align-items: flex-start; }
  .total-final strong { font-size: 28px; }
  .reviews-carousel { padding: 20px 48px 48px; }
  .review-image { height: 300px; }
  .reviews-controls { top: 67%; padding: 0 8px; }
  .reviews-heading p { font-size: 14px; }
  .reviews-arrow { width: 40px; height: 44px; }
  .page-panel, .services-section, .application-section, .profile-section, .consultant-chat-section { margin-top: 24px; padding: 24px; }
  .narrow-panel { margin-top: 40px; padding: 28px; }
  .section-heading { margin-bottom: 24px; }
  .application-heading { flex-direction: column; }
  .application-help { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: flex-start; min-width: 0; }
  .application-help .secondary-btn { width: auto; }
  .service-type-picker, .service-picker, .service-type-extra { padding: 20px; }
  .service-type-picker label { flex: 1 1 100%; min-width: 0; }
  .service-picker label { flex-wrap: wrap; gap: 10px; }
  .service-picker label strong { width: 100%; padding-left: 26px; }
  .custom-file-control { grid-template-columns: auto minmax(0, 1fr); }
  .custom-file-button { width: auto; }
  .submit-btn { width: 100%; }
  .consultant-chat-page { height: min(620px, calc(100dvh - 200px)); min-height: 340px; }
  .support-widget { display: flex; align-items: center; justify-content: flex-end; gap: 8px; right: 16px; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .support-toggle { min-height: 48px; width: auto; font-size: 12px; padding: 12px; }
  .support-panel { position: fixed; inset: auto 16px max(80px, calc(env(safe-area-inset-bottom) + 80px)) auto; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 160px)); max-height: calc(100dvh - 160px); }
  .support-head { padding: 16px; }
  .support-widget .support-form { background: var(--surface); }
  .social-links { position: static; display: flex; flex-direction: row; gap: 8px; }
  .social-link { width: 44px; height: 44px; box-shadow: var(--shadow-sm); }
  .social-link svg { width: 32px; height: 32px; }
  .modal-overlay { padding: 16px; }
  .modal-window { padding: 24px; border-radius: 20px; max-height: calc(100dvh - 32px); }
  .application-guide-modal .modal-head { top: -24px; margin: -24px -24px 20px; padding: 20px 24px; }
  .application-guide-actions { bottom: -24px; margin: 20px -24px -24px; padding: 16px 24px; }
  .operator-toolbar, .operator-settings { padding: 20px; }
  .operator-toolbar h1 { font-size: 26px; }
  .operator-toolbar-actions, .operator-type-tabs { gap: 8px; }
  .operator-type-tab, .operator-tab, .operator-request-tab { font-size: 13px; }
  .site-footer-wrap { padding: 28px 20px 96px; }
  .footer-links { gap: 12px 24px; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 8px; line-height: 1.6; }
}

@media (max-width: 420px) {
  .page-shell { width: calc(100% - 32px); }
  .logo-title { font-size: 17px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-actions .primary-btn, .hero-actions .secondary-btn { width: 100%; }
  .hero-visual { padding: 16px; }
  .hero-side-card { padding: 20px; }
  .landing-main .price-card { grid-template-columns: 40px minmax(0, 1fr); padding: 20px; gap: 4px 12px; }
  .price-card .icon-tile { width: 40px; height: 40px; border-radius: 12px; }
  .landing-main .price-card h3 { font-size: 18px; }
  .page-panel, .services-section, .application-section, .profile-section, .consultant-chat-section { padding: 20px; }
  .section-heading h1 { font-size: 28px; }
  .section-heading h2 { font-size: 24px; }
  .custom-file-control { grid-template-columns: 1fr; }
  .custom-file-button { width: 100%; }
  .date-picker-popover { width: min(356px, calc(100vw - 76px)); }
  .review-image { height: 250px; }
  .reviews-dots { gap: 7px; }
  .modal-window h2 { font-size: 22px; }
  .application-help .secondary-btn { width: 100%; }
  .social-link { width: 40px; height: 40px; }
  .social-link svg, .social-link--max svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.price-card .icon-tile img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

@media (max-width: 767px) {
  .total-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .total-details,
  .total-final {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    text-align: left;
  }

  .total-details span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .total-details .savings-line {
    display: block;
  }

  .total-final strong {
    font-size: 26px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 767px) {
  .service-picker {
    padding: 10px;
  }

  .service-picker label {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 2px 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    height: auto;
    min-height: 0;
  }

  .service-picker input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 0;
    grid-row: 1 / 3;
  }

  .service-picker label span,
  .service-picker label strong {
    grid-column: 2;
    width: auto;
    padding-left: 0;
    font-size: 14px;
    line-height: 1.25;
  }
}

@media (max-width: 767px) {
  .service-type-picker {
    padding: 10px;
    gap: 8px;
  }

  .service-type-picker label {
    min-height: 40px;
    height: auto;
    padding: 6px 8px;
    gap: 6px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 8px;
  }

  .service-type-picker input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
  }
}

.terms-choice {
  align-items: flex-start;
  line-height: 1.4;
}

.terms-choice input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 3px 0 0;
  flex-shrink: 0;
}
