/* Ecurem Alias — self-hosted, dependency-free mobile interface. */
:root {
  color-scheme: light;
  --navy: #123c69;
  --mint: #72ddb2;
  --green: #087c61;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #edf3f8;
  --text: #162c43;
  --muted: #5b6b7d;
  --line: #dae4ee;
  --soft-line: #e9eef4;
  --focus: #087c61;
  --success-bg: #e9f7f1;
  --success-text: #096c52;
  --warning-bg: #fff5e0;
  --warning-text: #82500a;
  --danger-bg: #fff0ed;
  --danger-text: #ab312b;
  --shadow: 0 8px 24px rgb(18 60 105 / 5%);
  --radius: 22px;
  --content-width: 980px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #72ddb2;
  --bg: #0b1523;
  --surface: #132236;
  --surface-raised: #1a2c42;
  --surface-muted: #1d3148;
  --text: #f0f5fb;
  --muted: #a7b9cd;
  --line: #2e435a;
  --soft-line: #22354a;
  --focus: #72ddb2;
  --success-bg: #12372f;
  --success-text: #a0e8ca;
  --warning-bg: #3b301b;
  --warning-text: #f1cf85;
  --danger-bg: #3d2426;
  --danger-text: #ffb5ad;
  --shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-padding-top: 88px; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 1rem; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
button, input, textarea, select { max-width: 100%; }
img, svg, canvas, video { max-width: 100%; }
svg { vertical-align: middle; }
a { color: var(--green); text-underline-offset: .2em; }
:root[data-theme="dark"] a { color: var(--mint); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: 2rem; letter-spacing: -.055em; font-weight: 780; }
h2 { font-size: 1.375rem; letter-spacing: -.035em; font-weight: 750; }
h3 { font-size: 1.0625rem; letter-spacing: -.015em; font-weight: 700; }
ul, ol { padding-inline-start: 1.4rem; }
li + li { margin-top: .45rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: 1rem; padding: .75rem 1rem; border-radius: 12px; background: var(--surface); transform: translateY(-180%); box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); }
.muted { color: var(--muted); }
.small, small { font-size: .875rem; }
.mono, code, .record-value { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.text-center { text-align: center; }
.break-anywhere { overflow-wrap: anywhere; }
.stack { display: grid; gap: 1rem; }
.row, .inline-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.icon { display: inline-block; width: 24px; height: 24px; flex: 0 0 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(6.75rem + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: calc(1rem + env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 1rem max(1.25rem, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(100%, var(--content-width)); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: var(--navy); color: var(--mint); border-radius: 14px; overflow: hidden; }
.brand-mark .icon { width: 27px; height: 27px; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-text { min-width: 0; }
.brand-name { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.2; letter-spacing: -.045em; }
.brand-caption { display: block; margin-top: .2rem; color: var(--muted); font-size: .8125rem; }
.header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: .4rem; }
.header-actions .session-close { max-width: 8rem; gap: .35rem; padding: .55rem .6rem; }
.content { width: min(100%, var(--content-width)); margin: 0 auto; padding: .2rem max(1.25rem, env(safe-area-inset-right)) 1.5rem max(1.25rem, env(safe-area-inset-left)); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin: .4rem 0 1.5rem; }
.page-heading h1 { font-size: 1.75rem; }
.page-heading p { margin-top: .5rem; color: var(--muted); }
.page-title { font-size: 1.75rem; margin: .5rem 0 1.25rem; }
.eyebrow { font-size: .8125rem; letter-spacing: .11em; text-transform: uppercase; font-weight: 750; }

.hero { position: relative; overflow: hidden; padding: 1.75rem; border-radius: 27px; color: #fff; background: linear-gradient(125deg, #123c69, #174b77); box-shadow: 0 14px 32px rgb(18 60 105 / 12%); }
.hero::after { content: ""; position: absolute; right: -92px; top: -130px; width: 300px; height: 300px; border: 1px solid rgb(114 221 178 / 18%); border-radius: 50%; box-shadow: 0 0 0 38px rgb(114 221 178 / 4%), 0 0 0 77px rgb(114 221 178 / 3%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.hero .eyebrow { color: #c5d8ec; }
.hero h1, .hero h2 { font-size: clamp(1.875rem, 5vw, 2.5rem); letter-spacing: -.05em; line-height: 1.12; font-weight: 780; max-width: 18ch; margin: 1.2rem 0 .9rem; }
.hero-lead { display: flex; align-items: flex-start; gap: .6rem; color: #dbe9f7; font-size: .9375rem; max-width: 45ch; }
.hero-lead .icon { width: 20px; height: 20px; flex-basis: 20px; color: var(--mint); margin-top: .1rem; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; border-top: 1px solid rgb(255 255 255 / 19%); padding-top: 1.1rem; margin-top: 1.5rem; font-size: .9375rem; }
.hero-bottom strong { font-weight: 650; }
.hero-bottom .plan-label { color: var(--mint); font-size: .8125rem; font-weight: 750; letter-spacing: .08em; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .35rem .65rem; border-radius: 999px; font-size: .8125rem; font-weight: 650; line-height: 1.25; white-space: nowrap; background: var(--surface-muted); color: var(--muted); }
.pill .icon { width: 15px; height: 15px; flex-basis: 15px; }
.pill.mint { color: var(--success-text); background: var(--success-bg); }
.hero .pill.mint { color: #a0f1cc; background: rgb(255 255 255 / 9%); border: 1px solid rgb(114 221 178 / 20%); }
.pill.warning { background: var(--warning-bg); color: var(--warning-text); }
.pill.subtle { border: 1px solid var(--line); background: transparent; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem; margin: 1.25rem 0; }
.stat { padding: 1.2rem; background: var(--surface); border: 1px solid var(--soft-line); border-radius: 18px; }
.stat-value, .stat strong { display: block; font-size: 1.75rem; line-height: 1.15; font-weight: 750; letter-spacing: -.05em; }
.stat-label, .stat > span { color: var(--muted); font-size: .875rem; }
.stat .icon { margin-bottom: .5rem; color: var(--green); }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem; margin: 1.25rem 0; }
.action-card { min-height: 110px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .7rem; border: 1px solid var(--line); border-radius: 19px; padding: 1.1rem; background: var(--surface); text-align: left; color: var(--text); font-weight: 650; font-size: .9375rem; transition: border-color .15s, transform .15s; }
.action-card .icon { color: var(--green); width: 27px; height: 27px; }
.action-card small { font-weight: 400; color: var(--muted); }
.action-card:active { transform: scale(.985); }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin: 1.75rem 0 .875rem; }
.section-heading h2 { font-size: 1.3rem; }
.section-heading .text-button { margin-right: -.5rem; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: .875rem; font-weight: 650; padding: .65rem .5rem; min-height: 44px; border-radius: 10px; }
:root[data-theme="dark"] .text-button { color: var(--mint); }
.card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--soft-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.record-list { display: grid; gap: .8rem; }
.record-card { background: var(--surface); border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.record-main { display: flex; align-items: center; gap: .75rem; min-width: 0; }
button.record-main { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }
.record-copy { min-width: 0; flex: 1; }
.record-title { display: block; font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.record-meta { display: block; color: var(--muted); font-size: .875rem; margin-top: .2rem; overflow-wrap: anywhere; }
.record-type { display: block; color: var(--muted); font-size: .8125rem; margin-top: .35rem; }
.institution-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 15px; color: #123c69; background: #e9eff7; font-size: 1.0625rem; font-weight: 750; line-height: 1; }
.institution-mark.wave { background: #e5f4fc; color: #0877a6; }
.institution-mark.orange { background: #fff0e6; color: #a84904; }
.institution-mark.bank { background: #eaf4ed; color: #286441; }
.record-value { margin-top: .85rem; padding: .4rem .3rem .4rem .8rem; display: flex; align-items: center; gap: .25rem; border-radius: 13px; background: var(--surface-muted); min-width: 0; font-size: .9375rem; }
.record-value > span, .record-value > code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.record-value .icon-button { width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; }
.record-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.record-actions.below { justify-content: flex-end; padding-top: .6rem; }
.record-note { margin-top: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: .9375rem; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: .55rem; border: 0; border-radius: 13px; background: transparent; color: var(--muted); }
.icon-button.bordered { background: var(--surface); border: 1px solid var(--line); }
.icon-button.active, .icon-button[aria-pressed="true"] { color: #956b13; background: #fbf2db; }
.icon-button.danger { color: var(--danger-text); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; padding: 2rem 1.25rem; border: 1px solid var(--soft-line); border-radius: var(--radius); background: var(--surface); }
.empty-state > .icon, .empty-state .empty-icon { width: 58px; height: 58px; border-radius: 19px; padding: 15px; background: var(--surface-muted); color: var(--navy); }
:root[data-theme="dark"] .empty-state > .icon { color: #a6cfff; }
.empty-state h2, .empty-state h3 { font-size: 1.0625rem; }
.empty-state p { font-size: .9375rem; color: var(--muted); max-width: 36ch; }
.empty-state .button { margin-top: .4rem; }

.search-field { position: relative; display: block; margin: 1rem 0; }
.search-field > .icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 2.9rem; }
.filter-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .9rem 0 1.25rem; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: .5rem .9rem; font-weight: 600; font-size: .875rem; border-radius: 999px; }
.chip.active, .chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: white; }
.chip .icon { width: 18px; height: 18px; flex-basis: 18px; }

.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 1px solid var(--line); border-radius: 15px; padding: .75rem 1.2rem; background: var(--surface); color: var(--navy); font-size: .9375rem; font-weight: 700; text-decoration: none; line-height: 1.35; text-align: center; transition: background-color .15s, border-color .15s; }
.button.primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.button.secondary { color: var(--green); background: var(--success-bg); border-color: transparent; }
.button.danger { color: var(--danger-text); background: var(--danger-bg); border-color: transparent; }
.button.small { min-height: 42px; padding: .6rem .85rem; font-size: .875rem; border-radius: 12px; }
.button.full { width: 100%; }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button .icon { width: 20px; height: 20px; flex-basis: 20px; }
:root[data-theme="dark"] .button:not(.primary):not(.danger):not(.ghost) { color: #a8dbc9; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.button-row > .button { flex: 1; }
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; min-width: 0; }
.field > label, label.field > span:first-child, .field-label { font-size: .9375rem; font-weight: 650; }
.field-hint { font-size: .875rem; color: var(--muted); line-height: 1.45; }
.field-error, .form-error { color: var(--danger-text); font-size: .9375rem; }
.form-error:not(:empty) { padding: .8rem 1rem; border-radius: 12px; background: var(--danger-bg); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.form-actions .button { flex: 1; }
input, select, textarea { border: 1px solid var(--line); border-radius: 14px; min-height: 51px; width: 100%; background: var(--surface); color: var(--text); padding: .8rem .9rem; font-size: 1rem; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[readonly] { background: var(--surface-muted); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger-text); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 20px; accent-color: var(--green); flex: 0 0 20px; }
input[type="file"] { padding: .55rem; font-size: .875rem; }
input::file-selector-button { font: inherit; font-weight: 600; color: var(--text); padding: .6rem .75rem; margin-right: .75rem; background: var(--surface-muted); border: 0; border-radius: 9px; }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%2365798b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right .65rem center; background-repeat: no-repeat; background-size: 20px; }
.checkbox-field { display: flex; align-items: flex-start; gap: .65rem; font-size: .9375rem; }
.checkbox-field input { margin: .15rem 0 0; }
.password-field { position: relative; }
.password-field input { padding-right: 3.2rem; }
.password-field .icon-button { position: absolute; top: 4px; right: 5px; }

.notice { display: flex; align-items: flex-start; gap: .65rem; padding: 1rem; border-radius: 16px; background: var(--surface-muted); color: var(--text); font-size: .9375rem; line-height: 1.45; margin: 1rem 0; }
.notice > .icon { flex: 0 0 20px; width: 20px; height: 20px; margin-top: .1rem; }
.notice p + p { margin-top: .5rem; }
.notice.warning { background: var(--warning-bg); color: var(--warning-text); }
.notice.success { background: var(--success-bg); color: var(--success-text); }
.notice.danger { background: var(--danger-bg); color: var(--danger-text); }
.notice .text-button { padding: .35rem 0; min-height: 36px; color: inherit; }
.offline-banner { margin: 0 auto; max-width: calc(var(--content-width) - 2.5rem); padding: .6rem 1rem; border-radius: 12px; background: var(--warning-bg); color: var(--warning-text); font-size: .875rem; text-align: center; }
.settings-list { border-radius: var(--radius); border: 1px solid var(--soft-line); overflow: hidden; background: var(--surface); }
.settings-row { display: flex; align-items: center; gap: .85rem; width: 100%; padding: 1.05rem 1.1rem; border: 0; background: transparent; text-align: left; min-height: 76px; color: var(--text); }
.settings-row + .settings-row { border-top: 1px solid var(--soft-line); }
.settings-row > .icon { color: var(--green); flex: 0 0 23px; }
.settings-row > .settings-copy, .settings-row > div { flex: 1; min-width: 0; }
.settings-row strong { display: block; font-size: .9375rem; font-weight: 650; }
.settings-row small { display: block; color: var(--muted); margin-top: .25rem; line-height: 1.4; }
.settings-row .trailing { margin-left: auto; flex: 0 0 auto; color: var(--muted); }
.settings-row.danger, .settings-row.danger > .icon { color: var(--danger-text); }
.settings-row select { width: auto; max-width: 45%; min-height: 44px; font-size: .875rem; }
.premium-card { padding: 1.4rem; border: 1px solid #b9e7d5; border-radius: var(--radius); background: var(--success-bg); }
.premium-card h2, .premium-card h3 { color: var(--success-text); }
.premium-card p { color: var(--muted); margin-top: .6rem; }
.premium-card .button { margin-top: 1rem; }
.premium-card .eyebrow { color: var(--success-text); margin-bottom: .6rem; }
.detail-grid { display: grid; gap: 1rem; }
.detail-grid dt { font-size: .875rem; color: var(--muted); margin-bottom: .25rem; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.detail-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1rem; overflow-wrap: anywhere; background: var(--surface-muted); border-radius: 15px; padding: 1rem; }
.qr-frame { padding: 18px; background: #fff; border-radius: 18px; width: fit-content; max-width: 100%; margin: 1rem auto; box-shadow: 0 0 0 1px var(--line); }
.qr-frame canvas, .qr-frame svg, .qr-frame img { display: block; width: min(64vw, 270px); height: auto; image-rendering: pixelated; }
.camera-preview { width: 100%; aspect-ratio: 1; border-radius: 18px; background: #071423; object-fit: cover; }
.camera-status { margin: .6rem 0; text-align: center; color: var(--muted); font-size: .875rem; }
.app-footer { color: var(--muted); text-align: center; font-size: .8125rem; line-height: 1.6; margin-top: 1.6rem; padding: 0 1rem; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem; width: min(100%, var(--content-width)); padding: .55rem max(.5rem, env(safe-area-inset-right)) calc(.55rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -5px 24px rgb(18 60 105 / 4%); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-width: 0; min-height: 63px; padding: .25rem .1rem; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 500; text-decoration: none; line-height: 1.2; }
.nav-item > .icon { box-sizing: content-box; width: 22px; height: 22px; flex-basis: 22px; padding: .3rem .9rem; border-radius: 12px; }
.nav-item.active, .nav-item[aria-current="page"] { color: var(--navy); font-weight: 750; }
.nav-item.active > .icon, .nav-item[aria-current="page"] > .icon { background: #e1edf9; }
:root[data-theme="dark"] .nav-item.active, :root[data-theme="dark"] .nav-item[aria-current="page"] { color: #b7d8ff; }
:root[data-theme="dark"] .nav-item.active > .icon, :root[data-theme="dark"] .nav-item[aria-current="page"] > .icon { background: #203c5c; }

.welcome { display: grid; grid-template-columns: 1fr; gap: 1.25rem; max-width: var(--content-width); margin: 0 auto; padding: .5rem 1.25rem 2rem; }
.welcome-art { position: relative; overflow: hidden; color: #fff; background: var(--navy); border-radius: 26px; padding: 1.7rem; }
.welcome-art h1 { font-size: clamp(2rem, 6.2vw, 3rem); max-width: 13ch; margin: 1.15rem 0 1rem; line-height: 1.1; letter-spacing: -.055em; }
.welcome-art > p { color: #d3e5f6; max-width: 40ch; font-size: 1rem; }
.welcome-art .eyebrow { color: #b9d5f0; }
.welcome-art .brand-mark { background: rgb(255 255 255 / 8%); width: 58px; height: 58px; margin-bottom: 1.5rem; }
.welcome-art .brand-mark .icon { width: 36px; height: 36px; }
.welcome-art .pill { color: #b6f3d9; background: rgb(114 221 178 / 12%); margin-top: 1.25rem; }
.welcome-card { padding: 1.6rem; background: var(--surface); border: 1px solid var(--soft-line); border-radius: 26px; box-shadow: var(--shadow); }
.welcome-card h1, .welcome-card h2 { margin-bottom: .7rem; font-size: 1.6rem; }
.welcome-card > p { color: var(--muted); margin-bottom: 1.35rem; }
.welcome-card .form { margin-top: 1.25rem; }
.welcome-card .notice { font-size: .875rem; }
.welcome-card .text-button { width: 100%; margin-top: .45rem; }
.benefits { list-style: none; display: grid; gap: 1rem; margin: 1.8rem 0 0; padding: 0; }
.benefits li, .benefit { display: flex; gap: .7rem; align-items: flex-start; color: #d3e5f6; font-size: .9375rem; }
.benefits .icon, .benefit .icon { color: var(--mint); width: 21px; height: 21px; flex-basis: 21px; }
.welcome-illustration { position: relative; width: min(100%, 320px); margin: 2rem auto .5rem; padding: 1.2rem; border: 1px solid rgb(255 255 255 / 18%); border-radius: 20px; background: rgb(255 255 255 / 7%); }
.welcome-illustration .sample-line { height: 9px; width: 75%; border-radius: 20px; background: rgb(255 255 255 / 20%); margin-top: .65rem; }
.welcome-illustration .sample-line.short { width: 45%; }
.install-steps { counter-reset: install-step; padding: 0; list-style: none; display: grid; gap: 1rem; }
.install-steps li { counter-increment: install-step; position: relative; display: block; min-height: 30px; padding-left: 2.65rem; font-size: 1rem; }
.install-steps li::before { content: counter(install-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; background: var(--surface-muted); border-radius: 10px; color: var(--text); font-size: .875rem; font-weight: 700; }

dialog { color: var(--text); background: var(--surface); width: min(560px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); border: 1px solid var(--line); border-radius: 25px; padding: 0; margin: auto; box-shadow: 0 24px 100px rgb(0 0 0 / 25%); overscroll-behavior: contain; }
dialog::backdrop { background: rgb(5 21 39 / 55%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.2rem 1.35rem; border-bottom: 1px solid var(--soft-line); }
.modal-header h2 { font-size: 1.3rem; }
.modal-header .icon-button { margin: -.3rem -.4rem -.3rem 0; }
.modal-body { padding: 1.35rem; }
.modal-body > p + p { margin-top: .85rem; }
.modal-body > .notice:first-child { margin-top: 0; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .7rem; padding: 1rem 1.35rem 1.35rem; }
.modal-footer .button { flex: 1; }
.toast { position: fixed; bottom: calc(6.5rem + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; width: max-content; max-width: min(600px, calc(100% - 2rem)); padding: .9rem 1.1rem; border: 1px solid #385979; border-radius: 15px; background: #133251; color: #fff; font-size: .9375rem; box-shadow: 0 12px 36px rgb(0 0 0 / 18%); text-align: center; overflow-wrap: anywhere; }
.toast:not(.visible) { opacity: 0; visibility: hidden; pointer-events: none; }
.toast.visible { opacity: 1; visibility: visible; }
.boot-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: 90vh; padding: 2rem; text-align: center; }
.boot-logo { border-radius: 22px; }
.boot-screen h1 { font-size: 1.6rem; }
.boot-screen p { color: var(--muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.noscript-notice { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; padding: 2rem; color: var(--text); background: var(--bg); text-align: center; }
.noscript-notice p { max-width: 42ch; align-self: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Components used by the vault application. */
.welcome-shell { padding-bottom: 1.5rem; }
.welcome-card > .eyebrow { display: block; margin-bottom: .65rem; color: var(--muted); }
.welcome-card > .small.text-center { margin-top: 1rem; margin-bottom: 0; }
.welcome-art > :not(.welcome-emblem) { position: relative; z-index: 1; }
.welcome-art > .pill:first-child { width: fit-content; margin-top: 0; }
.welcome-emblem { position: absolute; z-index: 0; right: -35px; top: 12px; width: 190px; height: 190px; transform: rotate(12deg); color: var(--mint); opacity: .09; pointer-events: none; }
.welcome-emblem > .icon { width: 100%; height: 100%; stroke-width: 1; }
.welcome-benefits { display: grid; gap: .85rem; margin-top: 1.65rem; }
.welcome-benefits p { display: flex; align-items: flex-start; gap: .65rem; font-size: .875rem; line-height: 1.5; color: #d3e5f6; }
.welcome-benefits .icon { flex-basis: 21px; width: 21px; height: 21px; margin-top: .1rem; color: var(--mint); }
.welcome-footer { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.checkbox-row { display: flex; align-items: flex-start; gap: .7rem; font-size: .875rem; line-height: 1.5; }
.checkbox-row input { margin: .15rem 0 0; }
.checkbox-row span { flex: 1; min-width: 0; }
.plan-strip, .install-strip { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 19px; margin: 1.25rem 0; background: var(--surface); }
.plan-strip { background: var(--success-bg); border-color: #b9e7d5; }
.plan-strip > div, .install-strip > div { flex: 1; min-width: 0; }
.plan-strip strong, .install-strip strong { font-size: .9375rem; font-weight: 700; }
.plan-strip p, .install-strip p { margin-top: .25rem; }
.plan-strip > .button, .install-strip > .button { flex: 0 0 auto; }
.install-strip > .icon { color: var(--green); }
.connection-label { display: block; max-width: none; color: inherit; font-size: 1rem; line-height: 1.5; text-align: left; }
.empty-icon { display: grid; place-items: center; }
.empty-icon > .icon { width: 28px; height: 28px; }
.record-card { display: flex; align-items: center; gap: .25rem; }
.record-card > .record-main { flex: 1; min-width: 0; }
.record-card > .record-actions { flex: 0 0 44px; flex-direction: column; align-self: stretch; justify-content: space-between; gap: .2rem; }
.record-main .record-value { padding: .6rem .7rem; margin-top: .65rem; }
.stat { text-align: left; }
.stat > span { display: flex; align-items: center; gap: .4rem; }
.stat > span .icon { width: 20px; height: 20px; margin-bottom: 0; }
.stat > strong { margin-top: .7rem; }
.action-card > strong { font-size: .9375rem; font-weight: 700; }
.action-card > span { color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.4; }
.settings-row > span { flex: 1; min-width: 0; }
.settings-row > .icon:last-child { flex: 0 0 18px; width: 18px; height: 18px; margin-left: auto; color: var(--muted); }
.content > h2 { margin: 1.6rem 0 .85rem; }
.premium-card > .pill { margin-bottom: .8rem; }
.detail-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.15rem; }
.detail-heading > div { min-width: 0; flex: 1; }
.detail-heading strong { display: block; font-size: 1.0625rem; overflow-wrap: anywhere; }
.detail-heading p { font-size: .875rem; margin-top: .2rem; }
.alias-detail-value { display: grid; gap: .7rem; padding: 1.1rem; margin: 1rem 0; border-radius: 15px; background: var(--surface-muted); }
.alias-detail-value .eyebrow { color: var(--muted); font-size: .75rem; letter-spacing: .06em; }
.alias-detail-value code { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.qr-panel { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin: 1.3rem 0; padding: 1.2rem; border: 1px solid var(--soft-line); border-radius: 20px; background: var(--surface-muted); text-align: center; }
.qr-panel > canvas { display: block; width: min(100%, 280px); height: auto; background: white; border: 8px solid white; border-radius: 12px; image-rendering: pixelated; }
.qr-panel > p { max-width: 42ch; }
.detail-notes { margin: 1.2rem 0; overflow-wrap: anywhere; }
.detail-notes > strong { font-size: .9375rem; }
.detail-notes > p { color: var(--muted); margin-top: .4rem; }
.installation-id { display: flex; align-items: center; gap: .5rem; padding: .55rem .45rem .55rem .85rem; background: var(--surface-muted); border-radius: 13px; }
.installation-id > code { font-size: .875rem; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.field + #license-form { margin-top: 1.2rem; }
.modal-body > .modal-footer { padding-left: 0; padding-right: 0; padding-bottom: 0; margin-top: .8rem; }
.scanner-view { position: relative; overflow: hidden; aspect-ratio: 4 / 3; margin: 1.1rem 0 .7rem; border-radius: 20px; background: #10253b; }
.scanner-view::after { content: ""; position: absolute; z-index: 1; inset: 14% 20%; border: 2px solid rgb(114 221 178 / 65%); border-radius: 17px; pointer-events: none; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; }
#scanner-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; color: #d5e7f6; }
#scanner-placeholder > .icon { width: 50px; height: 50px; color: var(--mint); }
#scanner-placeholder > p { font-size: .875rem; max-width: 16ch; text-align: center; }
#scanner-status { min-height: 1.5em; margin-bottom: 1rem; }
.qr-text-input { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.qr-text-input > summary { padding: .65rem .2rem; min-height: 44px; color: var(--green); font-size: .9375rem; font-weight: 650; cursor: pointer; }
.qr-text-input[open] > summary { margin-bottom: .5rem; }
.qr-text-input textarea, .copy-fallback { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9375rem; overflow-wrap: anywhere; }
.copy-fallback { margin-top: 1rem; min-height: 140px; }
.button:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --green: #72ddb2;
    --bg: #0b1523;
    --surface: #132236;
    --surface-raised: #1a2c42;
    --surface-muted: #1d3148;
    --text: #f0f5fb;
    --muted: #a7b9cd;
    --line: #2e435a;
    --soft-line: #22354a;
    --focus: #72ddb2;
    --success-bg: #12372f;
    --success-text: #a0e8ca;
    --warning-bg: #3b301b;
    --warning-text: #f1cf85;
    --danger-bg: #3d2426;
    --danger-text: #ffb5ad;
    --shadow: 0 8px 24px rgb(0 0 0 / 12%);
  }
  :root:not([data-theme]) a, :root:not([data-theme]) .text-button { color: var(--mint); }
  :root:not([data-theme]) .empty-state > .icon { color: #a6cfff; }
  :root:not([data-theme]) .button:not(.primary):not(.danger):not(.ghost) { color: #a8dbc9; }
  :root:not([data-theme]) .nav-item.active, :root:not([data-theme]) .nav-item[aria-current="page"] { color: #b7d8ff; }
  :root:not([data-theme]) .nav-item.active > .icon, :root:not([data-theme]) .nav-item[aria-current="page"] > .icon { background: #203c5c; }
}

@media (hover: hover) {
  .action-card:hover, .record-card:hover { border-color: #b7cbdc; }
  .icon-button:hover, .settings-row:hover { background: var(--surface-muted); }
  .button.primary:hover { background: #194c7f; border-color: #194c7f; }
  .button.secondary:hover { background: #d9f0e6; }
  .text-button:hover { background: var(--surface-muted); }
}
@media (min-width: 720px) {
  .app-header { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .content { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero { padding: 2rem; }
  .hero h1, .hero h2 { max-width: 24ch; }
  .actions-grid { margin: 1.5rem 0; }
  .action-card { display: grid; grid-template-columns: 32px 1fr; align-content: center; align-items: center; justify-content: flex-start; min-height: 92px; padding: 1.25rem 1.5rem; gap: .25rem 1rem; }
  .action-card > .icon { grid-row: 1 / 3; }
  .action-card > span { grid-column: 2; }
  .record-list.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
  .welcome { grid-template-columns: .95fr 1.05fr; padding: .5rem 1.5rem 3rem; align-items: stretch; }
  .welcome-art, .welcome-card { padding: 2rem; }
  .welcome-art { display: flex; flex-direction: column; justify-content: center; min-height: 470px; }
  .welcome-card { align-content: center; }
  .bottom-nav { width: min(calc(100% - 3rem), calc(var(--content-width) - 3rem)); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding-top: .7rem; }
  .nav-item { min-height: 64px; }
}
@media (max-width: 380px) {
  .app-header { padding-left: 1rem; padding-right: 1rem; gap: .5rem; }
  .content { padding-left: 1rem; padding-right: 1rem; }
  .brand-name { font-size: 1.125rem; }
  .brand-caption { font-size: .75rem; }
  .hero { padding: 1.4rem; }
  .hero h1, .hero h2 { font-size: 1.875rem; }
  .hero-top .eyebrow { font-size: .75rem; }
  .welcome { padding-left: 1rem; padding-right: 1rem; }
  .welcome-art, .welcome-card { padding: 1.3rem; }
  .form-row { grid-template-columns: 1fr; }
  .nav-item { font-size: .875rem; letter-spacing: -.025em; }
  .install-strip { flex-wrap: wrap; }
  .install-strip > .button { margin-left: 2.5rem; }
  .record-card { padding: .85rem; }
  dialog { width: calc(100% - 1rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .hero, .welcome-art { border: 1px solid CanvasText; }
  .pill, .button, .chip, .nav-item.active { border: 1px solid ButtonText; }
}
@media print {
  body > * { display: none !important; }
  body::before { content: "Ecurem Alias — l’impression du coffre n’est pas disponible. Utilisez une sauvegarde chiffrée depuis les réglages."; display: block; padding: 2rem; color: #000; }
}

/* Manual subscription status: colour always has a written equivalent. */
.brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; border-radius: 10px; }
.billing-status { display: flex; align-items: flex-start; gap: .7rem; padding: 1rem; border-radius: 15px; margin: 1rem 0; background: var(--surface-muted); }
.billing-status p { margin: .35rem 0 0; font-size: .9375rem; }
.billing-status.green { color: var(--success-text); background: var(--success-bg); }
.billing-status.orange { color: var(--warning-text); background: var(--warning-bg); }
.billing-status.red { color: var(--danger-text); background: var(--danger-bg); }
.billing-dot { display: block; flex: 0 0 .65rem; width: .65rem; height: .65rem; border-radius: 50%; margin-top: .4rem; background: currentColor; }
.billing-dates { display: grid; gap: .75rem; padding: 0; margin: 1rem 0; }
.billing-dates div { display: flex; justify-content: space-between; gap: 1rem; }
.billing-dates dt { color: var(--muted); font-size: .875rem; }
.billing-dates dd { margin: 0; text-align: right; font-size: .875rem; font-weight: 650; }
.payment-receivers { display: grid; gap: .7rem; margin: 1rem 0; }
.payment-receiver { display: flex; align-items: center; gap: .7rem; justify-content: space-between; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.payment-receiver > div { min-width: 0; }
.payment-receiver h4 { margin: 0 0 .45rem; font-size: .9375rem; }
.payment-receiver code { display: block; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .9375rem; }
.license-advanced { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.license-advanced > summary { cursor: pointer; color: var(--muted); font-size: .875rem; padding: .7rem 0; }
.license-advanced > .field { margin-top: 1rem; }
