:root {
  --ink: #30271f;
  --muted: #786d63;
  --cream: #f3ece3;
  --paper: rgba(255, 252, 247, .94);
  --line: #dfd1c1;
  --accent: #c46b36;
  --accent-dark: #94461f;
  --sage: #697c58;
  --sage-soft: #e4ebdc;
  --amber: #a86c17;
  --amber-soft: #faebcc;
  --red: #a24b3e;
  --red-soft: #f5ddd7;
  --blue: #4c6877;
  --blue-soft: #e1eaf0;
  --shadow: 0 18px 50px rgba(78, 54, 34, .10);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scrollbar-gutter: stable; background: var(--cream); }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: hidden; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 18% -10%, #fff 0, transparent 36%), linear-gradient(135deg, #f7f1e9, #ecdfd1); font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { min-width: 0; max-width: 100%; font: inherit; }
button { color: inherit; overflow-wrap: anywhere; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.12; }
h1 { font-size: clamp(34px, 4.2vw, 58px); }
h2 { font-size: 28px; }
h3 { font-size: 21px; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 7px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.ambient { position: fixed; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(4px); }
.ambient-one { width: 380px; height: 380px; top: 6%; right: -160px; background: rgba(224, 176, 132, .22); }
.ambient-two { width: 300px; height: 300px; bottom: 5%; left: -140px; background: rgba(122, 145, 102, .15); }

.login-screen { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(540px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 32px; background: var(--paper); box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 16px; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.login-form label { display: grid; gap: 8px; font-weight: 700; }
.login-form input { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf9; color: var(--ink); font: inherit; }
.login-form .primary-button { width: 100%; min-height: 52px; }
.form-error { margin: 0; color: #a23b2a !important; font-weight: 700; }
.callout { margin-top: 24px; padding: 16px; border-radius: 16px; background: var(--cream); word-break: break-all; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 25px; border-radius: 18px; color: #fff; background: var(--ink); font-family: Georgia, serif; font-size: 21px; }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 14px; font-size: 15px; }

.topbar { position: sticky; z-index: 20; top: 0; height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgba(181, 157, 134, .35); background: rgba(248, 243, 236, .86); backdrop-filter: blur(18px); }
.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand span { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 21px; }
.brand span { color: var(--muted); font-size: 12px; }
.sync-label { padding: 7px 12px; border-radius: 999px; color: var(--sage); background: var(--sage-soft); font-size: 12px; font-weight: 700; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); cursor: pointer; font-size: 21px; }
.icon-button:hover { background: #fff; }

.shell { position: relative; width: min(1320px, calc(100% - 48px)); min-width: 0; margin: 0 auto; padding: 52px 0 90px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; padding: 0 6px; }
.hero > div > p:last-child { max-width: 690px; margin-top: 14px; color: var(--muted); font-size: 17px; }
.date-control { min-width: 190px; display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.date-control input { height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.65); }
.primary-button, .secondary-button, .chat-shortcut { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 17px; border: 1px solid transparent; border-radius: 14px; cursor: pointer; font-weight: 800; line-height: 1.2; text-align: center; white-space: normal; }
.primary-button { color: white; background: var(--accent); }
.secondary-button, .chat-shortcut { border-color: var(--line); background: white; }
.main-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 34px; }
.main-tab { min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); cursor: pointer; font-size: 17px; font-weight: 850; }
.main-tab span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--cream); }
.main-tab.active { color: white; border-color: var(--ink); background: var(--ink); }
.main-tab.active span { color: var(--ink); background: white; }
.area { display: none; min-width: 0; }
.area.active { display: block; }
.policy-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding: 16px 20px; border-radius: 17px; color: #455738; background: var(--sage-soft); }
.policy-banner span { color: #627054; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.summary-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 9px 28px rgba(75,53,35,.05); }
.summary-card strong { display: block; margin-top: 8px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.summary-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-card.attention { border-color: #d9afa6; background: linear-gradient(135deg, var(--paper), var(--red-soft)); }

.tabs { width: fit-content; display: flex; gap: 6px; margin-bottom: 28px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.45); }
.tab { padding: 10px 17px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-weight: 750; }
.tab.active { color: #fff; background: var(--ink); }
#attention-count { opacity: .72; }
#service-count { opacity: .72; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 6px 18px; }
.booking-list { display: grid; gap: 13px; }
.empty-state { padding: 42px; border: 1px dashed #cdbba9; border-radius: 25px; color: var(--muted); text-align: center; background: rgba(255,255,255,.35); }

.directory-heading { align-items: center; }
.directory-heading .muted { max-width: 720px; margin-top: 6px; }
.directory-tabs { width: 100%; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.directory-card { min-width: 0; min-height: 190px; display: flex; align-items: flex-start; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--paper); box-shadow: 0 8px 26px rgba(75,53,35,.045); cursor: pointer; text-align: left; }
.directory-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.directory-card h3, .directory-card p, .directory-card small { max-width: 100%; overflow-wrap: anywhere; }
.directory-card p, .directory-card small { color: var(--muted); }
.directory-card small { display: block; }
.directory-card-wide { grid-column: 1 / -1; min-height: 150px; }
.directory-form { width: min(820px, calc(100vw - 24px)); }
.directory-form-fields { display: grid; gap: 16px; min-width: 0; }
.directory-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.directory-form label { min-width: 0; display: grid; gap: 6px; font-weight: 700; }
.directory-form input, .directory-form select, .directory-form textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; }
.directory-form select[multiple] { min-height: 120px; }
.directory-form .check-line { display: flex; align-items: center; }
.directory-form .check-line input { width: 20px; height: 20px; }
.object-directory-card { overflow: hidden; padding-top: 0; }
.directory-cover { width: calc(100% + 40px); height: 150px; margin: 0 -20px 8px; object-fit: cover; background: #e7ddd2; }
.directory-cover-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.directory-debt { margin-top: auto; }
.directory-object-hero { display: grid; gap: 14px; }
.object-photo-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.object-photo-strip img, .object-photo-strip .directory-cover { width: 190px; min-width: 190px; height: 125px; margin: 0; border-radius: 16px; object-fit: cover; scroll-snap-align: start; }
.directory-form-section, .directory-access-section { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.5); }
.directory-form-section h3 { margin: 0 0 12px; }
.directory-access-section summary { cursor: pointer; font: 700 21px/1.2 Georgia,serif; }
.directory-access-section[open] summary { margin-bottom: 12px; }
.form-field-wide { grid-column: 1 / -1; }
.form-hint { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.reserve-cleaner-rows { display: grid; gap: 8px; margin: 7px 0 10px; }
.reserve-cleaner-row { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.reserve-cleaner-row .icon-button { width: 44px; }
.cleaner-debt-card { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: var(--amber-soft); }
.cleaner-debt-card strong { font-size: 26px; }
.cleaner-debt-card small { color: var(--muted); }
.object-assignment-list { max-height: 360px; display: grid; gap: 7px; overflow-y: auto; }
.object-assignment-list label { grid-template-columns: 22px 1fr; align-items: start; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.object-assignment-list input { width: 18px; min-height: 18px; }
.object-assignment-list span { display: grid; gap: 3px; }
.object-assignment-list small { color: var(--muted); font-weight: 400; }
.checklist-directory-card { min-height: 160px; text-align: left; }
.checklist-directory-section { grid-column: 1 / -1; display: grid; gap: 12px; }
.checklist-directory-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.checklist-directory-heading h3 { margin: 0; }
.checklist-directory-heading span { color: var(--muted); font-size: 13px; }
.checklist-directory-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.marketplace-choice { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.marketplace-choice legend { padding: 0 6px; font-weight: 700; }
.marketplace-choice label { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.checklist-section { color: var(--accent-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.checklist-editor-intro { padding: 15px; border-radius: 15px; background: var(--sage-soft); }
.checklist-editor-intro p { margin-top: 4px; color: var(--muted); }
.directory-object-name { padding: 13px 15px; border-radius: 14px; background: var(--cream); font-family: Georgia, serif; font-size: 20px; }

.booking-card { display: grid; grid-template-columns: 132px minmax(220px, 1.3fr) 2fr auto auto; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 8px 26px rgba(75,53,35,.045); cursor: pointer; transition: .16s ease; }
.booking-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.booking-card.is-unread { border-color: #d89360; background: linear-gradient(90deg, #fff0df 0, var(--paper) 42%); box-shadow: 0 10px 30px rgba(196,107,54,.16); }
.booking-card.has-attention { border-left: 5px solid var(--red); }
.booking-card.is-service { border-left: 5px solid var(--blue); }
.date-block strong, .date-block span { display: block; }
.date-block strong { font-family: Georgia, serif; font-size: 19px; }
.date-block span { color: var(--muted); font-size: 12px; }
.booking-main h3 { margin-bottom: 5px; }
.booking-main p { color: var(--muted); font-size: 13px; }
.booking-new-badge { display: inline-flex; align-items: center; min-height: 24px; margin-bottom: 7px; padding: 2px 9px; border-radius: 999px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.guest-line { margin-top: 7px; color: var(--ink) !important; font-weight: 650; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(95px,1fr)); gap: 8px; }
.status-item { min-width: 0; padding: 9px 10px; border-radius: 13px; background: var(--cream); }
.status-item span, .status-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-item span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.status-item strong { margin-top: 2px; font-size: 12px; }
.status-item.good { background: var(--sage-soft); color: #46583a; }
.status-item.warn { background: var(--amber-soft); color: #7b4d0d; }
.status-item.bad { background: var(--red-soft); color: #7f372d; }
.status-item.info { background: var(--blue-soft); color: #385666; }
.attention-badge { min-width: 72px; padding: 7px 10px; border-radius: 999px; color: var(--red); background: var(--red-soft); font-size: 11px; font-weight: 800; text-align: center; }
.attention-badge.ok { color: var(--sage); background: var(--sage-soft); }
.attention-badge.service { color: var(--blue); background: var(--blue-soft); }
.service-exclusion { display: grid; gap: 3px; padding: 11px 14px; border-radius: 14px; color: var(--blue); background: var(--blue-soft); }
.service-exclusion strong { font-size: 13px; }
.service-exclusion span { font-size: 11px; }
.simple-list { min-width: 0; display: grid; gap: 12px; }
.simple-card { display: grid; grid-template-columns: minmax(260px,1fr) auto auto; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.simple-card h3 { margin: 5px 0; }
.simple-card small { color: var(--muted); }
.chat-card { grid-template-columns: 50px minmax(220px,1fr) auto; cursor: pointer; }
.chat-card p { max-width: 780px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.chat-load-more { display: block; width: min(420px, 100%); margin: 18px auto 0; }
.conversation-tabs { display: flex; gap: 7px; margin-bottom: 15px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.45); }
.conversation-tab { min-height: 44px; flex: 0 0 auto; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-weight: 800; }
.conversation-tab span { margin-left: 5px; color: var(--muted); }
.conversation-tab.active { color: white; background: var(--ink); }
.conversation-tab.active span { color: rgba(255,255,255,.72); }
.conversation-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.conversation-state { min-width: 118px; padding: 8px 11px; border-radius: 999px; text-align: center; font-size: 12px; font-weight: 850; white-space: nowrap; }
.conversation-state.needs_reply { color: var(--red); background: var(--red-soft); }
.conversation-state.waiting_guest { color: var(--sage); background: var(--sage-soft); }
.conversation-state.unlinked { color: var(--amber); background: var(--amber-soft); }
.conversation-state.closed, .conversation-state.contact_only { color: var(--muted); background: var(--cream); }
.conversation-actions { display: grid; justify-items: end; gap: 7px; }
.chat-booking-banner { position: sticky; z-index: 2; top: 86px; margin-bottom: 16px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.98); box-shadow: 0 8px 22px rgba(75,53,35,.08); }
.chat-booking-banner strong, .chat-booking-banner span { display: block; }
.chat-booking-banner span { color: var(--muted); }
.filter-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #f8f1e8; }
.status-pill { align-self: center; padding: 9px 12px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-weight: 800; white-space: nowrap; }
.directory-card .status-pill { align-self: flex-start; }
.status-pill.status-risk { color: var(--red); background: var(--red-soft); }
.status-pill.status-muted { color: var(--muted); background: var(--cream); }
.channel-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--accent); font-size: 20px; font-weight: 900; }
.inline-control { min-width: 230px; color: var(--muted); font-size: 12px; }
.inline-control select, .form-body input, .form-body select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.link-row { display: flex; gap: 7px; }
.link-row a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font-weight: 800; text-decoration: none; }

.booking-dialog { width: min(960px, 100%); height: 100dvh; max-width: none; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 0; background: #f7f1ea; box-shadow: -20px 0 60px rgba(53,36,23,.18); }
.booking-dialog::backdrop { background: rgba(45,34,25,.32); backdrop-filter: blur(3px); }
.booking-dialog.task-dialog[open] { display: block; overflow-x: hidden; overflow-y: auto; }
.booking-dialog.task-dialog .task-detail { min-height: auto; padding: 28px 26px 60px; overflow: visible; }
.dialog-bar { position: sticky; z-index: 3; top: 0; height: 74px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(248,243,236,.92); backdrop-filter: blur(16px); }
.dialog-bar > div { min-width: 0; }
.dialog-bar strong, .dialog-bar span { display: block; }
.dialog-bar strong, .dialog-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-bar span { color: var(--muted); font-size: 11px; }
.booking-detail { padding: 28px 26px 60px; }
.chat-detail { min-height: 100%; padding: 22px; }
.message-list { display: flex; flex-direction: column; gap: 10px; }
.chat-compose { position: sticky; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(248,243,236,.98); }
.chat-compose textarea { width: 100%; min-height: 52px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; padding: 12px; font: inherit; }
.chat-compose small { grid-column: 1 / -1; color: var(--muted); }
.booking-filter-stack { display: grid; gap: 8px; margin-top: 16px; }
.booking-filter-stack .conversation-tabs { margin-bottom: 0; }
.booking-class-tabs .conversation-tab { flex: 1 0 auto; }
.message { max-width: 76%; padding: 11px 14px; border-radius: 17px 17px 17px 5px; background: white; box-shadow: 0 5px 18px rgba(75,53,35,.06); }
.message.out { align-self: flex-end; border-radius: 17px 17px 5px 17px; background: var(--sage-soft); }
.message span, .message small { display: block; }
.message small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.small-dialog { width: min(640px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 22px; background: var(--paper); }
.small-dialog::backdrop { background: rgba(45,34,25,.32); }
.form-card { margin: 0; }
.form-body { display: grid; gap: 12px; padding: 20px; }
.form-body label { display: grid; gap: 5px; font-weight: 700; }
.choice-card { display: flex; gap: 16px; margin: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; }
.choice-card legend { padding: 0 5px; font-weight: 800; }
.choice-card label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; }
.booking-search-results { display: grid; gap: 6px; max-height: 250px; margin-top: 7px; overflow-y: auto; }
.booking-search-result { width: 100%; display: grid; gap: 2px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: white; cursor: pointer; }
.booking-search-result strong { font-size: 14px; }
.booking-search-result span { color: var(--muted); font-size: 12px; }
.selected-booking { padding: 15px; border: 1px solid #b9c7ad; border-radius: 16px; background: var(--sage-soft); }
.selected-booking h3 { margin-bottom: 7px; }
.selected-booking-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin-top: 10px; font-size: 13px; }
.selected-booking-grid span { color: var(--muted); }
.form-help { color: var(--muted); font-size: 12px; }
.contact-list { display: grid; gap: 8px; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 13px; background: var(--cream); }
.contact-row span { color: var(--muted); font-size: 12px; }
html.modal-open, body.modal-scroll-locked { overflow: hidden; overscroll-behavior: none; }
.cleaning-native-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#cleaning-native .section-heading { margin: 34px 6px 18px; }
#cleaning-native .cleaning-heading { margin-top: 22px; }
.area-toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.channel-badges { min-width: 150px; max-width: 230px; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 9px; }
.channel-badges span { width: auto; height: auto; display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--ink); background: var(--cream); font-size: 11px; white-space: nowrap; }
.chat-shortcut.empty { white-space: nowrap; }
.supply-basket { grid-template-columns: minmax(240px,.7fr) minmax(360px,1.3fr) auto; align-items: start; }
.basket-lines { display: grid; gap: 6px; }
.basket-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.basket-lines span { display: flex; gap: 9px; }
.basket-lines a { color: var(--accent); font-weight: 850; }
.detail-hero { padding: 25px; border: 1px solid var(--line); border-radius: 25px; background: var(--paper); }
#booking-detail .detail-hero { display: block; min-height: 0; align-items: initial; color: var(--ink); background: var(--paper); position: static; }
#booking-detail .detail-hero::before { content: none; }
#booking-detail .detail-hero > * { position: static; }
.detail-hero h2 { margin-bottom: 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; color: var(--muted); }
.detail-meta strong { color: var(--ink); }
.attention-panel { margin-top: 15px; padding: 15px 18px; border-radius: 16px; background: var(--red-soft); color: #71352d; }
.attention-panel ul { margin: 8px 0 0; padding-left: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-top: 14px; }
.detail-section { padding: 21px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
.detail-section h3 { margin-bottom: 14px; }
.realty-note p { white-space: pre-wrap; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid rgba(222,208,193,.6); }
.detail-row > * { min-width: 0; overflow-wrap: anywhere; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); }
.cleaning-detail, .cleaning-detail * { min-width: 0; }
.cleaning-detail { width: 100%; max-width: 100%; }
.cleaning-detail .detail-hero { width: 100%; min-height: 0; display: block; padding: 25px; color: var(--ink); background: var(--paper); }
.cleaning-detail .detail-hero > div { position: static; }
.cleaning-detail .detail-hero h1 { max-width: 100%; margin: 7px 0 8px; overflow-wrap: anywhere; word-break: normal; }
.cleaning-detail .detail-hero p { max-width: 100%; margin-top: 0; overflow-wrap: anywhere; }
.cleaning-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.cleaning-summary-grid > *, .cleaning-summary-stack > *, .cleaning-detail-stack > * { width: 100%; max-width: 100%; }
.cleaning-summary-stack, .cleaning-detail-stack { display: grid; gap: 14px; }
.cleaning-summary-stack { grid-template-rows: minmax(0, 1fr) auto; }
.cleaning-detail-stack { margin-top: 14px; }
.cleaning-progress-card { height: 100%; }
.cleaning-cost { margin-top: 8px; overflow-wrap: anywhere; }
.cleaning-detail .detail-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cleaning-detail .fact { min-width: 0; }
.cleaning-detail .fact span, .cleaning-detail .fact strong { max-width: 100%; overflow-wrap: anywhere; }
.cleaning-detail .action-row > *, .cleaning-detail button, .cleaning-detail select, .cleaning-detail input, .cleaning-detail textarea { max-width: 100%; }
.cleaning-detail .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.workflow-control { display: grid; grid-template-columns: 125px 1fr; align-items: center; gap: 12px; margin-top: 10px; }
.workflow-control span { color: var(--muted); font-size: 12px; }
.workflow-control select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
.timeline { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
.timeline h3 { margin-bottom: 16px; }
.event { position: relative; margin-left: 7px; padding: 0 0 18px 22px; border-left: 1px solid #cab9a8; }
.event:last-child { padding-bottom: 0; }
.event::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.event strong, .event span { display: block; }
.event span { color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 14px; color: #fff; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .booking-card { grid-template-columns: 100px 1fr auto auto; }
  .supply-basket { grid-template-columns: 1fr; }
  .status-strip { grid-column: 1 / -1; }
  .simple-card { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .login-screen { padding: 14px; }
  .login-card { padding: 28px 22px; border-radius: 24px; }
  .topbar-actions .ghost-button { padding-inline: 10px; font-size: 12px; }
  .topbar { height: 68px; padding: 0 14px; }
  .sync-label { display: none; }
  .shell { width: min(100% - 24px, 1320px); padding: 28px 0 60px; }
  .hero { display: grid; margin-bottom: 24px; }
  .hero h1 { font-size: 38px; }
  .date-control { width: 100%; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 15px; border-radius: 18px; }
  .summary-card strong { font-size: 28px; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1 0 auto; padding: 9px 12px; }
  .main-tabs { position: sticky; z-index: 10; top: 68px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 100%; margin-bottom: 24px; padding: 4px; overflow: visible; border-radius: 16px; background: rgba(248,243,236,.96); }
  .main-tab { min-width: 0; min-height: 56px; flex-direction: column; gap: 1px; padding: 4px 2px; font-size: 12px; line-height: 1.1; }
  .main-tab span { width: 21px; height: 21px; font-size: 10px; }
  .policy-banner { align-items: flex-start; flex-direction: column; gap: 8px; padding: 15px; }
  .section-heading { display: grid; align-items: start; margin-inline: 0; }
  .section-heading .primary-button { width: 100%; }
  #last-updated { display: none; }
  .booking-card { grid-template-columns: 82px 1fr; gap: 12px; padding: 16px; }
  .booking-main h3 { font-size: 19px; }
  .attention-badge { grid-column: 1 / -1; width: fit-content; }
  .chat-shortcut { grid-column: 1 / -1; width: 100%; }
  .channel-badges { max-width: none; justify-content: flex-start; }
  .status-strip { grid-template-columns: repeat(2,1fr); }
  .booking-dialog { width: 100%; }
  .dialog-bar { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 8px; padding: 0 12px; }
  .booking-detail { padding: 18px 12px 50px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-hero, .detail-section, .timeline { padding: 18px; border-radius: 19px; }
  .booking-dialog.task-dialog .task-detail { padding: 18px 12px 50px; }
  .cleaning-summary-grid { grid-template-columns: 1fr; }
  .cleaning-summary-stack { grid-template-rows: auto; }
  .cleaning-detail .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cleaning-detail .detail-hero h1 { font-size: clamp(28px, 8vw, 40px); }
  .workflow-control { grid-template-columns: 1fr; gap: 4px; }
  .simple-card, .chat-card { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 15px; }
  .simple-card > *, .chat-card > * { min-width: 0; max-width: 100%; }
  .chat-card h3 { overflow-wrap: anywhere; }
  .chat-card p { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
  .conversation-tabs { width: 100%; max-width: 100%; scroll-snap-type: x proximity; }
  .conversation-tab { scroll-snap-align: start; }
  .conversation-meta { font-size: 12px; }
  .conversation-actions { justify-items: stretch; }
  .conversation-state { width: fit-content; }
  .selected-booking-grid { grid-template-columns: 1fr; }
  .choice-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .cleaning-native-toolbar { align-items: stretch; flex-direction: column-reverse; }
  .channel-mark { display: none; }
  .simple-card .secondary-button, .simple-card .primary-button { width: 100%; }
  .message { max-width: 90%; }
  .small-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .form-body { padding: 16px; }
  .detail-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .primary-button, .secondary-button, .chat-shortcut { width: 100%; }
  .directory-heading { align-items: stretch; }
  .directory-grid { grid-template-columns: 1fr; }
  .directory-form .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .cleaning-detail .detail-facts { grid-template-columns: 1fr; }
  .cleaning-detail .detail-hero h1 { font-size: clamp(27px, 9vw, 36px); }
  .cleaning-detail .detail-hero, .cleaning-detail .detail-section { padding: 16px; }
  .cleaning-detail .action-row { display: grid; grid-template-columns: 1fr; }
  .cleaning-detail .action-row > * { width: 100%; }
}
