/* Brand: taken from the Rare Clinic website (src/styles/tokens.css): white / cream / beige, warm dark
   text and buttons, Lato everywhere (no title fonts), rounded corners; every status has its own colour.
   Light is the default; dark only when chosen (the moon button sets data-theme="dark"). */
:root {
  --bg: #fefcfb; --panel: #ffffff; --panel-2: #f4efe8; --line: #e6ddd0; --beige: #dbd2c2;
  --text: #2f2a2a; --muted: rgb(0 0 0 / 57%); --heading: #423033;
  --accent: #2f2a2a; --accent-2: #ede6da; --accent-text: #ffffff; --hot: #f44a4a;
  --ok: #2f7a52; --ok-bg: #e4f1e8; --warn: #9a6512; --warn-bg: #f8eedb; --danger: #c43d35; --danger-bg: #fbe6e3;
  --bubble-in: #ffffff; --bubble-out: #ede6da; --shadow: 0 1px 2px rgba(47, 42, 42, .05), 0 3px 12px rgba(47, 42, 42, .05);
  --r: 10px; --radius: 14px; color-scheme: light;
  --blue: #2b5c8f; --blue-bg: #e6eff8; --done: #56504a; --done-bg: #ece8e2;
}
:root[data-theme="dark"] {
  --bg: #1d1a1a; --panel: #262222; --panel-2: #302b2b; --line: #3d3636; --beige: #4a4238;
  --text: #f3eee7; --muted: #b3a99d; --heading: #eaded0;
  --accent: #dbd2c2; --accent-2: #3d3630; --accent-text: #1d1a1a; --hot: #ff6b6b;
  --ok: #7cc79a; --ok-bg: #213529; --warn: #e3b469; --warn-bg: #3a301f; --danger: #f07c71; --danger-bg: #3e2422;
  --bubble-in: #302b2b; --bubble-out: #4a4238; --shadow: 0 1px 2px rgba(0, 0, 0, .35); color-scheme: dark;
  --blue: #8fbbe8; --blue-bg: #22303f; --done: #c2b8ac; --done-bg: #37312d;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 Lato, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 700; margin: 0; color: var(--heading); }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack > * + * { margin-top: 12px; }

.btn { background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); text-transform: none; letter-spacing: .2px; border-radius: var(--r); padding: 9px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: var(--r); color: var(--muted); font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.accent { background: var(--accent-2); color: var(--accent); }
.badge { background: var(--hot); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 6px; min-width: 18px; text-align: center; }

.notice { padding: 10px 12px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); }
.notice.error { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.notice.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* --- Shell --- */
.shell { display: grid; grid-template-columns: 196px 1fr; height: 100vh; height: 100dvh; }
.nav { background: var(--panel-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; padding: 14px 12px; gap: 6px; overflow-y: auto; }
.brand { text-align: center; padding: 2px 0 12px; line-height: 1; }
.brand img { width: 96px; border-radius: var(--r); height: auto; display: block; margin: 0 auto; }
.brand small { display: block; font-family: Lato, sans-serif; font-size: 9.5px; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 14px; border: 0; background: none; border-radius: var(--r); color: var(--text); text-align: left; text-decoration: none; font-size: 16px; font-weight: 700; cursor: pointer; }
.nav .dots { width: 22px; text-align: center; font-size: 10px; letter-spacing: 0; }
.nav a svg { width: 22px; height: 22px; }
.nav a:hover, .nav button:hover { background: var(--accent-2); }
.nav a.on, .nav button.on { background: var(--accent); color: var(--accent-text); }
.nav .badge { margin-left: auto; }
.nav .bottom { margin-top: auto; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.page { flex: 1; overflow: auto; padding: 20px 24px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 16px; background: var(--panel); }
legend { font-weight: 700; padding: 0 6px; }

/* --- Login --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { text-align: center; font-size: 30px; }
.login img { width: 120px; display: block; margin: 0 auto; }

/* --- Inbox --- */
.inbox { display: grid; grid-template-columns: 280px 1fr; height: 100%; min-height: 0; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.inbox-tools { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: var(--r); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: var(--r); cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.rows { overflow-y: auto; flex: 1; }
.crow { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.crow:hover { background: var(--panel-2); }
.crow.on { background: var(--accent-2); }
.crow .body { flex: 1; min-width: 0; }
.crow .line1 { display: flex; gap: 6px; align-items: center; }
.crow .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.crow .time { color: var(--muted); font-size: 12px; }
.crow .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow.unread .name, .crow.unread .preview { color: var(--text); font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-2); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.thread-bar .who { flex: 1; min-width: 140px; }
.thread-bar .who b { display: block; }
.thread-body { display: grid; grid-template-columns: 1fr 270px; flex: 1; min-height: 0; }
.msgs { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); padding: 2px 10px; border-radius: 99px; margin: 8px 0; border: 1px solid var(--line); }
.bubble { max-width: min(640px, 80%); padding: 8px 11px; border-radius: var(--r); white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow); }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 0; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 0; }
.bubble .meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.bubble .meta .tpl { margin-right: auto; }
.bubble.failed { outline: 1px solid var(--danger); }
.bubble .err { color: var(--danger); font-size: 12px; margin-top: 4px; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 160px; }
.side { border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; }
.side h3 { font-size: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 8px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; font-size: 14.5px; }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 13.5px; color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; }
.table tr:hover td { background: var(--panel-2); }
.table td.click { cursor: pointer; }
.table-wrap { overflow: auto; border-radius: var(--radius); }
.bulkbar { position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* --- Boards --- */
.funnel { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.funnel button { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 6px 12px; cursor: pointer; text-align: left; }
.funnel button b { display: block; font-size: 18px; }
.funnel button span { font-size: 11.5px; color: var(--muted); }
.funnel button.on { border-color: var(--accent); background: var(--accent-2); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--panel-2); border-radius: var(--radius); padding: 8px; min-height: 120px; border: 2px dashed transparent; }
.col.over { border-color: var(--accent); }
.colhead { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; font-weight: 700; }
.colhead .n { color: var(--muted); font-weight: 600; }
.colhead a { margin-left: auto; text-decoration: none; font-size: 12px; }
.cards { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 250px); overflow-y: auto; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.kcard:active { cursor: grabbing; }
.kcard .t { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kcard .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kcard .pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.kcard select { margin-top: 8px; padding: 4px 6px; font-size: 12.5px; }

/* --- Calendar --- */
.cal { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 150px); position: relative; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--panel-2); padding: 8px 6px; font-size: 12.5px; font-weight: 600; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-head.today { color: var(--hot); }
.cal-hours { position: relative; }
.cal-hour { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal-day { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-slot { height: 48px; border-bottom: 1px solid var(--line); }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 2px 7px; font-size: 12.5px; line-height: 1.35; overflow: hidden; cursor: pointer; z-index: 1; background: var(--beige); border-left: 3px solid var(--heading); color: var(--text); }
.cal-ev.g { background: var(--panel-2); border-left-color: var(--muted); color: var(--muted); cursor: default; }
.cal-ev.s-Rezervuar, .cal-month-ev.s-Rezervuar { background: var(--blue-bg); border-left-color: var(--blue); }
.cal-ev.s-Konfirmuar, .cal-month-ev.s-Konfirmuar { background: var(--ok-bg); border-left-color: var(--ok); }
.cal-ev.s-Përfunduar, .cal-month-ev.s-Përfunduar { background: var(--done-bg); border-left-color: var(--done); }
.cal-ev.s-Anuluar, .cal-ev.s-Nuk-erdhi { opacity: .55; text-decoration: line-through; }
.cal-ev b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-month-head { background: var(--panel-2); padding: 8px 6px; font-size: 12.5px; font-weight: 600; text-align: center; border-bottom: 1px solid var(--line); }
.cal-month-day { min-height: 108px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-month-day.off { opacity: .45; }
.cal-month-n { align-self: flex-start; border: 0; background: none; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 6px; }
.cal-month-day.today .cal-month-n { color: var(--hot); font-weight: 700; }
.cal-month-ev { border: 0; border-left: 3px solid var(--accent); background: var(--beige); color: inherit; font: inherit; font-size: 11.5px; text-align: left; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-month-ev.s-Anuluar, .cal-month-ev.s-Nuk-erdhi { opacity: .55; text-decoration: line-through; }
.cal-month-more { border: 0; background: none; color: var(--muted); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.agenda { display: none; }

/* --- Automations --- */
.auto-stage { margin-bottom: 14px; }
.auto-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auto-head h3 { margin-right: auto; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.switch input { width: 36px; height: 20px; appearance: none; background: var(--line); border-radius: 99px; position: relative; cursor: pointer; padding: 0; border: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 18px; }
.step { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-top: 10px; background: var(--bg); }
.step-when { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step-when input { width: 80px; }
.step-when select { width: auto; }
.varbtns { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.varbtns button { font-size: 11.5px; padding: 2px 7px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.msg-preview { background: var(--bubble-out); border-radius: var(--r); padding: 8px 10px; white-space: pre-wrap; font-size: 13px; margin-top: 8px; }

/* --- Modal, toast --- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 12, 10, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 1100px; height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px; overflow: auto; flex: 1; min-height: 0; }
.modal.wide .modal-body { padding: 0; display: flex; flex-direction: column; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r); z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); color: #fff; }

.phone-only { display: none; }

/* --- Phones --- */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .nav { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .nav .brand, .nav .desk { display: none; }
  .nav .bottom { margin-top: 0; }
  .page { padding: 14px 16px; }
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread-body { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0; z-index: 40; }
  .phone-only { display: inline-flex; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cal, .cal-month { display: none; }
  .agenda { display: block; }
  .board { grid-auto-columns: 82vw; }
  .modal.wide { height: 100%; max-height: 100%; border-radius: 0; }
  .modal-back { padding: 0; }
  .hide-phone { display: none; }
  .table th.hide-phone, .table td.hide-phone { display: none; }
}
.cal-hours .cal-hour:first-child { transform: none; }

.theme-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; }
.theme-btn:hover { color: var(--text); }
.theme-btn svg { width: 20px; height: 20px; }

/* --- Status colours --- */
.pill.st-Rezervuar { background: var(--blue-bg); color: var(--blue); } .pill.st-Konfirmuar { background: var(--ok-bg); color: var(--ok); }
.pill.st-Erdhi { background: var(--warn-bg); color: var(--warn); } .pill.st-Përfunduar { background: var(--done-bg); color: var(--done); }
.pill.st-Anuluar, .pill.st-Nuk-erdhi { background: var(--danger-bg); color: var(--danger); }
.appt, .mini.ag { --c: var(--line); } .appt.st-Rezervuar, .mini.ag.st-Rezervuar { --c: var(--blue); } .appt.st-Konfirmuar, .mini.ag.st-Konfirmuar { --c: var(--ok); } .appt.st-Erdhi { --c: #d9962a; } .appt.st-Anuluar, .appt.st-Nuk-erdhi, .mini.ag.st-Anuluar, .mini.ag.st-Nuk-erdhi { --c: var(--danger); }
.grow { flex: 1; min-width: 0; } .sheet-row small { display: block; color: var(--muted); font-size: 14px; }
.lbl { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.link { border: 0; background: none; padding: 4px; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.search-big { max-width: 620px; min-height: 52px; font-size: 17px; }
.mini.ag { display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 12px 14px; background: var(--panel); border-left: 5px solid var(--c); cursor: pointer; font-size: 16px; line-height: 1.35; }

/* --- Today: one row per appointment, one button for the next step --- */
.appts { display: grid; gap: 10px; }
.appt { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 18px; padding: 14px 16px 14px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn.only-phone.wide { display: none; } .appt.over { opacity: .78; box-shadow: none; }
.people { display: grid; gap: 8px; margin-top: 10px; } .person { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); } .person:hover { background: var(--panel-2); } .person.blocked { background: var(--danger-bg); } .person .grow > * { display: block; } .person .grow > .muted > span { display: inline; } .person b { font-size: 17px; } .miss { color: var(--warn); } .person-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .person-last { min-width: 190px; text-align: right; } .appt.blocked { background: var(--danger-bg); }
.appt-time { font-size: 21px; font-weight: 700; } .appt-who > a, .appt-who > b { font-size: 18px; font-weight: 700; color: var(--heading); text-decoration: none; } .appt-who > a:hover { text-decoration: underline; }
.appt-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 300px; } .appt-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.appt-act .btn:not(.dotbtn) { min-width: 124px; } .dotbtn { width: 52px; padding: 0; font-size: 22px; }
.btn.pay { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.done { background: var(--done); border-color: var(--done); color: #fff; } :root[data-theme="dark"] .btn.pay, :root[data-theme="dark"] .btn.done { color: #1d1a1a; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; } .btn.choice.on { outline: 3px solid var(--beige); }
.money { margin-top: 18px; } .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; } .tiles > div { background: var(--panel-2); border-radius: var(--r); padding: 10px 14px; } .tiles b { display: block; font-size: 19px; }
@media (min-width: 761px) and (max-width: 1000px) {
  .shell { grid-template-columns: 96px 1fr; } .nav { padding: 10px 6px; } .nav a, .nav button { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 13px; text-align: center; } .nav .badge { margin: 0; } .brand img { width: 64px; }
  .appt { grid-template-columns: 64px minmax(0, 1fr) auto; } .appt-tags { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; max-width: none; }
}
@media (max-width: 760px) {
  .appt { grid-template-columns: 62px minmax(0, 1fr); padding: 14px; gap: 8px 10px; align-items: start; } .appt-time { font-size: 19px; } .appt-tags { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .appt-act { grid-column: 1 / -1; } .appt-act .btn:not(.dotbtn) { flex: 1; min-width: 0; }
  .appt.over { grid-template-columns: 62px minmax(0, 1fr) auto; padding: 10px 14px; } .appt.over .appt-tags { grid-column: 2 / -1; grid-row: 2; } .appt.over .appt-act { grid-column: 3; grid-row: 1; }
  .btn.wide.only-phone.only-phone { display: flex; width: 100%; margin-top: 14px; } .hide-phone.hide-phone { display: none; }
  .quick { grid-template-columns: 1fr 1fr; }
}
.pill.accent { background: var(--accent-2); color: var(--heading); }
.avatar { background: var(--beige); color: var(--heading); font-weight: 700; }
.colhead { font-weight: 700; color: var(--heading); }
.funnel button b { font-weight: 700; color: var(--heading); }

/* Photos in the chat */
.bubble .photo { display: block; margin: -2px -4px 6px; }
.bubble .photo img { display: block; max-width: 100%; width: 280px; max-height: 360px; object-fit: cover; border-radius: var(--r); background: var(--panel-2); }
.photo-draft { position: relative; align-self: flex-start; }
.photo-draft img { max-height: 120px; max-width: 200px; display: block; border: 1px solid var(--line); }
.photo-draft .icon-btn { position: absolute; top: 2px; right: 2px; background: var(--panel); }
.photo-btn { padding: 8px 10px; font-size: 16px; line-height: 1; }
@media (min-width: 1400px) { .inbox { grid-template-columns: 300px 1fr; } .thread-body { grid-template-columns: 1fr 290px; } }

/* --- Phone: big targets, four buttons, one "+" --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn.big { min-height: 52px; padding: 10px 18px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
a.btn { text-decoration: none; color: var(--accent-text); } a.btn.ghost { color: var(--text); }
label.btn.big { color: var(--accent-text); cursor: pointer; } label.btn.ghost.big { color: var(--text); } label.btn.off { opacity: .55; pointer-events: none; }
label.btn:focus-within { outline: 3px solid var(--hot); outline-offset: 2px; }
.files-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .mouse { display: none; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.files-item { padding: 8px; } .files-item img, .files-icon { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--panel-2); } .files-icon { display: grid; place-items: center; font-size: 28px; }
.files-name { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 0 16px; box-shadow: var(--shadow); } .fold summary { min-height: 56px; font-size: 16.5px; display: flex; align-items: center; cursor: pointer; font-weight: 700; } .fold summary::after { content: "▾"; margin-left: auto; color: var(--muted); } .fold summary::-webkit-details-marker { display: none; } .fold summary { list-style: none; } .fold[open] { padding-bottom: 16px; } .fold[open] summary::after { content: "▴"; }
.big-x { min-width: 44px; min-height: 44px; font-size: 20px; }
.install img { border-radius: 10px; } :root:not([data-theme="dark"]) :is(.brand img, .topbar img, .login img) { mix-blend-mode: multiply; }
.install { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 16px 0; padding: 12px; border-radius: var(--r); background: var(--accent-2); color: var(--text); } .install.line { flex-wrap: nowrap; padding: 4px 4px 4px 14px; font-weight: 700; } .install-text { flex: 1; min-width: 180px; } .install ol { margin: 4px 0 0; padding-left: 20px; } .install-actions { display: flex; gap: 8px; }
.tabs, .only-phone { display: none; }
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 12, 10, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; margin-bottom: 10px; } .sheet-head h2 { flex: 1; }
.sheet-list { display: grid; gap: 8px; margin-top: 10px; }
.sheet-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--text); font-size: 17px; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer; } .sheet-row svg { width: 24px; height: 24px; } .sheet-row .emoji { font-size: 24px; }
.sheet .theme-btn { flex-direction: row; gap: 14px; min-height: 56px; padding: 10px 14px; margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font-size: 17px; color: var(--text); } .sheet .theme-btn svg { width: 24px; height: 24px; } .sheet-row:hover, .sheet .theme-btn:hover { background: var(--panel-2); }
@media (hover: hover) and (pointer: fine) { .touch { display: none; } .mouse { display: inline; } .files-buttons label:has(input[capture]) { display: none; } .files-buttons { grid-template-columns: minmax(0, 280px); } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; min-height: 48px; } input[type="checkbox"], input[type="radio"] { min-height: 0; }
  label { font-size: 14px; } .small { font-size: 14px; } .pill { font-size: 13px; padding: 3px 10px; }
  .btn { min-height: 46px; } .btn.small { min-height: 44px; font-size: 15px; padding: 8px 14px; } .icon-btn { min-width: 44px; min-height: 44px; } .seg button { min-height: 44px; font-size: 15px; padding: 8px 12px; }
  .nav { display: none; } .only-phone { display: block; } a.only-phone.btn { display: inline-flex; align-items: center; text-decoration: none; margin-top: 6px; }
  .shell { grid-template-rows: minmax(0, 1fr) auto; }
  .tabs { order: 3; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); background: var(--panel-2); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
  .tabs a, .tabs button { position: relative; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 700; text-decoration: none; cursor: pointer; padding: 0; min-width: 0; }
  .tabs svg { width: 26px; height: 26px; } .tabs .dots { height: 26px; line-height: 26px; letter-spacing: 2px; } .tabs .on { color: var(--heading); box-shadow: inset 0 3px 0 var(--hot); background: var(--accent-2); } .tabs .badge { position: absolute; top: 6px; right: 18%; }
  .tabs .plus i { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font: 400 32px/1 Lato, sans-serif; }
  .page { padding-bottom: 28px; }
  .modal-back { place-items: end center; } .modal { max-width: 100%; max-height: 96dvh; } .modal-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .side.open { overflow: auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 70; }
  .today-page { display: flex; flex-direction: column; } .today-page > * { flex-shrink: 0; } 
  .install { margin: 8px 12px 0; padding: 10px; font-size: 14px; } .install ol { font-size: 14px; }
}
@media (max-width: 360px) { .tabs a, .tabs button { font-size: 10px; letter-spacing: -.2px; } }

@media (min-width: 761px) { .sheet-back { align-items: center; padding: 24px; } .sheet { border-radius: 18px; max-height: calc(100dvh - 48px); padding: 18px 22px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); } }

.autobtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin-bottom: 8px; padding: 6px 10px; border: 1px dashed var(--beige); border-radius: var(--r); background: none; color: var(--muted); font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; } .autobtn.on { border-style: solid; background: var(--ok-bg); color: var(--ok); } .autobtn:hover { background: var(--panel); }
.step-when .switch input { width: 36px; }
.risks { margin: 6px 0 0; padding-left: 20px; } .risks li + li { margin-top: 6px; }
.tplmore summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 0; min-height: 36px; }
.tplfield { display: grid; gap: 6px; } .tplfield + .tplfield { margin-top: 10px; } .varbtns { align-items: center; gap: 6px; } .varbtns button { padding: 6px 10px; font-size: 13.5px; }
.modal .auto-stage { margin-bottom: 0; box-shadow: none; }

/* --- Language switch --- */
.lang { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.lang button { border: 0; background: none; border-radius: 99px; padding: 4px 13px; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--accent); color: var(--accent-text); }
.nav .brand .lang { margin-top: 12px; } .nav .brand .lang button { display: inline; min-height: 0; gap: 0; text-align: center; } .login .lang { align-self: center; } .topbar { display: none; }
@media (max-width: 1000px) { .nav .brand .lang button { padding: 4px 8px; font-size: 12px; } }
@media (max-width: 760px) {
  .shell { grid-template-rows: auto minmax(0, 1fr) auto; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top)) 16px 6px; background: var(--panel-2); border-bottom: 1px solid var(--line); } .topbar img { height: 34px; border-radius: 6px; }
  .topbar .lang button, .login .lang button { min-height: 40px; min-width: 48px; font-size: 14px; }
}
