@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #e9ebe0;
  --surface: #fbfaf4;
  --ink: #34362b;
  --muted: #5f6554;
  --line: #d1d5c3;
  --accent: #89946b;
  --accent-press: #717c57;
  --warm: #d5c38f;
  --danger: #9a4f45;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Manrope, Arial, sans-serif; }
body { margin: 0; min-width: 320px; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #f5b942; outline-offset: 2px; }
.shell { position: relative; max-width: 1080px; margin: 0 auto; overflow: hidden; padding: var(--space-5) var(--space-4) var(--space-6); }
.shell::before { position: absolute; top: 150px; left: -170px; width: 520px; height: 350px; background: url('/static/assets/olive-branch.png') center / contain no-repeat; content: ''; opacity: .16; pointer-events: none; transform: rotate(-10deg); }
.shell > * { position: relative; z-index: 1; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) 250px auto; gap: var(--space-5); align-items: start; padding-bottom: var(--space-5); }
.topbar > div { max-width: 760px; }
.hero-copy { padding-top: var(--space-3); }
.hero-copy > p:last-child { max-width: 590px; margin-bottom: 0; }
.hero-cover-frame { width: 250px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 28px rgba(52, 54, 43, .10); }
.hero-cover { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: center; }
.eyebrow { margin: 0 0 var(--space-1); color: #687151; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; }
h1 { margin-bottom: var(--space-2); font-size: 40px; line-height: 0.98; }
h2 { margin-bottom: var(--space-3); font-size: 28px; line-height: 1.05; }
h3 { margin-bottom: var(--space-2); font-size: 22px; line-height: 1.1; }
p { color: var(--muted); line-height: 1.5; }
.status { min-height: 22px; color: var(--accent); font-size: 14px; }
.status.error { color: var(--danger); }
.nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 var(--space-4); scrollbar-width: thin; }
.nav button { flex: 0 0 auto; min-height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; color: var(--ink); padding: 0 10px; font-size: 14px; white-space: nowrap; }
.nav button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.product-grid { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.card { display: flex; min-width: 0; flex-direction: column; min-height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 24px rgba(52, 54, 43, .07); }
.cover { display: grid; min-height: 145px; place-items: end start; padding: var(--space-3); background: #dfe4d0; background-size: cover; background-position: center; color: #48513a; font-weight: 700; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: var(--space-4); }
.card-body p { flex: 1; font-size: 14px; }
.meta { color: var(--muted); font-size: 14px; line-height: 1.45; }
.price { margin: var(--space-4) 0 var(--space-3); font-weight: 700; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: #fff; padding: 0 18px; text-decoration: none; }
.button:hover { background: var(--accent-press); border-color: var(--accent-press); }
.button.secondary { background: var(--surface); color: var(--accent); }
.button.danger { border-color: var(--danger); background: var(--danger); }
.empty { border: 1px dashed var(--line); padding: var(--space-5); text-align: center; }
.channel-panel { display: grid; min-height: 270px; place-content: center; justify-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-6) var(--space-4); box-shadow: 0 10px 24px rgba(52, 54, 43, .06); text-align: center; }
.channel-panel h2 { margin-bottom: var(--space-2); font-size: 38px; }
.channel-panel p { max-width: 470px; margin-bottom: var(--space-5); }
.channel-link { min-height: 50px; font-size: 17px; font-weight: 700; }
.modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: none; align-items: center; justify-content: center; overflow-x: hidden; background: rgba(20, 32, 25, .58); padding: var(--space-3); }
.modal-backdrop.open { display: flex; }
.modal { width: min(680px, 100%); max-width: 100%; max-height: 92vh; overflow-x: hidden; overflow-y: auto; border-radius: var(--radius); background: var(--surface); padding: var(--space-5); }
.modal-header { display: flex; gap: var(--space-3); align-items: flex-start; justify-content: space-between; }
.modal-header > div { min-width: 0; }
.close { flex: 0 0 auto; width: auto; min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 0 12px; white-space: nowrap; }
.form-grid { display: grid; gap: var(--space-3); }
fieldset { min-width: 0; border: 1px solid var(--line); padding: var(--space-3); }
legend { padding: 0 var(--space-1); color: var(--ink); font-weight: 700; }
.field-hint { margin: 0; font-size: 13px; }
.field-label { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.required-mark { border-radius: 999px; background: #eef1e5; color: var(--muted); padding: 2px 7px; font-size: 12px; font-weight: 600; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; }
input.field-invalid, textarea.field-invalid, select.field-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(154, 79, 69, .14); }
.material-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.material-list li { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: var(--space-2); }
.material-list a { max-width: 100%; overflow-wrap: anywhere; color: var(--accent-press); }
.slot-list { display: grid; gap: var(--space-3); margin: var(--space-3) 0; }
.slot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; border-top: 1px solid var(--line); padding-top: var(--space-3); }
.slot-fields { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr); gap: var(--space-3); align-items: end; }
.slot-actions { display: flex; gap: var(--space-3); align-items: center; padding-bottom: 4px; }
.slot-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.slot-notice { margin: 0; border: 1px dashed var(--line); padding: var(--space-3); color: var(--muted); }
.event-details { display: grid; gap: var(--space-2); margin-top: var(--space-3); border-left: 3px solid var(--accent); background: #f2f4e9; padding: var(--space-3); color: var(--ink); font-size: 13px; line-height: 1.45; }
.event-dates { display: grid; gap: var(--space-2); margin: 0; padding-left: 20px; color: var(--muted); }
.event-dates li { padding-left: var(--space-1); }
.event-dates li span { display: block; }
.event-topic { display: block; color: var(--ink); }
.event-date-empty { color: var(--muted); }
.modal .event-details { font-size: 14px; }
.text-button { min-height: 36px; border: 0; background: transparent; color: var(--danger); padding: 4px 0; text-decoration: underline; }
label { display: grid; gap: var(--space-1); color: var(--ink); font-weight: 600; }
input, textarea, select { width: 100%; min-height: 44px; border: 1px solid #aebbb3; border-radius: 5px; background: #fff; color: var(--ink); padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
.check { grid-template-columns: 20px 1fr; align-items: start; font-size: 14px; font-weight: 400; }
.check input { width: 20px; min-height: 20px; margin: 1px 0 0; }
.legal { border-left: 3px solid var(--warm); padding: var(--space-3); background: #fff9e9; color: #5a4406; font-size: 14px; line-height: 1.45; }
.required-text { color: var(--muted); font-size: 12px; font-weight: 500; }
.consent-check { border: 1px solid var(--line); border-radius: 6px; background: #f3f5eb; padding: var(--space-3); line-height: 1.5; }
.consent-check a, .consent-hint a, .site-footer a, .legal-document a { color: #53613c; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.consent-hint { margin: calc(var(--space-2) * -1) 0 0; color: var(--muted); font-size: 12px; }
.site-footer { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(180px, .8fr) minmax(220px, 1fr); gap: var(--space-5); margin-top: 56px; border-top: 1px solid var(--line); padding: var(--space-5) 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.footer-identity, .footer-contacts, .footer-links { display: grid; align-content: start; gap: var(--space-1); }
.footer-identity strong { color: var(--ink); }
.footer-contacts a, .footer-links a { width: fit-content; overflow-wrap: anywhere; }
.legal-shell { max-width: 880px; overflow: visible; }
.legal-page-header { display: flex; gap: var(--space-4); align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: var(--space-5); }
.legal-page-header h1 { max-width: 680px; font-size: 38px; line-height: 1.05; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); padding: 0 16px; text-decoration: none; }
.legal-document { margin-top: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: clamp(20px, 4vw, 48px); box-shadow: 0 10px 24px rgba(52, 54, 43, .06); }
.legal-document h2 { margin-top: var(--space-6); font-size: 26px; }
.legal-document h2:first-child { margin-top: 0; }
.legal-document h3 { margin-top: var(--space-5); font-family: Manrope, Arial, sans-serif; font-size: 17px; line-height: 1.4; }
.legal-document p, .legal-document li { color: var(--ink); font-size: 15px; line-height: 1.7; }
.legal-document ul { padding-left: 24px; }
.legal-document li + li { margin-top: var(--space-2); }
.legal-meta { color: var(--muted) !important; font-size: 13px !important; }
.legal-requisites { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-5); border-bottom: 1px solid var(--line); padding-bottom: var(--space-4); color: var(--muted); font-size: 13px; }
.admin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--space-5); }
.admin-layout > aside { min-width: 0; }
.admin-workspace { min-width: 0; }
.admin-sections { display: grid; gap: var(--space-2); position: sticky; top: var(--space-3); z-index: 10; }
.admin-sections button { display: flex; min-height: 54px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 12px; text-align: left; }
.admin-sections button span { font-weight: 700; }
.admin-sections button small { color: var(--muted); }
.admin-sections button.active { border-color: var(--accent); background: #eaf0dd; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-4); box-shadow: 0 8px 20px rgba(52, 54, 43, .05); }
.panel + .panel { margin-top: var(--space-4); }
.panel-heading { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; }
.panel-heading h2 { margin-bottom: 0; }
.customers-toolbar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: var(--space-3); margin: var(--space-4) 0; }
.customer-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr); gap: var(--space-4); border-top: 1px solid var(--line); padding: var(--space-3) 0; }
.customer-button { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: var(--ink); text-align: left; }
.customer-button:hover { background: #f1f4ea; }
.customer-main, .customer-stats { display: grid; gap: var(--space-1); min-width: 0; }
.customer-main strong { overflow-wrap: anywhere; }
.customer-main span, .customer-stats span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.customer-profile { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: calc(var(--space-2) * -1) 0 var(--space-4); color: var(--muted); font-size: 14px; }
.detail-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .6fr); gap: var(--space-3); border-top: 1px solid var(--line); padding: var(--space-3) 0; color: var(--muted); font-size: 14px; }
.customer-detail-panel { margin-top: var(--space-5); border-top: 2px solid var(--accent); padding-top: var(--space-5); }
.customer-order-chat { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.5fr); gap: var(--space-5); }
.order-select-list { display: grid; gap: var(--space-2); }
.order-select { display: grid; gap: var(--space-1); width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 10px; text-align: left; }
.order-select span { display: grid; gap: 2px; }
.order-select small { color: var(--muted); }
.order-select.active { border-color: var(--accent); background: #eaf0dd; box-shadow: inset 3px 0 var(--accent); }
.selected-order-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: var(--space-3); }
.selected-order-meta span { color: var(--muted); font-size: 13px; }
.chat-history { display: grid; gap: var(--space-2); max-height: 390px; overflow-y: auto; margin: var(--space-3) 0; padding-right: var(--space-1); }
.chat-message { max-width: 88%; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px 12px; }
.chat-message.outgoing { justify-self: end; background: #edf2e3; }
.chat-message.deleted-for-customer { border-style: dashed; background: #f3f2ed; opacity: .82; }
.chat-message > div { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: space-between; }
.chat-message p { margin: var(--space-1) 0; color: var(--ink); white-space: pre-wrap; }
.chat-message time, .chat-message small { color: var(--muted); font-size: 12px; }
.empty-chat { border: 1px dashed var(--line); padding: var(--space-4); text-align: center; }
.legacy-messages { margin-top: var(--space-4); color: var(--muted); font-size: 13px; }
.legacy-messages summary { cursor: pointer; font-weight: 700; }
.status-pill { display: inline-flex; width: fit-content; border-radius: 999px; background: #f3ead0; color: #735e25; padding: 3px 8px; font-size: 12px; }
.status-pill.paid { background: #e4efdf; color: #426438; }
.list { display: grid; gap: var(--space-2); }
.list button { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 10px; text-align: left; }
.list button.active { border-color: var(--accent); background: #eaf5ef; }
.order-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(160px, 1fr) minmax(120px, .8fr) minmax(125px, .8fr); gap: var(--space-3); border-top: 1px solid var(--line); padding: var(--space-3) 0; font-size: 14px; }
.order-row small { color: var(--muted); }
.order-status-form { display: grid; gap: var(--space-2); align-self: start; }
.order-status-form label { font-size: 12px; }
.order-status-form select { min-height: 44px; padding: 8px 10px; }
.order-status-form .button { width: 100%; min-height: 44px; padding: 0 12px; }
.session-duration, .payment-note { font-size: 14px; }
.button.danger.secondary { background: transparent; color: var(--danger); }
.button:disabled, .text-button:disabled { cursor: not-allowed; opacity: .5; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .shell { padding: var(--space-4) var(--space-3) calc(var(--space-6) + env(safe-area-inset-bottom)); }
  h1 { font-size: 34px; }
  .topbar { display: flex; flex-direction: column; gap: var(--space-4); }
  .hero-copy { padding-top: 0; }
  .hero-cover-frame { width: min(100%, 330px); align-self: center; }
  .topbar > .button { align-self: stretch; }
  .product-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sections { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-sections .eyebrow { grid-column: 1 / -1; }
  .admin-sections button { min-height: 62px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .modal-backdrop { align-items: end; }
  .modal { padding: var(--space-4); }
  .order-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .customers-toolbar { grid-template-columns: 1fr; }
  .customer-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .detail-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .customer-order-chat { grid-template-columns: 1fr; }
  .channel-panel { min-height: 220px; padding: var(--space-5) var(--space-3); }
  .channel-panel h2 { font-size: 34px; }
  .channel-link { width: 100%; }
  .form-actions .button { flex: 1 1 180px; }
  .slot-row, .slot-fields { grid-template-columns: 1fr; align-items: stretch; }
  .slot-actions { justify-content: space-between; padding-bottom: 0; }
  .site-footer { grid-template-columns: 1fr; gap: var(--space-4); margin-top: 40px; }
  .legal-page-header { flex-direction: column-reverse; }
  .legal-page-header h1 { font-size: 32px; }
  .back-link { align-self: flex-start; }
  .legal-document { padding: var(--space-4); }
}
@media (min-width: 761px) and (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-order-chat, .customers-toolbar { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .card, .button, .nav button { transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease; } }
