/* SMS SETUP — SmsSetupView (SPC.Blazor/Components/Touch), the one /touch/sms every head hosts.

   Promoted from the salon's SmsSetup.razor.css. That was SCOPED css; scoped .razor.css in a
   referenced project never reaches a head's bundle, so this is a served sheet the head links next
   to touch-page-chrome.css:
       <link rel="stylesheet" href="_content/SPC.Blazor/css/sms-setup.css" />
   Every selector carries the smsx prefix: as a global sheet, a bare .sms or .sms__btn would land on
   whatever else a head one day calls that.

   Colour comes from the --touch-* tokens each head defines on its touch shell, so the salon keeps
   slate-and-pink and the café and restaurant their espresso, day and night. The literal after each
   comma is only the fallback for a host that defines none (the salon's own values). The cards are
   .touch-glass in the markup, which each head paints; nothing on this screen floats over content.

   The one shape invented here is the LIVE LINE at the top: a single band that says what the shop's
   texting is doing right now, tinted by how much the state should worry somebody rather than by
   whether it is nominally an error. "Switched on with no gateway" is not an error to the app; it is
   the one that costs a week of confirmations nobody received. */

/* ── Page ─────────────────────────────────────────
   TouchPage draws the header and caps the column at 900px (PageMax). The padding is the salon
   page's own, so the gutter the title reserves against the Back/Home cluster is restated with it —
   see MapleKiosk/docs/touch-page-chrome.md. Three classes deep to beat the chrome's own
   .touch-page-chrome .form-page. */
.smsx-shell {
    color: var(--touch-ink, #1f2024);
    --tph-ink: var(--touch-ink, #1f2024);
    --tph-muted: var(--touch-muted, #6b6f76);
}

.touch-page-chrome .form-page.smsx-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px clamp(12px, 3vw, 28px) 48px;
    --tph-gutter: calc(max(0px, (100vw - 900px) / 2) + clamp(12px, 3vw, 28px));
}

/* Says only that the write landed. Whether there is anything TO write is said by Save beside it. */
.smsx__status {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--touch-ok-bg, #eaf7f0);
    color: var(--touch-ok, #14683f);
    font-size: 0.9rem;
    font-weight: 700;
}

.smsx__err {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    background: var(--touch-danger-bg, #fdecef);
    border: 1px solid var(--touch-danger-border, #f3b6c4);
    color: var(--touch-danger, #b3123c);
}

/* SmsAssistantView's two cards (the channel; who a guest is handed to), apart wherever they are hosted. */
.smsx__stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.smsx__card {
    box-sizing: border-box;
    padding: 20px clamp(14px, 3vw, 22px) 22px;
    border-radius: 20px;
}

.smsx__h2 { margin: 0 0 4px; font-size: 1.12rem; font-weight: 800; color: var(--touch-ink, #1f2024); }
.smsx__sub { margin: 0 0 16px; font-size: 0.92rem; line-height: 1.5; color: var(--touch-muted, #6b6f76); }
.smsx__hint { margin: 0; padding: 24px 6px; text-align: center; color: var(--touch-hint, #9aa0ad); font-size: 1rem; }

/* ── What the app is doing now ──────────────────
   Above the cards and outside them: it is the answer the cards add up to. */
.smsx__live {
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--touch-line, #e3e1e8);
    background: var(--touch-panel, rgba(255, 255, 255, 0.72));
}

.smsx__live-text { margin: 0; font-size: 1.02rem; line-height: 1.5; font-weight: 700; color: var(--touch-ink, #1f2024); }

/* Why the line above may not describe the screen below it: a footnote about timing. */
.smsx__live-note { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.45; color: var(--touch-muted, #6b6f76); font-weight: 600; }

.smsx__live--ok   { background: var(--touch-ok-bg, #eaf7f0); border-color: var(--touch-ok-border, #b9e2cd); }
.smsx__live--ok .smsx__live-text { color: var(--touch-ok, #14683f); }

.smsx__live--warn { background: var(--touch-warn-bg, #fff5e6); border-color: var(--touch-warn-border, #f2d29a); }
.smsx__live--warn .smsx__live-text { color: var(--touch-warn, #8a5300); }

/* Nothing configured is not a warning — it is the state a shop ships in. */
.smsx__live--idle { background: var(--touch-panel, rgba(255, 255, 255, 0.72)); }
.smsx__live--idle .smsx__live-text { color: var(--touch-muted, #6b6f76); }

/* ── Choices: carrier chips, SIMs, send modes ───
   ACCENT IS SELECTION: the one that is on wears the head's accent fill; the rest are controls. */
.smsx__chip,
.smsx__sim,
.smsx__mode {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 14px;
    border: 1px solid var(--touch-control-border, #e3e1e8);
    background: var(--touch-control, #fff);
    color: var(--touch-ink, #1f2024);
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.smsx__chip.is-on,
.smsx__sim.is-on,
.smsx__mode.is-on {
    background: var(--touch-accent-fill, var(--touch-accent, #c2185b));
    border-color: transparent;
    color: var(--touch-on-accent, #fff);
}

.smsx__chip:disabled,
.smsx__sim:disabled,
.smsx__mode:disabled { opacity: 0.55; cursor: default; }

.smsx__chip {
    flex: 1 1 180px;
    min-height: 64px;
    padding: 10px 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.smsx__chip-t { font-size: 1.02rem; font-weight: 800; }

/* Three short choices on a single row down to phone width, at the height of the inputs around them. */
.smsx__sims { display: flex; gap: 10px; margin-top: 2px; }

.smsx__sim {
    flex: 1 1 0;
    min-width: 0;
    min-height: 56px;
    padding: 0 12px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

/* Two ways one message can leave. Wide cards: the choice is made on the sentence under each name. */
.smsx__modes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.smsx__mode {
    flex: 1 1 260px;
    min-height: 74px;
    padding: 12px 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.smsx__mode-t { font-size: 1.02rem; font-weight: 800; }
.smsx__mode-h { font-size: 0.86rem; line-height: 1.4; color: var(--touch-muted, #6b6f76); }
.smsx__mode.is-on .smsx__mode-h { color: var(--touch-on-accent, #fff); opacity: 0.86; }

/* ── Fields ─────────────────────────────────────
   The text boxes are the family's TextField; what is here dresses the things around them. The gap
   keeps one field's help text from running into the next field's label. */
.smsx__field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.smsx__field--test { margin-top: 18px; }

/* One credential, one row; auto-fit folds the pair back to a stack where 320px each will not fit. */
.smsx__pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 4px 18px;
    align-items: start;
}

.smsx__label { font-size: 0.95rem; font-weight: 700; color: var(--touch-ink, #1f2024); }
.smsx__help { margin: 0; font-size: 0.86rem; line-height: 1.45; color: var(--touch-muted, #6b6f76); }
.smsx__note { margin: 16px 0 0; font-size: 0.86rem; line-height: 1.5; color: var(--touch-muted, #6b6f76); }

/* ── Buttons that are not Save ──────────────────
   Outlined: they act, but commit nothing. The one that sends a real message is filled. */
.smsx__acts { display: flex; align-items: center; justify-content: flex-start; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

.smsx__btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border-radius: 12px;
    border: 1px solid var(--touch-accent, #c2185b);
    background: var(--touch-control, #fff);
    color: var(--touch-accent, #c2185b);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.smsx__btn--send {
    border-color: transparent;
    background: var(--touch-accent-fill, var(--touch-accent, #c2185b));
    color: var(--touch-on-accent, #fff);
}

.smsx__btn:disabled { opacity: 0.5; cursor: default; }
a.smsx__btn { text-decoration: none; }

/* A read-only list of people (name, number) — shown here, edited on another screen. */
.smsx__people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.smsx__people li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.95rem; }
.smsx__people span { color: var(--touch-muted, #6b6f76); font-variant-numeric: tabular-nums; }

/* What the button beside it costs, read before the tap. */
.smsx__free { font-size: 0.86rem; color: var(--touch-muted, #6b6f76); }
.smsx__cost { font-size: 0.86rem; color: var(--touch-warn, #8a5300); font-weight: 700; }

.smsx__result {
    margin: 14px 0 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 600;
}

.smsx__result.is-ok  { background: var(--touch-ok-bg, #eaf7f0); border: 1px solid var(--touch-ok-border, #b9e2cd); color: var(--touch-ok, #14683f); }
.smsx__result.is-bad { background: var(--touch-danger-bg, #fdecef); border: 1px solid var(--touch-danger-border, #f3b6c4); color: var(--touch-danger, #b3123c); }

/* ── Automatic messages ─────────────────────────
   Label on the left, switch on the right — the rule-row shape the touch settings pages use. */
.smsx__rule { display: flex; align-items: center; gap: 16px; padding: 10px 0; min-width: 0; }
.smsx__rule-label { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.smsx__rule-t { font-size: 1rem; font-weight: 700; color: var(--touch-ink, #1f2024); }
.smsx__rule-h { font-size: 0.86rem; line-height: 1.4; color: var(--touch-muted, #6b6f76); }

/* What Manual mode commits the shop to, and the door to the queue it creates. */
.smsx__note-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--touch-line, #e3e1e8);
    background: var(--touch-panel, rgba(255, 255, 255, 0.6));
}

.smsx__note-text { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--touch-muted, #6b6f76); }
.smsx__note-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--touch-accent, #c2185b);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

/* Switched on with nothing behind it, or a public address. Amber, on the card that caused it. */
.smsx__warn {
    margin: 14px 0 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--touch-warn-bg, #fff5e6);
    border: 1px solid var(--touch-warn-border, #f2d29a);
    color: var(--touch-warn, #8a5300);
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
}

/* ── Save ───────────────────────────────────────
   In TouchPage's command slot. Dead until something has changed: a live button that does nothing
   teaches an operator to distrust the one that does. */
.smsx__save {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 14px;
    background: var(--touch-accent-fill, var(--touch-accent, #c2185b));
    color: var(--touch-on-accent, #fff);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.smsx__save:disabled {
    background: var(--touch-tile-alt, #e4e2e9);
    color: var(--touch-hint, #9a9aa4);
    cursor: default;
}

/* ── The "instead" ──────────────────────────────
   The carrier accounts, at the foot of the card and quieter than everything above them. */
.smsx__alt {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--touch-line, #e3e1e8);
}

.smsx__alt-link {
    -webkit-appearance: none;
    appearance: none;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--touch-muted, #6b6f76);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.smsx__alt-link:hover { color: var(--touch-ink, #1f2024); }
.smsx__alt-link:disabled { opacity: 0.55; cursor: default; }

.smsx__alt-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* THE DOOR to what the messages say — the only way in, so not the smallest thing on the page. */
.smsx__door {
    display: inline-block;
    margin: 18px 0 0;
    color: var(--touch-accent, #c2185b);
    font-weight: 700;
    text-decoration: none;
}
.smsx__door:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .touch-page-chrome .form-page.smsx-page {
        padding: 14px 14px 36px;
        --tph-gutter: calc(max(0px, (100vw - 900px) / 2) + 14px);
    }
    .smsx__card { padding: 16px 14px 18px; }
    .smsx__pair { grid-template-columns: 1fr; }
    /* Stacking keeps the switch clear of a wrapped label. */
    .smsx__rule { flex-direction: column; align-items: stretch; }
}
