/* Jordan's dashboard — built for one-handed use on an iPhone first. */
body { background: var(--white); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 96px; opacity: .9; }

/* Sign-in / setup */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 40px max(var(--gutter), 16px); }
.auth img { width: 220px; height: auto; margin-bottom: 36px; align-self: center; object-fit: contain; }
.auth h1 { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth p.lead { color: var(--steel); margin-bottom: 28px; }

/* Shell */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  padding: env(safe-area-inset-top) var(--gutter) 0;
}
.top-inner { height: 56px; display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
.top-inner img { width: 58px; }
.top-inner h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back { width: 44px; height: 44px; margin-left: -12px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.top .back svg { width: 11px; height: 19px; }
.page { max-width: 980px; margin: 0 auto; padding: 8px var(--gutter) calc(110px + env(safe-area-inset-bottom)); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0,0,0,.1);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 50px; text-decoration: none; color: #8e8e93; font-size: 11px; font-weight: 600; position: relative; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a[aria-current="page"] { color: var(--black); }
.tabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--black); color: var(--white); font-size: 11px; display: grid; place-items: center; }

/* Headings & text */
.h-date { font-size: 32px; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 4px; }
.muted { color: var(--steel); }
.small { font-size: 14px; }
.section { margin-top: 30px; }
.section > h2 { font-size: 20px; letter-spacing: -0.015em; margin-bottom: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section > h2 a, .section > h2 button { font-size: 15px; font-weight: 600; }

/* Setup checklist banner */
.setup { margin-top: 18px; padding: 16px 0; border-top: 1.5px solid var(--black); border-bottom: 1px solid var(--line); }
.setup h2 { font-size: 17px; margin-bottom: 6px; }
.setup ul li { padding: 6px 0; font-size: 15px; }

/* Quick actions — the four things Jordan does most */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.quick button, .quick a {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px;
  min-height: 92px; padding: 14px; border-radius: var(--r-md); border: 0;
  background: var(--mist); text-align: left; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.quick .primary { background: var(--black); color: var(--white); }
.quick svg { width: 24px; height: 24px; }

/* Figures */
.figs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 24px; }
.figs > div { padding: 14px 0; }
.figs > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.figs .n { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.figs .l { font-size: 13px; color: var(--steel); margin-top: 6px; }

/* Day list (next 14 days) */
.daylist li { border-bottom: 1px solid var(--line); }
.daylist .dl-head { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 10px; font-size: 13px; font-weight: 600; color: var(--steel); padding: 4px 0 8px; border-bottom: 1.5px solid var(--black); }
.daylist button { width: 100%; display: grid; grid-template-columns: 64px 1fr 1fr; align-items: center; gap: 10px; min-height: 58px; border: 0; background: none; text-align: left; cursor: pointer; padding: 6px 0; }
.daylist .d { font-weight: 700; font-size: 15px; line-height: 1.1; }
.daylist .d small { display: block; font-weight: 500; color: var(--steel); font-size: 13px; }
.slot { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.slot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.slot.available::before { background: var(--black); }
.slot.full::before { background: var(--steel); }
.slot.blocked::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--danger); }
.slot.blocked { color: var(--danger); }
.slot.closed { color: #aeaeb2; font-weight: 500; }
.slot.closed::before { background: transparent; box-shadow: inset 0 0 0 1.5px #c7c7cc; }

/* Lists of enquiries / jobs */
.rows li { border-bottom: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 13px 0; text-decoration: none; min-height: 64px; }
.rows .t { font-weight: 600; font-size: 17px; }
.rows .s { font-size: 14px; color: var(--steel); grid-column: 1; }
.rows .r { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: flex; align-items: center; gap: 10px; }
.status { font-size: 13px; font-weight: 600; padding: 3px 0; white-space: nowrap; }
.status.prepared { color: #8e8e93; }
.status.awaiting_contact { color: var(--black); }
.status.confirmed { color: var(--ok); }
.status.cancelled { color: var(--danger); }
.empty { padding: 22px 0; color: var(--steel); }

/* Calendar screen */
.cal-admin .day { aspect-ratio: auto; height: 58px; border-radius: 10px; cursor: pointer; color: var(--ink); font-weight: 600; background: transparent; }
.cal-admin .day.past { color: #c7c7cc; cursor: default; }
.cal-admin .day .marks { gap: 4px; }
.cal-admin .day .mk { width: 7px; height: 7px; }
.cal-admin .day .mk.open { background: var(--black); }
.cal-admin .day .mk.full { background: var(--steel); }
.cal-admin .day .mk.blocked { background: transparent; box-shadow: inset 0 0 0 1.5px var(--danger); }
.cal-admin .day .mk.closed { background: transparent; box-shadow: inset 0 0 0 1.5px #d1d1d6; }
.cal-admin .day.has-open { background: var(--mist); }
.cal-admin .day.has-block { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(179,38,30,.10) 5px 6px); }
.cal-admin .day.selected { background: var(--black) !important; color: var(--white); }
.cal-admin .day.selected .mk { box-shadow: inset 0 0 0 1.5px var(--white); background: transparent; }
.cal-admin .day.selected .mk.open { background: var(--white); }
.cal-admin .day.note-dot .num::after { content: ""; position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--steel); margin-top: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .mk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.cal-legend .open { background: var(--black); }
.cal-legend .full { background: var(--steel); }
.cal-legend .blocked { box-shadow: inset 0 0 0 1.5px var(--danger); }
.cal-legend .closed { box-shadow: inset 0 0 0 1.5px #c7c7cc; }
.hint-line { font-size: 14px; color: var(--steel); margin: 4px 0 14px; }
.select-bar { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; color: var(--steel); }

.rules li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rules .rt { flex: 1; }
.rules .rt b { display: block; font-size: 16px; }
.rules .rt span { font-size: 14px; color: var(--steel); }

/* Bottom sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; opacity: 0; transition: opacity .2s; }
.sheet-back.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto;
  background: var(--white); border-radius: 18px 18px 0 0; padding: 10px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .28s var(--ease);
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
.sheet.open { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #d1d1d6; margin: 0 auto 12px; }
.sheet h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 4px; }
.sheet .sub { color: var(--steel); font-size: 15px; margin-bottom: 18px; }
.sheet .actions { display: grid; gap: 8px; margin-top: 20px; }

.win-set { padding: 14px 0; border-top: 1px solid var(--line); }
.win-set .wt { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.win-set .wt b { font-size: 17px; }
.win-set .wt span { font-size: 13px; color: var(--steel); }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; place-items: center; min-height: 46px; border-radius: var(--r-sm); border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; cursor: pointer; text-align: center; padding: 0 4px; }
.seg input:checked + span { background: var(--black); color: var(--white); border-color: var(--black); }
.seg input.block:checked + span { background: var(--danger); border-color: var(--danger); }
.seg input:focus-visible + span { outline: 3px solid #0a64d6; outline-offset: 2px; }
.warn { padding: 12px 14px; background: #fff4e5; border-radius: var(--r-sm); font-size: 15px; margin-top: 12px; }
.warn label { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-weight: 600; }
.warn input { width: 22px; height: 22px; accent-color: var(--black); flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: grid; place-items: center; min-width: 46px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 600; cursor: pointer; }
.chips input:checked + span { background: var(--black); color: var(--white); border-color: var(--black); }
.chips input:focus-visible + span { outline: 3px solid #0a64d6; outline-offset: 2px; }

/* Enquiries */
.search { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0 6px; }
.filter { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 4px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); background: var(--white); font-weight: 600; font-size: 14px; cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--black); color: var(--white); border-color: var(--black); }

.detail h2.name { font-size: 28px; letter-spacing: -0.03em; margin: 10px 0 2px; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 6px; }
.kv { border-top: 1.5px solid var(--black); margin-top: 18px; }
.kv .row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--steel); font-size: 14px; }
.kv dd { white-space: pre-line; overflow-wrap: anywhere; }
.truth { font-size: 14px; color: var(--steel); margin-top: 8px; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.notes time { display: block; font-size: 13px; color: var(--steel); }
.history li { font-size: 14px; color: var(--steel); padding: 4px 0; }

/* Settings */
.set-group { margin-top: 30px; }
.set-group > h2 { font-size: 20px; letter-spacing: -0.015em; margin-bottom: 4px; }
.set-group > p { color: var(--steel); font-size: 15px; margin-bottom: 16px; }
.saved-state { font-size: 13px; color: var(--steel); min-height: 18px; margin-top: 4px; }
.saved-state.err { color: var(--danger); font-weight: 600; }
.svc li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc .controls { display: flex; gap: 2px; align-items: center; }
.svc .mini { width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.svc .mini:hover { background: var(--mist); }
.svc .mini[disabled] { opacity: .25; }
.svc .mini svg { width: 16px; height: 16px; }
.svc input.input { min-height: 44px; padding: 8px 12px; }
.svc .grp { font-size: 13px; color: var(--steel); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: #e9e9eb; transition: background-color .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--black); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid #0a64d6; outline-offset: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-preview { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 0; }
.brand-preview .dark { background: var(--black); padding: 14px; border-radius: 10px; }
.brand-preview img { width: 150px; height: auto; }

@media (min-width: 820px) {
  :root { --gutter: 32px; }
  .tabs { top: 0; bottom: auto; left: auto; right: 0; width: auto; grid-template-columns: repeat(4, auto); gap: 4px; padding: 6px 24px; background: none; border: 0; z-index: 25; }
  .tabs a { flex-direction: row; font-size: 15px; gap: 6px; min-height: 44px; padding: 0 12px; }
  .tabs a svg { width: 20px; height: 20px; }
  .tabs .badge { position: static; }
  .top-inner { padding-right: 440px; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .home-cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .sheet { left: 50%; right: auto; width: 520px; bottom: 50%; border-radius: 18px; transform: translate(-50%, 60%); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
  .sheet.open { transform: translate(-50%, 50%); opacity: 1; }
  .cal-admin .day { height: 74px; }
}
.cal-admin .day.past .marks .av { visibility: hidden; }

/* Google Calendar */
.set-group .sub-h { font-size: 16px; font-weight: 700; margin: 22px 0 4px; }
.set-group .sub-h:first-of-type { margin-top: 8px; }
.steps { list-style: decimal; margin: 10px 0 14px; padding-left: 22px; font-size: 15px; display: grid; gap: 6px; }
.gcal-status { font-size: 15px; padding: 12px 14px; border-radius: var(--r-sm); margin: 10px 0; }
.gcal-status.good { background: #eef7f0; }
.gcal-status.bad { background: #fff4e5; }
.gcal-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.three-col .label { font-size: 13px; }
.three-col .select { padding-left: 12px; padding-right: 28px; background-position: right 10px center; }
@media (max-width: 480px) { .three-col { grid-template-columns: 1fr; gap: 0; } }

/* Diary: Google events, reminders, follow ups, leads and jobs */
.cal-admin .day .marks { flex-direction: column; align-items: center; height: auto; gap: 4px; }
.cal-admin .day .marks .av, .cal-admin .day .marks .evs { display: flex; gap: 3px; height: 7px; align-items: center; }
.cal-admin .day .marks .evs { height: 5px; }
.ev { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #8e8e93; }
.ev.job { background: var(--black); }
.ev.google, .ev.gfree { background: #1a73e8; }
.ev.gfree { opacity: .45; }
.ev.reminder, .ev.followup { background: #c77700; }
.ev.lead { background: #8e44ad; }
.cal-legend .ev { width: 7px; height: 7px; margin-right: 2px; }
.cal-admin .day.focus { box-shadow: inset 0 0 0 2px var(--black); }
.cal-admin .day.is-today .num { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.cal-admin .day.past { cursor: pointer; }
.cal-admin .day.selected .ev { background: var(--white); opacity: 1; }

.agenda-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.ap-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; }
.ap-head .btn-text { white-space: nowrap; }
.ap-head h3 { font-size: 19px; letter-spacing: -0.01em; }
.ap-slots { font-size: 14px; color: var(--steel); margin: 2px 0 10px; }
.agenda { list-style: none; margin: 0 0 12px; padding: 0; }
.ag { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 10px 0 10px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid #c7c7cc; }
.ag.job { border-left-color: var(--black); }
.ag.google { border-left-color: #1a73e8; }
.ag.google.free { border-left-color: #a8c7fa; }
.ag.reminder, .ag.followup { border-left-color: #c77700; }
.ag.lead { border-left-color: #8e44ad; }
.ag .tm { font-size: 13px; font-weight: 600; color: var(--steel); font-variant-numeric: tabular-nums; }
.ag .tm.late { color: var(--danger); }
.ag .what { display: grid; gap: 2px; text-align: left; background: none; border: 0; padding: 0; color: inherit; text-decoration: none; min-height: 40px; align-content: center; font: inherit; cursor: pointer; }
.ag span.what { cursor: default; }
.ag .what b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.ag .what small { font-size: 13px; color: var(--steel); overflow-wrap: anywhere; }
.ag.done .what b { text-decoration: line-through; color: var(--steel); }
.ag:not(:has(.tick)) { grid-template-columns: 74px 1fr; }
.tick { position: relative; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.tick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tick span { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #aeaeb2; }
.tick input:checked + span { background: var(--black); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E"); background-size: 14px; background-position: center; background-repeat: no-repeat; }
.tick input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.add-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.add-row .btn { min-height: 44px; padding: 0 8px; font-size: 14px; gap: 4px; }
.add-row .btn svg { width: 16px; height: 16px; }
.err-inline { color: var(--danger); }
.check-line { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 12px; font-weight: 600; }
.check-line input { width: 22px; height: 22px; accent-color: var(--black); flex: none; margin-top: 1px; }
.check-line small { display: block; font-weight: 400; font-size: 13px; color: var(--steel); }

/* Google connection */
.btn-google svg { width: 20px; height: 20px; }
.ticks { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; gap: 6px; font-size: 15px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid #1e7d4f; border-bottom: 2px solid #1e7d4f; transform: rotate(-45deg); }
.auth.wide { max-width: 520px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; padding: 10px 12px; background: var(--mist); border-radius: var(--r-sm); }
.copy-row .btn { flex: none; min-height: 40px; }
[hidden] { display: none !important; }
/* Job money + confirmation */
.money-set { margin-top: 4px; }
.total-line { font-size: 15px; margin: -2px 0 12px; min-height: 20px; }
.total-line.err { color: var(--danger); font-weight: 600; }
.msg-preview { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.45; background: var(--mist); border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0 4px; max-height: 42vh; overflow: auto; }
/* Stage 4 (re-check): sign-in card keeps a margin on phones; inputs visible on the light card */
@media (max-width: 460px) { .auth { width: calc(100% - 24px); } }
.auth .input { background: #f6f6f7; border-color: var(--line); }
