:root {
  color-scheme: light;
  --teal: #0f5f59; --teal-d: #0a4541; --teal-l: #e2efed;
  --sand: #e9ddd0; --bg: #f5f2ed; --card: #fff; --ink: #1d2b2a; --mut: #5d6b69; --line: #e2dcd3;
  --ok: #1e7d4f; --ok-bg: #e3f3ea; --warn: #8a5200; --warn-bg: #fdefd3; --bad: #b3261e; --bad-bg: #fbe4e1;
  --info: #235a85; --info-bg: #e4eef6;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.loading { padding: 48px 16px; text-align: center; color: var(--mut); }
.mut { color: var(--mut); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* Brand */
.brand { font-weight: 800; letter-spacing: .14em; color: var(--teal); font-size: 20px; line-height: 1; }
.brand small { display: block; font-weight: 600; letter-spacing: .16em; font-size: 9.5px; color: var(--mut); margin-top: 4px; text-transform: uppercase; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--teal); background: var(--teal); color: #fff; font-weight: 650; text-decoration: none; }
.btn:hover { background: var(--teal-d); }
.btn.ghost { background: transparent; color: var(--teal); }
.btn.ghost:hover { background: var(--teal-l); }
.btn.quiet { border-color: var(--line); background: #fff; color: var(--ink); font-weight: 550; }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; border-radius: 16px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; font-size: inherit; }

/* Chips */
.chip { display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--sand); color: var(--ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.soon { background: var(--warn-bg); color: var(--warn); }
.chip.overdue, .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.nodate, .chip.plain { background: #ece8e1; color: var(--mut); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.note { background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }

/* Chooser */
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 640px; }
.hero { padding: 28px 0 20px; }
.hero h1 { font-size: 30px; margin: 18px 0 6px; letter-spacing: -.01em; }
.pick { display: block; text-decoration: none; color: inherit; margin-top: 14px; }
.pick b, .pick-group > b { display: block; font-size: 19px; }
.pick span, .pick-group > span { color: var(--mut); font-size: 15px; }
a.pick:hover { border-color: var(--teal); }
.pick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.rules { margin-top: 14px; }
.rules summary { cursor: pointer; font-weight: 650; }
.rules ul { margin: 10px 0 0; padding-left: 20px; color: var(--mut); font-size: 15px; }
.rules li { margin: 4px 0; }
.foot { margin: 22px 0 30px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; color: var(--mut); font-size: 13px; }
.lock { max-width: 380px; margin: 12vh auto; padding: 16px; text-align: center; }
.lock input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 16px 0 10px; text-align: center; }

/* Gardener phone view */
.phone { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 40px; }
.g-head { background: var(--teal); color: #fff; padding: 16px 16px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-head b { display: block; font-size: 20px; }
.g-head span { font-size: 13.5px; opacity: .85; }
.g-head a { color: #fff; font-size: 13.5px; opacity: .9; }
.g-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--teal-d); }
.g-tabs button { border: 0; background: transparent; color: #fff; opacity: .7; padding: 12px; font-weight: 650; border-bottom: 3px solid transparent; }
.g-tabs button.on { opacity: 1; border-bottom-color: var(--sand); }
.g-body { padding: 14px 14px 0; }
.banner { margin: 12px 14px 0; background: #fff; border: 2px solid var(--teal); border-radius: var(--r); padding: 14px; }
.banner b { display: block; font-size: 17px; }
.search { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.sub { margin: 18px 2px 8px; font-size: 12.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.rowbtn { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.rowbtn b { display: block; }
.rowbtn .mut { font-size: 14px; }
.rowbtn .chips { justify-content: flex-end; flex-shrink: 0; max-width: 46%; }
.kv { display: grid; grid-template-columns: 118px 1fr; gap: 8px 12px; margin: 14px 0; font-size: 15px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; }
.backlink { display: inline-block; margin-bottom: 10px; background: none; border: 0; padding: 6px 0; color: var(--teal); font-weight: 650; }
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 650; color: var(--mut); margin-bottom: 5px; }
.field input, .field textarea, .field select, .inp { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 22px; }
.stepper b { font-size: 20px; min-width: 20px; text-align: center; }
.tasks { display: flex; flex-wrap: wrap; gap: 8px; }
.tasks button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px; font-size: 14.5px; }
.tasks button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--sand); border: 1px solid var(--line); padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; }
.addphoto { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--teal); background: var(--teal-l); color: var(--teal); font-weight: 650; font-size: 13.5px; }
.sum { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.sum b { font-size: 18px; }
.total { display: flex; justify-content: space-between; font-weight: 700; padding: 12px 2px; }
.done { text-align: center; padding: 36px 8px 8px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 38px; display: grid; place-items: center; margin: 0 auto 14px; }

/* Office */
.o-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.o-top .in { max-width: 1180px; margin: 0 auto; padding: 12px 16px 0; }
.o-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--mut); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--teal); border-bottom-color: var(--teal); }
.tabs .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { display: block; font-size: 26px; line-height: 1.15; }
.stat span { font-size: 13.5px; color: var(--mut); }
.stat.alert b { color: var(--bad); }
.h2 { font-size: 19px; margin: 6px 0 10px; }
.job { margin-bottom: 12px; }
.job-h { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; justify-content: space-between; }
.job-h h3 { font-size: 18px; }
.job-b { margin-top: 14px; display: grid; gap: 14px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos .thumb { width: 110px; height: 84px; cursor: zoom-in; }
.docs { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .docs { grid-template-columns: 1fr 1fr; } }
.docwrap > .hrs { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14.5px; }
.hrs input { width: 86px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13.5px; position: relative; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.doc-tag { font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); }
.doc h4 { color: var(--teal); font-size: 16px; margin-bottom: 8px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 12px; }
.doc-meta span { display: block; color: var(--teal); font-weight: 650; font-size: 11.5px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { text-align: left; color: var(--teal); font-size: 11.5px; border-bottom: 2px solid var(--ink); padding: 4px 4px 4px 0; }
.doc td { padding: 6px 4px 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc td.desc { white-space: pre-line; }
.doc .tot td { border: 0; padding: 3px 4px 3px 0; }
.doc .tot.grand td { font-weight: 750; border-top: 1px solid var(--ink); padding-top: 6px; }
.doc-foot { margin-top: 10px; color: var(--mut); font-size: 12px; }
.tblwrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 760px; }
table.t th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: #fff; }
table.t tfoot td { font-weight: 750; background: #faf8f4; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; }
.filters input { flex: 1; min-width: 180px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.line { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.feed { display: grid; gap: 8px; }
.feed .card { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
.sms { background: #e9f1ff; border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 14.5px; max-width: 520px; margin-top: 8px; }
.empty { text-align: center; color: var(--mut); padding: 34px 12px; }

/* Modal and toast */
.modal { position: fixed; inset: 0; background: rgba(20,30,29,.55); z-index: 20; display: grid; place-items: center; padding: 14px; overflow: auto; }
.modal .box { background: var(--bg); border-radius: 16px; padding: 16px; width: 100%; max-width: 920px; max-height: 92vh; overflow: auto; }
.modal .box.img { max-width: 900px; background: #000; padding: 0; }
.modal .box.img img { display: block; width: 100%; height: auto; max-height: 88vh; object-fit: contain; }
.modal .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }
