:root {
  --green: #006241;
  --accent: #00754A;
  --house: #1E3932;
  --light: #D4E9E2;
  --lighter: #EDF5F1;
  --gold: #CBA258;
  --bg: #F2F0EB;
  --card: #FFFFFF;
  --text: #1F2421;
  --muted: #5F6B66;
  --line: #E3E0D8;
  --danger: #C62828;
  --danger-bg: #FDECEC;
  --amber: #A86500;
  --amber-bg: #FFF3D6;
  --ok-bg: #E3F2EB;

  --t-visit: #00754A;
  --t-meeting: #2E6DB4;
  --t-office: #5B6770;
  --t-travel: #C77C02;
  --t-leave: #8E5BB5;
  --t-imported: #9AA5A0;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 57, 50, .06), 0 4px 14px rgba(30, 57, 50, .06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }

/* ---------- app shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--house); color: #fff;
  padding: calc(var(--safe-top) + 8px) 8px 8px;
  display: flex; align-items: center; gap: 4px; min-height: calc(56px + var(--safe-top));
}
.appbar h1 { font-size: 19px; font-weight: 650; flex: 1; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .icon-btn { color: #fff; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:active { background: rgba(255,255,255,.15); }
.icon-btn svg { width: 24px; height: 24px; }

.view {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
}
.view.no-tabbar { padding-bottom: calc(var(--safe-bottom) + 32px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  display: flex; justify-content: center;
}
.tabbar-inner { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 720px; height: var(--tabbar-h); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11.5px; font-weight: 550; border: 0; background: none; cursor: pointer;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--green); }
.tab.active svg { stroke-width: 2.4; }
.tab-add { display: grid; place-items: center; }
.tab-add span {
  width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; margin-top: -18px;
  box-shadow: 0 4px 14px rgba(0, 117, 74, .4);
}
.tab-add svg { width: 28px; height: 28px; }

/* ---------- typography & blocks ---------- */
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 26px 4px 10px; display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 4px; }
.section-title a { font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }

.hero {
  background: linear-gradient(135deg, var(--house), var(--green));
  color: #fff; border-radius: 20px; padding: 20px; margin-bottom: 8px;
}
.hero .greet { font-size: 24px; font-weight: 700; }
.hero .date { opacity: .85; margin-top: 2px; text-transform: capitalize; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  font-weight: 600; margin-top: 10px; color: inherit;
}
.banner svg { width: 22px; height: 22px; flex: none; }
.banner.danger { background: var(--danger-bg); color: var(--danger); }
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.banner .grow { flex: 1; }

/* ---------- lists ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px;
  color: inherit; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0;
  cursor: pointer;
}
.list > .item:first-child { border-top: 0; }
.item:active { background: var(--lighter); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--muted); font-size: 14px; margin-top: 1px; }
.item .chev { color: #B5B9B6; width: 20px; height: 20px; flex: none; }
.item .end { color: var(--muted); font-size: 14px; text-align: right; flex: none; }

.type-bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
.type-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff;
}
.type-icon svg { width: 22px; height: 22px; }

.badges { display: flex; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.badges span { display: inline-flex; align-items: center; gap: 4px; }
.badges svg { width: 15px; height: 15px; }

.day-head { font-weight: 700; margin: 18px 4px 8px; display: flex; gap: 8px; align-items: baseline; text-transform: capitalize; }
.day-head .muted { font-weight: 500; font-size: 14px; text-transform: none; }

.empty {
  text-align: center; color: var(--muted); padding: 28px 16px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty svg { width: 34px; height: 34px; color: #B5C9C0; display: block; margin: 0 auto 8px; }

/* ---------- actions (to-dos) ---------- */
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; min-height: 60px; }
.check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #A7B3AD; background: #fff;
  flex: none; display: grid; place-items: center; cursor: pointer; margin-top: 1px; padding: 0;
}
.check svg { width: 16px; height: 16px; color: #fff; opacity: 0; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on svg { opacity: 1; }
.todo .body { flex: 1; min-width: 0; }
.todo .text { white-space: pre-wrap; word-break: break-word; }
.todo.done .text { text-decoration: line-through; color: var(--muted); }
.todo .meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.due { font-weight: 600; }
.due.overdue { color: var(--danger); }
.due.today { color: var(--amber); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 26px; border: 0; cursor: pointer;
  font-weight: 650; font-size: 16px; background: var(--accent); color: #fff; width: 100%;
}
.btn:active { filter: brightness(.92); }
.btn:disabled { opacity: .55; }
.btn svg { width: 20px; height: 20px; }
.btn.secondary { background: var(--card); color: var(--green); border: 1.5px solid var(--accent); }
.btn.danger { background: var(--card); color: var(--danger); border: 1.5px solid #E7B4B4; }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 16px; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); color: var(--green);
  font-weight: 600; font-size: 14px; border: 0; cursor: pointer;
}
.quick svg { width: 24px; height: 24px; }
.quick .disabled { color: #B5B9B6; pointer-events: none; }

.form { display: grid; gap: 16px; }
.field label, .field .label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 4px 6px; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-size: 16px; outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,117,74,.15); }
.field .hint { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; color: var(--muted); }

.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.type-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--muted);
}
.type-opt .type-icon { width: 38px; height: 38px; }
.type-opt.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 8%, #fff); }

.picker-btn {
  width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
}
.picker-btn .body { flex: 1; }
.picker-btn .placeholder { color: var(--muted); }

.seg { display: flex; background: #E6E3DB; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.search { position: relative; margin-bottom: 14px; }
.search svg { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; color: var(--muted); }
.search input { padding-left: 44px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.cal-head h2 { flex: 1; font-size: 21px; text-transform: capitalize; padding-left: 4px; }
.cal-head .icon-btn { color: var(--green); background: var(--card); box-shadow: var(--shadow); }
.cal-head .today-btn { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 0; background: var(--card); box-shadow: var(--shadow); color: var(--green); font-weight: 650; cursor: pointer; margin-right: 6px; }
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; touch-action: pan-y; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow div { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; text-transform: uppercase; }
.cal-day {
  aspect-ratio: 1 / 1.05; border: 0; background: none; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7px; gap: 4px; min-height: 44px;
}
.cal-day .n { font-weight: 600; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.cal-day.other .n { color: #B5B9B6; }
.cal-day.weekend:not(.other) .n { color: var(--muted); }
.cal-day.today .n { background: var(--light); color: var(--green); }
.cal-day.sel .n { background: var(--accent); color: #fff; }
.dots { display: flex; gap: 3px; height: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- detail ---------- */
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-head .type-icon { width: 52px; height: 52px; border-radius: 14px; }
.detail-head h2 { font-size: 21px; }
.kv { display: grid; gap: 12px; }
.kv .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.kv .v { white-space: pre-wrap; word-break: break-word; }
.contact-actions { display: flex; gap: 8px; margin-top: 14px; }
.contact-actions a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px;
  border-radius: 23px; background: var(--lighter); color: var(--green); font-weight: 650; font-size: 15px;
}
.contact-actions svg { width: 19px; height: 19px; }
.round-actions { display: flex; gap: 6px; flex: none; }
.round-actions a {
  width: 42px; height: 42px; border-radius: 50%; background: var(--lighter); color: var(--green); display: grid; place-items: center;
}
.round-actions svg { width: 20px; height: 20px; }

.notes-box { width: 100%; min-height: 140px; border: 0; outline: none; resize: none; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); font-size: 16px; line-height: 1.5; }
.save-state { font-size: 13px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }

.add-row { display: flex; gap: 8px; padding: 10px 12px; align-items: center; }
.add-row input[type=text] { flex: 1; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 16px; outline: none; min-width: 0; }
.add-row input[type=text]:focus { border-color: var(--accent); }
.add-row .icon-btn { background: var(--accent); color: #fff; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos .ph, .photos label {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #E6E3DB; position: relative; cursor: pointer; border: 0; padding: 0;
}
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos label { display: grid; place-items: center; color: var(--green); background: var(--lighter); border: 2px dashed #A8CDBD; }
.photos label div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.photos label svg { width: 28px; height: 28px; }
.photos .uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6) center / 28px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300754A' stroke-width='2.5'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9'/%3E%3C/svg%3E"); animation: spin 1s linear infinite; }

.score-pill { display: inline-block; min-width: 64px; text-align: center; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.score-pill.g { background: var(--ok-bg); color: var(--green); }
.score-pill.a { background: var(--amber-bg); color: var(--amber); }
.score-pill.r { background: var(--danger-bg); color: var(--danger); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--lighter); color: var(--green); font-size: 12.5px; font-weight: 650; }

/* ---------- overlays ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(20, 30, 25, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
.sheet {
  background: var(--bg); width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(var(--safe-bottom) + 20px);
  animation: up .2s ease-out;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #CFCBC2; margin: 4px auto 12px; }
.sheet h3 { font-size: 19px; margin: 4px 4px 14px; }
.sheet p { margin: 0 4px 18px; color: var(--muted); }
.sheet .btn + .btn { margin-top: 10px; }

.viewer { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; }
.viewer img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.viewer .bar { display: flex; justify-content: space-between; padding: calc(var(--safe-top) + 6px) 8px 6px; }
.viewer .bar .icon-btn { color: #fff; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  background: var(--house); color: #fff; padding: 12px 8px 12px 18px; border-radius: 14px; z-index: 70;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px);
  animation: up .2s ease-out; min-height: 48px;
}
.toast button { background: none; border: 0; color: var(--light); font-weight: 700; padding: 8px 10px; cursor: pointer; }
.toast.error { background: var(--danger); }

.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--light); border-top-color: var(--accent); animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.toast { animation-name: toastup; }
@keyframes toastup { from { transform: translate(-50%, 24px); opacity: 0; } }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--house); color: #fff; }
.login .top { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--safe-top) + 40px) 28px 32px; max-width: 480px; width: 100%; margin: 0 auto; }
.login .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.login .logo svg { width: 36px; height: 36px; color: #fff; }
.login h1 { font-size: 30px; }
.login .top p { margin: 6px 0 0; opacity: .8; }
.login .panel { background: var(--bg); color: var(--text); border-radius: 26px 26px 0 0; padding: 28px 24px calc(var(--safe-bottom) + 28px); }
.login .panel > div { max-width: 432px; margin: 0 auto; }
.login .lang { position: absolute; top: calc(var(--safe-top) + 14px); right: 16px; }
.lang-toggle { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 20px; padding: 3px; }
.lang-toggle button { border: 0; background: none; color: #fff; padding: 6px 12px; border-radius: 16px; font-weight: 650; font-size: 14px; cursor: pointer; }
.lang-toggle button.on { background: #fff; color: var(--house); }
.form-error { background: var(--danger-bg); color: var(--danger); padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; }

@media (min-width: 760px) {
  .view { padding-top: 24px; }
  .hero { padding: 26px; }
}

/* Greek capitals must drop accents; browsers don't do this reliably, so keep section titles in sentence case. */
:lang(el) .section-title { text-transform: none; letter-spacing: 0; font-size: 14px; }
:lang(el) .cal-dow div { text-transform: none; }

.picker-btn > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.picker-btn > svg.chev { width: 20px; height: 20px; color: #B5B9B6; }
.type-opt { min-width: 0; font-size: 12.5px; padding: 10px 2px; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .tab { font-size: 10.5px; }
}

/* ---------- phase 2-4 ---------- */
:root { --ly: #B0ADA3; }
.lead { width: 22px; height: 22px; color: var(--accent); flex: none; }
.inline-ico svg, svg.inline-svg { width: 15px; height: 15px; vertical-align: -2px; }
.hint.err { color: var(--danger); }
.muted-chip { background: #EEE; color: #777; }
.spin { animation: spin 1s linear infinite; }

.syncbar {
  position: sticky; top: calc(56px + var(--safe-top)); z-index: 19;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--light); color: var(--green); font-size: 13.5px; font-weight: 600; padding: 7px 12px;
}
.syncbar.offline { background: #4A4F4C; color: #fff; }
.syncbar svg { width: 17px; height: 17px; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters select { flex: 1; min-height: 46px; }
.stepper { display: flex; align-items: center; background: var(--card); border-radius: 23px; box-shadow: var(--shadow); }
.stepper b { min-width: 44px; text-align: center; }
.stepper .icon-btn { color: var(--green); }
.icon-btn:disabled { opacity: .3; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 21px; font-weight: 700; margin: 4px 0 2px; overflow-wrap: anywhere; }
.tile-delta { font-size: 13.5px; }
.delta { font-weight: 700; white-space: nowrap; color: var(--muted); }
.delta.up { color: var(--green); }
.delta.down { color: var(--danger); }

.chart-card { padding: 14px 10px 12px; margin-top: 14px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #ECEAE4; stroke-width: 1; }
.chart .base { stroke: #C9C5BB; stroke-width: 1; }
.chart .yl, .chart .xl { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .cy { fill: var(--accent); }
.chart .ly { fill: var(--ly); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col.sel .hit { fill: rgba(0, 117, 74, .07); }
.chart .col.sel .xl { fill: var(--text); font-weight: 700; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 10px 6px 0; font-size: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.key.cy { background: var(--accent); }
.key.ly { background: var(--ly); }

.table-card { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child { text-align: left; }
table.data thead th { font-size: 12.5px; color: var(--muted); }
table.data tbody tr:last-child > * { border-bottom: 0; }
.end.num { font-variant-numeric: tabular-nums; }

.money-input input { padding-right: 40px; font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }
.money-input span { position: absolute; right: 16px; top: 15px; color: var(--muted); font-weight: 600; }

.score-pill.sm { min-width: 0; padding: 2px 8px; font-size: 12.5px; }
.badges .score-pill.sm { margin-right: 2px; }
details.score-month > summary { list-style: none; cursor: pointer; }
details.score-month > summary::-webkit-details-marker { display: none; }
details.score-month[open] > summary { background: var(--lighter); }
.sub-item { padding-left: 32px; min-height: 48px; background: #FBFAF7; }
.list > details + *, .list > * + details { border-top: 1px solid var(--line); }
details.score-month .sub-item { border-top: 1px solid var(--line); }

.photos .ph.pending::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #fff; }

/* ---------- audit ---------- */
.audit-head { position: sticky; top: calc(56px + var(--safe-top)); z-index: 15; padding: 12px 14px; margin: -4px -4px 14px; }
.audit-head.done { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.audit-head.done.band-a { box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }
.audit-head.done.band-r { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.live-score .score-pill { font-size: 17px; padding: 6px 12px; }
.progress { height: 6px; border-radius: 3px; background: var(--light); margin: 10px 0 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s; }
.counts { display: flex; gap: 14px; color: var(--muted); }
.counts .yes b { color: var(--green); }
.counts .no b { color: var(--danger); }
.qlist { display: grid; gap: 12px; }
.q { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; scroll-margin-top: 150px; transition: box-shadow .3s; }
.q.answered { background: #FCFCFA; }
.q.flash { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.q-head { display: flex; gap: 10px; }
.q-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lighter); color: var(--green); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.q.answered .q-n { background: var(--accent); color: #fff; }
.q-text { font-size: 15.5px; line-height: 1.45; }
.ans3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.ans3 button {
  min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 15px;
  color: var(--muted); cursor: pointer;
}
.ans3 .ans-yes.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ans3 .ans-no.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.ans3 .ans-na.on { background: #5B6770; border-color: #5B6770; color: #fff; }
.ans-extra { margin-top: 10px; }
.ans-extra textarea { width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid #EBC4C4; padding: 10px 12px; font-size: 16px; outline: none; background: #FFFBFB; resize: vertical; }
.ans-extra textarea:focus { border-color: var(--danger); }
.ans-extra.is-yes textarea { border-color: #C5DED3; background: #FAFDFB; }
.ans-extra.is-yes textarea:focus { border-color: var(--accent); }
.q-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.q-photos .ph, .q-photos label { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; border: 0; padding: 0; background: #E6E3DB; }
.q-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-photos label { display: grid; place-items: center; color: var(--green); background: var(--lighter); border: 2px dashed #A8CDBD; }
.q-photos label svg { width: 24px; height: 24px; }
.q-photos .ph.pending::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #fff; }
.finish-bar {
  position: sticky; bottom: 0; z-index: 15; margin: 16px -16px calc(-32px - var(--safe-bottom));
  padding: 12px 16px calc(12px + var(--safe-bottom)); background: linear-gradient(rgba(242,240,235,0), var(--bg) 30%);
}
.finish-bar > div { max-width: 720px; margin: 0 auto; }

.steps { margin: 0 4px 18px; padding-left: 22px; line-height: 1.7; }
.saved-line { font-size: 12.5px; color: var(--green); margin-top: 6px; font-weight: 600; }

/* Audit discussion thread */
.discussion { padding: 14px; }
.discussion > textarea, .comment textarea { width: 100%; min-height: 72px; border-radius: 12px; border: 1.5px solid var(--line, #E3E0D8); padding: 10px 12px; font-size: 16px; font-family: inherit; outline: none; background: #fff; resize: vertical; }
.discussion > textarea:focus, .comment textarea:focus { border-color: var(--green); }
.comments { display: grid; gap: 10px; margin-bottom: 12px; }
.comment { border-left: 3px solid var(--green); padding: 2px 0 2px 10px; }
.comment-meta { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.comment-meta b { color: var(--text, #1F2421); }
.comment-tools { margin-left: auto; display: flex; }
.comment-tools .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.comment-tools .icon-btn svg { width: 18px; height: 18px; }
.comment-tools .icon-btn:active { background: rgba(0,0,0,.06); }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; margin-top: 2px; }
.comment-btns { display: flex; gap: 8px; margin-top: 8px; }
