:root {
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e6dfd4;
  --paper: #f4f0e8;
  --card: #fffdf9;
  --accent: #0c6b52;
  --accent-2: #e5f4ee;
  --gold: #a68456;
  --warn: #9b3a2f;
  --side: #15211c;
  --side-text: #e8efe9;
  --shadow: 0 18px 50px rgba(28, 25, 21, 0.12);
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.4 "Segoe UI", "Helvetica Neue", sans-serif; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px; background:
  radial-gradient(circle at 10% 10%, #efe6d4, transparent 40%),
  radial-gradient(circle at 90% 80%, #dceee6, transparent 35%), var(--paper); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.auth .card { width: min(440px, 100%); box-shadow: var(--shadow); }
.oauth { display: grid; gap: 8px; margin: 12px 0 4px; }
.oauth .btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-decoration: none; }
.oauth .btn:disabled { opacity: .55; }
.brand-icon { width: 18px; height: 18px; flex: 0 0 18px; display: block; }
.provider-name { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { font-family: Georgia, serif; font-size: 34px; letter-spacing: -0.04em; }
.tabs { display: flex; gap: 6px; margin: 16px 0; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 8px 12px; color: var(--muted); }
.tabs button.on { background: var(--accent-2); color: var(--accent); }
.muted { color: var(--muted); }
label { display: block; font-size: 12px; margin: 8px 0 4px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; }
input[type="checkbox"] { width: auto; padding: 0; }
textarea { min-height: 64px; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 0; border-radius: 999px; padding: 7px 12px; background: var(--accent); color: white; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: var(--warn); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.err { color: var(--warn); min-height: 1.2em; font-size: 14px; }
.shell { height: 100vh; }
.side { position: fixed; top: 0; left: 0; bottom: 0; width: 212px; background: var(--side); color: var(--side-text); padding: 12px 10px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.navscroll { flex: 1; min-height: 0; overflow: auto; }
.side .brand { font-family: Georgia, serif; font-size: 22px; margin: 0 6px 4px; }
.side .company { margin: 0 6px 6px; }
.side .company select { background: #24342d; color: white; border-color: #31443c; padding: 6px 8px; }
.side .group { margin: 8px 6px 2px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #9aafa4; }
.side button.nav { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; background: transparent; color: inherit; border: 0; border-radius: 8px; padding: 4px 8px; font-size: 13px; line-height: 1.3; }
.side button.nav .count { min-width: 1.2em; text-align: center; font-size: 10px; color: #c5d5cc; background: #24342d; border-radius: 99px; padding: 0 5px; }
.side button.nav.on .count { background: #15261f; }
.fav-empty { margin: 0 8px 4px; font-size: 11px; line-height: 1.3; color: #9aafa4; }
.place-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.place-line span { flex: 1; }
.place-line select { max-width: 180px; }
.side button.nav.on { background: #2c4339; }
.side .spacer { flex: 0; height: 0; }
.main { margin-left: 212px; height: 100vh; overflow: auto; padding: 12px 16px 16px; min-width: 0; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pagehead h1, .top h1 { font-size: 22px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.top > div > .muted { font-size: 12px; margin: 2px 0 0; }
.top .tabs { margin: 0; }
.journal { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 8px; overflow: auto; height: calc(100vh - 120px); }
.col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 0; height: 100%; display: flex; flex-direction: column; }
.col h3 { font-size: 14px; padding: 8px 10px; margin: 0; border-bottom: 1px solid var(--line); }
.grid { position: relative; flex: 1; min-height: 480px; }
.slotline { position: absolute; left: 0; right: 0; border-top: 1px solid #e4dccd; font-size: 11px; color: var(--muted); padding-left: 6px; z-index: 1; pointer-events: none; }
.tick { position: absolute; left: 28px; right: 0; border-top: 1px dotted #efe8dc; z-index: 1; pointer-events: none; }
.tick.half { left: 18px; border-top-color: #e7dfd2; }
.nowline { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #c4453c; z-index: 2; pointer-events: none; }
.lunch { position: absolute; left: 0; right: 0; background: rgba(196, 69, 60, .18); border-top: 1px solid #c4453c; border-bottom: 1px solid #c4453c; z-index: 1; pointer-events: none; }
.lunch::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #c4453c; }
.lunch span { position: sticky; left: 8px; display: inline-block; margin: 4px 8px; font-size: 11px; color: #8d2e28; font-weight: 600; }
.guide { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #0c6b52; z-index: 4; pointer-events: none; }
.guide::after { content: attr(data-label); position: absolute; left: 4px; top: -10px; background: #0c6b52; color: #fff; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 6px; }
.appt { position: absolute; left: 8px; right: 8px; z-index: 3; border: 0; border-radius: 8px; padding: 16px 8px 16px; color: white; overflow: hidden; font-size: 12px; line-height: 1.25; text-align: left; box-shadow: 0 4px 10px rgba(0,0,0,.12); cursor: grab; touch-action: none; user-select: none; }
.appt.dragging { z-index: 6; opacity: .94; box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.appt .status { display: block; opacity: .9; font-size: 11px; }
.appt .t-edge { position: absolute; right: 6px; font-size: 11px; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.28); color: #fff; border-radius: 6px; padding: 0 4px; line-height: 16px; }
.appt.confirmed .t-edge { background: rgba(255,255,255,.78); color: #1c1915; }
.appt .t-edge.start { top: 2px; }
.appt .t-edge.end { bottom: 2px; }
.appt .grip { position: absolute; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.appt .grip.start { top: 0; }
.appt .grip.end { bottom: 0; }
.appt .grip.start::before, .appt .grip.end::before { content: ""; position: absolute; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 99px; background: currentColor; opacity: .85; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.appt .grip.start::before { top: 3px; }
.appt .grip.end::before { bottom: 3px; }
.appt.booked { background: #8a847c; }
.appt.confirmed { background: #e6b325; color: #1c1915; }
.appt.arrived { background: #e07a2f; }
.appt.completed { background: #1f8a4c; }
.appt.noshow, .appt.cancelled { background: #c4453c; }
.icon { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; padding: 0; line-height: 1; font-size: 16px; }
.icon.plus { color: var(--accent); border-color: #b7d8cc; }
.icon.edit { color: #3d4f46; }
.icon.del { color: #fff; background: var(--warn); border-color: var(--warn); }
.caret { width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); padding: 0; }
.checkline { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.checkline input { width: auto; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; align-items: start; }
.cat-head { justify-content: space-between; margin-bottom: 6px; }
.svc { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.perms { display: grid; gap: 2px; margin-top: 8px; }
.perm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 2px 0 8px 30px; }
.perm-actions[hidden] { display: none; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table tr.click:hover { background: #faf7f1; cursor: pointer; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.kpi b { display: block; font-size: 18px; margin-top: 2px; font-family: Georgia, serif; white-space: nowrap; }
.modal { position: fixed; inset: 0; background: rgba(21, 33, 28, .38); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal .card { width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(440px, 100%); background: var(--card); border-left: 1px solid var(--line); padding: 22px; overflow: auto; z-index: 20; box-shadow: var(--shadow); }
.backdrop { position: fixed; inset: 0; background: rgba(21, 33, 28, .28); z-index: 19; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 8px; background: var(--accent-2); color: var(--accent); font-size: 12px; }
.pill.warn { background: #f8e8e4; color: var(--warn); }
.pill.gold { background: #f6efe3; color: #7a5b2e; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; align-items: start; }
.stack { display: grid; gap: 8px; align-content: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cards.roles { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); margin-top: 8px; }
.block { margin: 12px 0 6px; font-size: 16px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid textarea, .form-grid .wide { grid-column: 1 / -1; }
.search { width: 100%; margin: 0 0 8px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; border-radius: 999px; padding: 10px 16px; z-index: 30; }
.book { max-width: 760px; margin: 28px auto; }
.steps { display: flex; gap: 8px; margin: 8px 0 16px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps span.on { background: var(--accent); }
.choices { display: grid; gap: 8px; }
.choices button { text-align: left; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.choices button:hover { border-color: var(--accent); }
.grid { cursor: cell; }
.suggest { display: grid; gap: 4px; margin-top: 4px; }
.suggest .item { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.suggest .item:hover { border-color: var(--accent); }
.visits { display: grid; gap: 2px; margin-top: 4px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 4px 3px 10px; background: var(--accent-2); color: var(--accent); font-size: 13px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.total { margin: 8px 0 0; font-weight: 600; }
.hint { background: #f7f1e6; border-radius: 12px; padding: 8px 12px; }
.chat { display: grid; grid-template-columns: 260px 1fr; gap: 8px; align-items: stretch; height: calc(100vh - 120px); }
.composer { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.composer input { flex: 1; width: auto; min-width: 0; }
.chat > .stack { overflow: auto; min-height: 0; }
.chat > .card { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-item { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); }
.chat-item.on { border-color: var(--accent); background: var(--accent-2); }
.thread { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; overflow: auto; margin-top: 8px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: #f4efe6; }
.bubble.out { margin-left: auto; background: var(--accent-2); }
.tl { border-left: 2px solid var(--line); margin: 8px 0 8px 8px; padding-left: 12px; }
.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; margin: 8px 0 0; }
.checks label { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 12px; line-height: 1.3; }
body.market, body.market #app { height: auto; min-height: 100%; overflow: auto; }
.landing { max-width: 1080px; margin: 0 auto; padding: 20px 20px 64px; }
.land-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; }
.land-bar .brand { font-family: Georgia, serif; font-size: 28px; }
.land-bar .btn { text-decoration: none; }
.hero { max-width: 720px; margin-bottom: 28px; }
.hero h1 { font-size: 42px; line-height: 1.05; margin-bottom: 12px; }
.hero p { font-size: 16px; color: var(--muted); margin: 0 0 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.plan h2 { font-size: 26px; margin: 4px 0 8px; }
.plan p { margin: 0 0 8px; color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; }
.plan li { margin: 4px 0; }
.compare, .contacts { margin-bottom: 16px; }
.compare h2, .contacts h2 { margin-bottom: 10px; }
.compare table { width: 100%; border-collapse: collapse; }
.compare th, .compare td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.landing .auth { min-height: 0; display: block; padding: 8px 0 0; background: none; }
.landing .auth .card { width: min(440px, 100%); margin: 0 auto; }
@media (max-width: 900px) {
  body { overflow: auto; }
  .shell { height: auto; }
  .side { position: sticky; top: 0; z-index: 5; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; overflow: hidden; padding: 8px; }
  .side .brand, .side .group, .side .spacer { display: none; }
  .side .company { margin: 0; flex: 1 1 140px; }
  .side button.nav { width: auto; white-space: nowrap; }
  .main { margin-left: 0; height: auto; overflow: visible; }
  .journal, .chat { height: auto; }
  .split, .chat, .form-grid, .checks, .plan-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
a.btn { text-decoration: none; }
