:root{color-scheme:light;--paper:#f8f7f0;--card:#fffef8;--ink:#192e23;--quiet:#546457;--line:#dce2d5;--forest:#204c37;--mint:#e4efd8;--orange:#995217;font:16px/1.45 system-ui,-apple-system,sans-serif;background:var(--paper);color:var(--ink)}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer;border:0;background:none}a{text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--forest);outline-offset:3px}[hidden]{display:none!important}h1,h2,p{margin:0}h1{font-size:clamp(2rem,8vw,3rem);line-height:1.05;letter-spacing:-.055em}h2{font-size:1.15rem;letter-spacing:-.025em}
.mast{max-width:600px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:calc(14px + env(safe-area-inset-top)) 20px 14px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;font-size:1.2rem;line-height:1.1;font-weight:800}.brand small{display:block;font-size:.58rem;letter-spacing:.15em;margin-top:4px;color:var(--quiet)}.mark{display:grid;place-items:center;border-radius:11px;width:38px;height:38px;background:var(--forest);color:white}.badge{font-size:.72rem;font-weight:700;background:var(--mint);border-radius:100px;padding:5px 9px}
main{max-width:600px;margin:auto;padding:23px 20px calc(94px + env(safe-area-inset-bottom))}.kicker{font-size:.67rem;font-weight:800;letter-spacing:.17em;color:var(--forest);margin-bottom:7px}.headline,.section-head,.calendar-bar,.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.primary,.secondary,.icon{display:inline-flex;align-items:center;justify-content:center;min-height:44px;border-radius:12px;padding:0 13px;font-weight:700}.primary{background:var(--forest);color:white}.secondary,.icon{background:var(--mint);color:var(--forest)}.icon{min-width:44px;font-size:1.4rem}.calendar-bar{margin-top:18px}.date-control{position:relative;overflow:hidden;display:grid;place-items:center;min-height:44px;padding:0 10px}.date-control input{position:absolute;inset:0;opacity:0;min-height:44px;width:100%}.date-control input::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:100%;height:100%}.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:8px}.week button{min-height:56px;border-radius:11px;background:var(--card);border:1px solid var(--line);font-weight:750}.week button span{display:block;font-size:.67rem;color:var(--quiet)}.week button[aria-pressed=true]{background:var(--forest);color:white;border-color:var(--forest)}.week button[aria-pressed=true] span{color:#e3efdb}
.section-head{margin:24px 0 8px}.section-head select{width:auto;font-size:.85rem}.job{border-top:1px solid var(--line);padding:13px 0 8px;display:grid;grid-template-columns:65px minmax(0,1fr);gap:11px}.job time{font-size:.76rem;font-weight:750;font-variant-numeric:tabular-nums;padding-top:3px}.job time small{display:block;color:var(--quiet);margin-top:4px}.job-body{border-left:3px solid var(--forest);padding-left:10px}.job[data-kind=Quote] .job-body{border-color:var(--orange)}.job-title,.address{display:block;text-align:left;padding:0;width:100%;overflow-wrap:anywhere}.job-title{font-weight:800;min-height:36px}.address{color:var(--forest);font-size:.83rem;min-height:44px;text-decoration:underline;text-underline-offset:3px}.job-meta,.intro,.panel p,.empty,.note{color:var(--quiet);font-size:.87rem}.note{margin-bottom:5px;white-space:pre-wrap;overflow-wrap:anywhere}.empty{padding:20px 0;border-top:1px solid var(--line)}.intro{margin:10px 0 15px}.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}.actions .primary{flex:1}.panel{background:var(--card);border:1px solid var(--line);border-radius:15px;padding:15px;margin:16px 0}.panel p{margin:8px 0 12px}
.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:13px 0}.filters .full{grid-column:1/-1}label{display:grid;gap:4px;font-size:.83rem;font-weight:650;min-width:0}.check{display:flex;align-items:center;min-height:44px;grid-column:1/-1}.check input{width:18px;min-height:18px;accent-color:var(--forest)}input,select,textarea{min-width:0;width:100%;background:var(--card);border:1px solid var(--line);border-radius:9px;min-height:44px;padding:8px;color:var(--ink);font-size:16px}input[type=date],input[type=datetime-local]{-webkit-appearance:none}textarea{resize:vertical}.error{color:#9a2c1e}
nav{position:fixed;z-index:2;bottom:0;left:0;right:0;display:flex;justify-content:center;gap:8px;background:var(--card);border-top:1px solid var(--line);padding:6px 12px calc(6px + env(safe-area-inset-bottom))}nav button{width:min(28%,170px);min-height:51px;border-radius:10px;color:var(--quiet);font-size:.78rem;font-weight:700}nav button span{display:block;font-size:1.2rem;line-height:1.1}nav button[aria-current]{background:var(--mint);color:var(--forest)}
dialog{width:min(calc(100% - 24px),480px);max-height:calc(100dvh - 30px);padding:18px;border:1px solid var(--line);border-radius:19px;background:var(--paper);color:var(--ink);overflow:auto}dialog::backdrop{background:#15271bc0}#notice{position:fixed;z-index:4;top:calc(env(safe-area-inset-top) + 12px);left:50%;transform:translateX(-50%);width:min(calc(100% - 24px),460px);padding:11px 48px 11px 14px;border-radius:12px;background:var(--forest);color:white;box-shadow:0 4px 18px #0003}#notice span{display:block;font-size:.85rem}#notice button{position:absolute;top:0;right:0;width:44px;height:44px;color:white;font-size:1.4rem}
main{padding-top:calc(12px + env(safe-area-inset-top))}
.segments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:3px;border-radius:24px;background:#e5e9e0;box-shadow:inset 0 1px 3px #15271b22;margin-bottom:18px}
.segments button{min-height:40px;border-radius:21px;font-weight:700;font-size:.88rem;color:var(--quiet)}
.segments button[aria-pressed=true]{background:var(--card);box-shadow:0 1px 4px #15271b35;color:var(--forest)}
.calendar-bar{margin-top:10px}.week{margin-top:5px}.week button{min-height:47px;padding:2px 0}
.week.month-grid button{min-height:42px}.week small{text-align:center;color:var(--quiet);font-size:.67rem}
.week button.outside:not([aria-pressed=true]){opacity:.52}
.dots{display:flex;justify-content:center;align-items:center;gap:3px;height:8px}
.dots i{height:5px;width:5px;border-radius:50%;box-shadow:0 0 0 1px #fff4}
#week,.calendar-grip{touch-action:none;user-select:none}
.calendar-grip{min-height:30px;width:100%;display:grid;place-items:center}
.calendar-grip span{width:35px;height:4px;border-radius:10px;background:#a6b5a7}
.section-head{margin:5px 0 5px}
.job{position:relative;grid-template-columns:57px minmax(0,1fr) 32px;gap:7px;padding:6px 0 5px;touch-action:pan-y}
.job time{padding-top:4px}.job time small{margin-top:1px}.job-body{padding-left:8px}
.job-title{min-height:26px;font-size:.94rem}.job-meta{font-size:.75rem}.address{min-height:28px;display:flex;align-items:center;line-height:1.2}
.job[data-status=Done] .job-body{border-color:#4c7860}.job[data-status=Done] .job-meta{color:#376650}
.job[data-status=Tentative] .job-body{border-color:#6c649b;border-left-style:dashed}
.job[data-status=Postponed] .job-body{border-color:#a96122}.job[data-status=Postponed] .job-meta{color:#8b491b}
.job[data-status=Cancelled] .job-title{text-decoration:line-through}.job[data-status=Cancelled] .job-body{border-color:#9ea8a0}
.more{min-height:34px;padding:0;font-size:1.3rem;color:var(--quiet);align-self:start}
.swipe-actions{grid-column:2/-1;display:flex;justify-content:flex-end;gap:4px}
.swipe-actions button{min-height:36px;border-radius:8px;padding:0 8px;font-size:.76rem;font-weight:700;background:var(--mint)}
.swipe-actions button[data-action=Done]{background:var(--forest);color:white}
.swipe-actions button[data-action=Postponed]{background:#f6e2cd;color:#74380d}
.swipe-actions button[data-action=Tentative]{background:#e8e4f3;color:#52417a}
.travel{display:block;text-align:right;font-size:.71rem;font-weight:650;color:var(--quiet);padding:4px 7px;border-radius:5px;background:#edf0e7;margin:1px 0 2px auto;width:max-content}
#history-jobs .job{grid-template-columns:72px minmax(0,1fr);padding:7px 0}
.motto-ideas{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.motto-ideas button{font-size:.68rem;min-height:32px;background:var(--mint);border-radius:9px;padding:0 8px}
.panel>label{margin-top:7px}.panel a,.detail-map{text-decoration:underline;color:var(--forest)}
.detail-map{font-size:.82rem}.align-end{align-self:end}.type-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:8px;font-size:.86rem}.type-row button{min-height:44px;color:#8b491b}
#type-form{flex-wrap:nowrap}#type-form input{flex:1}#type-form button{flex:0 0 auto}
#address-suggestions{border:1px solid var(--line);border-radius:8px;background:var(--card);overflow:hidden}
#address-suggestions button{display:block;width:100%;min-height:38px;text-align:left;padding:4px 8px;border-bottom:1px solid var(--line);font-size:.83rem}
#address-hint{color:var(--quiet);font-weight:400}

/* Schedule */
#schedule {
  --toolbar-height: 110px;
}
body:has(#schedule:not([hidden])) main {
  padding-top: 0;
}
.schedule-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0 -8px;
  padding: calc(5px + env(safe-area-inset-top)) 8px 5px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.schedule-top, .schedule-tools, .schedule-add, .calendar-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}
.schedule-top, .schedule-tools { justify-content: space-between; }
.schedule-brand {
  color: var(--forest);
  font-size: .88rem;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}
.schedule-brand span {
  color: var(--quiet);
  font-size: .64rem;
  letter-spacing: .06em;
  margin-left: 5px;
}
.schedule-top #today { font-size: .78rem; }
.schedule-toolbar .calendar-bar { margin: 1px 0 0; }
.schedule-toolbar .date-control { padding: 0; min-width: 0; }
.schedule-toolbar .date-control:focus-within {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}
.schedule-toolbar h1 {
  font-size: clamp(1.4rem, 7vw, 2.65rem);
  line-height: 1.12;
}
.schedule-toolbar #year { color: var(--quiet); font-weight: 500; }
.schedule-toolbar .icon {
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 44px;
  padding: 0 5px;
}
.schedule-calendar {
  margin-top: 10px;
  padding: 5px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 2px 8px #192e2309;
}
.schedule-calendar .week { gap: 0; margin: 0; }
.schedule-calendar #week { touch-action: pan-y pinch-zoom; }
.schedule-calendar .week small {
  padding: 7px 0 4px;
  text-transform: uppercase;
  letter-spacing: .045em;
  font-weight: 700;
}
.schedule-calendar .week button {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 44px;
  padding: 2px 2px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.schedule-calendar .week .weekend { background: #f3f3e9; }
.schedule-calendar .week .selected-week { background: #eef2e6; }
.schedule-calendar .week button.selected-week:nth-of-type(7n + 1) { border-radius: 8px 0 0 8px; }
.schedule-calendar .week button.selected-week:nth-of-type(7n) { border-radius: 0 8px 8px 0; }
.schedule-calendar .week button.outside:not([aria-pressed=true]) { color: #747d70; opacity: 1; }
.week .date-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: .98rem;
  line-height: 1;
  color: inherit;
}
.schedule-calendar .date-number { font-size: 1.02rem; font-weight: 600; }
.schedule-calendar [aria-current=date] .date-number {
  color: var(--forest);
  font-weight: 800;
  border: 1px solid var(--forest);
  border-radius: 50%;
}
.schedule-calendar button[aria-pressed=true] .date-number {
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 800;
}
.week .dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 7px;
  height: auto;
  padding: 2px 0 0;
}
.week .dots i { flex: 0 0 5px; box-shadow: none; }
#history-grid button { display: grid; justify-items: center; align-content: start; }
.schedule-calendar .calendar-grip { min-height: 33px; }
.schedule-calendar .calendar-grip span { width: 30px; }
.schedule-tools .segments {
  margin: 0;
  box-shadow: none;
  flex: 1;
  max-width: 310px;
}
.schedule-tools .segments button { padding: 0 2px; min-height: 38px; font-size: .72rem; }
.schedule-add .secondary { font-size: 1.18rem; min-width: 44px; padding: 0; }
.schedule-add .primary { font-size: .72rem; padding: 0 7px; white-space: nowrap; }
.agenda { margin-top: 8px; }
.agenda-day { padding-bottom: 8px; }
.agenda-day + .agenda-day { border-top: 1px solid var(--line); }
.agenda-day h2 {
  position: sticky;
  z-index: 1;
  top: var(--toolbar-height);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 0 7px;
  background: var(--paper);
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.agenda-day h2.is-today { color: var(--forest); }
.agenda-day h2 time { color: var(--quiet); font-size: .8rem; font-weight: 500; text-transform: none; }
.agenda .job {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  padding: 7px 6px 7px 9px;
  margin-bottom: 6px;
}
.agenda .job time { color: var(--forest); padding-top: 8px; }
.agenda .job .job-body { border-color: var(--job-color); padding-left: 8px; min-width: 0; }
.agenda .job-title { font-weight: 750; padding: 4px 0 2px; }
.agenda .job-meta { line-height: 1.25; }
.agenda .address { min-height: 32px; }
.agenda .travel { margin: 0 1px 5px auto; }
.agenda .empty { border: 0; padding: 6px 0 4px; }
body:has(#schedule:not([hidden])) nav { z-index: 3; }
@media (max-width: 360px) {
  body:has(#schedule:not([hidden])) main { padding-inline: 12px; }
  .schedule-calendar { padding-inline: 4px; }
}


/* TradieDay visual polish — inspired by the clarity of premium calendar apps.
   Presentation-only overrides: existing controls, storage, and job logic unchanged. */
:root {
  --paper:#f5f6f8;
  --card:#ffffff;
  --ink:#20252e;
  --quiet:#626c79;
  --line:#e3e7ec;
  --forest:#2563a6;
  --mint:#eaf2fc;
  --orange:#a05a21;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  line-height:1.48;
  font-synthesis:none;
  -webkit-font-smoothing:antialiased;
}
body { min-height:100dvh; }
h1,h2 { letter-spacing:-.035em; }
button,input,select,textarea { font-weight:inherit; }
button { transition:background-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease; }
button:active:not(:disabled) { transform:scale(.975); }
:focus-visible { outline-offset:3px; }
.primary,.secondary,.icon { border-radius:13px; font-weight:700; }
.primary { box-shadow:0 2px 5px #214d821a; }
.secondary,.icon { border:1px solid #dce5f0; }
.secondary:hover,.icon:hover { background:#dceafb; }
.primary:hover { background:#1d5089; }
main { max-width:660px; }
.schedule-toolbar {
  margin:0 -4px;
  padding:calc(9px + env(safe-area-inset-top)) 4px 11px;
  background:var(--paper);
  border-color:var(--line);
}
.schedule-top { gap:12px; }
.schedule-brand { color:var(--ink);font-size:1rem;font-weight:800;letter-spacing:-.025em; }
.schedule-brand span { color:var(--quiet);font-weight:600;letter-spacing:.075em; }
.schedule-toolbar h1 { font-size:clamp(1.65rem,6vw,2.45rem);letter-spacing:-.05em; }
.schedule-toolbar #year { font-weight:450; }
.schedule-toolbar .icon { border-radius:12px;background:var(--card);box-shadow:0 1px 3px #17263b0b; }
.schedule-calendar { margin-top:12px;padding:9px 9px 11px;border-radius:20px;box-shadow:0 5px 24px #18283f0b; }
.schedule-calendar .week small { color:#697586;letter-spacing:.065em;font-size:.66rem; }
.schedule-calendar .week button { min-height:47px; border-radius:10px; }
.schedule-calendar .week .weekend { background:#f7f9fc; }
.schedule-calendar .week .selected-week { background:#eef4fc; }
.schedule-calendar .week button.outside:not([aria-pressed=true]) { color:#9ca6b2; }
.week .date-number { width:32px;height:32px;font-variant-numeric:tabular-nums; }
.schedule-calendar [aria-current=date] .date-number { border:2px solid var(--forest); }
.schedule-calendar button[aria-pressed=true] .date-number { background:var(--forest);color:#fff;box-shadow:0 2px 8px #2563a63d; }
.schedule-calendar .calendar-grip span { background:#b4c0cc; }
.schedule-tools { gap:10px;flex-wrap:wrap; }
.schedule-tools .segments { background:#edf0f5;border:1px solid #e6eaf0;border-radius:13px; }
.schedule-tools .segments button { border-radius:10px;font-size:.78rem; }
.schedule-tools .segments button[aria-pressed=true] { background:white;color:var(--forest);box-shadow:0 1px 5px #1d35531b; }
.schedule-add { margin-left:auto; }
.schedule-add .primary { font-size:.78rem;padding:0 12px; }
.agenda { margin-top:13px; }
.agenda-day h2 { color:#343f4d;font-size:.81rem;letter-spacing:.075em;padding:13px 1px 9px; }
.agenda-day h2 time { letter-spacing:0;color:#788391; }
.agenda .job { border-color:#e3e8f0;border-radius:16px;padding:10px 10px 10px 12px;margin-bottom:9px;box-shadow:0 2px 9px #18283f08; }
.agenda .job time { color:#40546a;font-size:.72rem;font-variant-numeric:tabular-nums; }
.agenda .job-title { font-size:.96rem;line-height:1.3;font-weight:750;color:var(--ink); }
.agenda .job-meta { color:#697787;font-size:.75rem;line-height:1.45; }
.agenda .address { color:var(--forest);font-size:.79rem;text-decoration:none; }
.agenda .address:hover { text-decoration:underline; }
.agenda .job .job-body { border-left-width:4px;border-radius:2px; }
.more { border-radius:9px;color:#6f7d8c; }
.more:hover { background:#eef3f8; }
.travel { background:#edf3fa;color:#52677c;border-radius:8px; }
.panel { border-radius:18px;padding:18px;border-color:var(--line);box-shadow:0 2px 10px #18283f08; }
.panel h2 { font-size:1.08rem; }
input,select,textarea { border-radius:12px;border-color:#d8dfe8;background:#fff; }
input:focus,select:focus,textarea:focus { border-color:#7ca9d9; }
nav { gap:8px;background:#fffffff2;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-color:#e0e5ec; }
nav button { border-radius:13px;color:#687587; }
nav button[aria-current] { background:#e8f1fc;color:var(--forest); }
dialog { border-radius:22px;background:var(--paper);box-shadow:0 18px 65px #0003; }
dialog::backdrop { background:#14233799; }
#notice { border-radius:15px;background:#234f82; }
@media(min-width:760px) {
  main { max-width:850px;padding-inline:30px; }
  .schedule-toolbar { padding-left:8px;padding-right:8px; }
  .schedule-calendar { padding:15px 16px; }
  .schedule-calendar .week button { min-height:57px; }
  .agenda .job { grid-template-columns:85px minmax(0,1fr) 44px;padding:13px 15px; }
  #history-jobs .job { grid-template-columns:92px minmax(0,1fr); }
  nav { left:50%;right:auto;transform:translateX(-50%);width:min(100%,850px);border-left:1px solid var(--line);border-right:1px solid var(--line);border-radius:16px 16px 0 0; }
}
@media(max-width:390px) {
  .schedule-brand span { font-size:.58rem; }
  .schedule-tools { gap:6px; }
  .schedule-tools .segments button { font-size:.71rem; }
  .schedule-add .primary { padding-inline:9px; }
  .agenda .job { padding:8px 6px 8px 9px; }
}
@media(prefers-reduced-motion:reduce) {
  button { transition:none; }
  button:active:not(:disabled) { transform:none; }
}
