:root {
  color-scheme: light;
  --ink: #172a3a;
  --muted: #667681;
  --paper: #f5f7f8;
  --surface: #ffffff;
  --teal: #176b73;
  --teal-dark: #0e4d54;
  --teal-soft: #e3f0f1;
  --line: #dce4e7;
  --ok: #247a45;
  --ok-soft: #e6f4eb;
  --error: #a12b2b;
  --error-soft: #fbe9e9;
  --warning: #825a12;
  --warning-soft: #fff3d8;
  --info: #245a7a;
  --info-soft: #e6f2f8;
  --shadow: 0 18px 45px rgba(23, 42, 58, 0.08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
.topbar { min-height: 74px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--ink); color: white; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
.environment-label { padding: 7px 11px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: .82rem; font-weight: 700; }
.account-nav { display: flex; align-items: center; gap: 18px; }
.account-nav > span { text-align: right; }
.account-nav strong, .account-nav small { display: block; }
.account-nav small { margin-top: 2px; color: var(--muted); }
.account-nav form { margin: 0; }
.primary-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 10px clamp(20px, 5vw, 72px); background: #eaf4f2; border-bottom: 1px solid var(--line); }
.primary-nav a { font-weight: 700; color: var(--teal-dark); text-decoration: none; }
.primary-nav a:hover, .account-nav a:hover { text-decoration: underline; }
.persistent-notice { padding: 12px clamp(20px, 5vw, 72px); background: #fff0d8; color: #643e08; border-bottom: 1px solid #ead2a9; }
.persistent-notice a { color: inherit; font-weight: 800; }
.link-button { border: 0; padding: 8px 0; background: transparent; color: var(--teal); font: inherit; font-weight: 750; cursor: pointer; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; flex: 1; padding: clamp(42px, 7vw, 86px) 0 52px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: end; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.25rem, 6vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.lead { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.overall-status { min-width: 190px; padding: 18px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.overall-status span { display: block; }
.overall-status > span:last-child { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.status { display: inline-flex !important; width: fit-content; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-error { background: var(--error-soft); color: var(--error); }
.status-neutral { background: #eef1f2; color: #5f6d75; }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
dl { margin: 0; }
dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 750; text-align: right; }
.next-step { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; margin-top: 20px; padding: 26px 28px; border-radius: 22px; background: var(--ink); color: white; }
.next-step .eyebrow { color: #8cd0d5; }
.next-step p:last-child { margin: 0; color: #dce8ec; line-height: 1.55; }
.error-panel { max-width: 760px; padding: clamp(28px, 5vw, 54px); background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.error-panel h1 { font-size: clamp(2rem, 5vw, 4rem); }
.error-panel pre { max-width: 100%; overflow: auto; margin-top: 24px; padding: 16px; background: #101820; color: #f3f7f8; border-radius: 12px; white-space: pre-wrap; }
.button { display: inline-flex; margin-top: 24px; padding: 12px 16px; border-radius: 12px; background: var(--teal); color: white; text-decoration: none; font-weight: 750; }
.button, .secondary-button, .danger-button { border: 0; font: inherit; cursor: pointer; }
.button:hover { background: var(--teal-dark); }
.secondary-button { display: inline-flex; align-items: center; width: fit-content; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 750; }
.danger-button { padding: 8px 10px; border-radius: 10px; background: var(--error-soft); color: var(--error); font-size: .82rem; font-weight: 750; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 470px); gap: clamp(36px, 7vw, 90px); align-items: center; min-height: 560px; }
.compact-auth { max-width: 1050px; margin: 0 auto; }
.form-card, .table-card, .identity-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.form-card { padding: clamp(24px, 4vw, 36px); }
.form-card h2 { margin-bottom: 22px; font-size: 1.4rem; }
.field { display: grid; gap: 7px; margin-top: 16px; color: var(--ink); font-size: .9rem; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bdcbd0; border-radius: 11px; background: white; color: var(--ink); font: inherit; font-weight: 500; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(23,107,115,.16); border-color: var(--teal); }
.form-hint { margin: 16px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; line-height: 1.45; }
.alert-error { background: var(--error-soft); color: #7d2020; border: 1px solid #efc8c8; }
.alert-success { background: var(--ok-soft); color: #1d6739; border: 1px solid #c9e6d2; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid #ecd79f; }
.alert-info { background: var(--info-soft); color: var(--info); border: 1px solid #bfdde9; }
.form-link { display: block; width: fit-content; margin-top: 18px; color: var(--teal); font-size: .9rem; font-weight: 750; }
.readonly-value { margin: 0 0 18px; padding: 13px 14px; border-radius: 12px; background: #eef4f5; }
.readonly-value span, .readonly-value strong { display: block; }
.readonly-value span { margin-bottom: 4px; color: var(--muted); font-size: .78rem; }
.page-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(2.15rem, 5vw, 4.4rem); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.compact-button { margin-top: 0; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dashboard-intro { margin: 0 0 24px; }
.dashboard-intro h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; }
.dashboard-intro > p:last-child { margin: 10px 0 0; color: var(--muted); }
.dashboard-primary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dashboard-primary-card { min-height: 200px; display: flex; flex-direction: column; align-items: flex-start; padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.dashboard-primary-card h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
.dashboard-primary-card p { margin: 14px 0 auto; color: var(--muted); line-height: 1.5; }
.dashboard-primary-card > span { margin-top: 22px; color: var(--teal-dark); font-weight: 800; }
a.dashboard-primary-card:hover { border-color: #9bc4c8; transform: translateY(-1px); }
.dashboard-more { margin-top: 30px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dashboard-more h2 { margin-bottom: 14px; }
.dashboard-more > div { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-more a { padding: 9px 12px; border-radius: 9px; background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.dashboard-more a:hover { text-decoration: underline; }
.dashboard-shortcuts { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 26px; }
.dashboard-section-title { margin: 22px 0 16px; }
.dashboard-insights { margin-top: 26px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 22px; }
.insight-grid article { padding: 16px; border-radius: 12px; background: var(--teal-soft); display: flex; flex-direction: column; gap: 7px; }
.insight-grid strong { font-size: 2rem; line-height: 1.1; }
.insight-grid span { flex: 1; }
.insight-grid a { color: var(--teal-dark); font-weight: 700; }
.insight-chart { display: flex; align-items: end; height: 150px; gap: 14px; margin: 16px 0 0; }
.insight-chart > div { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 0; }
.insight-chart > div span { width: min(50px, 80%); background: var(--teal-dark); border-radius: 6px 6px 0 0; }
.insight-chart small { white-space: nowrap; font-size: 0.75rem; }
.example-picker { margin: 20px 0; }
.example-picker > * { margin: 8px 0; }
.invite-panel > summary { cursor: pointer; font-weight: 700; }
.action-card { min-height: 240px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.action-card:hover { border-color: #9bc4c8; transform: translateY(-1px); }
.action-card p { max-width: 520px; color: var(--muted); line-height: 1.6; }
.action-number { display: block; margin-bottom: 50px; color: var(--teal); font-size: .8rem; font-weight: 800; }
.muted-card { box-shadow: none; background: #eef2f3; }
.muted-card:hover { border-color: var(--line); transform: none; }
.identity-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 20px; overflow: hidden; background: var(--line); }
.identity-card div { padding: 20px 22px; background: var(--surface); }
.identity-card span, .identity-card strong { display: block; }
.identity-card span { margin-bottom: 5px; color: var(--muted); font-size: .82rem; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); gap: 22px; align-items: start; }
.stack-layout { display: grid; gap: 22px; }
.wide-form { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .72; }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; }
.module-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.module-picker legend { grid-column: 1 / -1; margin-bottom: 10px; font-weight: 800; }
.check-card { display: flex; gap: 10px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfc; cursor: pointer; }
.check-card input { margin-top: 3px; accent-color: var(--teal); }
.check-card strong, .check-card small { display: block; }
.check-card small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.compact-check { align-self: end; min-height: 76px; }
.summary-card, .metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.summary-card { padding: 26px; }
.summary-card h2 { margin-bottom: 20px; font-size: 1.5rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: .78rem; font-weight: 800; }
.muted-text { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }
.small-button { display: inline-flex; align-items: center; padding: 7px 9px; border: 1px solid #b9c9ce; border-radius: 9px; background: white; color: var(--ink); font: inherit; font-size: .78rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.inline-form { display: flex; gap: 7px; align-items: center; margin: 0; }
.inline-form select { min-height: 36px; padding: 6px 8px; border: 1px solid #bdcbd0; border-radius: 9px; background: white; font: inherit; font-size: .82rem; }
.table-title { padding: 18px; border-bottom: 1px solid var(--line); }
.license-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.metric-card { padding: 24px; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: .82rem; }
.metric-card strong { margin-top: 8px; font-size: 1.75rem; letter-spacing: -.03em; }
.metric-card small { margin-top: 8px; color: var(--muted); }
.table-card { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #eef4f5; color: var(--teal-dark); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
td small { display: block; margin-top: 4px; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.action-cell { width: 1%; white-space: nowrap; }
.action-cell form { margin: 0; }
.empty-cell { padding: 36px 18px; color: var(--muted); text-align: center; }
.table-link { color: var(--ink); text-decoration-color: #9bc4c8; text-underline-offset: 3px; }
.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) 210px auto; gap: 12px; align-items: end; margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.filter-bar label { display: grid; gap: 7px; font-size: .82rem; font-weight: 750; }
.filter-bar input, .filter-bar select { min-height: 44px; padding: 9px 11px; border: 1px solid #bdcbd0; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
.customer-layout { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .65fr); }
.customer-form { display: grid; gap: 26px; }
.customer-form > fieldset { display: grid; gap: 28px; }
.form-section { display: grid; grid-template-columns: minmax(180px, .5fr) minmax(0, 1.5fr); gap: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.age-result { margin: 14px 0 0; padding: 12px 14px; border-radius: 11px; font-size: .88rem; font-weight: 750; }
.age-result-neutral { background: #eef1f2; color: #5f6d75; }
.age-result-warning { background: var(--warning-soft); color: var(--warning); }
.age-result-ok { background: var(--ok-soft); color: var(--ok); }
.guardian-section[hidden] { display: none; }
.duplicate-panel { padding: 20px; border: 1px solid #e0c36e; border-radius: 16px; background: var(--warning-soft); color: #5f430f; }
.duplicate-panel h2 { margin-bottom: 8px; }
.duplicate-panel p { margin: 0; line-height: 1.5; }
.duplicate-panel ul { display: grid; gap: 10px; margin: 16px 0; padding-left: 20px; }
.duplicate-panel li span { display: block; margin-top: 3px; font-size: .82rem; }
.confirm-check { display: flex; gap: 10px; align-items: start; font-weight: 750; }
.confirm-check input { margin-top: 3px; accent-color: var(--teal); }
.confirm-check > span { display: grid; gap: 4px; }
.confirm-check small { color: var(--muted); font-weight: 400; }
.customer-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.customer-summary-grid .summary-card h2 { margin-bottom: 18px; }
.compact-date-form { display: grid; gap: 12px; }
.compact-date-form .field { margin-top: 0; }
.compact-date-form .secondary-button { justify-content: center; }
.customer-history { margin-top: 22px; }
.archive-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 22px; padding: 22px 24px; border: 1px solid #efc8c8; border-radius: 18px; background: var(--error-soft); }
.archive-panel p { margin: 7px 0 0; color: #7d2020; }
.ready-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 22px; padding: 22px 24px; border: 1px solid #b9dcc5; border-radius: 18px; background: var(--ok-soft); }
.ready-panel p { margin: 7px 0 0; color: #1d6739; }
.ready-panel .button { margin-top: 0; white-space: nowrap; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.month-picker { display: flex; align-items: end; gap: 10px; }
.month-picker .field { margin-top: 0; }
.usage-report { margin-top: 28px; }
.usage-report .license-grid { margin-bottom: 0; }
.contract-layout { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); }
.body-part-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: .78rem; font-weight: 750; }
.tag form { margin: 0; }
.tag-muted { background: #eef1f2; color: #5f6d75; }
.text-button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: .72rem; text-decoration: underline; cursor: pointer; }
.inline-create-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin-top: 18px; }
.contract-form > fieldset { display: grid; gap: 28px; }
.question-list { display: grid; gap: 12px; }
.question-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; }
.question-card legend { display: flex; gap: 10px; align-items: start; width: 100%; font-weight: 750; line-height: 1.45; }
.question-card legend span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: .76rem; }
.radio-row { display: flex; gap: 20px; margin-top: 14px; }
.radio-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.radio-row input { accent-color: var(--teal); }
.validation-panel { margin-bottom: 20px; padding: 20px 22px; border: 1px solid #e0c36e; border-radius: 16px; background: var(--warning-soft); color: #5f430f; }
.validation-panel h2 { margin-bottom: 10px; }
.validation-panel p { margin: 0 0 12px; line-height: 1.5; }
.validation-panel ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.validation-panel a { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.contract-status-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.contract-status-card span, .contract-status-card strong { display: block; }
.contract-status-card > div > span { margin-bottom: 4px; color: var(--muted); font-size: .78rem; }
.template-editor-form { display: grid; gap: 24px; }
.template-settings, .publish-card, .signature-form, .confirmation-submit { display: grid; gap: 18px; }
.editor-shell { display: grid; grid-template-columns: minmax(210px, .35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.editor-toolbox { position: sticky; top: 20px; display: grid; gap: 9px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.module-add { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfb; color: var(--ink); font: inherit; font-weight: 750; text-align: left; cursor: pointer; }
.module-add:hover { border-color: var(--teal); background: var(--teal-soft); }
.editor-canvas { min-height: 320px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #f6f9f9; }
.empty-editor { padding: 48px 20px; border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.module-editor-card { overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.module-editor-heading { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #eef7f5; }
.module-editor-heading > div { display: flex; flex-wrap: wrap; gap: 7px; }
.module-editor-heading .danger-button { padding: 7px 10px; font-size: .75rem; }
.module-editor-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.module-editor-body > .field:first-child, .module-editor-body > .confirm-check, .module-editor-body > .module-image-preview { grid-column: 1 / -1; }
.module-image-preview { display: block; max-width: 100%; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; }
.ack-card { display: grid; gap: 18px; margin-bottom: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.ack-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.ack-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ack-card dl > div { padding: 13px; border-radius: 12px; background: #f6f9f9; }
.ack-card dt { color: var(--muted); font-size: .75rem; }.ack-card dd { margin: 4px 0 0; font-weight: 750; }
.template-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.template-choice { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.template-choice footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.readonly-value { display: grid; align-content: center; gap: 4px; min-height: 77px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #f4f7f7; }
.readonly-value > span, .readonly-value small { color: var(--muted); }
.dynamic-module { display: grid; gap: 11px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; }
.confirm-check.dynamic-module { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; }
.confirm-check.dynamic-module input { flex: 0 0 auto; margin-top: 4px; }
.dynamic-module h3, .dynamic-module p { margin: 0; }
.contract-module-image, .confirmation-module:has(> img) { width: 100%; min-width: 0; margin: 0; box-sizing: border-box; }
.contract-module-image img.contract-image-small, .confirmation-module img.contract-image-small { width: min(100%, 220px); }
.contract-module-image img.contract-image-medium, .confirmation-module img.contract-image-medium { width: min(100%, 460px); }
.contract-module-image img.contract-align-left, .confirmation-module img.contract-align-left { margin-right: auto; }
.contract-module-image img.contract-align-center, .confirmation-module img.contract-align-center { margin-left: auto; margin-right: auto; }
.contract-module-image img.contract-align-right, .confirmation-module img.contract-align-right { margin-left: auto; }
.template-preview-dialog { width: min(900px, 96vw); max-height: 90vh; padding: 26px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px #2235; }
.template-preview-dialog::backdrop { background: #142b38a8; }
.contract-module-image img, .confirmation-module img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; }
.contract-preview { margin: 22px 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.confirmation-modules { display: grid; gap: 14px; margin-top: 20px; }
.confirmation-module { display: grid; gap: 8px; margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fafcfc; }
.confirmation-module h3, .confirmation-module p { margin: 0; }.answer-value { color: var(--teal-dark); font-weight: 800; }
.signature-current { margin-bottom: 22px; }.signature-current img, .signature-evidence { display: block; width: min(100%, 460px); max-height: 170px; margin-top: 14px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.signature-pad { display: grid; gap: 10px; }.signature-pad canvas { width: 100%; height: min(210px, 34vw); min-height: 150px; border: 2px dashed #a7babc; border-radius: 14px; background: #fff; cursor: crosshair; touch-action: none; }
.team-contract-access { display: grid; gap: 10px; }.team-contract-access details { min-width: 240px; }.team-contract-access summary { cursor: pointer; font-weight: 750; }
.material-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 16px 0; }
.material-entry-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin: 16px 0 26px; }
.material-entry { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; }
.material-entry.material-complete { border-color: #80bd91; background: #effaf2; }
.material-entry.material-needs-lot, .needs-attention { border: 2px solid #d99132 !important; border-radius: 12px; background: #fff8e8 !important; padding: 10px; }
.field.needs-attention input, .field.needs-attention select, .field.needs-attention textarea, [aria-invalid="true"] { border-color: #bc621f !important; background: #fff9ec !important; }
.dynamic-module.needs-attention { display: block; }
.material-state { display: inline-block; margin-top: 10px; font-size: .88rem; font-weight: 750; color: #766116; }
.material-complete .material-state { color: #176c39; }
.material-needs-lot .material-state { color: #9d4b12; }
.material-entry .field { margin-top: 12px; }
.material-entry[hidden] { display: none; }
.material-choice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.material-choice:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.material-choice input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); }
.material-choice span { display: grid; gap: 4px; }.material-choice small { color: var(--muted); }
.choice-expired { opacity: .55; cursor: not-allowed; }
.material-summary-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.material-summary-list article { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafcfc; }
.material-summary-list span, .material-summary-list small { color: var(--muted); }
.license-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); color: var(--muted); font-size: .78rem; }
@media (max-width: 820px) {
  .environment-label { display: none; }
  .account-nav > span { display: none; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .overall-status { width: fit-content; }
  .grid { grid-template-columns: 1fr; }
  .next-step { grid-template-columns: 1fr; }
  .auth-shell, .split-layout { grid-template-columns: 1fr; min-height: auto; }
  .portal-grid, .dashboard-primary-grid, .identity-card, .license-grid, .form-grid, .module-picker, .three-columns, .customer-summary-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: start; flex-direction: column; }
  .filter-bar, .form-section { grid-template-columns: 1fr; }
  .heading-actions { width: 100%; }
  .archive-panel, .ready-panel, .section-heading { align-items: stretch; flex-direction: column; }
  .month-picker { align-items: stretch; flex-direction: column; }
  .inline-create-form { grid-template-columns: 1fr; }
  .editor-shell, .module-editor-body, .ack-card dl { grid-template-columns: 1fr; }
  .editor-toolbox { position: static; }
  .module-editor-heading, .ack-heading { align-items: stretch; flex-direction: column; }
  .table-card { overflow-x: auto; }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .insight-grid { grid-template-columns: 1fr; }
  .dashboard-shortcuts > a { width: 100%; text-align: center; }
}

.pdf-layout-grid { display: grid; gap: 1.3rem; }
.pdf-layout-grid > section { border-top: 1px solid var(--border, #d9dfe2); padding-top: .8rem; }
.pdf-slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.pdf-slot { display: grid; gap: .45rem; border: 1px solid var(--border, #d9dfe2); border-radius: .7rem; padding: .8rem; min-width: 0; }
.pdf-slot .field { min-width: 0; }
.pdf-slot input, .pdf-slot select { width: 100%; }
@media (max-width: 780px) { .pdf-slot-grid { grid-template-columns: 1fr; } }

/* v2 studio experience */
:root {
  --ink: #252826;
  --muted: #5d6862;
  --paper: #f5f2ec;
  --surface: #fffdfa;
  --teal: #8d4f3b;
  --teal-dark: #633526;
  --teal-soft: #f3e6df;
  --line: #dcd8d0;
  --ok: #326445;
  --ok-soft: #e9f2e8;
  --warning: #805021;
  --warning-soft: #fff1db;
  --shadow: 0 12px 34px rgba(38, 34, 28, .055);
}
html { font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif; }
:focus-visible { outline: 3px solid #b76e4d; outline-offset: 3px; }
.topbar { background: #fffdfa; }
.brand-mark { background: var(--ink); border-radius: 11px; }
.brand small { color: #776a60; }
.primary-nav { background: #292d2b; gap: 4px; padding-block: 7px; overflow-x: auto; flex-wrap: nowrap; }
.primary-nav a { color: #f9f5ec; white-space: nowrap; padding: 10px 16px; border-radius: 9px; font-size: .92rem; }
.primary-nav a:hover, .primary-nav a:focus-visible { background: #454b46; text-decoration: none; }
.shell { padding-top: clamp(28px, 5vw, 56px); }
.eyebrow { color: var(--teal); }
.page-heading h1 { font-size: clamp(2rem, 4.2vw, 3.75rem); line-height: 1.06; }
.dashboard-intro h1 { max-width: 800px; font-size: clamp(2.2rem, 5vw, 4.4rem); }
.dashboard-intro { max-width: 850px; }
.button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.button { color: white; }
.dashboard-shortcuts { margin: 22px 0 28px; }
.dashboard-primary-card { min-height: 170px; background: #fffdfa; }
.dashboard-primary-card h2 { font-size: clamp(1.45rem, 2.8vw, 1.85rem); }
.dashboard-agenda { margin: 24px 0 28px; padding: clamp(20px, 4vw, 28px); background: #fffdfa; border: 1px solid var(--line); border-radius: 21px; box-shadow: var(--shadow); }
.dashboard-agenda > p { color: var(--muted); margin-bottom: 0; }
.dashboard-agenda .section-heading { margin-bottom: 12px; }
.dashboard-agenda .section-heading h2 { font-size: 1.35rem; }
.dashboard-appointment { display: grid; grid-template-columns: 145px 1fr auto; align-items: center; gap: 18px; padding: 16px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.dashboard-appointment:hover { color: var(--teal-dark); }
.dashboard-appointment span:first-child strong, .dashboard-appointment span:nth-child(2) strong { display: block; }
.dashboard-appointment small { display: block; margin-top: 4px; color: var(--muted); }
.dashboard-insights details { padding-top: 14px; border-top: 1px solid var(--line); }
.dashboard-insights summary { cursor: pointer; font-weight: 700; }
.session-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.week-calendar { background: #fffdfa; border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 18px; }
.week-calendar-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.week-calendar-heading strong, .week-calendar-heading small { display: block; }
.week-calendar-heading small { color: var(--muted); margin-top: 3px; }
.week-calendar-heading > div:last-child { display: flex; gap: 6px; }
.week-calendar-heading .secondary-button { min-width: 40px; text-align: center; padding: 8px; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { display: grid; justify-items: center; gap: 5px; padding: 12px 4px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 10px; }
.week-day:hover, .week-day.current { background: #e9f1ed; border-color: #708e80; }
.week-day > span { text-transform: uppercase; font-size: .72rem; color: var(--muted); }
.week-day > strong { font-size: 1.2rem; }
.week-day > small { color: var(--muted); text-align: center; font-size: .72rem; }
.route-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-block: 14px; }
.route-actions form { display: flex; gap: 8px; align-items: center; margin: 0; }
.route-actions select { min-height: 42px; max-width: 175px; }
.signer-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.signer-status { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.session-filters label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.session-filters input { width: min(220px, 100%); min-height: 44px; border: 1px solid #aab4aa; border-radius: 9px; padding: 8px 10px; background: #fff; font: inherit; }
.session-list { background: #fffdfa; border: 1px solid var(--line); border-radius: 19px; overflow: hidden; box-shadow: var(--shadow); }
.session-row { display: grid; grid-template-columns: 150px minmax(180px, 1fr) minmax(110px, .55fr) auto 24px; align-items: center; gap: 16px; min-height: 88px; padding: 16px 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
.session-row:last-child { border-bottom: 0; }
.session-row:hover { background: #faf5ee; }
.session-row strong, .session-row small { display: block; }
.session-row small { margin-top: 4px; color: var(--muted); }
.session-practitioner { color: var(--muted); }
.empty-state { padding: 28px; }
.step-nav { display: flex; gap: 6px; overflow-x: auto; margin: 20px 0 26px; }
.step-nav a { flex: 0 0 auto; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; font-weight: 700; text-decoration: none; font-size: .88rem; }
.step-nav a:hover { border-color: var(--teal); }
.session-steps { display: grid; gap: 18px; }
.session-step { padding: clamp(20px, 4vw, 30px); background: #fffdfa; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); scroll-margin-top: 22px; }
.session-step > p { line-height: 1.55; }
.step-head { display: flex; align-items: start; gap: 16px; margin-bottom: 16px; }
.step-head h2 { font-size: 1.5rem; }
.step-head p { color: var(--muted); margin: 5px 0 0; }
.step-number { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; }
.intake-answer { padding: 12px 0; border-bottom: 1px solid var(--line); }
.intake-answer p { margin: 5px 0; white-space: pre-wrap; }
.intake-answer small { white-space: pre-wrap; color: var(--muted); }
.review-form { max-width: 780px; padding-top: 14px; }
.product-list { margin: 14px 0; }
.product-line { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.product-line span { color: var(--muted); }
.product-form { padding-top: 12px; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.aftercare-copy { padding: 16px; border-radius: 12px; background: var(--ok-soft); white-space: pre-wrap; }
.aftercare-copy small { color: var(--muted); }
.done-line { color: var(--ok); font-weight: 750; }
.session-history { margin-top: 22px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; }
.session-history summary { font-weight: 750; cursor: pointer; }
.session-history li { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.session-history time { flex: 0 0 145px; color: var(--muted); }
.intake-public { max-width: 800px; margin: 0 auto; }
.intake-public h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.intake-public > .form-card { margin-top: 28px; }
.intake-public .dynamic-module { margin: 16px 0; }
.intake-public .confirm-check { display: flex; align-items: flex-start; gap: 12px; }
@media (max-width: 740px) {
  .week-days { gap: 2px; }
  .week-day { padding: 8px 1px; }
  .week-day > small { font-size: .62rem; }
  .session-row { grid-template-columns: 94px minmax(120px, 1fr) auto; gap: 10px; padding: 15px; }
  .session-row .session-practitioner, .session-row > span:last-child { display: none; }
  .session-row .status { grid-column: 2; }
  .dashboard-appointment { grid-template-columns: 95px 1fr auto; gap: 10px; }
  .form-columns { grid-template-columns: 1fr; }
  .session-history li { display: block; }
  .session-history time { display: block; }
  .account-nav { gap: 7px; }
  .topbar { min-height: 68px; padding-inline: 18px; }
  .account-nav > a { font-size: .83rem; }
}

/* Public product pages */
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px clamp(20px, 5vw, 72px); background: #fffdfa; border-bottom: 1px solid var(--line); }
.public-header nav { display: flex; align-items: center; gap: 18px; }
.public-header nav > a:not(.secondary-button) { text-decoration: none; font-weight: 700; }
.public-header nav > a:hover { text-decoration: underline; }
.public-shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; flex: 1; }
.public-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: clamp(28px, 6vw, 90px); align-items: center; min-height: 600px; padding: 65px 0 70px; }
.public-hero h1 { font-size: clamp(3rem, 6.2vw, 5.6rem); line-height: 1.02; }
.public-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.public-visual { padding: clamp(24px, 4vw, 42px); background: #292d2b; color: #fffdfa; border-radius: 24px; box-shadow: 0 28px 65px #2528262b; }
.public-visual .eyebrow { color: #e7ad8f; }
.public-visual h2 { font-size: 1.8rem; margin-bottom: 25px; }
.public-visual ol, .public-visual ul { list-style: none; margin: 0; padding: 0; }
.public-visual li { padding: 16px 0; border-top: 1px solid #5e625c; line-height: 1.5; }
.public-visual li span { margin-right: 13px; color: #e7ad8f; font-weight: 800; }
.public-section { padding: 55px 0; border-top: 1px solid var(--line); }
.public-section > h2, .public-business h2 { max-width: 690px; font-size: clamp(1.9rem, 4vw, 3.3rem); line-height: 1.1; }
.public-section > p { max-width: 760px; line-height: 1.65; color: var(--muted); }
.public-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 27px; }
.public-cards > article, .public-cards > a { display: block; padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: #fffdfa; text-decoration: none; }
.public-cards h3 { margin: 0 0 10px; font-size: 1.2rem; }
.public-cards p { margin: 0; color: var(--muted); line-height: 1.5; }
.public-cards > a { font-size: 1.25rem; font-weight: 750; }
.public-cards > a:hover { border-color: var(--teal); }
.public-footer { display: flex; justify-content: space-between; gap: 16px; padding: 28px clamp(20px, 5vw, 72px); background: #292d2b; color: #fffdfa; }
.public-footer a { color: #fffdfa; }
.public-plans-intro { max-width: 760px; padding: 70px 0 40px; }
.public-plans-intro h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.public-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; padding-bottom: 55px; }
.public-plan { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #fffdfa; }
.public-plan h2 { font-size: 1.6rem; }
.public-price { margin: 22px 0; font-size: 2.2rem; font-weight: 800; }
.public-price small { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.public-plan ul { margin: 0; padding-left: 20px; line-height: 2; }
.public-note { max-width: 800px; padding: 21px; border-left: 5px solid var(--teal); background: #fffdfa; }
.public-note p { margin-bottom: 0; }
@media (max-width: 820px) {
  .public-header { align-items: flex-start; flex-direction: column; }
  .public-header nav { max-width: 100%; overflow-x: auto; gap: 14px; padding-bottom: 5px; }
  .public-header nav a { white-space: nowrap; }
  .public-hero, .public-plan-grid { grid-template-columns: 1fr; min-height: 0; }
  .public-cards { grid-template-columns: 1fr; }
  .public-footer { flex-wrap: wrap; }
}
.qr-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:1.25rem; margin:1.5rem 0; }
.qr-card { background:#fff; border:1px solid #d7d1c6; border-radius:18px; padding:1.5rem; max-width:540px; }
.qr-card svg { display:block; background:#fff; width:min(100%,320px); height:auto; margin:1rem auto; padding:.5rem; border:1px solid #d7d1c6; }
.qr-print { text-align:center; margin-top:1.5rem; overflow-wrap:anywhere; }
.qr-print svg { width:min(100%,300px); height:auto; display:block; margin:1rem auto; }
.execution-picker { display:grid; gap:1.1rem; margin-top:1.4rem; }
.execution-sets,.execution-choices { display:grid; gap:.7rem; padding:1rem; border:1px solid var(--line,#d9e2dd); border-radius:12px; }
.execution-set > summary,.execution-manual > summary { cursor:pointer; list-style:none; }
.execution-set > .form-card,.execution-manual > .product-form { margin-top:.8rem; }
.execution-set-line { display:grid; grid-template-columns:minmax(180px,1fr) minmax(145px,230px); gap:.8rem; align-items:center; padding:.6rem 0; border-bottom:1px solid var(--line,#d9e2dd); }
.product-choice-list { display:flex; flex-wrap:wrap; gap:.45rem; max-height:200px; overflow:auto; }
.product-choice { white-space:normal; text-align:left; font-size:.88rem; }
.product-choice[hidden] { display:none !important; }
@media (max-width:620px) { .execution-set-line { grid-template-columns:1fr; } }
.qr-card .qr-code-label { padding:.85rem; border-radius:10px; background:#f5f0e7; text-align:center; }
.qr-card .qr-code-label strong { display:block; font-size:1.8rem; letter-spacing:.2em; font-variant-numeric:tabular-nums; }
.print-report { max-width:850px; margin:0 auto; padding:2rem; background:#fff; border:1px solid #d7d1c6; border-radius:14px; }
.print-report table { width:100%; border-collapse:collapse; }
.print-report th, .print-report td { padding:.7rem; text-align:left; border-bottom:1px solid #d7d1c6; }
.print-report .report-aftercare { white-space:pre-wrap; line-height:1.6; }
.print-actions { max-width:850px; margin:1rem auto; }
@media print { .topbar, .primary-nav, .footer, .persistent-notice, .print-actions { display:none !important; } .shell { max-width:none; padding:0; } .print-report { border:0; padding:0; max-width:none; } }
.appointment-summary { padding: 1rem 1.15rem; border-radius: .8rem; background: var(--surface-2, #f2f6f4); border: 1px solid var(--line, #d9e2dd); font-size: 1.02rem; }
.appointment-editor { width: 100%; }
.appointment-editor > summary { display: inline-flex; cursor: pointer; list-style: none; }
.appointment-editor > summary::-webkit-details-marker { display: none; }
.appointment-editor > .form-card { margin-top: 1rem; }
.consent-invitations { margin-top: 1.25rem; display: grid; gap: .8rem; }
.consent-invitations > .review-form { border: 1px solid var(--line, #d9e2dd); border-radius: .8rem; padding: 1rem; }

/* Five-step dossier: short summaries with a single open task by default. */
.step-panel > summary { cursor: pointer; margin: 0; list-style: none; align-items: center; }
.step-panel > summary::-webkit-details-marker { display: none; }
.step-panel > summary::after { content: '⌄'; color: var(--teal); font-size: 1.3rem; margin-left: auto; }
.step-panel[open] > summary::after { transform: rotate(180deg); }
.step-panel > summary > div { flex: 1; min-width: 0; }
.step-panel > summary .status { white-space: nowrap; }
.step-panel[open] > summary { margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.step-body > :first-child { margin-top: 0; }
.session-step { scroll-margin-top: 22px; }
.session-filters select { min-height: 44px; border: 1px solid #aab4aa; border-radius: 9px; padding: 8px 10px; background: #fff; font: inherit; }
.public-journey { list-style: none; padding: 0; display: grid; gap: 10px; margin: 28px 0; }
.public-journey li { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.public-journey li.is-done { background: var(--ok-soft); border-color: #b8ddc5; }
.public-journey li.is-active { background: var(--teal-soft); border-color: #bdd9da; }
.public-journey strong, .public-journey span { display: block; }
.public-journey span { color: var(--muted); line-height: 1.55; margin-top: 5px; }
@media (max-width: 740px) { .step-panel > summary { flex-wrap: wrap; } .step-panel > summary .status { margin-left: 54px; } }

/* Phase 1 feedback hardening */
.module-editor-heading > div { align-items: center; }
.module-editor-heading .small-button, .module-editor-heading .danger-button { min-height: 36px; padding: 8px 11px; border-radius: 10px; font-size: .78rem; line-height: 1; }
.module-editor-heading .danger-button { margin-left: 2px; }
.module-editor-heading input[type="number"] { width: 76px; min-height: 36px; padding: 7px 9px; }
.template-access-section { display: grid; gap: 16px; }
.template-access-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; padding: 0; border: 0; }
.template-access-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; min-height: 70px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; cursor: pointer; }
.template-access-card:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal); }
.template-access-card input { width: 18px; height: 18px; accent-color: var(--teal); }
.template-access-card span { display: grid; gap: 3px; }
.template-access-card small { color: var(--muted); }
.template-access-state { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.template-access-card:has(input:checked) .template-access-state { color: var(--teal-dark); }
.monthly-signatures { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; margin-top: 14px; }
.monthly-signatures article { display: grid; gap: 3px; min-height: 92px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafcfc; }
.monthly-signatures article span, .monthly-signatures article small { color: var(--muted); }
.monthly-signatures article strong { font-size: 1.6rem; line-height: 1; }
@media (max-width: 520px) { .template-access-grid { grid-template-columns: 1fr; } }

.calendar-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; width: 100%; margin: 14px 0 4px; }
.calendar-actions a { display: flex; align-items: center; justify-content: center; min-height: 46px; text-align: center; }
.pending-invites { margin: 20px 0; padding: 20px; border: 1px solid #e4c67a; border-radius: 16px; background: #fff9e9; }
.pending-invite-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 10px; }
.pending-invite-grid article { display: grid; gap: 5px; padding: 14px; border: 1px solid #ead9a9; border-radius: 12px; background: #fff; }
.pending-invite-grid span, .pending-invite-grid small { color: var(--muted); }
.pending-invite-grid em { width: fit-content; padding: 4px 8px; border-radius: 999px; background: #fff0be; color: #76580a; font-size: .75rem; font-style: normal; font-weight: 800; }
.practitioner-note { border-color: #9ec8bf; background: #f3fbf8; }

.agreement-preview { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; }
.agreement-preview > summary { cursor: pointer; font-weight: 800; }
.ack-preview-content { display: grid; gap: 10px; margin-top: 14px; }
.ack-preview-content section { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ack-preview-content h4 { margin: 0 0 5px; }
.ack-preview-content p { margin: 0; }

/* Studio build 1-6: shared spacing, navigation and predictable actions. */
.studio-layout { display:grid; grid-template-columns:200px minmax(0,1fr); align-items:start; gap:28px; width:min(1360px,calc(100% - 48px)); padding-top:38px; }
.studio-content { min-width:0; }
.studio-content h1 { font-size:clamp(2rem,3.8vw,3.3rem); line-height:1.08; }
.studio-sidebar { position:sticky; top:24px; background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:14px; }
.studio-sidebar-title { display:block; padding:10px 12px 18px; font-weight:800; text-decoration:none; }
.studio-sidebar nav { display:grid; gap:4px; }
.studio-sidebar nav a { display:block; padding:11px 12px; border-radius:10px; text-decoration:none; font-weight:650; font-size:.9rem; }
.studio-sidebar nav a:hover { background:#f0f5f5; }
.studio-sidebar nav a[aria-current] { background:var(--teal); color:white; }
.management-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:20px 0; }
.management-card { display:flex; flex-direction:column; min-width:0; padding:24px; gap:10px; border:1px solid var(--line); border-radius:18px; background:var(--surface); text-decoration:none; }
.management-card:hover { border-color:var(--teal); box-shadow:var(--shadow); }
.management-card h2 { line-height:1.25; }
.management-card p { color:var(--muted); margin:0; line-height:1.5; }
.management-card span { color:var(--teal); font-size:.85rem; font-weight:750; margin-top:auto; padding-top:12px; }
.metric-card { display:flex; flex-direction:column; gap:10px; padding:22px; border:1px solid var(--line); border-radius:18px; background:var(--surface); text-decoration:none; min-width:0; }
.metric-card strong { font-size:1.65rem; letter-spacing:-.03em; }
.metric-card small { color:var(--muted); line-height:1.45; }
.studio-content .license-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.module-price { display:flex; flex-direction:column; align-items:flex-start; padding:20px; gap:10px; border:1px solid var(--line); border-radius:14px; min-width:0; }
.module-price h3,.module-price p { margin:0; }
.module-price form { margin-top:auto; }
.module-price .secondary-button { white-space:normal; text-align:left; }
.quote-confirmation { padding:24px; border:2px solid var(--teal); background:#f2f8f8; border-radius:14px; margin:24px 0; }
.action-row,.preview-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:20px 0; }
.action-row .button,.action-row .secondary-button,.heading-actions .button,.route-actions .button,.row-actions .button { margin-top:0; }
.row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.row-actions form,.action-row form { margin:0; }
.button,.secondary-button,.small-button,.danger-button { justify-content:center; align-items:center; line-height:1.35; min-height:42px; box-sizing:border-box; max-width:100%; }
.small-button { padding:9px 12px; border-radius:10px; font-weight:700; font-size:.84rem; }
button:disabled { opacity:.5; cursor:not-allowed; }
.table-card > h2,.table-card > h3 { padding:24px 24px 12px; }
.table-title { padding:24px; }
.table-title h2 { margin:0; }
.table-title p { margin:10px 0 0; max-width:70ch; color:var(--muted); line-height:1.55; }
.table-scroll { overflow-x:auto; max-width:100%; }
.table-card { margin-bottom:22px; overflow:hidden; }
.table-card td,.table-card th { overflow-wrap:anywhere; }
.table-card table { min-width:0; }
.form-card + .form-card { margin-top:20px; }
.field,.form-grid > *,fieldset { min-width:0; }
fieldset { border:0; padding:0; margin:0; }
fieldset legend { display:block; padding:0 0 10px; font-weight:750; }
.module-picker legend { grid-column:1/-1; }
.module-picker .check-card { min-width:0; align-items:flex-start; }
.check-card input,.confirm-check input { flex-shrink:0; }
.section-heading { flex-wrap:wrap; gap:16px; }
.summary-list div,.detail-list div { flex-wrap:wrap; }
.email-preview { display:block; width:100%; height:730px; margin:20px 0; border:1px solid var(--line); border-radius:18px; background:white; }
.email-text-preview { max-width:680px; margin:24px auto; background:white; border:1px solid var(--line); border-radius:18px; padding:clamp(22px,4vw,40px); }
.email-text-preview h2 { padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.message-body,.practitioner-note p,.change-summary li p { white-space:pre-line; overflow-wrap:anywhere; line-height:1.65; }
.change-summary { background:#eef6f7; border:1px solid #c4dfe2; border-radius:18px; padding:26px; margin:22px 0; }
.change-summary h2 { margin-bottom:18px; }
.change-summary ul { margin:0; padding-left:22px; }
.change-summary li + li { margin-top:16px; }
.change-summary p { line-height:1.5; }
.customer-progress { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; list-style:none; padding:0; margin:28px 0; }
.customer-progress li { display:flex; flex-direction:column; gap:9px; padding:12px 6px; border-top:3px solid var(--line); color:var(--muted); }
.customer-progress li span { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#edf1f2; font-weight:750; }
.customer-progress li small { line-height:1.4; }
.customer-progress li.done { border-color:var(--teal); }
.customer-progress li.done span { background:var(--teal); color:white; }
.customer-progress li.current { border-color:var(--teal); color:var(--ink); font-weight:750; }
.customer-progress li.current span { background:var(--ink); color:white; }
.next-action { background:#f3f7f8; border-radius:14px; padding:20px; }
.next-action h3 { margin:0 0 8px; }
.next-action p { margin:0; line-height:1.6; }
.customer-dossiers { display:grid; gap:22px; }
.customer-dossier .section-heading h2 { margin:0; }
.customer-dossier .action-row { margin-bottom:0; }
.licensed-fields { margin-top:24px; border-top:1px solid var(--line); padding-top:24px; }
:focus-visible { outline:3px solid #63aeb6; outline-offset:3px; }
@media(max-width:1000px) {
  .studio-layout { grid-template-columns:170px minmax(0,1fr); gap:20px; }
  .studio-content .split-layout { grid-template-columns:1fr; }
  .studio-content .license-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .studio-layout { display:block; width:calc(100% - 28px); padding-top:20px; }
  .studio-sidebar { position:static; margin-bottom:26px; padding:12px; }
  .studio-sidebar-title { padding-bottom:10px; }
  .studio-sidebar nav { display:flex; overflow-x:auto; padding-bottom:5px; gap:5px; }
  .studio-sidebar nav a { flex-shrink:0; }
  .management-grid,.studio-content .license-grid { grid-template-columns:1fr; }
  .studio-content .form-card { padding:22px 18px; }
  .table-card { overflow-x:auto; }
  .table-card table { min-width:480px; }
  .row-actions { flex-direction:column; align-items:flex-start; }
  .route-actions,.heading-actions,.action-row { align-items:stretch; }
  .route-actions > a,.route-actions > button,.action-row > a,.heading-actions > a { width:100%; }
  .customer-progress { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
  .email-preview { height:820px; }
  .quote-confirmation { padding:18px; }
  .topbar { flex-wrap:wrap; }
}

.invitation-dialog { max-width: min(38rem, calc(100vw - 2rem)); border: 1px solid var(--border, #ddd); border-radius: 18px; padding: 1.5rem; box-shadow: 0 24px 70px #0003; }
.invitation-dialog::backdrop { background: #16223680; }
.invitation-dialog h2 { margin-top: 0; line-height: 1.2; }
.invitation-dialog .route-actions { margin-block: 1.2rem; }
/* Narrow screens: a status must not squeeze the appointment into one-word lines. */
@media (max-width: 640px) {
  .step-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) 16px; gap: 10px 12px; align-items: start; }
  .step-head .step-number { grid-column: 1; grid-row: 1; width: 32px; height: 34px; }
  .step-head > div { grid-column: 2; grid-row: 1; min-width: 0; }
  .step-head > .status { grid-column: 2; grid-row: 2; justify-self: start; max-width: 100%; white-space: normal; }
  .step-head::after { grid-column: 3; grid-row: 1; }
  .step-head h2 { font-size: 1.25rem; line-height: 1.3; overflow-wrap: normal; }
  .step-head p { line-height: 1.5; }
  .review-form .field small { font-weight: 400; line-height: 1.5; color: var(--muted); }
}

@media (min-width: 900px) {
  .team-contract-access { grid-template-columns: repeat(2, minmax(112px, 1fr)); min-width: 238px; gap: 8px; }
  .team-contract-access form { margin: 0; }
  .team-contract-access form button { width: 100%; }
}
