:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #5e6b78;
  --line: #dce1e7;
  --soft: #eaeef3;
  --primary: #2343c9;
  --primary-ink: #ffffff;
  --danger: #c8372a;
  --danger-soft: #fdecea;
  --warn-soft: #fff4dc;
  --warn: #9a6200;

  --st-confirmed: #6b7a8c;
  --st-design_ready: #7a4dd8;
  --st-ready: #c98a0b;
  --st-done: #2f8f5b;
  --st-cancelled: #a9b2bc;

  --radius-s: 6px;
  --radius-m: 10px;
  --sidebar: 212px;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark; /* brauseri enda väljad, kerimisribad jm tumedad — muidu valge väli + hele tekst */
    --bg: #12161b;
    --panel: #1a2027;
    --ink: #e8edf2;
    --muted: #93a0ad;
    --line: #2b333d;
    --soft: #222a33;
    --primary: #7b93ff;
    --primary-ink: #0d1330;
    --danger: #ff7a6b;
    --danger-soft: #3a1f1c;
    --warn-soft: #3a2f16;
    --warn: #f0c060;
    --st-confirmed: #8c9bad;
    --st-design_ready: #a786f0;
    --st-ready: #e6a92c;
    --st-done: #4fbf83;
    --st-cancelled: #59636e;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Kest ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line); background: var(--panel);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 2px;
}
.logo { font-weight: 700; font-size: 18px; padding: 4px 10px 18px; letter-spacing: -0.01em; }
.logo span { color: var(--muted); font-weight: 500; }
.nav a {
  display: block; padding: 9px 10px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--soft); color: var(--primary); }
.side .me { margin-top: auto; padding: 10px; font-size: 13px; color: var(--muted); }
.side .me b { display: block; color: var(--ink); font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-size: 13px; }

main.page { padding: 24px 28px 64px; min-width: 0; }
.bottomnav { display: none; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main.page { padding: 16px 14px 96px; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a {
    flex: 1; text-align: center; padding: 8px 2px; font-size: 13px; font-weight: 500;
    color: var(--muted); text-decoration: none; border-radius: var(--radius-s);
  }
  .bottomnav a.on { color: var(--primary); background: var(--soft); }
}

/* ---------- Päis ---------- */
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.bar h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; margin-right: auto; }
.bar h1 small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--panel); }
.seg a, .seg button {
  padding: 7px 12px; border: 0; background: none; text-decoration: none; color: var(--ink);
  font-weight: 500; cursor: pointer; border-right: 1px solid var(--line);
}
.seg > :last-child { border-right: 0; }
.seg .on { background: var(--soft); color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.iconbtn { width: 36px; padding: 8px 0; }

/* ---------- Päevatahvel ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col {
  flex: 0 0 264px; background: var(--soft); border-radius: var(--radius-m);
  padding: 10px; min-height: 140px; transition: background 0.12s, box-shadow 0.12s;
}
.col.unassigned { background: transparent; border: 1.5px dashed var(--line); }
.col.over { box-shadow: inset 0 0 0 2px var(--primary); }
.col h3 { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; padding: 2px 4px 10px; }
.col h3 span { color: var(--muted); font-weight: 500; }
.col .empty { color: var(--muted); font-size: 13px; padding: 16px 4px; text-align: center; }

.card {
  display: block; background: var(--panel); border-radius: var(--radius-s); border: 1px solid var(--line);
  border-left: 4px solid var(--st, var(--line)); padding: 10px 12px; margin-bottom: 8px;
  color: var(--ink); text-decoration: none; cursor: grab;
}
.card:hover { border-color: var(--muted); border-left-color: var(--st); }
.card.dragging { opacity: 0.4; }
.card.conflict { box-shadow: 0 0 0 1.5px var(--danger); }
.card .time { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.card .time small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.card .loc { font-weight: 500; margin-top: 4px; }
.card .who { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 500; padding: 2px 7px; border-radius: 4px;
  background: var(--soft); color: var(--ink); white-space: nowrap;
}
.chip.bg { background: transparent; border: 1px solid var(--line); }
.chip.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.card .warn { color: var(--danger); font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st); margin-right: 6px; vertical-align: 1px; }

@media (max-width: 760px) {
  .board { flex-direction: column; overflow: visible; }
  .col { flex: none; width: 100%; min-height: 0; }
  .col .empty { display: none; }
  .col.is-empty { display: none; }
  .card { cursor: pointer; }
}

/* ---------- Nädal ja kuu ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); min-height: 220px; padding: 8px; }
.wday.today { border-color: var(--primary); }
.wday > a { display: flex; justify-content: space-between; text-decoration: none; color: var(--ink); font-weight: 600; padding: 2px 4px 8px; }
.wday > a span { color: var(--muted); font-weight: 500; }
.mini {
  display: block; border-left: 3px solid var(--st); padding: 5px 7px; margin-bottom: 6px; background: var(--soft);
  border-radius: 4px; text-decoration: none; color: var(--ink); font-size: 13px;
}
.mini b { font-weight: 650; }
.mini .sub { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini.conflict { box-shadow: inset 0 0 0 1.5px var(--danger); }
@media (max-width: 960px) {
  .week { grid-template-columns: 1fr; }
  .wday { min-height: 0; }
}

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-m); overflow: hidden; }
.month .dow { padding: 6px 8px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 500; }
.mcell {
  min-height: 104px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); display: block;
}
.mcell:hover { background: var(--soft); }
.mcell.out { color: var(--muted); background: var(--bg); }
.mcell .d { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
.mcell.today .d > span:first-child { background: var(--primary); color: var(--primary-ink); border-radius: 4px; padding: 0 5px; }
.mcell .count { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; }
.mcell .line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .flag { color: var(--danger); font-size: 12px; font-weight: 600; }
@media (max-width: 760px) {
  .mcell { min-height: 64px; padding: 4px; }
  .mcell .line { display: none; }
  .mcell .count { font-size: 18px; }
}

/* ---------- Vormid ---------- */
.layout2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .layout2 { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; font-weight: 650; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; }
.grid .wide { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink); font-size: 15px;
}
/* ka tüübita / url / muud tekstiväljad: sama taust ja värv (laiust ei muuda) */
input:not([type]), input[type=url], input[type=datetime-local], input[type=month], input[type=week] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink); font-size: 15px;
}
input[readonly] { color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-weight: 500; font-size: 14px;
}
.pick button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pick button[disabled] { opacity: 0.4; cursor: not-allowed; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.bglist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bgrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.bgrow.bad { border-color: var(--danger); background: var(--danger-soft); }
.bgrow .n { font-weight: 650; min-width: 44px; }
.bgrow .name { flex: 1; min-width: 0; }
.sides { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.sides button { border: 0; background: none; padding: 2px 9px; cursor: pointer; font-size: 13px; font-weight: 600; }
.sides button.on { background: var(--ink); color: var(--panel); }
.x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }

.search-pop { position: relative; }
.search-pop .results {
  position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 8px 24px rgba(10, 20, 40, 0.12);
}
.search-pop .results button {
  display: flex; width: 100%; gap: 8px; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer;
}
.search-pop .results button:hover, .search-pop .results button.active { background: var(--soft); }
.search-pop .results .busy { margin-left: auto; color: var(--danger); font-size: 12.5px; font-weight: 600; }

.alerts { border-radius: var(--radius-m); background: var(--danger-soft); color: var(--danger); padding: 12px 14px; margin-bottom: 16px; }
.alerts b { display: block; margin-bottom: 4px; }
.alerts ul { margin: 0; padding-left: 18px; }
.alerts a { color: inherit; font-weight: 600; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sticky-actions {
  position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; z-index: 5;
}
@media (max-width: 760px) { .sticky-actions { bottom: 58px; } }

/* ---------- Ülesanded ---------- */
.task { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.task.done .desc { color: var(--muted); text-decoration: line-through; }
.task .top { display: flex; gap: 10px; align-items: flex-start; }
.task input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--st-done); flex: none; }
.task .desc { white-space: pre-wrap; font-weight: 500; flex: 1; }
.task .meta { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.task .meta .late { color: var(--danger); font-weight: 600; }
.files { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.file { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file span { color: var(--muted); font-size: 12px; }
.upload { display: inline-flex; margin-top: 8px; }
.upload input { display: none; }

.links .lrow { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.links .lrow:last-child { border-bottom: 0; }
.links .lrow b { font-weight: 600; }
.links input { font-size: 13px; color: var(--muted); }

/* ---------- Tabelid ---------- */
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 500; background: var(--soft); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.off td { color: var(--muted); }
table.list td.n { font-weight: 650; width: 70px; }
.tablewrap { overflow-x: auto; }

/* ---------- Sisselogimine ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth form { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth h1 { font-size: 22px; }
.auth p { color: var(--muted); margin: 0; }
.err { color: var(--danger); font-size: 14px; min-height: 1em; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: var(--radius-s); font-weight: 500;
  transition: opacity 0.18s, transform 0.18s; pointer-events: none; z-index: 3000; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--danger); color: #fff; }
@media (max-width: 760px) { #toast { bottom: 84px; } }

.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 40px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- v2: kaart, seadmed, taustad, kontaktid ---------- */
.card { outline-offset: 2px; }
.card .time small { font-size: 12px; margin-left: 6px; }
.card .work { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.card .work b { color: var(--ink); font-weight: 600; }
.card .missing { margin-top: 8px; font-size: 12.5px; color: var(--warn); font-weight: 600; }
.card .warn div + div { margin-top: 2px; }
.chip b { font-weight: 700; }
button.chip { border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.45; }
.chip.dev { background: var(--soft); }
.chip.dev:hover { border-color: var(--muted); }
.chip.dev.open { background: var(--warn-soft); color: var(--warn); border: 1px dashed currentColor; }
.chip.dev.bad { background: var(--danger-soft); color: var(--danger); }
.chip-select { width: auto; padding: 2px 6px; font-size: 12.5px; border-radius: 4px; }

.items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.items:empty { display: none; }
.itemrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.itemrow.bad { border-color: var(--danger); background: var(--danger-soft); }
.itemrow .name { font-weight: 600; min-width: 110px; }
.itemrow select { flex: 1; max-width: 260px; }

.thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; flex: none; background: var(--soft); display: inline-block; }
.thumb.empty { border: 1px dashed var(--line); background: none; }
.search-pop .results button { align-items: center; }
.bgrow .n { font-size: 17px; }

.contacts { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contactrow { display: grid; grid-template-columns: 1fr 1fr 1fr 28px; gap: 10px; align-items: end; width: 100%; }
.contactrow .x { padding-bottom: 10px; }
@media (max-width: 760px) { .contactrow { grid-template-columns: 1fr 28px; } .contactrow .x { grid-row: 1; grid-column: 2; } }

.bggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .bggrid { grid-template-columns: 1fr; } }
.bgcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; position: relative; }
.bgcard.off { opacity: 0.55; }
.bgcard.editing { border-color: var(--primary); }
.bgcard .edit { position: absolute; top: 10px; right: 10px; }
.sides2 { display: flex; flex-direction: column; gap: 10px; padding-right: 64px; }
.bgside { display: flex; gap: 12px; align-items: center; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.photo {
  width: 104px; height: 78px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft);
  padding: 0; overflow: hidden; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px;
}
.photo.empty { border-style: dashed; background: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .linkbtn { font-size: 12px; }
.bignum { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.bgname { font-weight: 500; }
.small { font-size: 12.5px; }

.devgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.panel.off { opacity: 0.6; }
.devhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.devhead h2 { margin: 0; font-size: 18px; }
.devlist { display: flex; flex-direction: column; margin-bottom: 10px; border-top: 1px solid var(--line); }
.devrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.devrow.off .name { color: var(--muted); text-decoration: line-through; }
.devrow .name { flex: 1; font-weight: 500; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; width: 100%; }
.inline-form input { flex: 1; min-width: 160px; }
.bggrid { align-items: start; }
@media (max-width: 760px) {
  .bottomnav { gap: 2px; overflow-x: auto; }
  .bottomnav a { font-size: 12px; padding: 8px 6px; flex: 1 0 auto; }
}

/* ---------- v3: asukoht, varukoopiad ---------- */
.locbox { display: flex; flex-direction: column; gap: 8px; }
.mapframe { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--soft); }
.maplinks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; align-items: center; }
.maplinks a { font-weight: 600; }
.pointrow { display: flex; gap: 8px; }
.pointrow input { flex: 1; }
.pointinfo { font-size: 13px; }
.backups { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: center; }
.brow:last-child { border-bottom: 0; }
@media (max-width: 760px) { .brow { grid-template-columns: 1fr auto; } .brow .muted { display: none; } }

/* ---------- v4: sõiduajad ---------- */
.col .office { font-size: 13px; color: var(--muted); margin: -6px 4px 10px; min-height: 1em; }
.col .office b { color: var(--primary); font-size: 15px; }
.card .drive { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.card .drive:empty { display: none; }
.card .drive .late { color: var(--danger); font-weight: 600; margin-top: 2px; }
.drivebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; padding-top: 4px; }

/* ---------- v5: sularaha, nimekiri ---------- */
.card .cashline { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--st-done); }
.packchip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 14px; }
.packchip .x { font-size: 16px; }
[hidden] { display: none !important; }

/* ---------- v6: ilma taustata, nimekiri seadme järgi ---------- */
.chip.nobg { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.packlist { display: flex; flex-wrap: wrap; gap: 6px; }
.packchk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 14px; cursor: pointer; }
.packchk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.packchk.off { color: var(--muted); text-decoration: line-through; background: var(--bg); }
.packchk.extra { border-color: var(--primary); padding-right: 4px; cursor: default; }
.devpack { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.devpack-title { font-weight: 600; margin-bottom: 8px; }
.pick .packchip .x, .packlist .x { border: 0; background: none; padding: 0 6px; border-radius: 4px; }

/* ---------- v7: seadme värv ja kood ---------- */
.card { position: relative; border-left: 1px solid var(--line); padding-left: 16px; overflow: hidden; }
.card:hover { border-left-color: var(--muted); }
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--devbar, var(--line)); }
.card.dim { opacity: 0.28; }
.card .time { display: flex; align-items: baseline; }
.card .time .status-dot { align-self: center; margin-right: 8px; }
.code {
  display: inline-block; min-width: 22px; padding: 0 5px; margin-right: 6px; border-radius: 3px;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; line-height: 17px; text-align: center; vertical-align: 1px;
}
.code.big { font-size: 14px; line-height: 26px; min-width: 40px; padding: 0 8px; border-radius: 5px; margin: 0; }
.chip.dev { padding-left: 3px; }
.chip.dev .code { margin-right: 5px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; }
.legend button[data-type] {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; font-size: 13.5px;
}
.legend button[data-type] .muted { margin-left: 2px; }
.legend button[data-type].on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.mini { border-left: 0; position: relative; padding-left: 10px; overflow: hidden; }
.mini::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--devbar, var(--line)); }
.mcell .dots { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 2px; }
.mcell .dot { width: 9px; height: 9px; border-radius: 50%; }

.devlook { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -2px 0 12px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.codeinput { width: 64px !important; text-transform: uppercase; text-align: center; font-weight: 700; }
.mini { display: block; }
.mini .top { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.mini .top .code { margin: 0; font-size: 10px; line-height: 15px; min-width: 20px; padding: 0 3px; }
.mini .top b { margin-left: 3px; }
.mini .loc { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* päise reegel (.wday > a) ei tohi kehtida kaartidele */
.wday > a.mini { display: block; font-weight: 400; padding: 5px 7px 5px 10px; }
.wday > a.mini span.code { color: #fff; font-weight: 700; }

/* ---------- v8: rahandus ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; }
.stat.main { border-color: var(--primary); }
.stat.main .value { font-size: 28px; color: var(--primary); }
.stat.warn .value { color: var(--warn); }
table.fin th.r, table.fin td.r { text-align: right; }
table.fin tr.click { cursor: pointer; }
table.fin tr.click:hover td { background: var(--soft); }
table.fin tr.sel td { background: var(--soft); font-weight: 600; }
table.fin tr.unpaid td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.warnt { color: var(--warn); font-weight: 600; }

/* ---------- v9: töötajate tasud ---------- */
.pays { display: flex; flex-direction: column; gap: 6px; }
.payrow { display: flex; align-items: center; gap: 10px; }
.payrow > span:first-child { min-width: 110px; font-weight: 500; }
.payrow input { width: 120px; }
.workerpay { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.workerpay h3 { font-size: 16px; margin-bottom: 10px; }
.payinput { width: 120px !important; text-align: right; }
.payinput.missing { border-color: var(--warn); background: var(--warn-soft); }

/* ---------- v10: avaleht ---------- */
.nav a .badge, .bottomnav a .badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px;
  background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.panel.home h2 { display: flex; align-items: center; gap: 8px; }
.panel.home h2 .count { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--soft); border-radius: 9px; padding: 0 8px; line-height: 20px; }
.panel.home.urgent { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }
.panel.home.urgent h2 .count { background: var(--warn); color: #fff; }
.homegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.homegrid .panel { margin-bottom: 16px; }
@media (max-width: 900px) { .homegrid { grid-template-columns: 1fr; gap: 0; } }
.hlist { display: flex; flex-direction: column; }
.hrow {
  display: grid; grid-template-columns: 110px 1fr auto auto; gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: opacity 0.3s;
}
.hrow:last-child { border-bottom: 0; }
.hrow.compact { grid-template-columns: 64px 1fr auto; }
a.hrow:hover .what { color: var(--primary); }
.hrow.done { opacity: 0.25; }
.hrow .what { min-width: 0; font-weight: 500; }
.hrow .what a { font-weight: 600; }
.hrow .acts { display: flex; gap: 8px; align-items: center; }
.hrow .codes .code { margin: 0 0 0 3px; }
.issues { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.issue { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 7px; }
@media (max-width: 760px) {
  .hrow { grid-template-columns: 1fr auto; }
  .hrow .when { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .hrow .acts { grid-column: 1 / -1; }
  .hrow.compact { grid-template-columns: 56px 1fr auto; }
  .hrow.compact .when { grid-column: auto; display: block; }
}
.photobar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; font-size: 14px; color: var(--muted); }
.photobar.todo { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-s); padding: 8px 12px; }
.hrow.compact.dated { grid-template-columns: 100px 1fr auto; }
@media (max-width: 760px) { .hrow.compact.dated { grid-template-columns: 92px 1fr auto; } }

/* ---------- v11: kliendid, kohad ---------- */
.kind { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; vertical-align: 1px; margin-right: 4px; }
.kind.company { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.kind.person { background: color-mix(in srgb, var(--st-done) 16%, transparent); color: var(--st-done); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.evchips { display: flex; flex-wrap: wrap; gap: 4px; }
.clientline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.newclient { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.newclient input { flex: 1; min-width: 200px; }
.seg.small button { padding: 5px 10px; font-size: 13.5px; }
.search-pop .results button { align-items: center; flex-wrap: wrap; }
.venueline { font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.venueline .hint { width: 100%; white-space: pre-line; }
.venuegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.venuecard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; color: var(--ink); text-decoration: none; }
.venuecard:hover { border-color: var(--muted); }
.venuecard img, .venuecard .nophoto { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--soft); }
.venuecard .nophoto { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.venuecard .vbody { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.venuecard .vinfo { margin-top: 4px; color: var(--ink); }
.vgallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.vph { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden; background: var(--soft); }
.vph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vph .x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 4px; }
.vph.add { border: 1.5px dashed var(--line); cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }

/* ---------- v12: telefoni külgmenüü ---------- */
.topbar, .backdrop, .closemenu { display: none; }
.bottomnav { display: none !important; }
@media (max-width: 760px) {
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
  }
  .toptitle { flex: 1; font-weight: 650; font-size: 17px; }
  .menubtn { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-s); width: 42px; height: 38px; display: grid; place-items: center; cursor: pointer; }
  .burger { display: grid; gap: 4px; }
  .burger i { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px; }
  .menubtn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
  .side {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; height: 100%; z-index: 50;
    width: min(82vw, 300px); transform: translateX(-102%); transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); overflow-y: auto;
  }
  .shell.open .side { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 15, 25, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.22s; }
  .shell.open .backdrop { opacity: 1; pointer-events: auto; }
  .logo { display: flex; align-items: center; }
  .closemenu { display: block; margin-left: auto; font-size: 26px; }
  .side .nav a { padding: 12px 12px; font-size: 16px; }
  main.page { padding-bottom: 40px; }
  .sticky-actions { bottom: 0; }
  #toast { bottom: 24px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .side, .backdrop { transition: none; } }

/* ---------- v12: kliendi ankeet ---------- */
.cform .filled { display: inline-block; background: color-mix(in srgb, var(--st-done) 14%, transparent); color: var(--st-done); font-weight: 600; font-size: 13.5px; border-radius: 6px; padding: 3px 9px; }
.panel.home.fresh { border-color: var(--st-done); box-shadow: inset 4px 0 0 var(--st-done); }
.panel.home.fresh h2 .count { background: var(--st-done); color: #fff; }
.setupinput { width: 110px !important; }

/* ---------- v13: taustade liik ja lisatasu, kujundus ---------- */
.fee { display: inline-block; background: #111; color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
.feeline { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--warn); }
.chip.bg.live { background: linear-gradient(135deg, #f3d27a33, #c9a7e833); border-color: #b8862b; }
.chip.bg.live::after { content: ' ✦'; color: #b8862b; }
.bgmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.bgmeta .fee { margin-left: 0; }
.bgmeta a { margin-left: auto; color: var(--primary); text-decoration: none; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--line); color: var(--ink); }
.tag.live { background: #f3d27a; color: #4a3500; }
.tag.client { background: color-mix(in srgb, var(--st-done) 18%, transparent); color: var(--st-done); }
.panel.design textarea { min-height: 56px; }
.dfiles { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.dfile { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 8px; }
.dfile .thumb { flex: none; width: 44px; height: 44px; border-radius: 6px; background: var(--line); display: grid; place-items: center; overflow: hidden; }
.dfile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.dfile .thumb.ext { font-size: 11px; font-weight: 800; color: var(--muted); }
.dfile .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dfile .meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.results .fee, .bgrow .fee { margin-left: auto; }

/* ---------- v15: aksessuaarid, lähimad üritused ---------- */
.proprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; }
.proprow .plabel { width: 120px; font-size: 14px; }
.nextpanel .nextday + .nextday { margin-top: 14px; }
.nextpanel .nextdate { display: inline-block; font-weight: 650; margin-bottom: 6px; color: var(--primary); text-decoration: none; }
.hrow .when.stack { display: flex !important; flex-direction: column; gap: 1px; line-height: 1.2; }
.hrow .when.stack small { font-size: 12.5px; }

/* ---------- v16: paigaldus päev varem, üle südaöö ---------- */
.daybefore { margin: 4px 0; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--warn); border-radius: 6px; padding: 2px 8px; display: inline-block; }
.daybefore.soft { background: var(--warn-soft); color: var(--warn); }
.daybefore.inline { margin: 0 0 0 8px; vertical-align: 1px; }
.daybefore.pickup { background: var(--st-done); color: #fff; }
.sub.strong.pickup { color: var(--st-done); }
.setupday-on.multiday-on { background: var(--soft); border-color: var(--primary); }
.setupday-on.multiday-on b { color: var(--primary); }
.plus1 { font-weight: 700; color: var(--warn); }
.mini.setupday { border-style: dashed; }
.sub.strong { color: var(--warn); font-weight: 650; }
.mcell .line.setupday { color: var(--warn); font-weight: 600; }
input.timefield { font-variant-numeric: tabular-nums; }
input.timefield.bad { border-color: var(--danger); background: var(--danger-soft); }
input.datefield {
  font-variant-numeric: tabular-nums; min-width: 140px; padding-right: 34px; cursor: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235e6b78' stroke-width='1.6'%3E%3Crect x='2' y='3' width='12' height='11' rx='2'/%3E%3Cpath d='M2 7h12M5 1.5v3M11 1.5v3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input.datefield.bad { border-color: var(--danger); background-color: var(--danger-soft); }

/* ---------- v17: operaator ---------- */
.opbtn { border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.opbtn.on { border-style: solid; border-color: #2f8f5b; color: #fff; background: #2f8f5b; }
.opbtn.extra { background: #f08c00; border-color: #f08c00; color: #fff; }
.opflag { margin: 6px 0 2px; display: inline-block; background: #f08c00; color: #fff; font-weight: 800; font-size: 12.5px; letter-spacing: 0.02em; border-radius: 6px; padding: 3px 8px; }
.opflag.mini { margin: 3px 0; font-size: 11px; padding: 1px 6px; }
.opmark { color: #e67700; font-weight: 800; }
.opmark.pill { background: #f08c00; color: #fff; border-radius: 4px; padding: 1px 5px; font-size: 11px; margin-right: 4px; }

/* ---------- v18: klient teeb kujunduse ise ---------- */
.selfdesign { background: #fff3e0; border: 1px solid #f08c00; color: #7a3d00; border-radius: var(--radius-s); padding: 8px 10px; margin-bottom: 10px; font-size: 13.5px; }
.selfdesign b { display: block; color: #c25e00; }
.selftag { display: inline-block; margin: 4px 0; font-size: 12px; font-weight: 700; color: #c25e00; border: 1px solid #f08c00; border-radius: 6px; padding: 1px 7px; }
@media (prefers-color-scheme: dark) { .selfdesign { background: #3a2a12; color: #ffd8a8; } .selfdesign b, .selftag { color: #ffa94d; } }

/* ---------- v19: paigalduse kuupäev ---------- */
.setupday { margin-top: -4px; }
.setupday-on { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius-s); padding: 8px 10px; }
.setupday-on b { color: var(--warn); }
.setupday-on .f.inline { margin: 0; gap: 6px; }
.setupday-on input.datefield { width: 150px; }
.setupday-on .hint { flex-basis: 100%; margin: 0; }
.hint.bad { color: var(--danger); }

/* ---------- v20: arve andmed ---------- */
.invbox { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; font-size: 13.5px; line-height: 1.45; }
.invhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.invnotes { margin-top: 4px; white-space: pre-wrap; }

/* ---------- v21: hinnapakkumised ---------- */
.ostatus { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.ostatus.ok { background: color-mix(in srgb, var(--st-done) 16%, transparent); color: var(--st-done); }
.ostatus.bad { background: var(--danger-soft); color: var(--danger); }
.ostatus.open { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.hrow.fresh { box-shadow: inset 3px 0 0 var(--st-done); }
a.btnlike { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: var(--ink); font-size: 14px; }
a.btnlike.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.offeropts { display: flex; flex-direction: column; gap: 12px; }
.offeropt { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; background: var(--panel); }
.offeropt .ohead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.offeropt .chip { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
form.locked input, form.locked textarea, form.locked .pick button { pointer-events: none; opacity: 0.7; }
.small.bad { color: var(--danger); }

/* ---------- v23: muudatuste ajalugu ---------- */
.chg { font-size: 13.5px; line-height: 1.45; margin: 2px 0; overflow-wrap: anywhere; }
.chg .old { color: var(--muted); text-decoration: line-through; }
.chg .new { color: var(--ink); font-weight: 600; }
.panel.clientchg { border-color: var(--st-done); box-shadow: inset 4px 0 0 var(--st-done); }
.hgroup { border-top: 1px solid var(--line); padding: 8px 0; }
.hgroup:first-child { border-top: 0; }
.hwho { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.whotag { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--soft); color: var(--ink); }
.whotag.client { background: color-mix(in srgb, var(--st-done) 18%, transparent); color: var(--st-done); }
.chgmini { margin-top: 4px; font-size: 12.5px; color: var(--ink); background: color-mix(in srgb, var(--st-done) 8%, transparent); border-radius: 6px; padding: 4px 8px; }
.chgmini b { font-weight: 650; }
details.views { margin-top: 6px; font-size: 13px; }
details.views summary { cursor: pointer; color: var(--muted); }

/* v27: lisad */
.exline { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.exline .x { margin-left: 6px; }
.extras-list { display: grid; gap: 12px; }
.exrow2 { display: flex; gap: 14px; align-items: flex-start; }
.exph { width: 120px; flex: 0 0 120px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.exph img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-m); display: block; }
@media (max-width: 640px) { .exrow2 { flex-direction: column; } }

.livefee{margin:0 0 10px;padding:8px 10px;border-radius:10px;background:rgba(116,64,220,.07)}
.livefee label{display:flex;align-items:center;gap:6px;font-weight:600;flex-wrap:wrap}

/* ---------- v28: kalender ---------- */
.cal { position: fixed; z-index: 1000; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(20,20,40,.18); padding: 10px; width: 266px; user-select: none; }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calhead b { text-transform: capitalize; font-size: 14.5px; }
.calhead button { border: 0; background: var(--soft); width: 30px; height: 30px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink); }
.calhead button:hover { background: var(--line); }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calgrid .wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.calgrid .d { border: 0; background: transparent; height: 32px; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.calgrid .we { color: var(--danger); }
.calgrid .d:hover { background: var(--soft); }
.calgrid .d.today { box-shadow: inset 0 0 0 1.5px var(--primary); font-weight: 700; }
.calgrid .d.sel { background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.calfoot { display: flex; justify-content: space-between; margin-top: 6px; }
.calfoot button { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.calfoot button:hover { background: var(--soft); }

/* ---------- v28: e-kirjad ---------- */
.notifycl { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 6px; white-space: nowrap; }
.notifycl input { width: 17px; height: 17px; margin: 0; }
.maillog { border-top: 1px solid var(--line); padding: 7px 0; }
.maillog summary { cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; list-style: none; }
.maillog summary::-webkit-details-marker { display: none; }
.mstat { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--st-done); }
.mstat.error { background: var(--danger); }
.mstat.off { background: var(--st-cancelled); }
.mailbody { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--soft); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; max-height: 260px; overflow: auto; }

/* ---------- v29: autom. kirjad, fotod ---------- */
.autotoggle { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; margin: 0 0 8px; line-height: 1.35; }
.autotoggle input { width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto; }
.mauto { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.phrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); align-items: center; }
.phrow input { min-width: 0; }
.phrow .phu { grid-column: 1 / -1; grid-row: 1; }

/* ---------- v30: päringud ---------- */
.leadgrid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14.5px; }
.leadgrid b { font-weight: 600; word-break: break-word; }
.leadmsg { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-radius: 8px; white-space: pre-wrap; font-size: 14px; }
.leadbox.compact { border-left: 3px solid var(--primary); }
.panel .btn.small + .btn.small { margin-left: 6px; }

/* ---------- v31: import ---------- */
.imptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.imptable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.imptable td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.imptable tr.past td { opacity: .55; }
.imptable tr.on td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.imptable .tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 6px; margin-top: 3px; background: var(--soft); color: var(--muted); }
.imptable .tag.warn { background: var(--warn-soft); color: var(--warn); }
.imptable .tag.bad { background: var(--danger-soft); color: var(--danger); }
.imptable details pre { max-width: 360px; }

/* ---------- v32: vestlus ---------- */
.chatpanel .cpl { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; margin-bottom: 8px; }
.cpm { max-width: 88%; padding: 7px 10px; border-radius: 12px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.cpm small { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.cpm.client { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 3px; }
.cpm.team { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 3px; }
.cpform { display: flex; gap: 6px; align-items: flex-end; }
.cpform textarea { flex: 1; min-height: 44px; margin: 0; }
.cpimg { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin-bottom: 4px; }
.cpfile { color: inherit; text-decoration: underline; display: block; margin-bottom: 2px; }

/* ---------- v34: rakendus + teavitused ---------- */
.modalwrap { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 12, 20, .5); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* pikk aken keritakse (enne jäi telefonis ülemine/alumine osa ekraanist välja) */
.modal { background: var(--panel); color: var(--ink); border-radius: 14px; padding: 16px 18px; width: min(440px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.35); margin: auto 0; }
html:has(.modalwrap) { overflow: hidden; }
.modalhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 16px; position: sticky; top: -16px; z-index: 2; background: var(--panel); padding: 6px 0; }
.modalhead .x { min-width: 40px; min-height: 40px; font-size: 24px; line-height: 1; }
.modal.wide { width: min(1100px, 100%); }
.vmodal .vtop { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.vmodal .vimg { width: 140px; border-radius: 8px; }
.vmodal .vtop > div { flex: 1 1 320px; min-width: 0; }
.vmodal .vctl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vmodal .vctl select { width: auto; }
@media (max-width: 640px) {
  .modalwrap:has(.modal.wide) { padding: 0; }
  .modal.wide { min-height: 100%; border-radius: 0; padding: 10px 14px calc(20px + env(safe-area-inset-bottom)); box-shadow: none; margin: 0; }
  .modal.wide .modalhead { top: -10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .vmodal .vimg { width: 72px; }
  .vmodal .vtop > div { flex-basis: 100%; }
  .vmodal .vctl { display: grid; grid-template-columns: 1fr 1fr; }
  .vmodal .vctl select { width: 100%; min-height: 42px; font-size: 16px; }
  .vmodal .vctl select:first-child { grid-column: 1 / -1; }
  .vmodal textarea { font-size: 16px; }
  .vmodal .btn.small { min-height: 40px; padding: 8px 12px; }
  .vmodal .btn.primary { flex: 1 1 100%; min-height: 46px; font-size: 16px; }
}
.modal .steps { padding-left: 20px; margin: 6px 0 10px; line-height: 1.55; }
.modal .steps li { margin-bottom: 6px; }
.pushbanner { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: color-mix(in srgb, var(--primary) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); border-radius: var(--radius-m); padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.pushbanner[hidden] { display: none !important; }
.pushbanner .btn { flex: 0 0 auto; }
.sticky-actions { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* Kujunduse variandid */
.dvars { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 4px; }
.dvhead { font-weight: 700; margin-bottom: 6px; }
.dvlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 4px; }
.dvar { border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.dvar.chosen { border-color: #2f8f5b; box-shadow: 0 0 0 2px rgba(47, 143, 91, .25); }
.dvar a { display: flex; justify-content: center; }
.dvar img { width: auto; max-width: 100%; height: 120px; border-radius: 4px; background: linear-gradient(135deg, #b79cf2, #f3a6c8); }
.dvok { color: #2f8f5b; font-weight: 700; }
.dvbtns { display: flex; gap: 6px; flex-wrap: wrap; }

/* Kalender: kliendi e-post */
.who { font-size: 12.5px; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .who { font-size: 11.5px; }

.tag.final { background: #2f8f5b; color: #fff; border-radius: 999px; padding: 0 7px; margin-right: 4px; font-weight: 700; }
.btn.star { color: #b8860b; font-size: 15px; padding: 2px 8px; }
.btn.star.on { background: #fff4d6; border-color: #e0b84a; }

.mailok { color: #2f8f5b; font-weight: 600; }
.mailno { color: #b06a00; font-weight: 600; }

/* Autod */
.vehgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vehcard { display: flex; flex-direction: column; gap: 4px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
.vehcard.off { opacity: .55; }
.vehcard .vh { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.plate { font-family: ui-monospace, monospace; font-weight: 700; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 6px; font-size: 12.5px; }
.valerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.valert { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.valert.warn { background: #fff1d6; color: #8a5a00; }
.valert.bad { background: #fde2df; color: #b42318; }
.small.ok { color: #2f8f5b; font-weight: 600; }
.vlog .vrow { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.vevent { border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.vehrow { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.vehtag { font-size: 12.5px; font-weight: 600; color: #2b5fb4; margin-top: 4px; }
.vehtag.mini { font-size: 11.5px; }

/* Päeva auto veeru päises */
.daycar { display: inline-flex; align-items: center; gap: 4px; margin: -4px 4px 10px; padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.daycar.on { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--card); font-size: 14px; }
.daycar.warn { border-color: #e0a100; }
.carpick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rentbox { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Arved ---------- */
.kind.seg-organizer { background: #fde7c8; color: #8a4b00; }
.kind.seg-public { background: #dbeafe; color: #1e4fa3; }
.ist { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--line); color: var(--ink); }
.ist.draft { background: #eee; color: #666; }
.ist.open { background: #fff1c7; color: #7a5a00; }
.ist.overdue { background: #fde0de; color: #b42318; }
.ist.paid { background: #dcf3e5; color: #1f7a45; }
.ist.credit, .ist.credited { background: #ece7f8; color: #5b3fa8; }
.invrows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.invrow { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); color: inherit; text-decoration: none; }
.invrow:hover { border-color: var(--primary); }
.vbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.vbgitem { display: flex; flex-direction: column; gap: 4px; }
.vbgitem img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); display: block; }
.invrow b { white-space: nowrap; margin-right: auto; }
.invrow .num { white-space: nowrap; }
.invlines { display: flex; flex-direction: column; gap: 6px; }
.invline { display: grid; grid-template-columns: 1fr 70px 110px 100px 28px; gap: 6px; align-items: center; }
.invline.head { font-size: 12px; color: var(--muted); font-weight: 600; }
.invline { align-items: start; }
.invtitle { display: flex; flex-direction: column; gap: 4px; }
.invtitle textarea { min-height: 76px; resize: vertical; font-size: 14px; }
.invline .r, .invline.head .r { text-align: right; }
.invopts { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin: 12px 0 6px; font-size: 14px; }
.invopts label { display: inline-flex; gap: 6px; align-items: center; }
.invtotals { margin-left: auto; max-width: 300px; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.invtotals > div { display: flex; justify-content: space-between; gap: 12px; }
.invtotals .sum { border-top: 2px solid var(--ink); padding-top: 6px; font-size: 17px; }
.invinfo { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.invinfo dt { color: var(--muted); }
.invinfo dd { margin: 0; }
.invframewrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-s); background: #f3f1f8; margin-bottom: 8px; }
.invframe { position: absolute; top: 0; left: 0; width: 880px; height: 1240px; border: 0; transform-origin: 0 0; display: block; }
.inl { display: flex; gap: 8px; align-items: center; }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; min-width: 0; font-size: 13px; }
.linkbtn.danger { color: var(--bad, #b42318); }
@media (max-width: 640px) {
  .invline { grid-template-columns: 1fr 60px 90px 28px; }
  .invline > :nth-child(4) { display: none; }
}
.pendlist { display: flex; flex-direction: column; }
.pendrow { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pendrow:first-child { border-top: 0; }
.pendrow .when { width: 92px; }
.pendrow .what { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.pendrow .dvbtns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

/* ---------- Statistika ---------- */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.bar1 { flex: 1; max-width: 28px; height: 100%; display: flex; align-items: flex-end; }
.bar1 i { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .8; }
.bar1:hover i { opacity: 1; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.statgrid h3, .panel h3 { font-size: 14px; margin: 12px 0 6px; }
details.conn { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 10px; }
details.conn summary { cursor: pointer; }
details.conn[open] summary { margin-bottom: 8px; }
.howto { margin: 6px 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.howto code { font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

/* ---------- AI ---------- */
.aibox { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); background: color-mix(in srgb, var(--primary) 4%, var(--panel)); }
.aimiss { background: #fff4d6; color: #6b4e00; border-radius: 8px; padding: 6px 10px; margin: 8px 0; font-size: 14px; }
.aiopts { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.aiopt { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.aiopt .num { margin-left: auto; }
.aisug { border: 1px dashed var(--primary); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: color-mix(in srgb, var(--primary) 5%, var(--panel)); }
.aisug.handoff { border-color: #d97706; }
.aisughead { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.aisugbody { white-space: pre-wrap; margin-bottom: 6px; }
.aimodes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.aimode { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.aimode input { grid-row: span 2; align-self: center; }
.aimode.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cpm.team small:only-child { }
.sitefiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.sitefile { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; display: flex; flex-direction: column; }
.sitefile img { width: 100%; height: 100px; object-fit: cover; display: block; background: var(--line); }
.sitefile .sfdoc { display: block; padding: 10px; font-size: 13px; word-break: break-all; min-height: 60px; }
.sfmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 6px; font-size: 12px; }
.sfmeta .x { margin-left: auto; }

.savecfg { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.savecfg .hint { flex-basis: 100%; }

.kind.unk { background: var(--line); color: var(--muted); }
.kind.guess { opacity: .75; border: 1px dashed currentColor; }
.kindpanel { padding-top: 12px; padding-bottom: 12px; }
.kindrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kindco { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.kindco .search-pop { flex: 1; }

.devwarn { background: #fde0de; color: #b42318; border-radius: var(--radius-s); padding: 8px 12px; margin: 0 0 12px; font-weight: 600; font-size: 14px; }

/* ---------- v54: mitmepäevane üritus päevade kaupa ---------- */
.xdays { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.xdays .xd-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.xdays .xd-head b { color: var(--primary); }
.xdays .xd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--soft); border-radius: var(--radius-s); padding: 6px 8px; }
.xdays .xd-row input.datefield { width: 150px; flex: 0 0 auto; }
.xdays .xd-row input.timefield { width: 80px; flex: 0 0 auto; }
.xdays .xd-n { font-weight: 650; min-width: 58px; }
.xdays .xd-row .x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 0 4px; }
.xdays .hint { margin: 0; }
.inl-group { display: inline-flex; gap: 4px; align-items: center; }
select.mini-sel { width: auto; padding: 4px 6px; font-size: 12.5px; }

/* ---------- v55: menüü rühmades, telefoni alumine riba, "+ Uus" ---------- */
.layout2 > * { min-width: 0; }
.side { overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.nav a .ico { width: 20px; text-align: center; font-size: 15px; flex: 0 0 20px; }
.nav a .lbl { flex: 1; min-width: 0; }
.nav a .badge, .navhead .badge, .tabbar .badge {
  min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup + .navgroup { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.navhead {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer;
  padding: 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-radius: var(--radius-s);
}
.navhead span:first-child { flex: 1; text-align: left; }
.navhead:hover { background: var(--soft); }
.navhead .chev { transition: transform 0.15s; font-size: 12px; }
.navgroup:not(.open) .navhead .chev { transform: rotate(-90deg); }
.navgroup:not(.open) .navlist { display: none; }
.navgroup.open .navhead .badge { display: none; }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.sidenew { padding: 0 4px 12px; }
.newwrap { position: relative; }
.newwrap .btn.wide { width: 100%; justify-content: center; }
.newpop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-m); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); padding: 6px; display: flex; flex-direction: column;
}
.sidenew .newpop { left: 0; right: auto; width: 100%; }
.newpop a, .newpop button {
  display: block; text-align: left; padding: 10px 12px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-weight: 550; background: none; border: 0; cursor: pointer; font-size: 15px;
}
.newpop a:hover, .newpop button:hover { background: var(--soft); color: var(--primary); }
.tabbar { display: none; }
@media (max-width: 760px) {
  .sidenew { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none;
    background: none; border: 0; border-radius: var(--radius-s); cursor: pointer;
  }
  .tabbar .ico { font-size: 19px; line-height: 1.2; filter: grayscale(0.6); }
  .tabbar .on { color: var(--primary); background: var(--soft); }
  .tabbar .on .ico { filter: none; }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  .tabbar .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main.page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(58px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .menubtn .badge { display: none; }
  .side .nav a { padding: 11px 12px; font-size: 16px; }
  .navhead { padding: 10px 12px; font-size: 12px; }
  /* tellimuse/pakkumise salvestusriba kompaktsemaks */
  .sticky-actions { padding: 8px 0; gap: 6px; }
  .sticky-actions .btn { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 760px) {
  /* kontaktid: väljad üksteise all, × paremal üleval */
  .contactrow { grid-template-columns: 1fr 28px; }
  .contactrow > label { grid-column: 1; }
  /* nimekirjad (päringud, pakkumised, avaleht): olek/nupud teksti alla, nimi saab laiuse */
  .hrow.compact, .hrow.compact.dated { grid-template-columns: 84px minmax(0, 1fr); row-gap: 4px; }
  .hrow.compact > :nth-child(n + 3) { grid-column: 2; justify-self: start; }
  .hrow.compact .when { font-size: 14px; }
}
@media (max-width: 760px) {
  .hrow.compact.dated, .hrow.compact { grid-template-columns: 96px minmax(0, 1fr); }
  .hrow.compact .when { font-size: 13.5px; overflow-wrap: anywhere; }
  .hrow .when small { display: block; }
  /* lülitid (Kõik / Firmad / …) kerivad, kui ei mahu */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg > * { flex: 0 0 auto; white-space: nowrap; }
  /* laiad tabelid kerivad külgsuunas (lehe laius jääb paika) */
  main.page table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.hrow.fresh { padding-left: 10px; }
@media (max-width: 760px) {
  /* lühikesel lehel ei venita ülemist riba (ruum jääb sisule) */
  .shell { grid-template-rows: auto 1fr; align-content: start; }
}
@media (max-width: 760px) {
  .side { box-shadow: none; visibility: hidden; transition: transform 0.22s ease, visibility 0.22s; }
  .shell.open .side { box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); visibility: visible; }
}

/* ---------- v55: tellimuse vahekaardid ---------- */
[data-otab][hidden] { display: none !important; }
.otabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px);
  padding: 6px 0 8px; margin: 0 0 12px; border-bottom: 1px solid var(--line);
}
.otabs::-webkit-scrollbar { display: none; }
.otabs button {
  flex: 0 0 auto; position: relative; border: 1px solid transparent; background: none; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--muted);
}
.otabs button:hover { color: var(--ink); background: var(--soft); }
.otabs button.on { color: var(--primary); background: var(--soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.otabs .odot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-left: 6px; vertical-align: 2px; }
.otabbody.noform, .otabbody.noside { grid-template-columns: minmax(0, 1fr); }
.otabbody.noform .sticky-actions, .otabbody.noform .notifycl { display: none; }
.otabbody.noside .oside { display: none; }
.otabbody.noform .oside { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.otabbody.noform .oside > .panel { margin: 0; }
@media (max-width: 760px) {
  .otabs { top: calc(55px + env(safe-area-inset-top)); margin: -4px -14px 12px; padding: 6px 14px 8px; }
  .otabs button { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 760px) {
  /* salvestusriba ühel real */
  .sticky-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sticky-actions > * { flex: 0 0 auto; }
  .sticky-actions .notifycl { font-size: 13.5px; white-space: nowrap; }
}

/* ---------- v55: avalehe kokkuvõte ---------- */
.hchips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.hchip {
  display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.hchip b { font-size: 16px; }
.hchip:hover { border-color: var(--primary); }
.hchip.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.hchip.warn b { color: var(--warn); }
.morebtn { display: block; margin: 10px auto 2px; font-size: 14px; font-weight: 600; }
section.panel.home[id], .homegrid[id] { scroll-margin-top: 70px; }
@media (max-width: 760px) {
  .hchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 14px; padding: 0 14px; }
  .hchip { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 760px) {
  /* kalender: navigatsioon kompaktsemaks, tühjad töötajate veerud peitu */
  .calbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .calbar h1 { grid-column: 1 / -1; }
  .calbar .seg { justify-self: start; }
  .calbar input[type='date'] { width: 100% !important; min-width: 0; }
  .calbar .calnew { justify-self: stretch; text-align: center; }
  .board .col.is-empty:not(.unassigned) { display: none; }
}
@media (max-width: 760px) {
  .calbar .seg a { padding: 8px 11px; }
  .calbar .seg + .seg { justify-self: end; }
}

/* ---------- v55: seaded ---------- */
.setcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.setcard { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; text-decoration: none; color: var(--ink); }
.setcard:hover { border-color: var(--primary); }
.setcard .ico { grid-row: 1 / 3; font-size: 24px; }
#uhendused { scroll-margin-top: 70px; }

/* ---------- v55: üldotsing ---------- */
.searchbox { position: relative; }
.sidenew .searchbox { margin-top: 8px; }
.searchbox input { width: 100%; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); }
.sres {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 70; width: min(420px, 92vw); max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18); padding: 6px;
}
.sgroup + .sgroup { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.shead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 6px 10px 2px; }
.srow { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.srow:hover, .srow:focus { background: var(--soft); }
.stitle { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.stag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 6px; }
.topsearch, .msearch { display: none; }
@media (max-width: 760px) {
  .sidenew { display: none; }
  .topsearch { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-s); font-size: 16px; cursor: pointer; }
  .shell.searching .msearch {
    display: flex; gap: 10px; align-items: center; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 5;
    background: var(--panel); padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
  }
  .msearch .searchbox { flex: 1; }
  .msearch input { font-size: 16px; padding: 9px 12px; }
  .msearch .sres { width: calc(100vw - 24px); left: 0; }
}

/* v56: AI stiilid (AI fotoboks / peegel) */
.aipb{display:inline-block;font-size:12px;font-weight:700;border-radius:999px;padding:2px 9px;white-space:nowrap}
.aipb.openai{background:#e6f4ef;color:#0b6b4d}.aipb.gemini{background:#e8effd;color:#1d4fb8}
.aibtns{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.aiwarn{margin-top:10px;padding:8px 12px;border-radius:8px;background:#fff4e0;color:#8a4b00;font-size:14px;font-weight:600}
.aist{border:1px solid var(--line);border-radius:10px;padding:12px;margin-top:12px}
.aisth{display:flex;gap:12px;align-items:flex-start}
.aithumb{width:60px;height:90px;object-fit:cover;border-radius:6px;background:var(--line);flex:none}
.aitags{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:4px 0}
.aitags select{width:auto;padding:3px 8px;font-size:13px}
.aisrc{font-size:12px;font-weight:700;border-radius:999px;padding:2px 9px;background:var(--line)}.aisrc.own{background:#f0e8ff;color:#5b2fb8}
.aidesc{font-size:14px;white-space:pre-line;margin-top:4px}
.aifiles{display:flex;gap:6px;margin-top:6px}.aifiles img{width:44px;height:44px;object-fit:contain;border-radius:6px;background:var(--line);border:1px solid var(--line)}
.aitests{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:6px;margin-top:10px}
.aitests a{position:relative;display:block}.aitests img{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:6px;display:block;background:var(--line)}
.aitests span{position:absolute;left:3px;bottom:3px;background:rgba(0,0,0,.6);color:#fff;font-size:10.5px;border-radius:4px;padding:1px 4px}
.aipd{margin-top:10px}.aipd summary{cursor:pointer;font-weight:600;font-size:14px}
.aiprompt{width:100%;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.45;margin-top:6px}
.aiown{margin-top:14px;border-top:1px dashed var(--line);padding-top:10px}.aiown summary{cursor:pointer;font-weight:600;color:var(--accent)}
.aiownf{display:grid;gap:8px;margin-top:8px}
.aiex{margin-bottom:10px}.aiexh{display:flex;gap:14px;align-items:flex-start}
.aiexi{position:relative;width:96px;flex:none}.aiexi img{width:96px;aspect-ratio:2/3;object-fit:cover;border-radius:8px;display:block;background:var(--line)}
.aiexi img.bf{position:absolute;left:4px;bottom:4px;width:34px;border:2px solid #fff;border-radius:4px}
.aiexed{display:grid;gap:8px;margin-top:12px}.aiexrow{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px;align-items:start;font-size:14px}.aiexrow>span{padding-top:8px;font-weight:600}
.aiexed .grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media (max-width:640px){.aiexrow{grid-template-columns:1fr;gap:4px}.aiexrow>span{padding-top:0}}
@media (prefers-color-scheme:dark){.aipb.openai{background:#173b30;color:#7fe0b9}.aipb.gemini{background:#1c2a4d;color:#9dbbff}.aiwarn{background:#3a2a10;color:#ffcf8a}.aisrc.own{background:#2e2350;color:#c9b3ff}}

/* v58: Minu tööd */
.myjobs{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
.myjob{display:block;color:inherit;text-decoration:none;margin:0;padding:12px 14px}.myjob:hover{border-color:var(--accent,#7440dc)}
.myjob.today{border:2px solid #7440dc}.myjob.past{opacity:.6}
.myjh{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}

/* v60: paigalduse fotod / portfoolio */
.setupgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}.setupgrid.big{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.setupph img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;display:block;background:var(--line)}.setupph.hid img{opacity:.45}
.setupbar{display:flex;gap:4px;align-items:center;margin:4px 0 2px}.setupbar button{border:1px solid var(--line);background:var(--panel,#fff);border-radius:6px;padding:2px 7px;cursor:pointer;font-size:14px}
.setupbar .star.on{border-color:#f9b122;background:#fff7e0}.setupbar a{margin-right:8px}

/* v63: taustade pesu */
.washp{margin-bottom:14px}.washdue{display:grid;gap:6px}
.washrow{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff8e6}
.washrow .num{font-size:18px;min-width:34px;text-align:center}
.washchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.washchip{font-size:12.5px;border:1px solid var(--line);border-radius:999px;padding:2px 9px}.washchip.soon{border-color:#f9b122;background:#fff7e0}
@media (prefers-color-scheme:dark){.washrow{background:#3a2a10}.washchip.soon{background:#3a2a10}}

/* v64: numbrid ja ajad */
.pgroup h3{font-size:14px;margin:16px 0 6px;color:var(--muted)}
.prow{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:7px 0;border-bottom:1px solid var(--line)}
.prow .plabel{flex:1;font-size:14px}.prow .pval{display:flex;align-items:center;gap:6px;white-space:nowrap}
.prow input{width:80px}.prow .pval>.small{min-width:78px}.prow.changed .plabel{font-weight:600}
@media (max-width:640px){.prow{flex-direction:column;align-items:flex-start}}
/* Ürituse statistika (v68) */
.evstats h2{display:flex;align-items:center;gap:8px}
.evstats h3{font-size:15px;margin:12px 0 6px}
.evtiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.evtile{border:1px solid var(--line,#e4dff2);border-radius:12px;padding:10px 12px}
.evtile b{display:block;font-size:24px;line-height:1.1;color:#7040CC}
.evtile span{font-size:13px;color:var(--muted,#6b6580)}
.evsub{border-top:1px solid var(--line,#e4dff2);padding-top:6px;margin-top:8px}
.evkv td{padding:3px 8px 3px 0}
.evlist{margin:4px 0;padding-left:18px}
.evkv{width:auto;min-width:280px}.evkv td{padding:4px 18px 4px 0}
/* AI piltide suurendamine */
.aistyles img,.aiexi img,.aitests img,.aifiles img,img.aithumb{cursor:zoom-in}
.crmlb{position:fixed;inset:0;z-index:1000;background:rgba(10,8,20,.92);display:flex;align-items:center;justify-content:center;padding:44px 12px}
.crmlb[hidden]{display:none}
.crmlb img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px;touch-action:pinch-zoom}
.crmlb button{position:absolute;background:rgba(255,255,255,.14);color:#fff;border:0;border-radius:999px;width:44px;height:44px;font-size:24px;line-height:1;cursor:pointer}
.crmlb button:hover{background:rgba(255,255,255,.28)}
.crmlb .lbc{top:10px;right:10px;font-size:20px}.crmlb .lbp{left:10px;top:50%;transform:translateY(-50%)}.crmlb .lbx{right:10px;top:50%;transform:translateY(-50%)}
.crmlb .lbn{position:absolute;bottom:12px;left:0;right:0;text-align:center;color:#fff;opacity:.7;font-size:14px}
.mclick{display:inline-block;margin-left:6px;font-size:12px;font-weight:600;color:#1f7a45;background:#e3f5ea;border-radius:999px;padding:1px 8px}
/* Pärast üritust: fotod + arve (v71) */
.afline{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:6px}
.afacts{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap}
.afst{font-size:13.5px;border-radius:999px;padding:2px 10px;background:#f1f3f6}
.afst.pending{background:#fff1d6;color:#8a5300}.afst.sent{background:#e3f5ea;color:#1f7a45}.afst.skip{background:#eef0f3;color:#6b7280}.afst.untracked{display:none}
/* Klientide tööd */
.cwgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.cwcard{background:var(--card,#fff);border:1px solid var(--line);border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:4px}
.cwimgs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-bottom:4px}.cwimgs.one{grid-template-columns:1fr}
.cwimgs img{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:8px;background:#eee}.cwimgs.one img{aspect-ratio:auto;max-height:320px;object-fit:contain}
.cwdesc{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* ChatGPT kvaliteedi võrdlus */
.qcgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.qccol{display:flex;flex-direction:column;gap:4px;min-width:0}
.qcbox{aspect-ratio:2/3;background:var(--bg2,#f3f0fa);border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;text-align:center;padding:4px}
.qcbox img{width:100%;height:100%;object-fit:contain}
@media (max-width:700px){.qcgrid{grid-template-columns:1fr}}
.qsel{width:auto;padding:5px 8px;font-size:13px}
.ailogos{margin:12px 0;padding:10px;border:1px dashed var(--line);border-radius:10px}.ailogo{display:inline-flex;align-items:center;gap:2px}.ailogo img{height:48px;max-width:110px;object-fit:contain;border-radius:6px;background:repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 0 0/10px 10px;padding:3px}

.cpm .cpread { display: block; opacity: .7; margin-top: 2px; }

/* Rahandus: summa ja makse muudetavad otse tabelis */
.fin .finprice { width: 6.5em; text-align: right; padding: 4px 6px; }
.fin .finprice.bad { border-color: var(--warn, #e0a030); }
.fin .finsel { padding: 4px 6px; max-width: 9em; }

/* 🧩 AI küsimustik (v93) */
.qzed { display: grid; gap: 8px; margin-top: 6px; }
.qz3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.qz3 input, .qza textarea { width: 100%; box-sizing: border-box; }
.qzq { border: 1px solid var(--line, #333); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.qzqh, .qzah { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.qzah { justify-content: flex-start; }
.qzah .linkbtn { margin-left: auto; }
.qza { border-left: 3px solid var(--accent, #7c8cff); padding-left: 8px; display: grid; gap: 4px; }
.qzst { margin: 8px 0; }
.qzbar { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.qzbar i { display: block; height: 8px; border-radius: 4px; background: var(--accent, #7c8cff); min-width: 2px; }
@media (max-width: 600px) { .qz3 { grid-template-columns: 1fr; } }

/* naks.ee lugu (siteCasePanel) */
.sitecase h2 { display: flex; align-items: center; }
.sitecase h3 { font-size: 15px; margin: 16px 0 6px; }
.cphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.cphoto { position: relative; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: var(--radius-s); padding: 4px; cursor: pointer; font-size: 11px; background: var(--panel); }
.cphoto.on { border-color: var(--primary); }
.cphoto img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; background: var(--line); }
.cphoto input[type=checkbox] { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; }
.cphoto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cphoto .x { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; }
.cphoto.add { align-items: center; justify-content: center; min-height: 120px; border-style: dashed; }
.cphoto.add b { font-size: 28px; }
.cphoto .cvid { position: absolute; bottom: 26px; right: 8px; font-style: normal; font-size: 18px; text-shadow: 0 0 4px #000; }
.cedit .field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.cedit .field > span { font-size: 13px; color: var(--muted); }
.cedit textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.calt { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; margin: 8px 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.calt img { width: 120px; height: 160px; object-fit: cover; border-radius: 6px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.calt-r { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.calt-top { min-width: 0; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cfxs { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2px 10px; }
.cfx { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); min-width: 0; }
.cfx input { width: 100%; }
.sitecase .cpill { margin-left: 8px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.sitecase .cpill.ok { background: #e3f4ea; color: var(--st-done); }
.cphoto.dup { border-color: #f08c00; }
.cphoto.dup::after { content: '⚠️ sarnane'; position: absolute; bottom: 26px; left: 8px; background: #f08c00; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }

/* Ürituse lõpetamine (v97) */
.cdot{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#eef0f3;filter:grayscale(1);opacity:.55;font-size:15px}
.cdot.ok{background:#e3f5ea;filter:none;opacity:1;box-shadow:inset 0 0 0 2px #2f9e5f}
.photobar .cdot{width:24px;height:24px;font-size:13px}
.closewiz .cwtitle{margin:2px 0 12px}
.closewiz .cstep{border:1px solid var(--line);border-radius:12px;margin:0 0 10px;background:var(--panel)}
.closewiz .cstep>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;list-style:none;font-weight:600}
.closewiz .cstep>summary::-webkit-details-marker{display:none}
.closewiz .cbody{padding:0 14px 12px}
.closewiz .cbody .panel{border:0;box-shadow:none;padding:0;margin:0;background:transparent}
.closewiz .cwfoot{position:sticky;bottom:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end;padding:12px 0 2px;background:var(--panel)}
.closewiz .cwfoot>div:first-child{margin-right:auto}
.closewiz .cwdone{margin-right:auto;font-weight:600;color:var(--st-done)}
.closewiz .cbody .panel>h2{display:none}

.payinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel2, rgba(127,127,127,.08)); }
.payinfo select { width: auto; padding: 4px 8px; }
.payinfo.wp.cash { background: rgba(46,160,67,.12); }
.payinfo.wp.none { background: rgba(220,140,30,.15); }
.payinfo .warn { color: #d33; font-weight: 700; }

.prow .pline{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.pchip{display:inline-flex;gap:4px;align-items:center;font-size:12.5px;padding:3px 9px;border-radius:999px;border:1px solid var(--line)}
.pchip.ok{background:rgba(46,160,67,.13);border-color:rgba(46,160,67,.35)}
.pchip.wait{background:rgba(80,120,220,.13);border-color:rgba(80,120,220,.35)}
.pchip.todo{background:rgba(220,140,30,.18);border-color:rgba(220,140,30,.5);font-weight:700}
.pchip.missing{background:rgba(220,60,50,.13);border-color:rgba(220,60,50,.4)}
.prow .warn{color:#d08000}.prow .bad{color:#d33;font-weight:700}

/* ---------- 📣 Reklaam (viewAds) ---------- */
.adkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.adkpi { padding: 12px 14px; border-radius: 12px; background: var(--panel2, rgba(112, 64, 204, .07)); }
.adkpi b { display: block; font-size: 1.35rem; }
.adkpi span { font-size: .8rem; opacity: .7; }
.adtable { overflow-x: auto; }
.adtable td, .adtable th { white-space: nowrap; vertical-align: top; }
.adtable td:nth-child(2) { white-space: normal; min-width: 220px; max-width: 360px; }
.adtable tr.adcamp td { background: rgba(112, 64, 204, .06); }
.adtable .good { color: var(--ok, #2f8f5b); font-weight: 700; }
.adtable .bad { color: #d04545; font-weight: 700; }
.adbody { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adsug { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line, #e5e5ef); flex-wrap: wrap; }
.admedia { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.admed { position: relative; display: block; border-radius: 12px; overflow: hidden; cursor: pointer; background: #111; }
.admed video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.admed input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; z-index: 1; }
.admed span { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: .72rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.admed:has(input:checked) { outline: 3px solid var(--accent, #7040CC); }
.addraft { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line, #e5e5ef); }
.addraft img { width: 88px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.addraft__body { display: grid; gap: 6px; }
.addraft__body textarea, .addraft__body input { width: 100%; }
.addraft__act { display: grid; gap: 6px; align-content: start; }
.addraft.done { opacity: .75; }
@media (max-width: 640px) { .addraft { grid-template-columns: 64px 1fr; } .addraft img { width: 64px; } .addraft__act { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; } }
.adrev { white-space: pre-wrap; font: inherit; line-height: 1.5; margin: 8px 0; }
.blogspark { display: flex; align-items: flex-end; gap: 2px; height: 48px; margin: 4px 0 12px; }
.blogspark i { flex: 1; background: var(--accent, #7040CC); opacity: .55; border-radius: 2px 2px 0 0; min-width: 2px; }
.blogspark i:hover { opacity: 1; }

/* Meta reklaam: AI karusselli eelvaade */
.admed .adcar { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 8px; }
.admed .adcar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Püsikliendid: tabel ilma horisontaalse kerimiseta, pikad tekstid murduvad */
.reptbl table.list td, .reptbl table.list th { white-space: normal; overflow-wrap: anywhere; max-width: 320px; vertical-align: top; }
@media (max-width: 700px) { .reptbl { overflow-x: auto; } }

/* Töötajate video (paigalduse fotode seas) + märkmed */
.setupvid { position: relative; display: block; }
.setupvid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #000; }
.setupvid span { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 0 6px; font-size: 13px; }
.crewnote { border-left: 3px solid var(--accent, #7040CC); padding: 4px 10px; margin: 6px 0; }
.remnext { border: 2px solid #e67e22; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
