:root {
  --bg: #f4f4f5; --card: #fff; --text: #09090b; --muted: #71717a; --border: #e4e4e7;
  --accent: #0f766e; --soft: #fafafa; --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
body.client { --bg: #faf7f2; --soft: #f7f3ed; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button, input, select, textarea { transition: background-color 150ms, border-color 150ms; }
a { color: inherit; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
#app:focus { outline: none; }
header { background: var(--card); border-bottom: 1px solid var(--border); }
.demo-controls { background: #18181b; color: #fff; }
.controls-inner, .topbar { max-width: 1200px; margin: auto; padding: 14px 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.control-label, .preview-label { color: #e4e4e7; font-size: 12px; }
.control-label { display: block; margin-bottom: 5px; }
.role-switch { display: flex; gap: 4px; background: #27272a; border: 1px solid #52525b; border-radius: 8px; padding: 4px; }
.role-switch button { background: none; color: #e4e4e7; border: 0; border-radius: 4px; padding: 7px 12px; min-height: 34px; }
.role-switch button[aria-pressed="true"] { background: #fff; color: #18181b; }
.preview-label { display: grid; gap: 5px; min-width: 220px; margin: 0; }
.preview-label select { background: #27272a; color: #fff; border-color: #52525b; }
.controls-inner > p { font-size: 12px; color: #d4d4d8; margin-left: auto; max-width: 210px; }
.demo-controls :focus-visible { outline-color: #fff; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand strong { font-weight: 600; overflow-wrap: anywhere; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-badge { background: var(--accent); color: #fff; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.workspace-role { margin-left: auto; padding: 4px 10px; background: var(--soft); border: 1px solid var(--border); border-radius: 99px; font-size: 12px; }
nav { width: 100%; display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 8px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); background: var(--bg); }
.menu-toggle { display: none !important; }
.wrap { max-width: 1200px; margin: auto; padding: 28px 24px 40px; }
.page-guide, .alert { padding: 12px 16px; border: 1px solid #d3e2d5; border-radius: 8px; background: #edf4ee; color: #405647; margin-bottom: 20px; }
.alert { background: #fff; border-color: var(--border); color: var(--text); }
.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
h1 { font-size: 30px; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 28px 0 14px; font-weight: 600; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
p { margin: 8px 0; }
.muted, small { color: var(--muted); }
small { font-size: 12px; }
.eyebrow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 24px 0; }
.heading > div { min-width: 0; }
.heading p { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.single { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: 0 1px 3px #0000000b; overflow-wrap: anywhere; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.schedule-first-form { margin-bottom: 28px; }
.stack { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.stat { text-decoration: none; display: block; }
.stat:hover { border-color: #a1a1aa; }
.stat span { color: var(--muted); display: block; }
.stat b { font-size: 30px; font-weight: 600; display: block; letter-spacing: -.03em; margin: 6px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 1px solid var(--border); border-radius: 6px; padding: 7px 14px; min-height: 36px; background: var(--card); color: var(--text); font-weight: 500; max-width: 100%; text-align: center; }
.btn:hover { background: var(--soft); }
.btn.primary { background: #09090b; color: #fff; border-color: #09090b; }
.btn.primary:hover { background: #27272a; }
.client .btn.primary { background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.text-btn { border: 0; background: none; color: inherit; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.actions:first-child { margin-top: 0; }
.badge { display: inline-flex; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 500; background: #f4f4f5; color: #52525b; white-space: nowrap; }
.badge.good { background: #f0fdf4; color: #166534; }
.badge.warn { background: #fefce8; color: #854d0e; }
.badge.urgent { background: #fef2f2; color: #991b1b; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.row > div { min-width: 0; }
.list-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row strong { display: block; font-weight: 500; }
.list-row p { margin: 4px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
.customer-table { table-layout: fixed; min-width: 760px; }
.customer-table th:nth-child(1) { width: 44%; }
.customer-table th:nth-child(2) { width: 28%; }
.customer-table th:nth-child(3) { width: 28%; }
.customer-table td { vertical-align: middle; overflow-wrap: normal; }
.customer-name { display: block; font-size: 15px; font-weight: 600; }
.customer-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.customer-equipment small { display: block; margin-top: 4px; }
.customer-equipment + .customer-equipment { margin-top: 12px; }
.customer-unit-link { font-weight: 500; text-decoration: none; }
.customer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.customer-actions .btn { min-height: 32px; padding: 5px 8px; font-size: 12px; }
th { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
tr:last-child td { border-bottom: 0; }
td strong { font-weight: 500; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary { background: var(--soft); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 16px; }
.summary .row { margin: 8px 0; }
.summary .total { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; font-weight: 600; }
.total .money, .option-price { font-size: 24px; letter-spacing: -.025em; font-weight: 600; }
.option { display: flex; flex-direction: column; }
.option .actions { margin-top: auto; padding-top: 20px; }
.option.chosen { border-color: var(--accent); }
.option dl { flex: 1; }
dl { margin: 16px 0; }
dt { color: var(--muted); font-size: 12px; margin-top: 12px; }
dd { margin: 3px 0 0; }
label { display: block; font-weight: 500; margin: 16px 0 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); min-height: 36px; padding: 8px 10px; }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid > div { min-width: 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 20px 0; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.toolbar input { width: auto; max-width: 100%; }
.schedule-call { padding: 16px; margin-top: 12px; background: var(--soft); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; }
.schedule-call.emergency { border-left-color: #b91c1c; }
.schedule-time { font-size: 12px; color: var(--muted); }
.unit-visual { display: flex; align-items: center; gap: 24px; background: var(--soft); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.unit-visual img { width: 100px; height: 100px; object-fit: contain; }
.unit-visual p { font-size: 12px; }
.message { max-width: 88%; padding: 12px 16px; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.outgoing { margin-left: auto; background: #edf4ee; border-color: #d3e2d5; }
.message p { margin: 4px 0; }
.conversation { max-height: 420px; overflow-y: auto; padding: 2px; }
.empty { padding: 24px 0; color: var(--muted); }
.intro { background: #f8faf9; }
.intro .actions { margin-top: 16px; }
.client .intro { background: #fff; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
footer { color: var(--muted); font-size: 12px; margin-top: 40px; border-top: 1px solid var(--border); padding-top: 20px; max-width: 850px; }
@media (max-width: 850px) {
  .grid.three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls-inner > p { display: none; }
}
@media (max-width: 600px) {
  :root { font-size: 14px; }
  .controls-inner, .topbar { padding: 12px 16px; gap: 12px; }
  .controls-inner > div, .preview-label { width: 100%; }
  .role-switch button { flex: 1; min-height: 44px; }
  .wrap { padding: 20px 16px 32px; }
  .workspace-role { display: none; }
  .menu-toggle { display: inline-flex !important; margin-left: auto; }
  nav:not(.open) { display: none; }
  nav a { min-height: 44px; display: flex; align-items: center; }
  h1 { font-size: 26px; }
  .card { padding: 20px; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stats .card { padding: 16px; }
  .stat b { font-size: 26px; }
  .heading { flex-direction: column; }
  .btn, input, select { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .unit-visual { gap: 12px; }
  .unit-visual img { width: 72px; height: 72px; }
  th, td { padding: 12px 8px; }
  .message { max-width: 96%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
