/* OwnerCare Pro
   Materials of a finished pool: plaster (base), deep end (ink), cobalt waterline tile (action),
   travertine coping (the frame), test-kit yellow (due now), phenol red (problems).
   The one bold element is the waterline tile band; everything else stays quiet. */
:root{
  --bg:#F5F7F8; --surface:#FFFFFF; --ink:#0C3552; --muted:#58707F; --line:#D6DEE3;
  --accent:#1D6FB8; --accent-ink:#FFFFFF; --soft:#E6EFF7;
  --coping:#E6DFD3; --coping-line:#D3C9B8;
  --tile-1:#1D6FB8; --tile-2:#4B93CF; --tile-3:#0F4F8A; --tile-4:#8DBCE3; --grout:#F5F7F8;
  --sun:#9A6B00; --sun-fill:#F2C230; --sun-soft:#FCF3D2; --ok:#2A7A4F; --ok-soft:#E0F1E7; --danger:#B8362E; --danger-soft:#F8E3E1;
  --radius-lg:10px; --radius-sm:6px;
  --head:"Archivo", "Segoe UI", system-ui, sans-serif;
  --body:"Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#08202F; --surface:#0D2A3D; --ink:#E3EDF3; --muted:#8FA8B8; --line:#1C3D52;
    --accent:#5EA4E6; --accent-ink:#06223A; --soft:#12354D;
    --coping:#0B2536; --coping-line:#1C3D52;
    --tile-1:#2F7FC6; --tile-2:#5EA4E6; --tile-3:#1B5C99; --tile-4:#8DBCE3; --grout:#0B2536;
    --sun:#F2C230; --sun-fill:#F2C230; --sun-soft:#352B0C; --ok:#62C38E; --ok-soft:#113424; --danger:#EC7F76; --danger-soft:#3A1715;
  }
}
:root[data-theme="dark"]{
  --bg:#08202F; --surface:#0D2A3D; --ink:#E3EDF3; --muted:#8FA8B8; --line:#1C3D52;
  --accent:#5EA4E6; --accent-ink:#06223A; --soft:#12354D;
  --coping:#0B2536; --coping-line:#1C3D52;
  --tile-1:#2F7FC6; --tile-2:#5EA4E6; --tile-3:#1B5C99; --tile-4:#8DBCE3; --grout:#0B2536;
  --sun:#F2C230; --sun-fill:#F2C230; --sun-soft:#352B0C; --ok:#62C38E; --ok-soft:#113424; --danger:#EC7F76; --danger-soft:#3A1715;
}
*,*::before,*::after{box-sizing:inherit}
html{scroll-padding-top:env(safe-area-inset-top,0px); height:100%}
body{margin:0; min-height:100%; background:var(--bg); color:var(--ink); font:16px/1.55 var(--body)}
/* headings: wide and heavy, like lettering on a service truck door */
h1,h2,h3{font-family:var(--head); line-height:1.1; margin:0}
h1{font-size:2rem; font-weight:800; font-stretch:118%; letter-spacing:-0.015em}
h2{font-size:1.2rem; font-weight:700; font-stretch:112%}
h3{font-size:1.02rem; font-weight:600}
a{color:var(--accent); text-underline-offset:2px}
img{max-width:100%}
button,input,select,textarea{font:inherit; color:inherit}
:focus-visible{outline:3px solid var(--accent); outline-offset:2px}
.num{font-variant-numeric:tabular-nums}

/* The waterline tile band: two courses of small glazed squares with grout between. */
.tileband{height:22px; background-color:var(--grout);
  background-image:
    repeating-linear-gradient(90deg, var(--tile-1) 0 9px, transparent 9px 11px, var(--tile-2) 11px 20px, transparent 20px 22px, var(--tile-3) 22px 31px, transparent 31px 33px),
    repeating-linear-gradient(90deg, var(--tile-2) 0 9px, transparent 9px 11px, var(--tile-1) 11px 20px, transparent 20px 22px, var(--tile-4) 22px 31px, transparent 31px 33px, var(--tile-3) 33px 42px, transparent 42px 44px);
  background-size:100% 9px, 100% 9px; background-position:0 1px, 5px 12px; background-repeat:no-repeat}

/* brand mark: four tiles, one lighter */
.brand .mark{width:22px; height:22px; flex:none}
.brand .mark{background:
  linear-gradient(var(--tile-1),var(--tile-1)) 0 0/10px 10px no-repeat,
  linear-gradient(var(--tile-4),var(--tile-4)) 12px 0/10px 10px no-repeat,
  linear-gradient(var(--tile-3),var(--tile-3)) 0 12px/10px 10px no-repeat,
  linear-gradient(var(--tile-2),var(--tile-2)) 12px 12px/10px 10px no-repeat}

.app{display:grid; grid-template-columns:232px 1fr; min-height:100vh}
.nav{background:var(--coping); border-right:1px solid var(--coping-line); padding:0 12px 22px; display:flex; flex-direction:column; gap:2px; position:sticky; top:env(safe-area-inset-top,0px); height:100vh}
.nav .tileband{margin:0 -12px 18px}
.brand{font-family:var(--head); font-size:1.12rem; font-weight:800; font-stretch:115%; white-space:nowrap; padding:0 10px 18px; display:flex; align-items:center; gap:10px; letter-spacing:-0.01em}
.nav a{display:flex; justify-content:space-between; align-items:center; text-decoration:none; color:var(--ink); padding:8px 12px; border-radius:var(--radius-sm); font-weight:500}
.nav a:hover{background:color-mix(in srgb, var(--ink) 7%, transparent)}
.nav a.on{background:var(--ink); color:var(--bg)}
.nav .count{font-size:.78rem; background:var(--sun-fill); color:#2A2000; border-radius:999px; padding:0 8px; font-weight:700}
.nav .foot{margin-top:auto; font-size:.85rem; color:var(--muted); padding:10px 12px}
main{padding:36px clamp(16px,4vw,52px) 80px; max-width:1100px; width:100%}
main > .tileband{display:none}
.pagehead{display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin-bottom:26px}
.pagehead p{margin:8px 0 0; color:var(--muted); max-width:62ch}
.pagehead p:first-child{margin:0 0 6px}

.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px 22px}
.panel > h2{margin-bottom:6px}
.stack{display:grid; gap:20px}
.grid2{display:grid; grid-template-columns:3fr 2fr; gap:20px; align-items:start}

/* dashboard summary: a sentence, not a row of big numbers */
.summary{font-size:1.15rem; line-height:1.5; margin:0; max-width:60ch}
.summary b{font-weight:700; font-variant-numeric:tabular-nums}
.summary .quiet{color:var(--muted)}

.testbar{border:1px solid var(--sun-fill); border-left:6px solid var(--sun-fill); background:var(--sun-soft); border-radius:var(--radius-sm); padding:14px 18px; display:flex; flex-wrap:wrap; gap:12px 20px; align-items:center}
.testbar .when{font-family:var(--head); font-weight:700; font-stretch:110%; font-size:1.1rem}
.testbar small{display:block; color:var(--muted); font-size:.85rem}
.testbar .btns{display:flex; gap:8px; flex-wrap:wrap}

.btn{border:1px solid var(--line); background:var(--surface); padding:8px 15px; border-radius:var(--radius-sm); cursor:pointer; font-weight:600; text-decoration:none; color:var(--ink); display:inline-flex; align-items:center; gap:6px; white-space:nowrap; transition:background-color .15s, border-color .15s}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}
.btn.primary:hover{background:color-mix(in srgb, var(--accent) 86%, var(--ink))}
.btn.sun{background:var(--sun-fill); border-color:var(--sun-fill); color:#2A2000}
.btn.danger{color:var(--danger); border-color:var(--danger-soft)}
.btn.small{padding:4px 10px; font-size:.86rem; font-weight:500}
.btn:disabled{opacity:.5; cursor:not-allowed}

.list{list-style:none; margin:0; padding:0}
.list li{display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--line); align-items:center}
.list li:first-child{border-top:0}
.sub{color:var(--muted); font-size:.9rem}
.empty{color:var(--muted); padding:8px 0; max-width:48ch}

/* coming up: one row per date, names beside it */
.agenda{list-style:none; margin:4px 0 0; padding:0}
.agenda > li{display:grid; grid-template-columns:5.2rem 1fr; gap:14px; padding:12px 0; border-top:1px solid var(--line)}
.agenda > li:first-child{border-top:0}
.agenda .day{font-family:var(--head); font-weight:800; font-stretch:115%; font-size:1.05rem; line-height:1.15; font-variant-numeric:tabular-nums}
.agenda .day small{display:block; font-weight:500; font-stretch:100%; font-size:.8rem; color:var(--muted)}
.agenda .day.due{color:var(--sun)}
.agenda .who{display:grid; gap:4px}
.agenda .who div{display:flex; flex-wrap:wrap; gap:0 8px; align-items:baseline}
.agenda .who .sub{font-size:.88rem}

.chip{display:inline-block; font-size:.78rem; font-weight:600; padding:2px 9px; border-radius:4px; background:var(--soft); color:var(--accent); white-space:nowrap}
.chip.scheduled{background:var(--soft); color:var(--accent)}
.chip.due{background:var(--sun-soft); color:var(--sun)}
.chip.sent{background:var(--ok-soft); color:var(--ok)}
.chip.skipped,.chip.canceled{background:color-mix(in srgb, var(--line) 70%, transparent); color:var(--muted)}
.chip.new{background:var(--sun-soft); color:var(--sun)}
.chip.done{background:var(--ok-soft); color:var(--ok)}
.chip.declined{background:var(--danger-soft); color:var(--danger)}

.tablewrap{overflow-x:auto}
table{border-collapse:collapse; width:100%; font-size:.95rem}
th,td{text-align:left; padding:10px 12px; border-top:1px solid var(--line); vertical-align:top}
th{font-weight:600; color:var(--muted); border-top:0; font-size:.85rem}
tr.link{cursor:pointer}
tr.link:hover td{background:var(--soft)}

label{display:block; font-weight:600; font-size:.9rem; margin-bottom:4px}
.field{margin-bottom:14px}
.field .hint{color:var(--muted); font-size:.85rem; margin-top:3px}
input[type=text],input[type=email],input[type=tel],input[type=password],input[type=date],input[type=number],select,textarea{width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--bg)}
input[type=text]:focus,input[type=email]:focus,input[type=tel]:focus,input[type=password]:focus,input[type=date]:focus,input[type=number]:focus,select:focus,textarea:focus{border-color:var(--accent); background:var(--surface)}
textarea{min-height:80px; resize:vertical}
.row{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:0 14px}
.check{display:flex; gap:10px; align-items:flex-start; font-weight:400}
.check input{margin-top:4px; accent-color:var(--accent)}
.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px}

/* the waterline: an install's reminder timeline */
.waterline{position:relative; height:56px; margin:12px 6px 4px}
.waterline .line{position:absolute; left:0; right:0; top:22px; height:4px; border-radius:2px; background:linear-gradient(90deg, var(--tile-3), var(--tile-4))}
.waterline .dot{position:absolute; top:16px; width:16px; height:16px; margin-left:-8px; border-radius:3px; border:3px solid var(--surface); background:var(--accent)}
.waterline .dot.sent{background:var(--ok)}
.waterline .dot.skipped{background:var(--muted)}
.waterline .dot.due{background:var(--sun-fill)}
.waterline .today{position:absolute; top:4px; bottom:4px; width:2px; background:var(--sun-fill)}
.waterline .today span{position:absolute; top:-4px; left:6px; font-size:.75rem; color:var(--sun); font-weight:700; white-space:nowrap}
.waterline .ends{position:absolute; top:36px; left:0; right:0; display:flex; justify-content:space-between; font-size:.75rem; color:var(--muted)}

.tabs{display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px}
.tabs a{padding:7px 14px; border-radius:var(--radius-sm); border:1px solid var(--line); text-decoration:none; color:var(--ink); font-weight:500; background:var(--surface)}
.tabs a.on{background:var(--ink); color:var(--bg); border-color:var(--ink)}

.step{border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); margin-bottom:10px}
.step summary{cursor:pointer; list-style:none; padding:14px 18px; display:flex; justify-content:space-between; gap:12px; align-items:center}
.step summary::-webkit-details-marker{display:none}
.step[open] summary{border-bottom:1px solid var(--line)}
.step .body{padding:16px 18px}
.step.off summary h3{color:var(--muted); text-decoration:line-through}

.msg{border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); padding:14px 16px; margin-bottom:10px}
.msg .meta{display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; font-size:.88rem; color:var(--muted); margin-bottom:8px}
.bubble{background:var(--soft); border-radius:16px 16px 16px 4px; padding:10px 14px; max-width:520px; white-space:pre-wrap}
.emailbox{border-left:3px solid var(--accent); padding:4px 0 4px 12px; white-space:pre-wrap; max-width:72ch}

.saved{font-size:.8rem; color:var(--muted)}
.toast{position:fixed; left:50%; transform:translateX(-50%); bottom:calc(24px + env(safe-area-inset-bottom,0px)); background:var(--ink); color:var(--bg); padding:10px 18px; border-radius:var(--radius-sm); font-weight:500; z-index:50; max-width:90vw}

/* homeowner page: the installer's brand color drives the header and its tile band */
.ho{min-height:100vh; background:var(--bg); --brand:#1D6FB8}
.ho .testnote{background:var(--sun-soft); color:var(--ink); font-size:.88rem; padding:8px 16px; text-align:center}
.ho header{background:var(--brand); color:#fff; padding:0 20px}
.ho header .inner{padding:26px 0 72px}
.ho header .tileband{--tile-1:color-mix(in srgb, var(--brand) 78%, #fff); --tile-2:color-mix(in srgb, var(--brand) 55%, #fff); --tile-3:color-mix(in srgb, var(--brand) 80%, #000); --tile-4:color-mix(in srgb, var(--brand) 35%, #fff); --grout:#fff; margin:0 -20px}
.ho .inner{max-width:560px; margin:0 auto}
.ho .logo{font-family:var(--head); font-size:1.3rem; font-weight:800; font-stretch:115%; display:flex; align-items:center; gap:12px}
.ho .logo img{height:42px; border-radius:6px; background:#fff; padding:2px}
.ho .card{max-width:560px; margin:-48px auto 20px; background:var(--surface); border-radius:var(--radius-lg); border:1px solid var(--line); padding:24px; box-shadow:0 12px 32px color-mix(in srgb, var(--ink) 12%, transparent); position:relative}
.ho .card + .card{margin-top:0; box-shadow:none}
.ho .card h1{font-size:1.9rem}
.ho .card .sub{font-size:1rem; margin:6px 0 18px}
.ho .card h1 + .sub{margin-bottom:0}
.ho .tip{background:var(--soft); border-left:4px solid var(--brand); border-radius:var(--radius-sm); padding:14px 16px; margin:16px 0 4px}
.ho .cta{background:var(--brand); border-color:var(--brand); color:#fff; width:100%; justify-content:center; padding:13px; font-size:1.05rem}
.ho footer{text-align:center; color:var(--muted); font-size:.85rem; padding:10px 20px 40px}
.ho .optout{display:flex; gap:14px; justify-content:center; flex-wrap:wrap}
.ho .optout button{background:none; border:0; color:var(--muted); text-decoration:underline; cursor:pointer; font-size:.88rem}

.onboard{max-width:620px; margin:0 auto; padding:40px 20px 80px}
.onboard .intro{margin:10px 0 26px; color:var(--muted)}

.flash{border-radius:var(--radius-sm); padding:10px 14px; margin-bottom:16px; background:var(--ok-soft); color:var(--ink); border:1px solid color-mix(in srgb, var(--ok) 30%, transparent)}
.flash.error{background:var(--danger-soft); border-color:color-mix(in srgb, var(--danger) 30%, transparent)}
.inline{display:inline}
.nav form{margin:0}
.nav .linkbtn{background:none; border:0; padding:0; color:var(--muted); cursor:pointer; text-decoration:underline; font-size:.85rem}
.status-banner{font-size:.9rem; color:var(--muted); display:flex; flex-wrap:wrap; gap:4px 18px; margin:0}
.status-banner strong{color:var(--ink); font-weight:600}
.status-banner .dry{color:var(--sun)}

/* login and signup: coping frame with the tile band across the top */
.authpage{min-height:100vh; background:var(--coping)}
.authpage > .tileband{height:22px}
.auth{max-width:460px; margin:0 auto; padding:44px 20px 80px}
.auth .brand{font-size:1.3rem; padding:0; margin-bottom:28px}
.auth h1{font-size:2.1rem}
.auth .lede{color:var(--muted); margin:10px 0 0}
.auth .panel{margin-top:20px}
.signup{max-width:640px}
.rule{border:0; border-top:1px solid var(--line); margin:18px 0}

@media (max-width:820px){
  .app{grid-template-columns:1fr}
  .nav{position:fixed; top:auto; bottom:0; left:0; right:0; height:auto; flex-direction:row; justify-content:space-around; padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px)); border-right:0; border-top:1px solid var(--coping-line); z-index:20; gap:0}
  .nav .brand,.nav .foot,.nav .tileband{display:none}
  .nav a{flex-direction:column; font-size:.72rem; padding:6px 6px; gap:2px}
  .nav .count{font-size:.65rem; padding:0 6px}
  main{padding:0 16px 110px}
  main > .tileband{display:block; margin:0 -16px 22px}
  .grid2{grid-template-columns:1fr}
  h1{font-size:1.6rem}
  .hide-sm{display:none}
  .toast{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion: reduce){*{transition:none!important; animation:none!important}}
