/*
 * HMtext: staff inbox + admin. Plain CSS, no build step, system fonts only (SF on Apple devices).
 * Direction (CLAUDE.md, Liz Nov 6 2026): looks like iPhone Messages, so people know what it does at a glance.
 * White, an accent colour (default Barbie pink #DA1884, or the client's own) for buttons, links and sent bubbles; grey #E9E9EB received bubbles; bold large
 * titles; grouped lists on #F2F2F7. Red only for problems and deleting. No gradients, blobs or blur.
 */
:root {
    --white: #FFFFFF;
    --ink: #000000;
    --grey: #6E6E73;          /* secondary text (Apple web grey, passes AA on white) */
    --grey-2: #8E8E93;
    --soft: #F2F2F7;          /* iOS grouped background */
    --received: #E9E9EB;      /* iMessage received bubble */
    --line: rgba(60, 60, 67, .22);
    --line-2: rgba(60, 60, 67, .12);
    /* Accent: default Barbie pink. A client's own panel colour overrides these five in the layout
       (App\Support\PanelTheme), with text colours worked out so they always read. */
    --accent: #DA1884;        /* Barbie pink (Pantone 219C): buttons, sent bubbles, badges, current nav */
    --accent-press: #AE1369;
    --accent-tint: rgba(218, 24, 132, .12);
    --accent-text: #DA1884;   /* the accent used as text on white (darkened if the colour is too light) */
    --on-accent: #FFFFFF;     /* text on an accent fill: black or white, whichever reads */
    --red: #D70015;           /* problems and destructive actions (iOS red, darkened for AA) */
    --ok: #248A3D;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pill: 999px;
    --bubble: 18px;
    --group: 12px;
    --gutter: max(16px, env(safe-area-inset-left, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
::selection { background: var(--accent-tint); }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
.num, time, .ref { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* iOS large titles: bold, tight. Names semibold like a Messages list. */
.title { font-size: clamp(2rem, 4.5vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.name { font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.15rem; font-weight: 600; }
.muted { color: var(--grey); }
.small { font-size: .85rem; }
.ok { color: var(--ok); }

/* Attention (blue pill, like an unread badge) vs problem (red text). */
.flag, .badge { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: var(--pill); padding: .05rem .55rem; font-size: .76rem; font-weight: 600; line-height: 1.5; }
.problem { color: var(--red); font-weight: 600; font-size: .82rem; }

/* ---------- Top bar: text hub | client logo (centred) | nav ---------- */
.topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem;
    padding: .7rem var(--gutter); border-bottom: 1px solid var(--line-2);
    background: rgba(249, 249, 249, .97); position: sticky; top: 0; z-index: 10;
}
.topbar__left { display: flex; align-items: baseline; gap: .75rem; min-width: 0; }
.topbar__left .muted { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__center { display: flex; justify-content: center; }
.topbar__right { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; flex-wrap: wrap; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: .2rem; font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__bubble {
    position: relative; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .95em;
    padding: .02em .5em .1em; border-radius: var(--bubble); line-height: 1.25;
}
/* The tail of a sent message, bottom right. */
.brand__bubble::after {
    content: ""; position: absolute; right: -.18em; bottom: 0; width: .55em; height: .55em;
    background: radial-gradient(circle at 0 0, transparent .55em, var(--accent) .56em);
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.client-logo { display: flex; align-items: center; }
.client-logo img { display: block; height: 36px; width: auto; max-width: min(180px, 40vw); object-fit: contain; }
.topbar nav { display: flex; gap: .4rem; font-size: .9rem; flex-wrap: wrap; }
.topbar nav a { color: var(--accent-text); padding: .35rem .85rem; border-radius: var(--pill); font-size: .95rem; }
.topbar nav a:hover { background: var(--accent-tint); text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--on-accent); background: var(--accent); }
.topbar .who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: var(--grey); margin: 0; }
@media (max-width: 52rem) {
    /* Phones: text hub + logo on the first row, nav underneath. */
    .topbar { grid-template-columns: auto minmax(0, 1fr); }
    .topbar__center { justify-content: flex-end; }
    .topbar__right { grid-column: 1 / -1; justify-content: space-between; }
}

/* Client logo on settings pages and the client list. */
.account-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.account-head__logo { height: 44px; width: auto; max-width: 200px; object-fit: contain; }
.client-row { display: flex; align-items: center; gap: .75rem; }
.client-row img { height: 24px; width: auto; max-width: 90px; object-fit: contain; }
.header-preview { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--group); background: rgba(249, 249, 249, .97); }
.header-preview > :last-child { justify-self: end; }
input[type=file] { font: inherit; font-size: .9rem; }

/* ---------- Page frame ---------- */
.page { padding: 3rem var(--gutter) 4rem; max-width: 68rem; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; }
.page--narrow { max-width: 26rem; padding-top: 16vh; }
.page-head { display: flex; flex-direction: column; gap: .5rem; }
.subnav { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .9rem; }
/* iOS segmented control. */
.subnav { background: var(--soft); border-radius: var(--pill); padding: 3px; gap: 2px; align-self: flex-start; max-width: 100%; }
.subnav a { color: var(--ink); padding: .4rem .95rem; border-radius: var(--pill); }
.subnav a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.subnav a[aria-current="page"] { background: var(--white); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.flash { padding: .75rem var(--gutter); font-size: .9rem; border-bottom: 1px solid var(--line-2); }
.flash--ok { background: var(--soft); }
.flash--error { background: var(--white); color: var(--red); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 12rem; min-width: 0; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--grey); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search],
input[type=date], input[type=time], input[type=number], select {
    font: inherit; color: var(--ink); background: var(--soft);
    border: 1px solid transparent; border-radius: 10px;
    padding: .6rem .85rem; width: 100%; min-width: 0;
}
input[type=search] { border-radius: 10px; }
textarea {
    font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line);
    border-radius: var(--bubble); padding: .65rem 1rem; width: 100%; min-width: 0; resize: vertical; min-height: 5rem;
}
input[type=color] { width: 3rem; height: 2.5rem; padding: .2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px var(--accent-tint); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.hint { font-size: .82rem; color: var(--grey); }

/* Show/Hide button beside every password box (added by the layout script). It sits outside the box so
   password-manager icons, which draw inside the box's right edge, never cover it. */
.password-field { display: flex; align-items: center; gap: .4rem; }
.password-field input { flex: 1; min-width: 0; }
.password-field__toggle {
    flex: none; padding: .55rem .8rem; font-size: .85rem; font-weight: 600; border-radius: var(--pill);
    background: transparent; color: var(--accent-text);
}
.password-field__toggle:hover { background: var(--accent-tint); }
.error { font-size: .85rem; color: var(--red); }

button, .button {
    font: 600 .95rem/1 var(--sans); cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .75rem 1.3rem; border-radius: var(--pill);
    border: 0; background: var(--accent); color: var(--on-accent);
}
button:hover, .button:hover { background: var(--accent-press); text-decoration: none; }
button.quiet, .button.quiet { background: var(--accent-tint); color: var(--accent-text); }
button.quiet:hover, .button.quiet:hover { box-shadow: inset 0 0 0 1px var(--accent-text); }
button.danger { background: var(--red); color: var(--white); }
button.danger:hover { background: #A80010; }
button.danger-text { background: var(--soft); color: var(--red); }
button.danger-text:hover { background: #E5E5EA; }
button.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 400; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { background: none; color: var(--red); }
.inline-form { display: inline; margin: 0; }

/* ---------- Tables and lists (hairlines, no boxes) ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; font-weight: 400; color: var(--grey); font-size: .82rem; padding: 0 1rem .6rem 0; border-bottom: 1px solid var(--line); }
td { padding: .85rem 1rem .85rem 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled > li { padding: .85rem 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.75rem; border-top: 1px solid var(--line-2); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 3rem; align-items: start; }
code, .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); min-height: calc(100vh - 3.9rem); }
.inbox__list { border-right: 1px solid var(--line-2); display: flex; flex-direction: column; min-width: 0; }
.inbox__thread { min-width: 0; display: flex; flex-direction: column; }
.inbox__empty { margin: auto; text-align: center; color: var(--grey); padding: 3rem var(--gutter); }
@media (max-width: 52rem) {
    .inbox { grid-template-columns: minmax(0, 1fr); }
    .inbox--open .inbox__list { display: none; }
    .inbox:not(.inbox--open) .inbox__thread { display: none; }
    .inbox__list { border-right: 0; }
}

.filters { padding: 1.1rem var(--gutter); display: flex; flex-direction: column; gap: .6rem; border-bottom: 1px solid var(--line-2); }
.filters .row { gap: .5rem; }
.filters details summary { font-size: .85rem; color: var(--grey); cursor: pointer; }
.filters details[open] { display: flex; flex-direction: column; gap: .6rem; }
.filters .exports { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--grey); }

.chats { list-style: none; margin: 0; padding: .4rem 0; overflow-y: auto; overflow-x: hidden; }
/* Messages-style list: unread dot, bold name, grey time, two-line preview, inset hairlines. */
.chats > li + li .chat::before { content: ""; position: absolute; top: 0; left: 1.6rem; right: 0; border-top: 1px solid var(--line-2); }
.chat { position: relative; display: block; color: var(--ink); padding: .75rem 1rem .75rem 1.6rem; margin: 0 .5rem; border-radius: var(--group); }
.chat:hover { background: var(--soft); text-decoration: none; }
.chat[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.chat[aria-current="page"] .chat__top time, .chat[aria-current="page"] .chat__meta, .chat[aria-current="page"] .chat__last { color: var(--on-accent); opacity: .85; }
.chat[aria-current="page"] .flag { background: var(--on-accent); color: var(--accent); }
.chat__dot { position: absolute; left: .55rem; top: 1.2rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
.chat[aria-current="page"] .chat__dot { background: var(--on-accent); }
.chat__top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.chat__top time { font-size: .8rem; color: var(--grey); white-space: nowrap; }
.chat__meta { font-size: .82rem; color: var(--grey); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .2rem; }
.chat__last { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .92rem; color: var(--grey); margin-top: .2rem; overflow: hidden; overflow-wrap: anywhere; }
.chat--closed .chat__last, .chat--closed .name { color: var(--grey); }
.pager { display: flex; justify-content: space-between; padding: 1rem var(--gutter); font-size: .85rem; color: var(--grey); }

.thread-head { padding: 1.75rem var(--gutter) 1.25rem; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: .9rem; }
.thread-head .back { font-size: .95rem; }
@media (min-width: 52.01rem) { .thread-head .back { display: none; } }
.facts { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; font-size: .88rem; margin: 0; }
.facts dt { color: var(--grey); }
.facts div { display: flex; gap: .4rem; align-items: baseline; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions select { width: auto; }
.notices { list-style: none; margin: 0; padding: 0; font-size: .88rem; display: flex; flex-direction: column; gap: .3rem; }
.notices--problem li { color: var(--red); }

.messages { flex: 1; padding: 1.5rem var(--gutter); display: flex; flex-direction: column; gap: .75rem; overflow-y: auto; }
.msg { max-width: min(36rem, 88%); display: flex; flex-direction: column; gap: .3rem; }
.msg__by { font-size: .78rem; color: var(--grey); }
.msg__body { padding: .5rem .85rem; border-radius: var(--bubble); background: var(--received); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.msg--visitor .msg__body { border-bottom-left-radius: 5px; }
.msg--staff { align-self: flex-end; align-items: flex-end; }
.msg--staff .msg__body { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }
.msg--system { align-self: center; align-items: center; max-width: 100%; }
.msg--system .msg__body { background: none; padding: 0; color: var(--grey); font-size: .85rem; text-align: center; }

.composer { border-top: 1px solid var(--line-2); padding: 1rem var(--gutter) max(1rem, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .5rem; }
.composer .row { align-items: stretch; }
.composer textarea { min-height: 3.2rem; }

/* ---------- Site admin: bubble preview ---------- */
.site-form { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 3rem; align-items: start; }
@media (max-width: 60rem) { .site-form { grid-template-columns: minmax(0, 1fr); } }
.preview { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.bubble-panel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1b1b1b; }
.bubble-panel__head { padding: .9rem 1rem; }
.bubble-panel__head strong { display: block; font-size: 15px; }
.bubble-panel__head span { font-size: 13px; opacity: .85; }
.bubble-panel__body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #fff; }
.bubble-panel__msg { align-self: flex-end; padding: .45rem .7rem; border-radius: 14px; max-width: 80%; }
.bubble-panel__reply { align-self: flex-start; padding: .45rem .7rem; border-radius: 14px; background: #efefef; max-width: 80%; }
.bubble-panel__consent { font-size: 11px; color: #6b6b6b; padding: 0 1rem .9rem; }
.bubble-launcher { align-self: flex-end; width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; font: 600 13px system-ui, sans-serif; }
.hours td, .hours th { padding-right: .6rem; }
.hours input[type=time] { width: 8rem; }
.snippet { background: var(--soft); border-radius: var(--group); padding: .9rem 1rem; }

/* ---------- /dev/sms phone simulator ---------- */
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; }
.phone { border: 1px solid var(--line); border-radius: 24px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.phone header { display: flex; justify-content: space-between; gap: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line-2); }
.bubble { max-width: 85%; padding: .5rem .85rem; border-radius: var(--bubble); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.bubble small { display: block; font-size: .72rem; opacity: .7; margin-top: .2rem; }
.bubble--received { align-self: flex-start; background: var(--received); border-bottom-left-radius: 5px; }
.bubble--sent { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- Home: three big tiles (Inbox, Clients, Settings) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.5rem; }
.tile { display: flex; flex-direction: column; gap: .6rem; color: var(--ink); }
.tile:hover { text-decoration: none; }
.tile__box {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    min-height: 8.5rem; padding: 1.5rem; border-radius: 22px; background: var(--soft);
}
.tile__label { font-size: clamp(1.8rem, 3.4vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; }
.tile__hint { color: var(--grey); font-size: .95rem; padding: 0 .25rem; }
.tile:hover .tile__box { background: var(--accent); color: var(--on-accent); }
.tile:hover .badge { background: var(--on-accent); color: var(--accent); }
.tile:active .tile__box { background: var(--accent-press); }
/* Hover or keyboard focus: the word cross-fades to its icon (mail, people, gear). Phones keep the word. */
.tile__label { display: grid; align-items: center; justify-items: start; }
.tile__text, .tile__icon { grid-area: 1 / 1; transition: opacity .18s ease, transform .18s ease; }
.tile__icon { width: 2.75rem; height: 2.75rem; opacity: 0; transform: scale(.85); }
@media (hover: hover) {
    .tile:hover .tile__text, .tile:focus-visible .tile__text { opacity: 0; transform: scale(.95); }
    .tile:hover .tile__icon, .tile:focus-visible .tile__icon { opacity: 1; transform: none; }
}
.tile:focus-visible .tile__box { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .tile__text, .tile__icon { transition: none; } }
@media (max-width: 40rem) { .tile__box { min-height: 5.5rem; padding: 1.1rem 1.25rem; } .tiles { gap: 1rem; } }

/* ---------- Settings: iOS grouped lists ---------- */
.group { display: flex; flex-direction: column; gap: .5rem; max-width: 40rem; }
.group__heading { font-size: .85rem; font-weight: 400; color: var(--grey); padding: 0 1rem; }
.group__list { list-style: none; margin: 0; padding: 0; background: var(--soft); border-radius: var(--group); overflow: hidden; }
.group__list > li + li, .group__facts > div + div { border-top: 1px solid var(--line-2); margin-left: 1rem; }
.group__list a { display: flex; flex-direction: column; gap: .1rem; padding: .8rem 2.25rem .8rem 1rem; color: var(--ink); position: relative; }
.group__list a::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: .5rem; height: .5rem; border-top: 2px solid var(--grey-2); border-right: 2px solid var(--grey-2); transform: translateY(-50%) rotate(45deg); }
.group__list li + li a { margin-left: -1rem; padding-left: 2rem; }
.group__list a:hover { background: #E5E5EA; text-decoration: none; }
.group__hint { color: var(--grey); font-size: .85rem; }
.group__facts { margin: 0; }
.group__facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem .8rem 0; }
.group__facts > div:first-child { padding-left: 1rem; }
.group__facts dt { color: var(--ink); }
.group__facts dd { margin: 0; color: var(--grey); overflow-wrap: anywhere; text-align: right; }
.narrow { max-width: 26rem; }
.terms { max-width: 44rem; }
.terms ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .4rem; }
.terms blockquote { margin: 0; }
.consent-box { align-items: flex-start; line-height: 1.45; }
/* Sign-up form inside a client's own page: no page margins, sits on their background. */
body.embed { background: transparent; }
.terms--embed { padding: 1rem; margin: 0; max-width: none; }
.consent-box input { margin-top: .2rem; flex: none; }
.panel-colour { display: flex; flex-direction: column; gap: .75rem; padding: 0 .25rem; }
.panel-colour__preview { display: inline-flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-colour__button { background: var(--accent); color: var(--on-accent); border-radius: var(--pill); padding: .45rem 1rem; font-weight: 600; font-size: .9rem; }
.panel-colour__bubble { background: var(--accent); color: var(--on-accent); border-radius: var(--bubble); border-bottom-right-radius: 5px; padding: .4rem .8rem; font-size: .9rem; }
.panel-colour__link { color: var(--accent-text); font-size: .9rem; }
.danger-zone h2 { color: var(--red); }
.logo-well { display: inline-flex; align-items: center; justify-content: center; min-width: 9rem; height: 3.5rem; padding: .4rem .8rem; border-radius: var(--group); background: var(--soft); }
.logo-well img { max-height: 2.6rem; max-width: 12rem; object-fit: contain; }

/* ---------- Setup wizard ---------- */
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border-radius: 22px; background: var(--accent-tint); color: var(--ink); }
.setup-banner:hover { text-decoration: none; }
.setup-banner strong { display: block; font-size: 1.1rem; }
.setup-banner__hint { color: var(--grey); font-size: .92rem; }
.setup-strip { font-size: .9rem; background: var(--accent-tint); padding: .55rem 1rem; border-radius: var(--pill); align-self: flex-start; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.steps__item { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem .4rem .45rem; border-radius: var(--pill); background: var(--soft); color: var(--ink); font-size: .92rem; }
.steps__item:hover { text-decoration: none; background: #E5E5EA; }
.steps__mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--white); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps__item--done .steps__mark { background: var(--accent); color: var(--on-accent); }
.steps__item[aria-current="step"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.steps__item[aria-current="step"] .steps__mark { background: var(--on-accent); color: var(--accent); }
.step { display: flex; flex-direction: column; gap: 1.25rem; max-width: 46rem; }
.step__title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.step h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.narrow-form { max-width: 28rem; }
.team-part { display: flex; flex-direction: column; gap: .6rem; padding: .85rem 1rem; border-radius: var(--group); background: var(--soft); }
.team-part__fields { border: 0; margin: 0; padding: 0 0 0 1.6rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.team-part__fields[hidden] { display: none; }
.inbox-sites { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.inbox-sites legend { font-size: .88rem; color: var(--grey); padding: 0; margin-bottom: .2rem; }
.inbox-sites__list { display: flex; flex-direction: column; gap: .35rem; padding-left: 1.6rem; }
.inbox-sites__list[hidden] { display: none; }
.team-part input:not([type=checkbox]), .team-part select { background: var(--white); }
.install-status { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border-radius: var(--group); background: var(--soft); }
.install-status--live { background: rgba(36, 138, 61, .1); }
.install-status--live strong { color: var(--ok); }
.install-help { display: flex; flex-direction: column; gap: .35rem; }
.install-help details { background: var(--soft); border-radius: var(--group); padding: .6rem 1rem; }
.install-help summary { cursor: pointer; font-weight: 600; }
.install-help ol { margin: .5rem 0 .2rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line-2); max-width: 46rem; }

/* ---------- Twilio guide ---------- */
.guide { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 1.75rem; max-width: 46rem; }
.guide li { padding-left: .4rem; }
.guide li::marker { font-weight: 300; font-size: 1.3rem; }
.guide h2 { margin-bottom: .35rem; }
.guide p + p, .guide p + ul, .guide ul + p, .guide p + .facts { margin-top: .6rem; }
/* Guides: copyable answers and plain notices. */
.narrow-text { max-width: 46rem; }
.notice { max-width: 46rem; padding: .75rem 1rem; border-radius: var(--group); background: var(--accent-tint); font-size: .92rem; }
.copy-block { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.copy-block__label { margin: 0; font-size: .85rem; font-weight: 600; color: var(--grey); }
.copy-block__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide ul, .guide-notes { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.facts--stack { flex-direction: column; gap: .6rem; }
.facts--stack div { flex-direction: column; gap: .15rem; }

/* ---------- Phones (Liz Nov 26 2026: most people use HMtext on their phone) ----------
   Tighter header and page, home tiles as one tappable card each, settings tabs that scroll sideways
   instead of wrapping, and list tables (class list-table) as stacked cards with their column names. */
@media (max-width: 40rem) {
    .topbar { padding: .5rem var(--gutter) .55rem; gap: .5rem .75rem; }
    .brand { font-size: 1.1rem; }
    .client-logo img { height: 28px; max-width: min(150px, 45vw); }
    .topbar nav { flex-wrap: nowrap; width: 100%; background: var(--soft); border-radius: var(--pill); padding: 3px; gap: 2px; }
    .topbar nav a { flex: 1; text-align: center; padding: .4rem .5rem; font-size: .92rem; color: var(--ink); }
    .topbar nav a[aria-current="page"] { font-weight: 600; }

    .page { padding: 1.25rem var(--gutter) 3rem; gap: 1.25rem; }
    .title { font-size: 1.75rem; }
    .page-head { gap: .25rem; }

    .tiles { gap: .6rem; }
    .tile { position: relative; gap: .15rem; padding: .95rem 2.5rem .95rem 1.1rem; border-radius: 18px; background: var(--soft); }
    .tile::after { content: ""; position: absolute; right: 1.2rem; top: 50%; width: .55rem; height: .55rem; border-top: 2px solid var(--grey-2); border-right: 2px solid var(--grey-2); transform: translateY(-50%) rotate(45deg); }
    .tile__box, .tile:hover .tile__box, .tile:focus-visible .tile__box { min-height: 0; padding: 0; background: none; color: inherit; }
    .tile:hover .badge { background: var(--accent); color: var(--on-accent); }
    .tile:active { background: #E5E5EA; }
    .tile__label { font-size: 1.35rem; }
    .tile__hint { padding: 0; font-size: .9rem; }

    .subnav { flex-wrap: nowrap; overflow-x: auto; align-self: stretch; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .subnav::-webkit-scrollbar { display: none; }
    .subnav a { flex: none; white-space: nowrap; padding: .4rem .8rem; }
    .setup-strip { border-radius: var(--group); }

    .list-table thead { display: none; }
    .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; width: 100%; }
    .list-table tr { padding: .8rem 0; border-bottom: 1px solid var(--line-2); }
    .list-table td { position: relative; padding: .12rem 0 .12rem 8.25rem; border: 0; }
    .list-table td::before { content: attr(data-label); position: absolute; left: 0; top: .2rem; width: 7.75rem; color: var(--grey); font-size: .82rem; }
    .list-table td:first-child, .list-table td:not([data-label]), .list-table td[data-label=""] { padding-left: 0; }
    .list-table td:first-child { padding-bottom: .3rem; }
    .list-table td:first-child::before, .list-table td:not([data-label])::before, .list-table td[data-label=""]::before { display: none; }
    .list-table td:empty { display: none; }

    .hours input[type=time] { width: 6.75rem; }
    .filters { padding: .8rem var(--gutter); }
    .filters .row > .grow { flex-basis: 8rem; }
    .thread-head { padding: 1rem var(--gutter) .9rem; gap: .6rem; }
    .thread-head .title { font-size: 1.5rem; }
    .facts { gap: .2rem 1.1rem; font-size: .85rem; }
    .messages { padding: 1rem var(--gutter); }
    .composer { padding-top: .75rem; }
}

/* ---------- "Add to home screen" bar (phones only; resources/views/_install.blade.php) ---------- */
.install { display: flex; align-items: center; gap: .75rem; padding: .7rem var(--gutter); background: var(--accent-tint); border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.install[hidden] { display: none; }
.install img { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.install__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; line-height: 1.35; }
.install__text [hidden] { display: none; }
.install__share { width: 1.05em; height: 1.05em; vertical-align: -.15em; color: var(--accent-text); }
.install__go { flex: none; padding: .5rem .9rem; }
.install__x { flex: none; background: none; color: var(--grey); font-size: 1.4rem; font-weight: 400; padding: .2rem .4rem; }
.install__x:hover { background: none; color: var(--ink); }
.group__facts--stack > div { flex-direction: column; gap: .15rem; }
.group__facts--stack dd { text-align: left; }
.group__note { padding: 0 1rem; }
.bubble-tease { align-self: flex-end; max-width: 15rem; background: #fff; color: #1b1b1b; border: 1px solid var(--line); border-radius: 14px; padding: .5rem .8rem; font: 600 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; box-shadow: 0 3px 12px rgba(0, 0, 0, .1); }
.bubble-tease[hidden] { display: none; }
