:root {
  --ink: #171a1c;
  --ink-soft: #52595d;
  --paper: #f1f0eb;
  --white: #ffffff;
  --line: #d3d4d2;
  --lime: #d66a3f;
  --teal: #343b3f;
  --orange: #d66a3f;
  --red: #b63f35;
  --blue: #607989;
  --steel: #c7c9ca;
  --steel-dark: #6c7478;
  --shadow: 0 18px 45px rgba(18, 21, 23, .14);
  --brand-primary: #303539;
  --brand-primary-dark: #292d30;
  --brand-on-primary: #ffffff;
  --brand-accent: #79361f;
  --brand-soft: #dad8d2;
}

* { box-sizing: border-box; }
html { background: #d8d8d5; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }

.login-screen { min-height: 100vh; min-height: 100dvh; padding: env(safe-area-inset-top) 18px calc(28px + env(safe-area-inset-bottom)); background: #191b1d; color: white; display: flex; flex-direction: column; justify-content: flex-start; }
.login-brand { height: 246px; margin: 0 -18px; overflow: hidden; background: #0c0d0e; }
.login-brand img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.compact-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-icon { flex: 0 0 38px; width: 38px; height: 38px; object-fit: contain; border-radius: 5px; border: 1px solid #555b5e; background: white; box-shadow: inset 0 0 0 1px #aeb1b2; }
.brand-type { display: grid; gap: 2px; min-width: 0; max-width: min(47vw, 230px); }
.brand-type strong { overflow: hidden; font-size: clamp(11px, 3.2vw, 16px); letter-spacing: .08em; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.brand-type small { font-size: 6px; letter-spacing: 1.2px; color: #71797d; font-weight: 800; white-space: nowrap; }
.brand-strip { display: none; width: 270px; height: auto; }
.login-card { position: relative; z-index: 1; margin-top: -18px; background: white; color: var(--ink); border-radius: 22px; padding: 27px 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.34); border-top: 3px solid var(--steel); }
.login-card .login-business { display: grid; gap: 4px; margin: 0 0 18px; padding-left: 11px; border-left: 4px solid var(--brand-primary); }
.login-business strong { color: var(--ink); font-size: 14px; letter-spacing: .08em; line-height: 1.25; }
.login-business span { color: var(--brand-accent); font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.eyebrow { color: var(--steel-dark); font-weight: 850; font-size: 10px; letter-spacing: 1.6px; }
.login-card h1 { font-size: 36px; line-height: 1.05; margin: 12px 0; letter-spacing: -1.7px; }
.login-card > p { color: var(--ink-soft); margin: 0 0 22px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; color: var(--ink-soft); margin-bottom: 14px; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid #cfd6ce; border-radius: 12px; padding: 11px 13px; color: var(--ink); background: #fbfcf8; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 16%, transparent); }
.primary-button, .secondary-button { border: 0; border-radius: 13px; min-height: 50px; padding: 0 18px; font-weight: 800; cursor: pointer; }
.primary-button { background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-dark)); color: var(--brand-on-primary); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.24); }
.secondary-button { background: var(--brand-primary); color: var(--brand-on-primary); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.full { width: 100%; }
.form-error { min-height: 18px; color: var(--red) !important; font-size: 12px; font-weight: 700; margin: 0 0 10px !important; }
.local-note { display: flex; gap: 7px; align-items: center; justify-content: center; color: #74817d; font-size: 11px; margin-top: 17px; }
.local-note span, .mode-pill span { width: 7px; height: 7px; border-radius: 50%; background: #5e9c6b; box-shadow: 0 0 0 3px rgba(94,156,107,.16); }

.app-shell { min-height: 100vh; min-height: 100dvh; max-width: 520px; margin: 0 auto; padding-bottom: calc(94px + env(safe-area-inset-bottom)); background: var(--paper); }
.topbar { min-height: calc(70px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; position: sticky; top: 0; z-index: 10; background: rgba(244,243,239,.96); backdrop-filter: blur(16px); border-bottom: 1px solid #cfd0ce; box-shadow: 0 2px 0 rgba(255,255,255,.7); }
.mode-pill { margin-left: auto; margin-right: 10px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; font-size: 7px; letter-spacing: .7px; font-weight: 850; background: white; white-space: nowrap; }
.avatar-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand-primary); color: var(--brand-on-primary); font-weight: 800; }
main { padding: 0 16px; }
.page { display: none; animation: page-in .18s ease-out; }
.page.active { display: block; }
@keyframes page-in { from { opacity: .4; transform: translateY(4px); } }
.page-intro { display: flex; align-items: center; justify-content: space-between; padding: 24px 2px 17px; }
.page-intro p { margin: 0 0 5px; }
.page-intro h1 { margin: 0; font-size: 29px; line-height: 1; letter-spacing: -1px; }
.round-button { width: 48px; height: 48px; border: 1px solid var(--brand-primary-dark); border-radius: 12px; background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-dark)); color: var(--brand-on-primary); font-size: 28px; line-height: 1; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.2); cursor: pointer; }

.run-section { margin-top: 2px; }
.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 11px 0; }
.snapshot-card { min-height: 94px; padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--steel-dark); border-radius: 14px; background: white; box-shadow: 0 4px 12px rgba(18,21,23,.04); }
.snapshot-card > span { color: var(--steel-dark); font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.snapshot-card strong, .snapshot-card small { display: block; }
.snapshot-card strong { margin-top: 9px; font-size: 16px; letter-spacing: -.3px; }
.snapshot-card small { margin-top: 4px; color: #697074; font-size: 10px; line-height: 1.3; }
.focus-card { color: white; background: linear-gradient(145deg, #24282b, #111315); padding: 18px 15px 12px; border-radius: 18px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12); overflow: hidden; border: 1px solid #3a3f42; }
.focus-top { display: flex; justify-content: space-between; align-items: center; color: #c3c6c7; font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.focus-count { background: var(--orange); color: white; min-width: 25px; height: 25px; padding: 0 7px; display: grid; place-items: center; border-radius: 6px; font-size: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.focus-card > h2 { font-size: 20px; margin: 7px 0 18px; letter-spacing: -.4px; }
.attention-list { display: grid; gap: 7px; }
.attention-item { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; min-height: 59px; padding: 10px; display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; }
.attention-item strong, .attention-item small { display: block; }
.attention-item strong { font-size: 13px; line-height: 1.2; }
.attention-item small { margin-top: 4px; color: #bdc1c3; font-size: 11px; max-width: 235px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.priority-high .attention-dot { background: var(--orange); }
.priority-low .attention-dot { background: var(--steel); }
.attention-item button { border: 1px solid rgba(255,255,255,.24); color: white; background: transparent; border-radius: 8px; min-height: 44px; padding: 0 11px; font-size: 11px; font-weight: 750; cursor: pointer; }
.attention-more { justify-self: center; border: 0; background: transparent; color: #c5c8c9; min-height: 44px; font-size: 10px; font-weight: 750; }
.focus-card .empty-state { color: #c6d5d2; }

.content-section { margin-top: 25px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.section-heading button, .section-heading span { border: 0; background: none; color: var(--teal); font-size: 11px; font-weight: 750; padding: 0 3px; }
.section-heading button { min-height: 44px; margin: -12px 0; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-tile { min-height: 98px; text-align: left; border: 1px solid var(--line); border-top: 3px solid #7d8386; background: white; padding: 12px 13px; border-radius: 14px; cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 5px 13px rgba(18,21,23,.04); }
.quick-tile::after { content: ""; position: absolute; width: 48px; height: 48px; transform: rotate(45deg); right: -27px; top: -27px; background: #dfe0df; }
.quick-tile span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; background: #e6e7e5; color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.quick-tile strong, .quick-tile small { display: block; }
.quick-tile strong { font-size: 13px; }
.quick-tile small { color: #73817d; font-size: 10px; margin-top: 3px; }
.quick-tile.appointment { border-top-color: #3f474b; }
.quick-tile.reminder { border-top-color: var(--orange); }
.quick-tile.marketing { border-top-color: #778b98; }
.quick-tile.appointment::after, .quick-tile.reminder::after, .quick-tile.marketing::after { background: #dfe0df; }

.stack-list { display: grid; gap: 9px; }
.stack-list.spacious { padding-bottom: 18px; }
.appointment-card { display: grid; grid-template-columns: 63px 1fr 40px; gap: 10px; align-items: center; background: white; border: 1px solid var(--line); border-left: 4px solid #4e565a; border-radius: 12px; padding: 12px 8px 12px 10px; box-shadow: 0 4px 12px rgba(18,21,23,.035); }
#today-appointments .appointment-card { grid-template-columns: 58px 1fr 36px; min-height: 78px; padding: 8px 6px 8px 9px; gap: 8px; }
#today-appointments .time-block strong { font-size: 16px; }
#today-appointments .status-badge { min-height: 16px; }
#today-appointments .card-main h3 { margin: 2px 0 1px; }
#today-appointments .location-line { margin-top: 1px; }
.appointment-card.is-emergency { border-color: #e6aaa1; }
.time-block { align-self: stretch; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.time-block strong { font-size: 17px; }
.time-block small, .card-main p, .location-line { color: #737a7d; font-size: 10px; }
.card-main h3 { margin: 5px 0 2px; font-size: 14px; }
.card-main p { margin: 0; }
.card-main .job-line { margin-top: 3px; color: #343a3d; font-size: 11px; font-weight: 650; }
.location-line { display: block; margin-top: 3px; }
.more-button { width: 40px; min-height: 44px; border: 0; background: transparent; font-size: 28px; color: #737b7f; cursor: pointer; }
.status-badge { display: inline-flex; align-items: center; min-height: 19px; padding: 0 7px; border-radius: 99px; background: #e7ece8; color: #5b6965; font-size: 8px; letter-spacing: .5px; font-weight: 850; text-transform: uppercase; }
.status-new, .status-ready { background: #f8e2d8; color: #8d3f27; }
.status-confirmed, .status-accepted, .status-approved, .status-completed { background: #e5f2d5; color: #47752d; }
.status-contacted, .status-scheduled { background: #dfecef; color: #356b74; }
.status-waiting, .status-draft { background: #e8e5f5; color: #5e5489; }
.status-cancelled, .status-declined { background: #efe4e2; color: #92534c; }
.emergency-flag { font-size: 8px; font-weight: 900; color: var(--red); margin-left: 4px; letter-spacing: .6px; }
.link-row { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.link-row a { color: var(--ink); text-decoration: none; text-align: center; min-width: 54px; }
.link-row a span { display: grid; place-items: center; margin: 0 auto 5px; width: 45px; height: 45px; border-radius: 14px; border: 1px solid var(--line); background: white; font-weight: 900; color: var(--teal); }
.link-row a small { font-size: 9px; color: var(--ink-soft); }
.quick-links-section { padding-bottom: 12px; }

.filter-pills { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 15px; padding-bottom: 2px; }
.filter-pills button { white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 99px; min-height: 44px; padding: 0 15px; font-size: 11px; font-weight: 750; }
.filter-pills button.active { background: var(--ink); color: white; border-color: var(--ink); }
.entity-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 15px; }
.entity-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.entity-top > small, .source-label { color: #7d8985; font-size: 9px; }
.source-label { margin-left: 7px; }
.entity-card h3 { font-size: 17px; margin: 10px 0 1px; }
.phone-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); text-decoration: none; font-size: 12px; font-weight: 700; }
.entity-card p { font-size: 13px; line-height: 1.45; margin: 11px 0 5px; }
.address-line { color: #76837f; font-size: 10px; }
.card-actions { display: flex; gap: 8px; margin-top: 13px; }
.card-actions button, .mini-item button, .mini-action button, .tradify-handoff button { border: 1px solid var(--line); background: #f7f8f4; border-radius: 8px; min-height: 44px; padding: 0 12px; font-size: 10px; font-weight: 800; }

.date-control { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 13px; }
.date-control label { margin: 0; }
.date-control input { min-height: 44px; }
.date-control button { min-height: 44px; }
.availability-result { background: #e7f0ee; border-radius: 13px; margin-top: 8px; padding: 0 12px; max-height: 0; overflow: hidden; transition: .2s; }
.availability-result:not(:empty) { padding: 12px; max-height: 180px; }
.availability-result p { margin: 0 0 9px; font-size: 11px; }
.slot-row { display: flex; gap: 6px; overflow-x: auto; }
.slot-row button { min-width: 60px; min-height: 44px; border: 1px solid #aeb2b3; background: white; border-radius: 8px; font-size: 11px; font-weight: 750; }
.schedule-heading { margin-top: 22px; }
.date-divider { margin: 7px 3px 6px; color: #64736f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }

.module-block { background: white; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.module-block summary { list-style: none; min-height: 56px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 800; cursor: pointer; }
.module-block summary::-webkit-details-marker { display: none; }
.module-block summary span { color: #70807b; font-size: 9px; background: #eef0ec; padding: 5px 8px; border-radius: 99px; }
.module-block[open] summary { border-bottom: 1px solid var(--line); }
.inline-add { margin: 8px 12px 2px; border: 0; background: transparent; color: #3d4549; font-weight: 850; font-size: 11px; min-height: 44px; }
.mini-list { padding: 6px 12px 12px; }
.mini-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid #edf0eb; }
.mini-item:last-child { border-bottom: 0; }
.mini-item .initial { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: #e4efed; color: var(--teal); font-size: 12px; font-weight: 900; }
.mini-item .reminder-icon { background: #f1ecd9; color: #8c7223; }
.mini-item .marketing-icon { background: #e4e9f4; color: #4d6491; }
.mini-item .connector-icon, .mini-item .tool-icon { background: #e4e5e4; color: #4d5559; }
.mini-item strong, .mini-item small { display: block; }
.mini-item strong { font-size: 12px; }
.mini-item strong.done { text-decoration: line-through; color: #83908c; }
.mini-item small { margin-top: 3px; color: #7d8985; font-size: 9px; line-height: 1.25; }
.mini-item > a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; color: var(--teal); font-size: 10px; font-weight: 800; text-decoration: none; }
.mini-action { display: grid; gap: 4px; justify-items: end; }
.stub-label { font-size: 8px; font-weight: 900; color: #7b8783; }
.prototype-boundary { background: #f9eadf; border: 1px solid #f0ceba; border-radius: 15px; padding: 14px; margin-top: 18px; }
.prototype-boundary strong { font-size: 12px; color: #984a30; }
.prototype-boundary p { font-size: 10px; line-height: 1.45; color: #77594d; margin: 5px 0 0; }
.text-button { border: 0; background: transparent; min-height: 48px; width: 100%; margin-top: 14px; font-weight: 750; font-size: 12px; }
.text-button.danger { color: var(--red); }

.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 520px); height: calc(72px + env(safe-area-inset-bottom)); padding: 8px 14px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav button { position: relative; border: 0; background: transparent; color: #81908b; font-size: 9px; font-weight: 750; display: grid; place-items: center; gap: 2px; }
.bottom-nav button > span { font-size: 20px; line-height: 1; }
.bottom-nav button.active { color: var(--ink); }
.bottom-nav button.active::after { content: ""; position: absolute; bottom: 0; width: 20px; height: 3px; border-radius: 2px; background: var(--brand-primary); }
.bottom-nav i { position: absolute; top: -1px; right: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 99px; background: var(--brand-primary); color: var(--brand-on-primary); font-style: normal; font-size: 8px; }
.pilot-bottom-nav { display: none; }

dialog { width: min(calc(100% - 24px), 480px); max-height: calc(100vh - 32px); border: 0; border-radius: 24px; padding: 0; color: var(--ink); box-shadow: 0 26px 80px rgba(16,43,45,.3); }
dialog::backdrop { background: rgba(16,43,45,.58); backdrop-filter: blur(4px); }
dialog form { padding: 21px; overflow-y: auto; max-height: calc(100vh - 32px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 19px; }
.dialog-heading h2 { font-size: 24px; margin: 4px 0 0; letter-spacing: -.7px; }
.dialog-heading > button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: #e5e6e4; font-size: 24px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.check-label { grid-template-columns: 22px 1fr; align-items: center; }
.check-label input { width: 20px; min-height: 20px; margin: 0; }
.cancel-appointment-button { width: 100%; min-height: 44px; border: 1px solid #e8c3bd; background: #fff5f3; color: var(--red); border-radius: 10px; font-size: 11px; font-weight: 800; margin-bottom: 10px; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 88px; transform: translate(-50%, 20px); background: var(--ink); color: white; border-radius: 12px; padding: 11px 15px; font-size: 12px; font-weight: 750; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty-state { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #788681; font-size: 11px; }
.empty-state span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #e1e2e1; color: #4e565a; }

.pilot-mode .app-shell { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.pilot-mode .bottom-nav, .pilot-mode #profile-button { display: none; }
.pilot-mode main { padding-bottom: 0; }
.pilot-mode .pilot-bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 520px); height: calc(74px + env(safe-area-inset-bottom)); padding: 7px max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(18,21,23,.08); backdrop-filter: blur(18px); }
.pilot-bottom-nav button { position: relative; min-width: 0; min-height: 52px; border: 0; border-radius: 11px; background: transparent; color: #77817d; display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; }
.pilot-bottom-nav button > span { font-size: 21px; line-height: 1; }
.pilot-bottom-nav button > strong { font-size: 10px; line-height: 1.1; letter-spacing: .01em; }
.pilot-bottom-nav button.active { background: var(--brand-soft); color: var(--brand-accent); }
.pilot-bottom-nav button.active::before { content: ""; position: absolute; top: -7px; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-primary); }
.pilot-bottom-nav i { position: absolute; top: 2px; right: calc(50% - 27px); min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border: 2px solid white; border-radius: 99px; background: var(--brand-primary); color: var(--brand-on-primary); font-style: normal; font-size: 8px; font-weight: 850; }
.pilot-bottom-nav i[hidden] { display: none; }
.pilot-mode .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
.pilot-view[hidden] { display: none; }
.pilot-heading { padding: 27px 2px 17px; }
.pilot-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.pilot-heading .eyebrow { color: var(--brand-accent); margin-bottom: 7px; }
.pilot-heading h1 { margin: 0 0 8px; font-size: 34px; line-height: 1; letter-spacing: -1.3px; }
.pilot-caller-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 17px; box-shadow: 0 8px 24px rgba(18,21,23,.06); }
.pilot-caller-card label > span { color: #7d8588; font-size: 10px; font-weight: 600; }
.pilot-caller-card input { min-height: 54px; font-size: 16px; }
.pilot-send-button { width: 100%; min-height: 58px; font-size: 14px; letter-spacing: .3px; text-transform: uppercase; }
.send-boundary { margin: 10px 4px 0; color: #70787b; font-size: 10px; line-height: 1.4; text-align: center; }
.pilot-section-heading { margin: 4px 0 12px; }
.pilot-section-heading span { color: var(--brand-accent); }
.pilot-caller-list { display: grid; gap: 10px; }
.recent-caller { padding: 14px; }
.recent-caller.is-done { opacity: .72; }
.pilot-caller-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pilot-caller-top h3 { margin: 0 0 2px; font-size: 17px; }
.pilot-caller-top a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-accent); font-size: 13px; font-weight: 750; text-decoration: none; }
.recent-caller > p { margin: 7px 0 12px; color: #757d80; font-size: 10px; }
.pilot-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 7px; }
.pilot-actions a, .pilot-actions button { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #f5f6f3; color: var(--ink); font-size: 9px; font-weight: 850; text-align: center; text-decoration: none; cursor: pointer; }
.pilot-actions .send-action { border-color: var(--brand-primary-dark); background: var(--brand-primary); color: var(--brand-on-primary); }
.pilot-actions button:disabled { cursor: default; color: #67706d; background: #e7e9e6; }
.team-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.team-panel[hidden] { display: none; }
.supporting-copy { margin: -6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.team-form { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.team-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.team-form input { min-height: 48px; font-size: 16px; }
.team-user-list { display: grid; gap: 9px; margin-top: 12px; }
.team-user, .microsoft-contacts-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.team-user header, .microsoft-contacts-card header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }

.customer-directory-heading { padding-bottom: 13px; }
.customer-search { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 20px rgba(18,21,23,.05); }
.customer-search > label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.customer-search > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.customer-search input { min-width: 0; min-height: 50px; font-size: 16px; }
.customer-search button { min-height: 50px; padding: 0 15px; border: 1px solid var(--brand-primary-dark); border-radius: 10px; background: var(--brand-primary); color: var(--brand-on-primary); font-weight: 850; }
.customer-search .customer-search-clear { display: block; min-height: 44px; margin: 3px 0 -8px auto; padding: 0 5px; border: 0; background: transparent; color: var(--brand-accent); }
.customer-search .customer-search-clear[hidden] { display: none; }
.customer-search-summary { min-height: 20px; margin: 12px 2px 8px; color: var(--muted); font-size: 11px; }
.customer-directory-list { display: grid; gap: 8px; }
.customer-result { width: 100%; min-height: 70px; padding: 10px 12px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 22px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 4px 12px rgba(18,21,23,.035); cursor: pointer; }
.customer-result-initial { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-accent); font-size: 15px; font-weight: 900; }
.customer-result strong, .customer-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-result strong { font-size: 14px; }
.customer-result small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.customer-result > span:last-child { color: var(--brand-accent); font-size: 26px; text-align: right; }
.customer-directory-pages { min-height: 60px; margin-top: 10px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.customer-directory-pages[hidden] { display: none; }
.customer-directory-pages button { min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 800; }
.customer-directory-pages button:last-child { color: var(--brand-accent); }
.customer-directory-pages button:disabled { color: #98a09d; background: #eceeeb; }
.customer-directory-pages span { color: var(--muted); font-size: 10px; }

.customer-detail { width: min(calc(100% - 20px), 520px); max-height: calc(100dvh - 20px); }
.customer-detail-panel { max-height: calc(100dvh - 20px); padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.customer-detail-header { position: sticky; z-index: 2; top: -18px; margin: -18px -18px 15px; padding: 18px 18px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.customer-detail-header h2 { margin: 4px 0 0; font-size: 23px; line-height: 1.1; letter-spacing: -.6px; }
.customer-detail-header button { flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #eef0ed; color: var(--ink); font-size: 26px; }
.customer-contact-name { margin: 0 0 8px; }
.customer-contact-name strong, .customer-contact-name span { display: block; }
.customer-contact-name strong { font-size: 17px; }
.customer-contact-name span { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.customer-contact-line, .customer-address { margin: 7px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.customer-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 17px 0; }
.customer-actions a { min-width: 0; min-height: 58px; padding: 7px 3px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #f7f8f5; color: var(--brand-accent); font-size: 9px; font-weight: 850; text-align: center; text-decoration: none; }
.customer-actions a span { font-size: 18px; line-height: 1; }
.customer-contact-sync { padding: 12px; border-radius: 12px; background: #eef2f0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.customer-contact-sync small { color: var(--muted); }
.customer-history { margin-top: 20px; }
.customer-history h3 { margin: 18px 0 8px; display: flex; justify-content: space-between; font-size: 15px; }
.customer-history h3 span { color: var(--brand-accent); font-size: 11px; }
.customer-history-item { width: 100%; min-height: 64px; padding: 10px 0; display: block; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.customer-history-item > span { display: flex; justify-content: space-between; align-items: center; }
.customer-history-item strong, .customer-history-item > small { display: block; margin-top: 5px; }
.customer-history-item strong { font-size: 12px; line-height: 1.35; }
.customer-history-item small { color: var(--muted); font-size: 9px; }
.customer-history-limit { color: var(--muted); font-size: 10px; }

@media (max-width: 380px) {
  .customer-actions { grid-template-columns: repeat(2, 1fr); }
}
.team-user h3, .team-user p, .microsoft-contacts-card h3, .microsoft-contacts-card p { margin: 0; }
.team-user p, .microsoft-contacts-card p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.team-user .pilot-actions, .microsoft-contacts-card .pilot-actions { margin-top: 10px; grid-template-columns: repeat(3, 1fr); }
.pilot-enquiry-list { display: grid; gap: 11px; }
.pilot-enquiry-card { padding: 17px; border: 1px solid var(--line); border-left: 4px solid var(--brand-primary); border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(18,21,23,.06); }
.pilot-enquiry-card h3 { margin: 12px 0 1px; font-size: 19px; }
.pilot-enquiry-card .phone-link, .pilot-enquiry-card .email-link { display: flex; align-items: center; min-height: 44px; color: #354d59; font-size: 13px; font-weight: 750; text-decoration: none; }
.pilot-enquiry-card .email-link { margin-top: -8px; }
.pilot-enquiry-card p { margin: 8px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.pilot-enquiry-card p strong, .intake-photos > strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.intake-photos { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; }
.intake-photos a, .enquiry-photo-links a { display: flex; align-items: center; min-height: 44px; width: fit-content; color: #354d59; font-weight: 750; }
.intake-photos span { color: var(--ink-soft); }
.enquiry-photo-links { display: grid; gap: 3px; margin-top: 8px; font-size: 12px; }
.photo-thumbnail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-thumbnail { min-width: 0; min-height: 96px; border: 1px solid var(--line); border-radius: 11px; padding: 4px; overflow: hidden; background: #ecece8; cursor: pointer; }
.photo-thumbnail img { display: block; width: 100%; aspect-ratio: 1; border-radius: 7px; object-fit: cover; }
.photo-thumbnail span { display: block; padding: 6px 2px 3px; color: var(--ink); font-size: 10px; font-weight: 800; text-align: center; }
.photo-thumbnail:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }

.photo-viewer { width: min(calc(100% - 16px), 760px); max-height: calc(100dvh - 16px); border-radius: 18px; background: #111416; color: white; }
.photo-viewer-panel { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.photo-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.photo-viewer-header div { display: grid; gap: 2px; }
.photo-viewer-header span { color: #aeb4b6; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.photo-viewer-header strong { font-size: 16px; }
.photo-viewer-header button { flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid #4b5053; border-radius: 12px; background: #2a2e30; color: white; font-size: 28px; cursor: pointer; }
.photo-viewer-stage { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 7px; min-height: 240px; }
.photo-viewer-stage img { grid-column: 2; display: block; width: 100%; max-height: calc(100dvh - 190px); border-radius: 10px; object-fit: contain; background: #080909; }
.photo-viewer-nav { width: 48px; height: 54px; border: 1px solid #4b5053; border-radius: 11px; background: #2a2e30; color: white; font-size: 32px; cursor: pointer; }
.photo-viewer-nav:disabled { opacity: .3; cursor: default; }
.photo-viewer-name { min-height: 18px; margin: 12px 55px 0; overflow: hidden; color: #c7cbcd; font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 370px) {
  .photo-thumbnail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.status-not_sent { background: #ececea; color: #62686b; }
.status-link_sent { background: #dfecef; color: #356b74; }
.status-done { background: #e5f2d5; color: #47752d; }

.automation-entry { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.automation-entry[hidden], .automation-panel[hidden] { display: none; }
.automation-entry button, .automation-panel button { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.automation-entry button[aria-current="page"] { border-color: var(--brand-primary); color: var(--brand-primary-dark); }
.automation-entry button:focus-visible, .automation-panel button:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.automation-panel button:disabled { opacity: .6; cursor: wait; }
.automation-panel .pilot-heading h1 { overflow-wrap: anywhere; }
.automation-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.automation-paused { font-size: 12px; font-weight: 800; }
.automation-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.automation-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 22px; }
.automation-counts > div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.automation-counts dt { color: var(--ink-soft); font-size: 11px; }
.automation-counts dd { margin: 5px 0 0; font-size: 25px; font-weight: 800; }
.automation-threads { display: grid; gap: 12px; }
.automation-card { margin: 0 0 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; overflow-wrap: anywhere; }
.automation-threads .automation-card { margin: 0; }
.automation-card header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.automation-card h2, .automation-card h3 { margin: 0 0 8px; font-size: 17px; }
.automation-card p { margin: 7px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.automation-card header > span { font-size: 11px; color: var(--muted); }
.automation-phone { font-variant-numeric: tabular-nums; }
.automation-attention { padding: 10px 12px 10px 28px; border-radius: 9px; background: #fff3db; color: #624712; font-size: 12px; line-height: 1.5; }
.automation-attention li + li { margin-top: 5px; }
.automation-channels { display: grid; gap: 7px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.automation-channels > div { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr); gap: 10px; font-size: 11px; line-height: 1.45; }
.automation-channels dt { color: var(--muted); }
.automation-channels dd { margin: 0; font-weight: 650; }
.automation-messages, .automation-timeline { margin: 12px 0 0; padding-left: 20px; font-size: 13px; }
.automation-messages li, .automation-timeline li { padding: 4px 0 12px; }
.automation-messages p { white-space: pre-wrap; }
.automation-timeline small, .automation-messages small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.automation-live { margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.automation-live .section-heading { align-items: center; margin-bottom: 4px; }
.automation-live .section-heading h2 { display: flex; align-items: center; gap: 8px; }
.automation-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2f9b61; box-shadow: 0 0 0 4px #dff3e8; }
.automation-activity { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.automation-activity li { position: relative; padding-left: 24px; }
.automation-activity li:not(:last-child)::before { content: ""; position: absolute; top: 21px; bottom: -5px; left: 7px; width: 2px; background: var(--line); }
.automation-activity li::after { content: ""; position: absolute; top: 18px; left: 3px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary); }
.automation-activity button { display: grid; width: 100%; min-height: 62px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.automation-activity button:hover { background: var(--brand-soft); }
.automation-activity-time { color: var(--muted); font-size: 10px; font-weight: 700; }
.automation-activity strong { margin: 2px 0; font-size: 13px; }
.automation-activity small { color: var(--ink-soft); font-size: 11px; }
.automation-empty-activity { padding: 18px 0 18px 24px; color: var(--muted); font-size: 13px; }
.pilot-enquiry-card:focus { outline: 3px solid var(--brand-primary); outline-offset: 3px; }

@media (min-width: 700px) {
  body { padding: 28px 0; }
  .app-shell { min-height: calc(100vh - 56px); border-radius: 28px; overflow: hidden; box-shadow: 0 24px 70px rgba(16,43,45,.18); }
  .bottom-nav { bottom: 28px; border-radius: 0 0 28px 28px; }
  .pilot-mode .pilot-bottom-nav { bottom: 28px; border-radius: 0 0 28px 28px; }
  .login-screen { max-width: 520px; min-height: calc(100vh - 56px); margin: 0 auto; border-radius: 28px; box-shadow: 0 24px 70px rgba(16,43,45,.22); }
  .automation-panel { max-width: 920px; }
  .automation-live { padding: 20px; }
  .automation-counts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .pilot-mode.automation-view .app-shell { max-width: 1000px; }
  .pilot-mode.automation-view #pilot-view-today { padding-inline: 38px; }
  .pilot-mode.automation-view .automation-threads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (display-mode: standalone) {
  .mode-pill { border-color: #adb3b5; }
}
