/* Base reset. This is Tailwind CSS v3.4 "preflight" (MIT license, tailwindcss.com), copied here with its
   theme() values resolved, so the app no longer loads the Tailwind Play CDN script at runtime. Phase 1 pages
   were designed and reviewed with this reset applied, so it stays: removing it would change spacing. */
*,
::before,
::after {
  box-sizing: border-box;   border-width: 0;   border-style: solid;   border-color: #e5e7eb; }

::before,
::after {
  --tw-content: '';
}

html,
:host {
  line-height: 1.5;   -webkit-text-size-adjust: 100%;   -moz-tab-size: 4;   tab-size: 4;   font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";   font-feature-settings: normal;   font-variation-settings: normal;   -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;   line-height: inherit; }

hr {
  height: 0;   color: inherit;   border-top-width: 1px; }

abbr:where([title]) {
  text-decoration: underline dotted;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;   font-feature-settings: normal;   font-variation-settings: normal;   font-size: 1em; }

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

table {
  text-indent: 0;   border-color: inherit;   border-collapse: collapse; }

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;   font-feature-settings: inherit;   font-variation-settings: inherit;   font-size: 100%;   font-weight: inherit;   line-height: inherit;   letter-spacing: inherit;   color: inherit;   margin: 0;   padding: 0; }

button,
select {
  text-transform: none;
}

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button;   background-color: transparent;   background-image: none; }

:-moz-focusring {
  outline: auto;
}

:-moz-ui-invalid {
  box-shadow: none;
}

progress {
  vertical-align: baseline;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

[type='search'] {
  -webkit-appearance: textfield;   outline-offset: -2px; }

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;   font: inherit; }

summary {
  display: list-item;
}

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

dialog {
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;   color: #9ca3af; }

button,
[role="button"] {
  cursor: pointer;
}

:disabled {
  cursor: default;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;   vertical-align: middle; }

img,
video {
  max-width: 100%;
  height: auto;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}

/* Component styles. Colors come from brand.css (generated from brand.py). */
:root {
  --danger: #b42318; --danger-bg: #fef3f2; --warn-bg: #fff4d6; --warn-ink: #5c3b00;
  --ok: #1a6b3a; --ok-bg: #e8f6ee; --line: #b9aeb4; --card: #ffffff;
}
body { background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.5; margin: 0; }
a.link { color: var(--accent-dark); text-decoration: underline; display: inline-block; padding: 12px 4px; min-height: 44px; box-sizing: border-box; }
.shell { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right)); }
.shell.narrow { padding-bottom: 32px; }
body h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 16px; font-weight: 700; }
body h2 { font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 16px; }

.label { display: block; font-weight: 600; margin: 16px 0 6px; }
.hint { color: var(--muted); font-size: 16px; margin-top: 4px; }
.input, .select, .textarea { width: 100%; box-sizing: border-box; min-height: 52px; padding: 12px 14px; font-size: 17px;
  color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; font-family: inherit; }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .btn:focus-visible, .nav a:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.input.bad, .select.bad, .textarea.bad { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 600; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px;
  font-size: 17px; font-weight: 700; border-radius: 12px; border: 2px solid transparent; cursor: pointer; text-decoration: none;
  font-family: inherit; box-sizing: border-box; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-secondary { background: #fff; color: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 12px 4px; min-height: 48px; font-size: 17px; color: var(--accent-dark);
  text-decoration: underline; cursor: pointer; font-family: inherit; }

.card { background: var(--card); border: 1px solid #e3d9de; border-radius: 16px; padding: 16px; margin-bottom: 12px; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:active { background: #fbeff3; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name { font-size: 19px; font-weight: 700; }
.chip { display: inline-block; font-size: 16px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin: 6px 6px 0 0; }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad { background: var(--danger-bg); color: var(--danger); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.kv { margin: 12px 0 0; }
.kv dt { font-size: 16px; color: var(--muted); font-weight: 600; }
.kv dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-weight: 600; }
.alert-bad { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #d9a400; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.alert-info { background: #fff; border: 1px solid var(--line); }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 608px; margin: 0 auto;
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 12px; font-weight: 600; z-index: 50; }
.toast.bad { background: var(--danger); }

/* Bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #e3d9de; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px;
  padding: 6px 0; font-size: 16px; font-weight: 600; color: var(--muted); text-decoration: none; }
.nav a svg { width: 26px; height: 26px; }
.nav a[aria-current="page"] { color: var(--accent-dark); }
.nav a[aria-current="page"] span { text-decoration: underline; text-underline-offset: 4px; }
.nav small { font-size: 16px; font-weight: 500; line-height: 1; }

.skeleton { color: var(--muted); padding: 24px 0; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.actions { display: grid; gap: 12px; margin-top: 20px; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; }
.center { text-align: center; }
.brandmark { font-weight: 800; color: var(--accent-dark); font-size: 20px; margin: 8px 0 0; }
[hidden] { display: none !important; }
body h1, .name { overflow-wrap: anywhere; }

/* Visits, formulas, photos */
.mb { margin-bottom: 16px; }
.mt-lg { margin-top: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
/* Grid children may shrink below their content (a date input is wide by default), or the page grows wider than the phone. */
.grid2 > *, .grid3 > *, .stack > * { min-width: 0; }
input[type="date"], input[type="time"] { min-width: 0; max-width: 100%; }
.lastcolor { border: 2px solid var(--accent-dark); }
.formula { padding: 10px 0; }
.formula + .formula { border-top: 1px solid #e3d9de; }
.formula-area { font-weight: 700; font-size: 19px; }
.formula-line { font-size: 18px; overflow-wrap: anywhere; }
.formula-notes { margin-top: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.visit-title { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.price { font-weight: 700; }
.editor { border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; background: #fff; }
.editor .label:first-child { margin-top: 0; }
.product { border-top: 1px solid #e3d9de; margin-top: 12px; padding-top: 4px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.thumb { position: relative; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #f3eef0;
  aspect-ratio: 1 / 1; cursor: pointer; display: block; width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 700;
  padding: 2px 8px; border-radius: 8px; }
.overlay { position: fixed; inset: 0; background: rgba(20, 14, 17, .94); z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px; gap: 16px; }
.overlay img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 8px; }
.overlay .btn { min-width: 160px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 100px; }

/* Money and Square */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 12px; border: 2px solid var(--accent-dark); border-radius: 12px; overflow: hidden; }
.seg-btn { min-height: 52px; padding: 8px 4px; font-size: 17px; font-weight: 700; font-family: inherit; background: #fff; color: var(--accent-dark);
  border: 0; border-left: 2px solid var(--accent-dark); cursor: pointer; }
.seg-btn:first-child { border-left: 0; }
.seg-btn[aria-pressed="true"] { background: var(--accent-dark); color: #fff; }
.seg-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.takehome { border-top: 2px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 20px; font-weight: 700; }
.row { min-height: 40px; }
.price.neg { color: var(--danger); }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--ink); min-height: 64px; }
.entry .right { text-align: right; flex: none; }
.rule + .rule { border-top: 1px solid #e3d9de; margin-top: 12px; padding-top: 12px; }
.suggest { border-top: 1px solid #e3d9de; margin-top: 12px; padding-top: 12px; }

/* Color memory, my color lines, rebooking */
.memory { background: #fbf6f8; border-radius: 12px; padding: 10px 12px; margin: 8px 0; overflow-wrap: anywhere; }
.memory .chip { margin: 0 6px 0 0; }
.memory-label { font-weight: 700; }
.nexttime { margin-top: 6px; padding: 8px 10px; border-left: 4px solid var(--accent-dark); background: #fff; font-size: 18px; white-space: pre-wrap; }
.formula-cost { font-weight: 600; margin-top: 4px; }
.picker { position: relative; }
.suggestions { margin-top: 6px; }
.suggestion { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 52px;
  padding: 10px 14px; margin-top: 6px; background: #fff; border: 2px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 17px;
  color: var(--ink); cursor: pointer; }
.suggestion:active { background: #fbeff3; }
.suggestion-name { font-weight: 700; overflow-wrap: anywhere; }
.pad { padding: 8px 4px; }
.linked { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--ok-bg); color: var(--ok);
  border-radius: 12px; padding: 4px 12px; margin-top: 10px; font-weight: 600; }
.linked .linkbtn { color: var(--ok); }
.weeks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.checkrow { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-top: 16px; font-weight: 600; }
.checkrow input { width: 28px; height: 28px; flex: none; accent-color: var(--accent-dark); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.dueitem { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dueitem .btn { flex: none; min-width: 96px; }
.reminder { margin-bottom: 12px; }
.banner { display: block; text-decoration: none; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
code { font-size: 16px; font-family: ui-monospace, Menlo, Consolas, monospace; background: #f3eef0; padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
body h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }

/* Collapsible help (for example how to import into QuickBooks): the whole line is a large tap target. */
details > summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; margin: 0; }
details ol { padding-left: 24px; }
details li { margin-bottom: 8px; }

/* Calendar, appointments, online booking */
.seg2 { grid-template-columns: repeat(2, 1fr); }
.calnav { gap: 8px; margin-bottom: 8px; }
.calnav .btn { flex: 1; min-width: 0; }
.dayhead { margin: 20px 0 8px; }
.dayhead.today { color: var(--accent-dark); }
.appt-muted { opacity: .75; }
.slotgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.slot { padding: 8px 4px; min-width: 0; }
.slot[aria-pressed="true"] { background: var(--accent-dark); color: #fff; }
.kv-list { margin: 8px 0 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.need { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.need.done { color: var(--ok); font-weight: 600; }
.need .tick { font-size: 20px; width: 24px; text-align: center; flex: none; }
.hours-range { border-top: 1px solid #e3d9de; padding: 8px 0 0; margin-top: 8px; }
.hours-range .grid2 { margin-bottom: 0; }
.need.todo { color: var(--ink); }
.muted.closed { margin: 0 0 8px; }
.appt { display: block; }
