/* Vybilda darbų sistema. Brand: vybilda.lt (pine #2D4A1E, gold #C8A96E, ink #181A1B, paper #FAFAF5, DM Sans + Playfair Display).
   Signature: the roof ridge line (gold chevron) marks where you are and frames documents; everything else stays quiet. */
:root {
  --ink: #181A1B;
  --ink-2: #3A3E3C;
  --muted: #6A6F69;
  --pine: #2D4A1E;
  --pine-2: #3C6128;
  --pine-tint: #EAF0E4;
  --gold: #C8A96E;
  --gold-deep: #8A6400;
  --gold-tint: #F6EFDF;
  --paper: #FAFAF5;
  --card: #FFFFFF;
  --line: #E4E3DA;
  --line-2: #D3D2C6;
  --red: #A33A2B;
  --red-tint: #F8E7E3;
  --blue: #2F5D7C;
  --blue-tint: #E5EEF4;
  --amber: #A86A00;
  --amber-tint: #FBF0DA;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(24, 26, 27, .05), 0 6px 18px -10px rgba(24, 26, 27, .18);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 600 28px/1.15 var(--serif); letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .6em; }
small { font-size: 12.5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.i { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 8px 4px; }
.pre { white-space: normal; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(250, 250, 245, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand-sm img { height: 35px; width: auto; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); min-width: 0; }
.search input { border: 0; background: none; padding: 9px 0; width: 100%; min-width: 0; font: inherit; color: var(--ink); outline: none; }
.top .search { display: none; }
.search.big { margin-bottom: 18px; padding: 4px 16px; }
.add-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--pine); color: #fff; border-radius: 999px; padding: 8px 14px 8px 11px; font-weight: 600; cursor: pointer; }
.add-btn:hover { background: var(--pine-2); }
.main { padding: 18px 16px calc(96px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
body.wide .main { max-width: 1320px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 2px; border: 0; background: none;
  color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; position: relative; text-decoration: none;
}
.tabbar .on { color: var(--pine); }
.tabbar .on::before { content: ''; position: absolute; top: -7px; left: 50%; width: 28px; height: 8px; transform: translateX(-50%);
  background: no-repeat center/100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 8'%3E%3Cpath d='M1 7 14 1l13 6' fill='none' stroke='%23C8A96E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

@media (min-width: 960px) {
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 22px 14px 14px;
    background: var(--card); border-right: 1px solid var(--line); z-index: 20;
  }
  .brand { padding: 0 10px 18px; }
  .brand img { width: 112px; height: auto; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; position: relative; text-decoration: none; }
  .side-nav a:hover { background: var(--paper); }
  .side-nav a.on { background: var(--pine-tint); color: var(--pine); }
  .side-nav a.on::after { content: ''; position: absolute; left: -14px; top: 50%; width: 4px; height: 22px; transform: translateY(-50%); background: var(--gold); border-radius: 0 3px 3px 0; }
  .side-nav .count { margin-left: auto; background: var(--gold); color: var(--ink); font-size: 11.5px; min-width: 20px; text-align: center; border-radius: 999px; padding: 1px 6px; }
  .side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 10px; border-top: 1px solid var(--line); }
  .me-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
  .me-name small { display: block; color: var(--muted); font-weight: 500; }
  .side .credit { padding: 0 6px; margin: 0; }
  .top { margin-left: var(--side); padding: 12px 28px; }
  .top .brand-sm { display: none; }
  .top .search { display: flex; max-width: 460px; }
  .main { margin-left: var(--side); padding: 26px 28px 48px; }
  body.wide .main { margin-left: var(--side); }
  .main, body.wide .main { max-width: none; }
  .main > * { max-width: 1180px; }
  body.wide .main > * { max-width: 1320px; }
  .tabbar { display: none; }
}
.credit { font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.credit a { color: var(--ink-2); font-weight: 700; }

/* ---------- common bits ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 16px; border-radius: var(--r);
  border: 1px solid var(--pine); background: var(--pine); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--pine-2); text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--pine); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--pine); background: var(--card); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: none; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--paper); color: var(--pine); }
.icon-btn.call { background: var(--pine-tint); color: var(--pine); }
.link { background: none; border: 0; padding: 0; color: var(--pine); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.link.danger { color: var(--red); }
.link.warn { color: var(--amber); }
.ava {
  --s: 30px; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  background: var(--c, var(--pine)); color: #fff; font-size: calc(var(--s) * .4); font-weight: 700; letter-spacing: .02em; border: 2px solid var(--card);
}
.ava.sys { background: var(--gold-tint); color: var(--gold-deep); }
.people { display: inline-flex; }
.people .ava + .ava { margin-left: -7px; }
.flash { padding: 11px 14px; border-radius: var(--r); background: var(--pine-tint); color: var(--pine); font-weight: 600; margin-bottom: 16px; }
.flash-err { background: var(--red-tint); color: var(--red); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.b-lead-new, .b-est-draft, .b-ev-meeting { background: var(--gold-tint); color: var(--gold-deep); border-color: #EBDDBC; }
.b-lead-contacted, .b-ev-other { background: var(--blue-tint); color: var(--blue); border-color: #CFDEE8; }
.b-lead-measure, .b-ev-measure, .b-obj-planned { background: var(--amber-tint); color: var(--amber); border-color: #F0DDB4; }
.b-lead-offer, .b-est-sent { background: #EEF0EC; color: var(--ink-2); border-color: var(--line-2); }
.b-lead-won, .b-est-accepted, .b-obj-active, .b-ev-job { background: var(--pine-tint); color: var(--pine); border-color: #D2DFC7; }
.b-obj-done { background: var(--pine); color: #fff; border-color: var(--pine); }
.b-lead-lost, .b-est-rejected, .b-obj-paused { background: #F1F0EC; color: var(--muted); }
.wx { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--muted); font-weight: 600; vertical-align: middle; }
.wx-bad { color: var(--blue); }
.empty { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 22px 18px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 10px; }
.empty p:last-child { margin: 0; }

.titlebar { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.titlebar .tt { flex: 1; min-width: 200px; }
.titlebar .sub { color: var(--muted); margin: 4px 0 0; }
.titlebar .acts { display: flex; gap: 8px; align-items: center; }
.back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--ink); flex: none; margin-top: -2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: 10px; }
.narrow { max-width: 680px; }
.narrow-l { max-width: 760px; }
.block-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.block-h h2 { margin: 0; }
.minor { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.minor small { color: var(--muted); font-weight: 600; }

.seg { display: flex; gap: 4px; background: #EFEEE6; border-radius: 11px; padding: 4px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button, .seg label span {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px;
  border: 0; background: none; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.seg label { display: contents; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .on, .seg input:checked + span { background: var(--card); color: var(--pine); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg input:focus-visible + span { outline: 2.5px solid var(--gold); }
.seg small { color: var(--muted); font-weight: 600; }
.seg.small { margin-bottom: 10px; }
.seg.small a, .seg.small button, .seg.small label span { padding: 6px 10px; font-size: 13px; }

/* rows (lists) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows li > a:not(.icon-btn):not(.btn), .rows .grow-link { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 2px; color: inherit; text-decoration: none; min-width: 0; }
.rows li > a:hover b { color: var(--pine); }
.rows li > a:not(.icon-btn):not(.btn):hover { text-decoration: none; }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .grow small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .time { width: 58px; flex: none; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.rows .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rows.tight li > a { padding: 8px 0; }
.rows li.win .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pine); color: #fff; flex: none; }
.card-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 14px; box-shadow: var(--shadow); }

/* forms */
.form label, label.waste, label.pitch, .est-title { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
input, select, textarea {
  font: 15px/1.4 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(45, 74, 30, .12); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--pine); }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600; }
.row2, .row3, .row4 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: repeat(3, 1fr); } .row4 { grid-template-columns: repeat(4, 1fr); } }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
fieldset.plain { margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.crew-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.crew-pick legend { width: 100%; }
.chip { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; padding: 5px 12px 5px 6px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; margin: 0 !important; font-size: 14px !important; color: var(--ink) !important; }
.chip input { position: absolute; opacity: 0; }
.chip:has(input:checked) { border-color: var(--pine); background: var(--pine-tint); }
.chip:has(input:focus-visible) { outline: 2.5px solid var(--gold); }
.danger-zone { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 18px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.note-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.note-form textarea { flex: 1; }
.linked { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }

/* layout helpers */
.split { display: grid; gap: 14px; }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.col-main > :last-child, .col-side > :last-child { margin-bottom: 0; }

/* contact buttons */
.contact-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 14px; }
.contact-btns .btn { min-height: 46px; }
@media (min-width: 700px) { .contact-btns { display: flex; flex-wrap: wrap; } }

/* ---------- today ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.hello h1 { font-size: 30px; }
.hello .sub { color: var(--muted); margin: 5px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.today-grid { display: grid; gap: 22px; }
@media (min-width: 1100px) { .today-grid { grid-template-columns: 1.15fr 1fr; } .today-grid .stats-block { grid-column: 1 / -1; } }
.block > .block-h { margin-top: 2px; }
.block .rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 14px; margin-bottom: 18px; box-shadow: var(--shadow); }
.block .empty { margin-bottom: 18px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--r-lg); background: var(--blue-tint); color: var(--blue); margin-bottom: 18px; flex-wrap: wrap; }
.alert div { flex: 1; min-width: 200px; color: var(--ink-2); }
.alert b { color: var(--blue); }
.alert .btn { background: var(--blue); border-color: var(--blue); }

.ev-card { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.ev-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pine); }
.ev-card.k-measure::before { background: var(--amber); }
.ev-card.k-other::before { background: var(--blue); }
.ev-card.k-meeting::before { background: var(--gold-deep); }
.ev-time { width: 54px; flex: none; }
.ev-time b { font-size: 17px; display: block; }
.ev-time small { color: var(--muted); font-weight: 600; }
.ev-body { flex: 1; min-width: 0; }
.ev-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ev-title { font-weight: 700; font-size: 17px; color: var(--ink); display: block; margin-bottom: 4px; }
.ev-addr { display: flex; align-items: center; gap: 5px; color: var(--ink-2); margin-bottom: 4px; }
.ev-note { color: var(--muted); font-size: 14px; }
.ev-card .contact-btns { margin: 10px 0 0; }
@media (max-width: 520px) { .ev-card { flex-direction: column; gap: 4px; } .ev-time { display: flex; gap: 8px; align-items: baseline; width: auto; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.stats > div { background: var(--card); padding: 14px 16px; }
.stats b { display: block; font: 600 26px/1.1 var(--serif); color: var(--ink); }
.stats span { color: var(--muted); font-size: 13px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } .stats.two { grid-template-columns: repeat(2, 1fr); } }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 14px 16px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 14px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i { display: block; width: 100%; max-width: 46px; background: var(--pine-tint); border-radius: 6px 6px 2px 2px; border-top: 3px solid var(--pine); }
.bar.cur i { background: var(--gold-tint); border-top-color: var(--gold); }
.bar span { font-size: 12px; color: var(--muted); font-weight: 600; }

.dmnt-card { margin-top: 26px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-lg); background: var(--ink); color: #E9E7DF; }
.dmnt-card > div:first-child { flex: 1; min-width: 240px; }
.dmnt-card b { color: #fff; }
.dmnt-card p { margin: 4px 0 0; font-size: 14px; color: #BEBBB0; }
.dmnt-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.dmnt-card .btn { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.dmnt-card .btn.ghost { background: transparent; color: #fff; border-color: #4A4E4B; }

/* ---------- leads ---------- */
.pipe { display: grid; gap: 14px; }
@media (min-width: 900px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; } }
.pipe-col { background: #F1F0E8; border-radius: var(--r-lg); padding: 10px; }
.pipe-h { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 10px; }
.pipe-h small { color: var(--muted); font-weight: 700; }
.lead-card { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.lead-card:hover { border-color: var(--pine); text-decoration: none; }
.lead-card b { font-weight: 700; }
.lead-card span { font-size: 13.5px; }
.lead-card .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.lead-card em { font-style: normal; font-size: 12px; color: var(--muted); }
.lead-card .tag { display: inline-flex; align-items: center; gap: 3px; color: var(--amber); font-weight: 700; }
.lead-card .tag.warn { color: var(--red); }

.stepper { display: flex; gap: 0; padding: 6px; overflow-x: auto; }
.step { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 0; background: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); position: relative; }
.step i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); font-style: normal; font-size: 12px; background: var(--card); z-index: 1; }
.step::before { content: ''; position: absolute; top: 20px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step.past { color: var(--pine); }
.step.past i { background: var(--pine); border-color: var(--pine); color: #fff; }
.step.past::before, .step.now::before { background: var(--pine); }
.step.now { color: var(--ink); }
.step.now i { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.step:hover span { text-decoration: underline; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quick-row form { display: contents; }
details.lost { position: relative; }
details.lost summary { list-style: none; }
details.lost summary::-webkit-details-marker { display: none; }
details.lost[open] .inline-form { position: absolute; z-index: 5; background: var(--card); padding: 10px; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); width: 300px; }
.banner-link { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-radius: var(--r-lg); background: var(--pine-tint); color: var(--pine); font-weight: 700; margin-bottom: 14px; }
.banner-link.muted-b { background: #F1F0EC; color: var(--ink-2); font-weight: 600; }
.editbox summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.editbox summary::-webkit-details-marker { display: none; }
.editbox summary h2 { margin: 0; }
.editbox[open] summary { margin-bottom: 14px; }
.pinned { background: var(--gold-tint); border-radius: var(--r); padding: 10px 12px; font-size: 14px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.feed li p { margin: 0; font-size: 14px; }
.feed li small { color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-bottom: 12px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }

/* uploads */
.drop { position: relative; display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: 10px !important; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); color: var(--pine) !important; font-weight: 700 !important; font-size: 15px !important; cursor: pointer; background: var(--paper); margin: 0 !important; text-align: center; }
.drop:hover, .drop.over { border-color: var(--pine); background: var(--pine-tint); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.big { padding: 38px 18px; flex-direction: column !important; }
.drop.busy { pointer-events: none; color: var(--muted) !important; }
.upload .seg { margin-bottom: 10px; }
.fileico { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; background: var(--paper); border-radius: 8px; color: var(--muted); font-size: 11px; text-align: center; padding: 6px; overflow: hidden; }
.fileico.sm { aspect-ratio: auto; width: 40px; height: 40px; flex: none; }

/* ---------- objects ---------- */
.obj-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.obj-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.obj-card:hover { border-color: var(--pine); text-decoration: none; }
.obj-img { position: relative; aspect-ratio: 16 / 9; background: var(--pine-tint); }
.obj-img img { width: 100%; height: 100%; object-fit: cover; }
.obj-img .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #A8BB9A; }
.obj-img .badge { position: absolute; left: 10px; top: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.obj-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.obj-body b { font-size: 16px; }
.obj-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.obj-meta > span:not(.people) { display: inline-flex; align-items: center; gap: 4px; }
.obj-meta .people { margin-left: auto; }

.tabs { position: sticky; top: 52px; z-index: 10; display: flex; gap: 2px; overflow-x: auto; background: var(--paper); margin: -4px -16px 16px; padding: 4px 16px 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs a small { color: var(--muted); font-weight: 600; }
.tabs a.on { color: var(--pine); border-bottom-color: var(--gold); }
@media (min-width: 960px) { .tabs { top: 61px; margin: -6px -28px 18px; padding: 4px 28px 0; } }
.js .tab-pane { display: none; }
.js .tab-pane.on { display: block; }
.map { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; aspect-ratio: 16 / 9; max-height: 340px; background: #E9EBE4; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 600; }
.people-list { display: flex; flex-direction: column; gap: 4px; }
.people-list span { display: flex; align-items: center; gap: 6px; }
.status-box .btn { margin-top: 6px; }
.status-box .seg { flex-wrap: wrap; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 10px; background: var(--line); }
.gallery figcaption { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 3px 2px 0; min-height: 30px; }
.fig-acts { display: flex; }
.fig-acts .icon-btn { width: 28px; height: 28px; }

.compare { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; max-height: 460px; width: 100%; background: var(--line); user-select: none; }
.compare > img, .compare-before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.compare-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--gold); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); pointer-events: none; }
.compare-line::after { content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .tagl, .compare .tagr { position: absolute; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(24, 26, 27, .7); color: #fff; font-size: 12.5px; font-weight: 700; pointer-events: none; }
.compare .tagl { left: 10px; } .compare .tagr { right: 10px; }

.checklist { list-style: none; margin: 0 0 12px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist li > span { flex: 1; }
.checklist li.done > span { color: var(--muted); text-decoration: line-through; }
.tick { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--card); color: transparent; display: grid; place-items: center; cursor: pointer; }
.done .tick { background: var(--pine); border-color: var(--pine); color: #fff; }
.progress { height: 6px; border-radius: 6px; background: var(--line); margin-bottom: 12px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--pine); border-radius: 6px; transition: width .3s; }
.money-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.money-top div { background: var(--paper); border-radius: var(--r); padding: 10px 12px; }
.money-top span { font-size: 12.5px; color: var(--muted); display: block; }
.money-top b { font: 600 21px var(--serif); }
.money-top .owe b { color: var(--red); }

/* ---------- calendar ---------- */
.cal-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-tools .seg { margin: 0; }
.weeknav { display: flex; align-items: center; gap: 6px; }
.weeknav b { font-size: 16px; min-width: 170px; text-align: center; }
.week { display: grid; gap: 10px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.day.past { opacity: .72; }
.day.weekend { background: #F6F5EF; }
.day-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.day-h .dn { color: var(--muted); font-weight: 700; font-size: 13px; }
.day-h b { font-size: 17px; }
.day-add { margin-left: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.day-add:hover { background: var(--pine-tint); color: var(--pine); }
.is-today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.is-today .day-h { background: var(--gold-tint); }
.is-today .day-h b { color: var(--gold-deep); }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 46px; }
.day-empty { color: #A9AAA2; font-size: 13px; padding: 4px; }
.chip-ev { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: center; padding: 7px 9px; border-radius: 9px; background: var(--pine-tint); border-left: 3px solid var(--pine); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.chip-ev:hover { text-decoration: none; filter: brightness(.97); }
.chip-ev.k-measure { background: var(--amber-tint); border-left-color: var(--amber); }
.chip-ev.k-other { background: var(--blue-tint); border-left-color: var(--blue); }
.chip-ev.k-meeting { background: var(--gold-tint); border-left-color: var(--gold-deep); }
.ce-time { font-weight: 700; font-size: 12.5px; color: var(--ink-2); grid-row: span 2; }
.chip-ev b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ev small { grid-column: 2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ev .people { grid-row: 1 / span 2; grid-column: 3; }
.day-move { padding: 0 12px 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; font-weight: 600; align-items: center; }
.legend span[class^=k-]::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--pine); vertical-align: -1px; }
.legend .k-measure::before { background: var(--amber) !important; }
.legend .k-other::before { background: var(--blue) !important; }
.legend .k-meeting::before { background: var(--gold-deep) !important; }
@media (min-width: 1100px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .day-h { padding: 8px 9px; gap: 6px; flex-wrap: wrap; }
  .day-h .wx { font-size: 11.5px; }
  .day-body { padding: 6px; }
  .chip-ev { padding: 6px 7px; font-size: 12.5px; }
  .chip-ev .people .ava { --s: 18px !important; }
  .day { min-height: 300px; }
  .chip-ev { grid-template-columns: 1fr auto; }
  .ce-time { grid-row: auto; grid-column: 1; }
  .chip-ev b, .chip-ev small { grid-column: 1 / -1; }
  .chip-ev .people { grid-row: 1; grid-column: 2; }
}
.kinds { margin-bottom: 14px; }

/* ---------- estimate editor ---------- */
.est { display: grid; gap: 14px; }
@media (min-width: 1100px) { .est { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .est-side { position: sticky; top: 80px; } }
.est-title input { font-weight: 700; font-size: 17px; }
.helper-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.card-in { background: var(--gold-tint); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.card-in label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.planes { display: grid; gap: 10px; margin-bottom: 10px; }
.plane-card { display: grid; grid-template-columns: 1fr; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; background: #FDFDFA; }
@media (min-width: 640px) { .plane-card { grid-template-columns: 180px 1fr; } }
.plane-draw { background: var(--paper); border-radius: var(--r); display: grid; place-items: center; min-height: 118px; }
.plane-svg { width: 100%; max-width: 200px; height: auto; }
.plane-svg polygon, .plane polygon { fill: var(--pine-tint); stroke: var(--pine); stroke-width: 2; stroke-linejoin: round; }
.plane-svg text, .plane text { font: 600 11px var(--sans); fill: var(--ink-2); }
.plane-svg .hgt, .plane .hgt { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 3 3; }
.plane-top { display: flex; gap: 6px; margin-bottom: 8px; }
.plane-name { font-weight: 700; }
.shape-pick { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.shape-pick button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.shape-pick button.on { border-color: var(--pine); background: var(--pine-tint); color: var(--pine); }
.plane-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.plane-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.plane-fields .cnt input { max-width: 90px; }
.plane-area { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.plane-area b { color: var(--pine); font-size: 15px; }
.measure-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.measure-opts .seg { margin: 0; }
.pitch { margin: 0 !important; max-width: 140px; }
.pitch.dim { opacity: .45; }
.cover-row { align-items: end; }
.waste { max-width: 220px; }
.lines-head, .line { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px 90px 36px; gap: 8px; align-items: center; }
.lines-head { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 2px 6px; border-bottom: 1px solid var(--line); }
.line { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ln-qty { display: flex; gap: 4px; align-items: center; }
.ln-qty input { padding: 8px; }
.ln-qty .unit { width: 52px; flex: none; }
.ln-price { display: flex; align-items: center; gap: 4px; }
.ln-price input { padding: 8px; }
.ln-price small { color: var(--muted); white-space: nowrap; }
.ln-sum { text-align: right; font-weight: 700; font-size: 14px; }
.auto { border: 1px dashed var(--line-2); background: none; border-radius: 8px; padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.auto.on { border-style: solid; border-color: var(--pine); color: var(--pine); background: var(--pine-tint); }
.add-line { display: flex; gap: 8px; margin: 12px 0 14px; flex-wrap: wrap; }
.add-line select { max-width: 340px; }
@media (max-width: 720px) {
  .lines-head { display: none; }
  .line { grid-template-columns: 1fr 1fr 36px; grid-template-areas: 'n n x' 'q p p' 's s s'; }
  .ln-name { grid-area: n; } .ln-qty { grid-area: q; } .ln-price { grid-area: p; } .ln-sum { grid-area: s; } .line .icon-btn { grid-area: x; }
}
.sum-card { padding: 18px; }
.roof-preview { background: var(--ink); border-radius: var(--r); padding: 10px; margin-bottom: 14px; min-height: 60px; }
.roof-preview svg { width: 100%; height: auto; max-height: 190px; display: block; margin: 0 auto; }
.est-mini { position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); z-index: 35; display: flex; align-items: center; gap: 14px; padding: 9px 16px; background: var(--ink); color: #fff; font-size: 14px; }
.est-mini b { font: 600 18px var(--serif); }
.est-mini .m-total { margin-left: auto; font: 600 20px var(--serif); color: var(--gold); }
.est-mini .btn { background: var(--gold); border-color: var(--gold); color: var(--ink); min-height: 32px; }
@media (min-width: 960px) { .est-mini { left: var(--side); bottom: 0; } }
@media (min-width: 1100px) { .est-mini { display: none; } }
.roof-preview polygon { fill: rgba(200, 169, 110, .22); stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; animation: draw .5s ease-out both; }
@keyframes draw { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.area { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.area b { font: 600 34px/1 var(--serif); color: var(--pine); }
.area span { color: var(--muted); font-weight: 600; }
.sum-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0 0 12px; font-size: 14px; }
.sum-list dt small { display: block; color: var(--muted); font-size: 12px; }
.sum-list dd { margin: 0; font-weight: 700; text-align: right; }
.sum-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.sum-opts label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sum-opts label.check { grid-column: 1 / -1; }
.total { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; border-top: 2px solid var(--ink); margin-bottom: 4px; }
.total span { font-weight: 700; }
.total b { font: 600 30px/1 var(--serif); }
.save-state { min-height: 20px; margin: 0 0 8px; }
.sum-card .btn { margin-bottom: 8px; }
.share { margin-top: 14px; }
.share-row { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url { font-size: 13.5px; color: var(--ink-2); background: var(--paper); }
.est-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.pill { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row-acts { gap: 20px; }

/* tables */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--paper); }
.num { text-align: right !important; white-space: nowrap; }
.cat-table td { padding: 6px; vertical-align: middle; }
.cat-table input, .cat-table select { padding: 8px; }
.cat-table .num input { width: 100px; text-align: right; }
.new-row td { background: var(--gold-tint); }
.del-x { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); cursor: pointer; }
.del-x:has(input:checked) { color: var(--red); }

/* team */
.team { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.person.off { opacity: .6; }
.person-h { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.person-h small { display: block; color: var(--muted); }
.person-acts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; }
.linkbox { background: var(--gold-tint); border-radius: var(--r); padding: 12px; margin: 8px 0; }
.linkbox p { font-size: 13.5px; }
.welcome { border-color: var(--gold); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(24, 26, 27, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 520px; background: var(--card); border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + var(--safe-b)); animation: up .22s ease-out; max-height: 88vh; overflow: auto; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-card h2 { font: 600 22px var(--serif); margin-bottom: 14px; }
.sheet-grid { display: grid; gap: 8px; margin-bottom: 12px; }
.sheet-grid a { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; }
.sheet-grid a:hover { border-color: var(--pine); background: var(--pine-tint); }
.sheet-grid a .i { color: var(--pine); }
.sheet-grid span { font-weight: 700; }
.sheet-grid small { display: block; color: var(--muted); font-weight: 500; }
.sheet-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.sheet-list a, .sheet-list button { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-weight: 600; text-decoration: none; width: 100%; cursor: pointer; font-size: 15px; }
.sheet-list form { display: contents; }
.sheet .credit { text-align: center; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 70; background: rgba(12, 13, 13, .92); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 96vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lb button { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; cursor: pointer; }
.lb .lb-prev, .lb .lb-next { top: 50%; transform: translateY(-50%); right: auto; }
.lb .lb-prev { left: 12px; } .lb .lb-next { right: 12px; left: auto; }

/* ---------- auth ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--paper); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px 24px; box-shadow: var(--shadow); text-align: center; }
.auth-logo { margin: 0 auto 6px; width: 140px; height: auto; }
.ridge { width: 100%; height: 22px; margin-bottom: 14px; }
.ridge path, .doc-ridge path { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-card h1 { font-size: 26px; margin-bottom: 18px; }
.auth-card .form { text-align: left; }
.auth-lead { color: var(--ink-2); margin-bottom: 18px; }
.auth-note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.auth .credit { text-align: center; }

/* ---------- offer document ---------- */
body.doc-page { background: #EDECE4; padding: 20px 12px 40px; }
.doc-bar { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.doc { max-width: 820px; margin: 0 auto; background: #fff; padding: 40px 44px; border-radius: 6px; box-shadow: 0 10px 40px -18px rgba(0, 0, 0, .3); }
.doc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.doc-h img { width: 130px; height: auto; }
.doc-co { display: flex; flex-direction: column; text-align: right; font-size: 13px; color: var(--ink-2); }
.doc-co b { font-size: 15px; color: var(--ink); }
.doc-ridge { width: 100%; height: 26px; margin: 18px 0 6px; }
.doc-title { text-align: center; margin-bottom: 22px; }
.doc-title h1 { font-size: 30px; }
.doc-title p { color: var(--muted); margin: 6px 0 0; }
.doc-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.doc-meta span { display: block; font-size: 12px; color: var(--muted); }
.doc-meta b { font-size: 15px; }
@media (min-width: 640px) { .doc-meta { grid-template-columns: repeat(4, 1fr); } }
.doc-planes h2, .doc-table th { font-size: 13px; color: var(--muted); font-weight: 700; }
.doc-planes-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 8px; }
.doc-planes-grid figure { margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.doc-small { font-size: 12.5px; color: var(--muted); }
.doc-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.doc-table th { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--ink); }
.doc-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.doc-table tfoot td { border-bottom: 0; padding-top: 7px; padding-bottom: 7px; }
.doc-table .grand td { font: 600 20px var(--serif); border-top: 2px solid var(--ink); padding-top: 12px; }
.doc-note { background: var(--paper); border-left: 3px solid var(--gold); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.doc-f { display: flex; gap: 40px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.doc-f span { display: block; color: var(--muted); font-size: 12px; }
.answer-box { max-width: 820px; margin: 16px auto 0; background: #fff; border-radius: 10px; padding: 20px 22px; border: 2px solid var(--pine); }
.answer-box h2 { font: 600 22px var(--serif); margin-bottom: 12px; }
.answer-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.answer-box.done { background: var(--pine-tint); color: var(--pine); margin: 0 auto 16px; border-color: var(--pine-tint); }
.answer-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.public .doc-small.center { margin-top: 14px; }
@media (max-width: 600px) { .doc { padding: 24px 18px; } .doc-co { text-align: left; } }
@media print {
  body.doc-page { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
  @page { margin: 14mm; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1099px) { body.wide .main { padding-bottom: calc(150px + var(--safe-b)); } }
/* grid children must be allowed to shrink, otherwise long nowrap rows push the page wider than the phone */
.today-grid > *, .split > *, .est > *, .pipe > *, .obj-grid > *, .week > * { min-width: 0; }
.doc-table-wrap { overflow-x: auto; }
@media (max-width: 600px) { .doc-table { font-size: 13px; } .doc-table th, .doc-table td { padding-left: 3px; padding-right: 3px; } .doc-table .grand td { font-size: 17px; } .doc-title h1 { font-size: 25px; } }
@media (max-width: 600px) {
  .doc-table thead { display: none; }
  .doc-table tbody tr { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .doc-table tbody td { border: 0; padding: 0; text-align: left !important; }
  .doc-table tbody td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .doc-table tbody td:nth-child(2), .doc-table tbody td:nth-child(3) { color: var(--muted); }
  .doc-table tbody td:nth-child(3)::before { content: '× '; }
  .doc-table tbody td:last-child { text-align: right !important; font-weight: 700; }
  .doc-table tfoot tr { display: flex; justify-content: space-between; }
  .doc-table tfoot td:first-child { padding-left: 0; }
}
@media (max-width: 600px) { h1 { font-size: 24px; } .hello h1 { font-size: 27px; } }
@media (max-width: 600px) { .doc-table tfoot tr.grand { border-top: 2px solid var(--ink); } .doc-table .grand td { border-top: 0; } }

/* ---------- motion (2026-10-19): calm, quick, never in the way. Everything is off for prefers-reduced-motion. ---------- */
:root { --ease: cubic-bezier(.2, .75, .25, 1); --ease-spring: cubic-bezier(.3, 1.4, .5, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: translateX(-50%) scaleX(.2); opacity: 0; } 70% { transform: translateX(-50%) scaleX(1.15); opacity: 1; } 100% { transform: translateX(-50%) scaleX(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 140, 40, .45); } 70% { box-shadow: 0 0 0 8px rgba(60, 140, 40, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 140, 40, 0); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(200, 169, 110, .6); } 100% { box-shadow: 0 0 0 9px rgba(200, 169, 110, 0); } }
@keyframes drawline { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes loadbar { 0% { transform: scaleX(0); } 40% { transform: scaleX(.55); } 100% { transform: scaleX(.92); } }

/* page content arrives in a short cascade */
.main > * { animation: rise .42s var(--ease) both; }
.main > :nth-child(2) { animation-delay: .04s; } .main > :nth-child(3) { animation-delay: .08s; }
.main > :nth-child(4) { animation-delay: .12s; } .main > :nth-child(5) { animation-delay: .16s; } .main > :nth-child(n+6) { animation-delay: .2s; }
:is(.rows li, .lead-card, .ev-card, .sheet-grid a, .sheet-list > *)[style*="--i"] { animation: rise .38s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms + .06s); }

/* the same page across navigations: content cross-fades, menus stay put (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
.side { view-transition-name: side; }
.tabbar { view-transition-name: tabbar; }
.top { view-transition-name: top; }
::view-transition-old(root) { animation: fade .16s ease-in reverse both; }
::view-transition-new(root) { animation: fade .22s ease-out both; }
html.vt .main > *, html.vt .rows li, html.vt .lead-card, html.vt .ev-card { animation-duration: .3s; }

/* hover and press feedback */
.btn, .add-btn, .icon-btn, .link, .back, .tabbar a, .tabbar button, .seg a, .seg button, .step, .chip, .side-nav a {
  transition: transform .14s var(--ease), background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn:active, .add-btn:active, .icon-btn:active, .back:active, .chip:active { transform: scale(.96); }
.tabbar a:active, .tabbar button:active { transform: scale(.92); }
.btn:not(.ghost):hover { box-shadow: 0 6px 16px -8px rgba(45, 74, 30, .55); }
.add-btn:hover { box-shadow: 0 6px 16px -8px rgba(45, 74, 30, .6); transform: translateY(-1px); }
.add-btn .i { transition: transform .3s var(--ease-spring); }
.add-btn:hover .i { transform: rotate(90deg); }
.lead-card, .ev-card, .sheet-grid a, .card-list, .rows li { transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background-color .2s; }
@media (hover: hover) {
  .lead-card:hover, .ev-card:hover, .sheet-grid a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(24, 26, 27, .35); }
  .rows li:hover { background: linear-gradient(90deg, transparent, rgba(234, 240, 228, .6) 12%, rgba(234, 240, 228, .6) 88%, transparent); }
  .side-nav a:hover .i { transform: translateX(2px); }
}
.side-nav a .i { transition: transform .2s var(--ease); }
.tabbar .on::before { animation: pop .35s var(--ease) both; }
.tabbar .on .i { animation: rise .3s var(--ease-spring) both; }
.side-nav a.on::after { animation: grow .3s var(--ease) both; transform-origin: center; }
.seg .on { transition: background-color .2s, box-shadow .2s, color .2s; }
.step.now i { animation: ring 1.6s ease-out 2; }
.icon-btn.call { position: relative; }
.icon-btn.call:hover { background: var(--pine); color: #fff; }

/* sheets and lightbox open and close softly */
.sheet { animation: fade .2s ease-out both; }
.sheet-card { animation: up .32s var(--ease-spring) both; }
.sheet.closing { animation: fade .18s ease-in reverse both; }
.sheet.closing .sheet-card { animation: up .18s ease-in reverse both; }
.lb { animation: fade .2s ease-out both; }
.lb img { animation: rise .3s var(--ease) both; }

/* flash messages behave like a toast: slide in, the green ones fold away after a few seconds */
.flash { animation: rise .35s var(--ease-spring) both; overflow: hidden; display: flex; align-items: center; gap: 8px; }
.flash.flash-ok::before { content: ''; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--pine) no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.flash.gone { animation: toast-out .35s ease-in forwards; }

/* numbers and bars on Šiandien */
.bar i { transform-origin: bottom; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + .15s); }
.bar.cur i { background: var(--gold-tint); border-top-color: var(--gold); }
.stats b { font-variant-numeric: tabular-nums; }

/* live status dot (Facebook sync) */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3C8C28; margin-right: 7px; vertical-align: 1px; animation: pulse 2s ease-out infinite; }
.fb-state { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 600; margin: 4px 0 12px; }

/* page loading bar: shows at once when a link or form is used, so a slow connection never feels frozen */
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold), var(--pine-2)); }
.loadbar.on { animation: loadbar 2.4s var(--ease) forwards; }

/* buttons that were pressed show they work and can't be pressed twice */
.btn.busy, .link.busy { pointer-events: none; opacity: .75; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* quick filter on long lists */
.filter { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); margin-bottom: 12px; max-width: 420px; }
.filter input { border: 0; padding: 9px 0; background: none; box-shadow: none !important; }
.filter-none { display: none; }
.filter-none.on { display: block; }

/* AI e-mail assistant card */
.ai-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 26px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid #EBDDBC;
  background: linear-gradient(120deg, var(--gold-tint), #FFFDF7 60%); position: relative; overflow: hidden; }
.ai-card.card { margin-top: 0; box-shadow: var(--shadow); }
.ai-card + .dmnt-card { margin-top: 12px; }
.ai-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--ink); flex: none; }
.ai-txt { flex: 1; min-width: 230px; }
.ai-txt p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.ai-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .7) 50%, transparent 60%); transform: translateX(-100%); animation: shine 3.2s ease-in-out 1s 1 both; pointer-events: none; }
@keyframes shine { to { transform: translateX(100%); } }

/* login: the roof ridge draws itself, the card rises */
.auth-card { animation: rise .5s var(--ease) both; }
.auth-card .ridge path { stroke-dasharray: 260; animation: drawline .9s var(--ease) .15s both; }
.auth-logo { animation: fade .5s ease-out both; }
.auth-link-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.auth-link-form summary { cursor: pointer; color: var(--pine); font-weight: 600; font-size: 14px; list-style: none; text-align: center; }
.auth-link-form summary::-webkit-details-marker { display: none; }
.auth-link-form[open] summary { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

/* flash after a save: a floating toast, visible wherever the page scrolled to (#anchor redirects) */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-away { to { opacity: 0; transform: translate(-50%, -12px); } }
.main > .flash { position: fixed; z-index: 80; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px); width: max-content; max-width: min(520px, calc(100vw - 32px));
  margin: 0; box-shadow: 0 14px 34px -14px rgba(24, 26, 27, .45); border: 1px solid rgba(45, 74, 30, .18); animation: toast-in .38s var(--ease-spring) both; cursor: pointer; }
.main > .flash-err { border-color: rgba(163, 58, 43, .25); }
.main > .flash.gone { animation: toast-away .3s ease-in forwards; pointer-events: none; }
@media (min-width: 960px) { .main > .flash { left: calc(50% + var(--side) / 2); top: 78px; } }
.ai-card { align-items: flex-start; }
@media (max-width: 620px) { .ai-txt { min-width: 0; flex-basis: calc(100% - 56px); } .ai-acts { margin-left: 56px; } }
.seg { position: relative; }
