/* Screen layout and form states for the app. Values come from tokens.css. */

[hidden] { display: none !important; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
.ar-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell: nav rail + main; the rail becomes a top strip on narrow screens */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; background: var(--surface-page); }
.shell > .ar-nav { flex: 1 1 96px; width: auto; }
.shell > main { flex: 999 1 560px; min-width: 0; padding: var(--space-24) clamp(16px, 3vw, 40px) var(--space-48); }
/* The side menu stays on screen while the page scrolls (wide screens; on phones it sits on top). */
@media (min-width: 720px) {
  .shell > .ar-nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow: hidden; flex: 0 0 auto; width: var(--nav-rail, 96px);
    gap: clamp(8px, 2.2vh, 24px); padding-block: clamp(10px, 2.2vh, 20px); }
  /* The logo stays put; only the list scrolls, and only when the window is too short for it.
     No scroll bar — a soft fade at the top or bottom shows there's more. */
  .shell > .ar-nav .ar-nav-items { flex: 1 1 auto; min-height: 0; align-content: start; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: none; gap: clamp(2px, .6vh, 6px); margin-inline: -4px; padding-inline: 4px; }
  .shell > .ar-nav .ar-nav-items::-webkit-scrollbar { display: none; }
  .shell > .ar-nav .ar-nav-item { padding-block: clamp(6px, 1.1vh, 10px); }
  @media (max-height: 780px) {
    .shell > .ar-nav .ar-nav-home img { width: 24px; height: 34px; }
    .shell > .ar-nav .ar-nav-item { gap: 3px; padding-block: 6px; font-size: 11.5px; }
    .shell > .ar-nav .ar-nav-items { gap: 1px; }
  }
  .shell > .ar-nav .ar-nav-items.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
  .shell > .ar-nav .ar-nav-items.more-above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 44px); mask-image: linear-gradient(to bottom, transparent, #000 44px); }
  .shell > .ar-nav .ar-nav-items.more-above.more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
}
/* Phones: the menu is a bar fixed to the bottom of the screen, like an app. */
@media (max-width: 719.98px) {
  .shell > .ar-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; width: auto; flex: none; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-nav); box-shadow: 0 -4px 16px rgba(22, 22, 29, .06); gap: 0; }
  .shell > .ar-nav .ar-nav-home { display: none; }
  .shell > .ar-nav .ar-nav-items { display: flex; justify-content: space-between; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .shell > .ar-nav .ar-nav-items::-webkit-scrollbar { display: none; }
  .shell > .ar-nav .ar-nav-item { flex: 1 0 auto; min-width: 50px; padding: 6px 2px; font-size: 10.5px; gap: 3px; }
  .shell > main { flex-basis: 100%; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
.page { max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-24); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-12); }
.page-title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-secondary); }
.date-line { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.steps-crumb { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-6); font-size: 13px; color: var(--ink-muted); }
.steps-crumb .is-current { color: var(--ink-strong); font-weight: 600; }
.demo-strip { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); align-items: center; padding: 10px var(--space-16); border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: 13px; font-weight: 500; }
.demo-strip button { margin-left: auto; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: var(--space-16); }
.grid-units { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--space-16); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-12); }

/* Two-column work area */
.split { display: flex; flex-wrap: wrap; gap: var(--space-24); align-items: flex-start; }
.split > .side { flex: 1 1 320px; max-width: 100%; }
.split > .work { flex: 999 1 480px; min-width: 0; }
.form-card > div:empty, .field > span:empty, #saved-slot:empty { display: none; }

/* Meter list */
.meter-list { list-style: none; margin: 0; padding: var(--space-8); display: flex; flex-direction: column; gap: 4px; }
.meter-btn { width: 100%; display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12); border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.meter-btn[aria-current="true"] { background: var(--surface-selected); }
.meter-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--surface-card); border: 1px solid var(--line-card); display: flex; align-items: center; justify-content: center; }
.meter-name { display: block; font-weight: 600; font-size: 14px; }
.meter-prev { display: block; font-size: 13px; color: var(--ink-muted); }
.chip-sm { flex: none; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.side-note { margin: 4px 0 0; padding: var(--space-12) var(--space-12) var(--space-8); border-top: 1px solid var(--line-card); font-size: 13px; color: var(--ink-muted); }
.side-head { margin: 0; padding: var(--space-12) var(--space-12) var(--space-8); font-size: 13px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Form */
.form-card { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-24); }
.form-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-12); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-20); }
.field { display: flex; flex-direction: column; gap: var(--space-6); }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--ink-secondary); }
.field .hint { font-weight: 400; color: var(--ink-muted); }
.input { height: var(--control-lg); padding: 0 14px; border: 1px solid var(--line-control); border-radius: var(--radius-sm); font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-card); }
.input-num { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
textarea.input { height: auto; padding: var(--space-10) var(--space-12); resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.input:disabled { background: var(--surface-sunken); color: var(--ink-secondary); }
.field-error { margin: 0; display: flex; gap: var(--space-6); align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--danger); }
.field-error svg { flex: none; margin-top: 2px; }
.prev-panel { display: flex; gap: 14px; align-items: center; padding: 14px var(--space-16); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.prev-panel dl { margin: 0; flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-8) var(--space-16); }
.prev-panel dt { font-size: 12px; color: var(--ink-muted); }
.prev-panel dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: var(--space-16); border-radius: var(--radius-sm); border: 1px dashed var(--line-dashed); background: #FBFBFC; }
.dropzone.is-invalid { border-color: var(--danger); background: var(--surface-card); }
.dropzone img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.dropzone-text { flex: 1 1 200px; font-size: 14px; }
.dropzone-text small { display: block; font-size: 13px; color: var(--ink-muted); }

.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; padding-top: var(--space-20); border-top: 1px solid var(--line-card); }
.form-actions .aside { margin-left: auto; font-size: 13px; color: var(--ink-muted); }

/* Messages */
.summary { padding: var(--space-16) var(--space-20); border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid var(--danger-line); }
.summary-title { margin: 0 0 var(--space-8); display: flex; align-items: center; gap: var(--space-8); font-weight: 700; color: var(--danger); }
.summary ul { margin: 0; padding: 0 0 0 26px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.summary a { color: var(--ink); }
.banner-error { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; padding: 14px var(--space-16); border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid var(--danger-line); font-size: 14px; }
.banner-error b { color: var(--danger); }
.banner-error .grow { flex: 1 1 260px; }
.banner-error button { height: 40px; padding: 0 var(--space-16); border-radius: var(--radius-sm); border: 1px solid var(--danger-line); background: var(--surface-card); font: inherit; font-size: 14px; font-weight: 600; color: var(--danger); cursor: pointer; }
.banner-ok { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12) var(--space-16); padding: 14px var(--space-20); border-radius: var(--radius-lg); background: var(--success-soft); color: var(--success); }
.banner-ok a, .banner-ok button.link { color: var(--success); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: underline; padding: 0; }
.banner-lock { display: flex; gap: var(--space-12); align-items: flex-start; padding: 14px var(--space-16); border-radius: var(--radius-sm); background: var(--surface-selected); color: var(--ink-strong); font-size: 14px; }
.warn { display: flex; gap: var(--space-10); align-items: flex-start; padding: var(--space-12) 14px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: 14px; }
.warn .mark { width: 22px; height: 22px; flex: none; border-radius: var(--radius-pill); background: var(--surface-card); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* Dialog */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(22, 22, 29, 0.4); display: flex; align-items: center; justify-content: center; padding: var(--space-16); z-index: 10; }
.dialog { width: 100%; max-width: 480px; background: var(--surface-card); border-radius: var(--radius-lg); padding: var(--space-24); display: flex; flex-direction: column; gap: var(--space-16); }
.dialog h2 { margin: 0; font-size: 20px; font-weight: 700; }
.dialog p { margin: 0; }
.dialog .actions { display: flex; flex-wrap: wrap; gap: var(--space-12); justify-content: flex-end; }

/* Sign-in (mobile app look) */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-24) 18px; background: var(--surface-app); color: var(--app-ink); }
.signin-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; }
.signin-card img { width: 129px; height: 34px; margin-bottom: 26px; }
.signin-title { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -0.015em; }
.signin-sub { margin: 5px 0 20px; font-size: 13px; color: rgba(22, 22, 29, .55); }
.signin-hint { margin: 14px 0 0; font-size: 12px; color: rgba(22, 22, 29, .5); line-height: 1.55; }
.signin-foot { margin-top: 28px; font-size: 11px; color: rgba(22, 22, 29, .45); }

/* Empty / placeholder */
.placeholder { padding: 40px var(--space-24); text-align: center; display: flex; flex-direction: column; gap: var(--space-12); align-items: center; }
.placeholder h2 { margin: 0; font-size: 18px; }
.placeholder p { margin: 0; max-width: 460px; color: var(--ink-secondary); font-size: 14px; }

.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* Segmented filter: pressed state uses aria-pressed instead of a class */
.ar-seg-btn { cursor: pointer; }
.ar-seg-btn[aria-pressed="true"] { background: var(--surface-card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-segment); }

/* ---------- Dashboard ---------- */
:root {
  /* Chart colours: categorical slots validated with the dataviz checks (light surface).
     Aqua is below 3:1 on white, so every chart also has a table view. */
  --viz-1: #2a78d6;      /* rent */
  --viz-2: #eb6834;      /* internet */
  --viz-3: #1baf7a;      /* fees */
  --viz-elec: #eb6834;   /* electricity, this year */
  --viz-water: #2a78d6;  /* water, this year */
  --viz-muted: #B4B4BE;  /* last year (de-emphasised comparison) */
  --viz-grid: #ECECF1;
}
.head-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--space-16); }
.grid-kpi .ar-stat-value { font-size: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: var(--space-24); align-items: start; }
.dash-section { display: flex; flex-direction: column; gap: var(--space-16); }
.section-title { margin: 0; font-size: 20px; font-weight: 700; }
.dash-card { padding: var(--space-24); display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
.dash-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-12); }
.dash-card-head > div:first-child { flex: 1 1 240px; }
.dash-headline { margin: 0; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dash-headline b { font-size: 22px; }
.delta { font-size: 13px; font-weight: 600; }
.title-icon { display: inline-flex; vertical-align: -3px; margin-right: 8px; }
.ar-card-title { display: flex; align-items: center; }
.input-sm { height: 40px; font-size: 14px; padding: 0 10px; }
.mini-title { margin: var(--space-8) 0 0; font-size: 12px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-row); font-size: 14px; }
.rows > li:last-child { border-bottom: 0; }
.rows > li.row-stack { flex-direction: column; align-items: stretch; }
.row-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.row-main { flex: 1 1 200px; min-width: 0; }
.row-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.row-end { display: flex; align-items: center; gap: var(--space-10); flex-wrap: wrap; }
.empty-line { margin: 0; padding: 10px 0; font-size: 14px; color: var(--ink-muted); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: var(--space-12); padding: var(--space-12) var(--space-16); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.mini-value { margin: 2px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-12); }
.tile { padding: var(--space-12) var(--space-16); border-radius: var(--radius-sm); background: var(--surface-sunken); display: flex; flex-direction: column; gap: 2px; }
.dash-table th, .dash-table td { white-space: nowrap; }
.dash-table tbody th, .dash-table tfoot th { font-size: 14px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; text-align: left; border-bottom: 1px solid var(--line-row); }
.dash-table tfoot td, .dash-table tfoot th { border-top: 1px solid var(--line-card); border-bottom: 0; }
.dash-table tr > :first-child { padding-left: 0; }
.dash-table tr > :last-child { padding-right: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Charts ---------- */
.viz { display: flex; flex-direction: column; gap: var(--space-10); }
.viz-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-secondary); }
.viz-legend li { display: inline-flex; align-items: center; gap: 6px; }
.viz-key { display: inline-block; flex: none; }
.viz-key-box { width: 10px; height: 10px; border-radius: 3px; }
.viz-key-line { width: 16px; height: 2px; border-radius: 2px; }
.viz-plot { position: relative; min-height: 220px; }
.viz-plot svg { display: block; overflow: visible; }
.viz-axis { font-size: 11px; fill: var(--ink-muted); font-variant-numeric: tabular-nums; }
.viz-label { font-size: 12px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.viz-hit { cursor: crosshair; outline: none; }
.viz-hit:focus-visible { stroke: var(--ink-strong); stroke-width: 2; }
.viz-tip { position: absolute; z-index: 2; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-card); border: 1px solid var(--line-card); box-shadow: 0 6px 20px rgba(22, 22, 29, .10); font-size: 13px; }
.viz-tip p { margin: 0; }
.viz-tip-title { font-weight: 600; color: var(--ink-secondary); margin-bottom: 4px !important; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; }
.viz-tip-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.viz-tip-row span:last-child { color: var(--ink-muted); }
.viz-tip-key { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.viz-empty { position: absolute; inset: 40px 24px auto; margin: 0; text-align: center; font-size: 14px; color: var(--ink-muted); }
.viz-table summary { cursor: pointer; font-size: 13px; color: var(--ink-secondary); width: max-content; }
.viz-table .ar-table { margin-top: 8px; }
.viz-table .ar-table tr > :first-child { padding-left: 0; }
.viz-table .ar-table tbody th { font-size: 14px; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; text-align: left; }

/* ---------- Concerns & maintenance ---------- */
.concern-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.concern { padding: var(--space-16) 0; border-bottom: 1px solid var(--line-row); display: flex; flex-direction: column; gap: var(--space-8); }
.concern:last-child { border-bottom: 0; }
.concern-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; font-size: 14px; }
.concern-text { margin: 0; font-size: 15px; }
.concern-res { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-sunken); font-size: 14px; }
.concern-res p { margin: 0; }
.concern-res .row-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dialog-form { max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog-backdrop { overflow-y: auto; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.maint-fields { margin: 0; padding: var(--space-16); border: 1px solid var(--line-card); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: var(--space-16); }
.wrap-table td, .wrap-table th { white-space: normal; vertical-align: top; }
.wrap-table td:first-child, .wrap-table th:first-child { white-space: nowrap; }
.field select.input { appearance: auto; }
.dash-table thead th { text-align: left; }
.dash-table thead th.num { text-align: right; }
.dash-table tbody tr:last-child th { border-bottom: 0; }

/* ---------- Units ---------- */
.unit-link { text-decoration: none; }
.unit-chip { font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.unit-tabs { overflow-x: auto; }
.unit-tabs .ar-tab { text-decoration: none; white-space: nowrap; }
.check-box { display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-16); border-radius: var(--radius-sm); border: 1px solid var(--line-card); }
.tile-link { color: inherit; text-decoration: none; }
.tile-link:hover { background: var(--surface-selected); }
.unit-grid { gap: var(--space-24); }
.unit-grid > section { min-width: 0; }
.unit-sub { display: flex; flex-direction: column; gap: var(--space-8); }
.unit-fig { margin: 0; display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.kv { margin: var(--space-8) 0 0; display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.soa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.soa-row { border-bottom: 1px solid var(--line-row); }
.soa-row > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 12px 0; font-size: 14px; }
.soa-row > summary::-webkit-details-marker { display: none; }
.soa-row > summary .row-main::before { content: '▸'; display: inline-block; width: 16px; color: var(--ink-muted); }
.soa-row[open] > summary .row-main::before { content: '▾'; }
.soa-body { padding: 0 0 var(--space-16) 16px; display: flex; flex-direction: column; gap: var(--space-8); }
.span-2 { grid-column: 1 / -1; }
.field-warn { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--warning); }
.field-warn b { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--warning-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.lease-form { display: flex; flex-direction: column; gap: var(--space-16); }
#unit-panel { display: flex; flex-direction: column; gap: var(--space-24); }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: var(--space-12); }
.gallery li { display: flex; flex-direction: column; gap: 4px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-sunken); display: block; }
.gallery figcaption { font-size: 13px; color: var(--ink-secondary); margin-top: 4px; }
.gallery .ar-btn-ghost { align-self: flex-start; }

/* ---------- Tenant site (mobile first) ---------- */
.tenant { min-height: 100vh; background: var(--surface-app); color: var(--app-ink); padding-bottom: 96px; }
.t-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; max-width: 600px; margin: 0 auto; padding: 14px 16px; background: var(--surface-app); }
.t-head img { width: 112px; height: auto; }
.t-main { max-width: 600px; margin: 0 auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.t-title { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.015em; }
.t-sub { margin: -8px 0 0; font-size: 14px; color: rgba(22, 22, 29, .6); }
.t-h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.t-h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.t-label { margin: 0; font-size: 13px; color: rgba(22, 22, 29, .55); }
.t-amount { margin: 4px 0 2px; font-size: 36px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.t-note { margin: 0 0 14px; font-size: 13px; color: rgba(22, 22, 29, .62); }
.t-line { margin: 4px 0; font-size: 14px; }
.t-row { display: flex; flex-direction: column; gap: 8px; }
.t-row .ar-appbtn { text-decoration: none; }
.t-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ar-appcard { display: flex; flex-direction: column; gap: 6px; }
.ar-appcard .progress, .ar-appcard .ar-progress { margin: 8px 0; }
.t-link, .t-back { color: var(--app-ink); font-size: 14px; font-weight: 600; }
.t-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.t-alerts { display: flex; flex-direction: column; gap: 8px; }
.t-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; color: var(--app-ink); text-decoration: none; background: #fff; box-shadow: var(--shadow-app-card); }
.t-alert b { display: block; }
.t-alert-body { display: block; margin-top: 2px; color: rgba(22, 22, 29, .7); }
.t-alert-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.t-alert-danger .t-alert-icon { background: var(--danger-soft); color: var(--danger); }
.t-alert-warning .t-alert-icon { background: var(--warning-soft); color: var(--warning); }
.t-alert-info .t-alert-icon { background: var(--info-soft); color: var(--info); }
.t-alert-success .t-alert-icon { background: var(--success-soft); color: var(--success); }
.t-alert-danger { box-shadow: 0 0 0 1px var(--danger-line); }
.t-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.t-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-app-card); color: var(--app-ink); text-decoration: none; font-size: 12px; }
.t-tile b { font-size: 20px; }
.t-rowlink { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; width: 100%; color: inherit; text-decoration: none; }
.tenant .rows > li { border-bottom-color: rgba(22, 22, 29, .07); }
.tenant .field { margin-top: 10px; }
.tenant .field label { font-size: 12px; color: rgba(22, 22, 29, .6); }
.tenant .ar-appbtn { margin-top: 10px; text-decoration: none; }
.tenant .ar-appbtn:disabled { opacity: .5; }
.t-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; box-shadow: var(--shadow-app-sheet); padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); }
.t-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; color: rgba(22, 22, 29, .55); font-size: 12px; font-weight: 500; text-decoration: none; }
.t-nav-item.is-current { color: var(--app-ink); background: var(--surface-app); font-weight: 600; }
.soa-doc { gap: 10px; }
.soa-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.soa-biz { margin: 0; font-weight: 700; font-size: 16px; }
.soa-small { margin: 2px 0 0; font-size: 12px; color: rgba(22, 22, 29, .6); }
.soa-title { margin: 10px 0 0; font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.soa-meta { margin-bottom: 6px; }
.soa-lines tfoot th, .soa-lines tfoot td { font-size: 15px; }
.soa-confidential { margin: 8px 0 0; font-size: 12px; color: rgba(22, 22, 29, .55); }
.t-how { padding: 12px 14px; border-radius: 12px; background: var(--surface-sunken); }
.t-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.t-thumb { width: 120px; padding: 0; border: 0; background: none; cursor: zoom-in; display: flex; flex-direction: column; gap: 4px; font: inherit; font-size: 12px; color: rgba(22, 22, 29, .6); text-align: left; }
.t-thumb img { width: 120px; height: 84px; object-fit: cover; border-radius: 10px; }
.t-thumb-sm, .t-thumb-sm img { width: 64px; height: 46px; }
.t-thumb-none { cursor: default; padding: 10px; border-radius: 10px; background: #fff; }
.t-zoom { padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.t-lightbox { margin: 0; max-width: 720px; width: 100%; background: #fff; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.t-lightbox img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: #111; }
.t-lightbox figcaption { font-size: 14px; }
.t-terms { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.t-private { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--warning-soft); font-size: 14px; }
.t-private p { margin: 0; }
.t-method { padding: 12px 14px; border-radius: 12px; background: var(--surface-sunken); margin-top: 8px; }
.t-show { border: 0; background: none; padding: 0 2px; font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; color: var(--app-ink); }
@media print {
  .t-head, .t-nav, .no-print, .t-back, .demo-strip { display: none !important; }
  .tenant { background: #fff; padding: 0; }
  .t-main { max-width: none; padding: 0; }
  .ar-appcard { box-shadow: none !important; }
}
.page > div:empty { display: none; }

/* ---------- Motion: page entrances, route loading, hover feedback ---------- */
#route-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; pointer-events: none; opacity: 0; overflow: hidden; transition: opacity .2s; }
#route-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: linear-gradient(90deg, rgba(24, 24, 29, 0), var(--ink-strong) 50%, rgba(24, 24, 29, 0)); animation: rb-slide 1s cubic-bezier(.45, 0, .55, 1) infinite; }
body.is-routing #route-bar { opacity: 1; transition-delay: .15s; }
/* While a page loads, the old one stays put until the loader replaces it (no dimmed copy). */
.page-loading { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--ink-muted); font-size: 14px; animation: pl-in .3s ease both; }
.pl-mark { width: 40px; height: 56px; fill: none; stroke: var(--ink-strong); stroke-width: 2.6; }
.pl-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pl-draw 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
.pl-mark path:nth-child(2) { animation-delay: .15s; }
.pl-mark path:nth-child(3) { animation-delay: .3s; }
@keyframes pl-draw { 0% { stroke-dashoffset: 1; } 45%, 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes pl-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pl-mark path { animation: none; stroke-dashoffset: 0; } }
#view, .t-main { transition: opacity .15s; }
@keyframes rb-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.route-enter > .page > *, .t-main.route-enter > * { animation: route-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.route-enter > .page > *:nth-child(2), .t-main.route-enter > *:nth-child(2) { animation-delay: .04s; }
.route-enter > .page > *:nth-child(3), .t-main.route-enter > *:nth-child(3) { animation-delay: .08s; }
.route-enter > .page > *:nth-child(4), .t-main.route-enter > *:nth-child(4) { animation-delay: .12s; }
.route-enter > .page > *:nth-child(5), .t-main.route-enter > *:nth-child(5) { animation-delay: .16s; }
.route-enter > .page > *:nth-child(n+6), .t-main.route-enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes route-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Sign-in: logo and card rise in after the loading screen */
.signin-card > * { animation: route-in .6s cubic-bezier(.2, .7, .2, 1) both; }
.signin-card > *:nth-child(2) { animation-delay: .06s; }
.signin-card > *:nth-child(3) { animation-delay: .12s; }
.signin-card > *:nth-child(4) { animation-delay: .18s; }
.signin-card > *:nth-child(n+5) { animation-delay: .24s; }

/* Hover and press feedback */
.ar-btn, .ar-appbtn, .ar-seg-btn, .ar-nav-item, .t-nav-item, .meter-btn, .ar-iconbtn { transition: background-color .18s, color .18s, box-shadow .18s, transform .12s, opacity .18s; }
.ar-btn:active:not(:disabled), .ar-appbtn:active:not(:disabled), .ar-iconbtn:active { transform: scale(.97); }
.ar-nav-item:hover:not(.is-current), .meter-btn:hover:not([aria-current="true"]) { background: var(--surface-sunken); }
.ar-unit, .tile-link, .t-tile, .t-alert, .grid-kpi .ar-stat { transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s; }
.ar-unit:hover, .t-tile:hover, a.t-alert:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(22, 22, 29, .35); }
.ar-progress-fill { transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.route-enter .ar-progress-fill { animation: bar-grow .9s .15s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dialog-backdrop { animation: fade-in .2s ease both; }
.dialog, .t-lightbox { animation: pop-in .26s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.banner-ok, .banner-error, .summary { animation: route-in .35s cubic-bezier(.2, .7, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------- Brand mark and sign-in ---------- */
.brand-mark { overflow: visible; }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: miter; }
.brand-mark.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mark-draw 1.2s cubic-bezier(.65, 0, .35, 1) forwards; }
.brand-mark.draw path:nth-child(2) { animation-delay: .2s; }
.brand-mark.draw path:nth-child(3) { animation-delay: .4s; }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

.si-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; color: #3F3F48; }
.si-mark { width: 26px; height: 37px; }
.si-brand span { display: flex; flex-direction: column; line-height: 1; }
.si-brand b { font-size: 17px; font-weight: 600; letter-spacing: .18em; }
.si-brand small { margin-top: 5px; font-size: 8.5px; font-weight: 500; letter-spacing: .62em; color: #6B6B76; }

.signin-split { padding: 0; align-items: stretch; display: grid; grid-template-columns: 1fr; }
.signin-split .signin-card { align-self: center; justify-self: center; padding: 32px 18px; }
.brand-panel { display: none; }
@media (min-width: 900px) {
  .signin-split { grid-template-columns: minmax(380px, 46%) 1fr; }
  .signin-split .si-brand { display: none; }
  .brand-panel {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px;
    background: radial-gradient(120% 90% at 20% 15%, #34343F 0%, #1D1D25 55%, #131318 100%); color: #F4F3F9;
  }
  .bp-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 360px; }
  .bp-mark { width: 120px; height: 168px; color: #F4F3F9; margin-bottom: 28px; animation: bp-float 6s 1.6s ease-in-out infinite; }
  .bp-mark path { stroke-width: 1.6; }
  .bp-word { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: .22em; margin-right: -.22em; animation: route-in .8s .9s cubic-bezier(.2, .7, .2, 1) both; }
  .bp-sub { margin: 10px 0 0; font-size: 13px; letter-spacing: .72em; margin-right: -.72em; color: rgba(244, 243, 249, .62); animation: route-in .8s 1.05s cubic-bezier(.2, .7, .2, 1) both; }
  .bp-tag { margin: 34px 0 0; font-size: 15px; line-height: 1.6; color: rgba(244, 243, 249, .72); animation: route-in .8s 1.2s cubic-bezier(.2, .7, .2, 1) both; }
  /* A huge faint copy of the mark behind everything, slowly drifting */
  .bp-bg { position: absolute; right: -12%; bottom: -8%; width: 78%; height: auto; color: rgba(255, 255, 255, .05); animation: bp-drift 18s ease-in-out infinite alternate; }
  .bp-bg path { stroke-width: .5; }
  .bp-glow { position: absolute; width: 640px; height: 640px; left: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 138, 11, .22) 0%, rgba(201, 138, 11, 0) 60%); animation: bp-glow 9s ease-in-out infinite alternate; }
}
@keyframes bp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bp-drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(-24px, -18px) rotate(-2deg); } }
@keyframes bp-glow { from { transform: translate(0, 0) scale(1); opacity: .8; } to { transform: translate(120px, 90px) scale(1.15); opacity: 1; } }

/* ---------- Unit photos: uploader and watermark ---------- */
.unit-tabs { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
.up-drop { justify-content: flex-start; transition: border-color .2s, background .2s; }
.up-drop.is-over { border-color: var(--ink-strong); background: var(--surface-selected); }
.up-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.up-list:empty { display: none; }
.up-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-card); background: var(--surface-card); animation: route-in .3s cubic-bezier(.2, .7, .2, 1) both; }
.up-item.is-error { border-color: var(--danger-line); background: var(--danger-soft); }
.up-thumb { flex: none; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--danger); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.up-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-options { align-items: start; }
.wm-box { gap: 12px; }
.wm-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.wm-style { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-control); cursor: pointer; font-size: 14px; }
.wm-style:has(input:checked) { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); }
.wm-style:has(input:disabled) { opacity: .5; cursor: default; }
.up-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.gallery-sm { grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); }
@media (max-width: 520px) { .up-item { flex-wrap: wrap; } .up-thumb { width: 100%; height: 180px; } }

/* ---------- Unit icon ---------- */
.unit-icon { --s: 40px; width: var(--s); height: var(--s); flex: none; position: relative; overflow: hidden; border-radius: calc(var(--s) * .26); background: var(--surface-sunken); border: 1px solid var(--line-card); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * .34); letter-spacing: .02em; color: var(--ink-strong); line-height: 1; }
.unit-icon.has-img { background: var(--surface-neutral); }
.unit-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.unit-icon-md { --s: 48px; }
.unit-icon-lg { --s: 56px; }
.unit-icon-xl { --s: 184px; }
.unit-title-row { display: flex; align-items: center; gap: 14px; }
.unit-title-row .ar-card-title { margin: 0; }
.unit-icon-link { display: inline-flex; border-radius: 16px; position: relative; }
.unit-icon-link:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }
.unit-icon-link .edit-dot { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-card); border: 1px solid var(--line-control); display: flex; align-items: center; justify-content: center; color: var(--ink-strong); }
.ar-unit-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Icon editor */
.ic-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; margin-top: 12px; }
.ic-stage-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ic-stage { cursor: grab; touch-action: none; user-select: none; border-width: 2px; }
.ic-stage.is-dragging { cursor: grabbing; }
.ic-stage:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }
.ic-stage img { pointer-events: none; }
.ic-stage-empty { flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-muted); text-align: center; padding: 14px; letter-spacing: 0; }
.ic-stage-empty b { font-size: 40px; color: var(--ink-strong); }
.ic-sizes { display: flex; align-items: center; gap: 10px; }
.ic-controls { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ic-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ic-opt { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; flex: none; }
.ic-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ic-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ic-opt:has(input:checked) { border-color: var(--ink-strong); box-shadow: 0 0 0 2px var(--surface-card) inset; }
.ic-opt:has(input:focus-visible) { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
.ic-opt-new { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-strong); background: var(--surface-sunken); border: 1px dashed var(--line-dashed); }
.ic-sliders { display: grid; gap: 12px; }
.ic-slider { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.ic-slider input[type=range] { width: 100%; accent-color: var(--ink-strong); min-height: 28px; }
.ic-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Photo order */
.gallery-sortable > li { position: relative; }
.gallery-sortable > li[draggable=true] { cursor: grab; }
.gallery-sortable > li.is-dragging { opacity: .45; }
.gallery-sortable > li.drop-before::before, .gallery-sortable > li.drop-after::after { content: ''; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--ink-strong); }
.gallery-sortable > li.drop-before::before { left: -8px; }
.gallery-sortable > li.drop-after::after { right: -8px; }
.ph-pos { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: rgba(22, 22, 29, .72); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.ph-icon-tag { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 10px; background: var(--surface-card); color: var(--ink-strong); font-size: 12px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ph-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ph-tools .ar-iconbtn { width: 36px; height: 36px; }
.ph-tools .ar-iconbtn:disabled { opacity: .35; cursor: default; }
.ph-tools .grow { flex: 1; }

@media (max-width: 640px) {
  .ic-grid { grid-template-columns: 1fr; }
  .ic-slider { grid-template-columns: 1fr; gap: 4px; }
}
.ic-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.ic-field legend { padding: 0; }
[data-chip] { display: contents; }
.ic-field > legend.label, .ic-slider > span { font-size: 13px; font-weight: 500; color: var(--ink-secondary); }
.unit-icon-sm { --s: 28px; }
.t-sub-unit { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.t-unit-head { display: flex; align-items: center; gap: 14px; }
.t-unit-head .t-sub { margin: 2px 0 0; }

/* ---------- Subscription promo banner ---------- */
.pm { --px: 0; --py: 0; --pm-sky: #1F1A4D; --pm-dusk: #F3913B; --pm-amber: #FFC94D; --pm-paper: #FFFDF6; --pm-lav: #F6D7FF;
  position: relative; overflow: hidden; container-type: inline-size;
  border-radius: 22px; color: #F4F7F6; isolation: isolate;
  background: radial-gradient(90% 70% at 78% 62%, rgba(255, 170, 90, .55), transparent 60%),
    radial-gradient(70% 60% at 10% 0%, rgba(120, 80, 255, .35), transparent 60%),
    linear-gradient(165deg, #1F1A4D 0%, #4B2470 34%, #A3366F 66%, #F07C45 100%);
  background-size: 140% 140%; animation: pm-in .7s cubic-bezier(.2, .7, .2, 1) both, pm-sky 16s ease-in-out infinite alternate;
  box-shadow: 0 22px 44px -24px rgba(75, 36, 112, .8); }
.pm-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; height: 100%; }
.pm::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, transparent, rgba(255, 201, 77, .10), transparent); transform: translateX(-100%); animation: pm-sheen 7s 1.4s ease-in-out infinite; }
.pm-art { order: 2; align-self: end; min-width: 0; }
.pm-scene { display: block; width: 100%; height: auto; max-height: 300px; }
.pm-copy { order: 1; padding: 30px 8px 30px 32px; min-width: 0; }
.pm-eyebrow { margin: 0 0 10px; font-size: 13px; color: var(--pm-lav); }
.pm-h { margin: 0; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; max-width: 17ch; text-wrap: balance; }
.pm-body { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: rgba(255, 244, 250, .86); max-width: 44ch; }
.pm-h { text-shadow: 0 2px 18px rgba(31, 26, 77, .35); }
.pm-status { margin: 0 0 12px; }
.pm-plan { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 13px; color: rgba(244, 247, 246, .85); }
.pm-plan-name { padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #7CF0C5, #3CC8A0); color: #06291F; font-weight: 600; }
.pm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.pm-cta { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: var(--pm-amber); color: #2A2100; font-weight: 600; text-decoration: none; box-shadow: 0 0 0 0 rgba(255, 201, 77, .55); animation: pm-pulse 3.2s 2.4s ease-out infinite; transition: transform .15s, background-color .15s; }
.pm-cta:hover { background: #FFD872; transform: translateY(-1px); }
.pm-cta { background: linear-gradient(135deg, #FFE08A, #FFB547); box-shadow: 0 8px 20px -8px rgba(255, 150, 60, .8); }
.pm-cta:focus-visible, .pm-later:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pm-later { min-height: 46px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: rgba(244, 247, 246, .8); font: inherit; font-weight: 500; cursor: pointer; }
.pm-later:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pm.is-leaving { animation: pm-out .38s ease forwards; }

/* Depth: each layer moves with the pointer by its own amount. */
.pm-layer { transform: translate(calc(var(--px) * var(--d) * -10px), calc(var(--py) * var(--d) * -6px)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.pm-w { fill: #2B2160; transition: fill .4s; animation: pm-light 9s calc(var(--o) * .09s + .6s) ease-in-out infinite; }
.pm-w.is-touched { fill: var(--pm-amber); filter: drop-shadow(0 0 4px rgba(255, 201, 77, .9)); }
.pm-star { animation: pm-twinkle 3.6s calc(var(--i) * .5s) ease-in-out infinite; }
.pm-card { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-card 9s 1s cubic-bezier(.2, .7, .2, 1) infinite; }
.pm-stamp { transform-box: fill-box; transform-origin: center; animation: pm-stamp 9s 1s cubic-bezier(.2, .9, .3, 1.4) infinite; }

@keyframes pm-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes pm-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes pm-sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pm-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 77, .55); } 70%, 100% { box-shadow: 0 0 0 14px rgba(255, 201, 77, 0); } }
@keyframes pm-light { 0%, 4% { fill: #2B2160; } 10%, 78% { fill: var(--pm-amber); } 90%, 100% { fill: #2B2160; } }
@keyframes pm-sky { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes pm-sun { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.pm-sun, .pm-glow { transform-box: fill-box; transform-origin: center; animation: pm-sun 10s ease-in-out infinite; }
@keyframes pm-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes pm-card { 0% { transform: translateY(70px) rotate(4deg); opacity: 0; } 12%, 84% { transform: translateY(0) rotate(-5deg); opacity: 1; } 94%, 100% { transform: translateY(-10px) rotate(-5deg); opacity: 0; } }
@keyframes pm-stamp { 0%, 30% { transform: translate(336px, 214px) rotate(-14deg) scale(2.4); opacity: 0; } 36%, 84% { transform: translate(336px, 214px) rotate(-14deg) scale(1); opacity: 1; } 94%, 100% { opacity: 0; } }

@container (max-width: 640px) {
  .pm-grid { grid-template-columns: 1fr; }
  .pm-art { order: 0; max-height: 200px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
  .pm-scene { max-height: none; margin-top: -30px; }
  .pm-copy { padding: 4px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pm, .pm::after, .pm-cta, .pm-w, .pm-star, .pm-card, .pm-stamp, .pm-sun, .pm-glow { animation: none; }
  .pm-w:nth-child(3n) { fill: var(--pm-amber); }
  .pm-layer { transition: none; transform: none; }
}

/* On the registration page the banner is the whole side panel. */
.pm-register { border-radius: 0; min-height: 100%; box-shadow: none; animation: none; }
.pm-register .pm-grid { grid-template-columns: 1fr; align-content: space-between; }
.pm-register .pm-copy { order: 0; padding: 48px 44px 0; }
.pm-register .pm-art { order: 1; }
.pm-register .pm-scene { max-height: 420px; }
.pm-register .pm-h { font-size: clamp(28px, 3vw, 40px); }
.ar-nav-item { position: relative; }
.ar-nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #C2342B; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface-card); }
.ar-account-text { display: flex; flex-direction: column; line-height: 1.15; }
.ar-account-text small { font-size: 11px; color: var(--ink-muted); font-weight: 500; }
.notice-strip { max-width: var(--content-max); margin: 0 auto 16px; }
.promo-slot { margin: 0 0 24px; }
.banner-warning, .banner-info { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; padding: 14px var(--space-16); border-radius: var(--radius-sm); font-size: 14px; }
.banner-warning { background: var(--warning-soft); border: 1px solid #EED9A4; }
.banner-warning b { color: var(--warning); }
.banner-info { background: var(--info-soft); border: 1px solid #C9CEEE; }
.banner-info b { color: var(--info); }
.banner-warning .grow, .banner-info .grow { flex: 1 1 260px; }
.signin-place { margin: -8px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.signin-new { margin: 18px 0 0; font-size: 14px; color: rgba(22, 22, 29, .7); }
.signin-new a { color: var(--ink-strong); font-weight: 600; }

/* ---------- Registration ---------- */
.register { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--surface-app); }
.reg-art { min-width: 0; }
.reg-art .pm-register { min-height: 0; }
.reg-main { display: flex; align-items: flex-start; justify-content: center; padding: 28px 18px 48px; }
.reg-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; }
.reg-brand img { display: block; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; margin-bottom: 20px; }
.reg-grid .field { display: flex; flex-direction: column; gap: 6px; }
.reg-grid label { font-size: 13px; font-weight: 500; color: var(--ink-secondary); }
.reg-plans { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.reg-plans legend { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 12px; border-radius: 14px; border: 1.5px solid var(--line-control); background: var(--surface-card); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan-card:hover { transform: translateY(-1px); }
.plan-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan-card:has(input:checked) { border-color: #10343A; box-shadow: 0 0 0 3px rgba(16, 52, 58, .14); }
.plan-card:has(input:focus-visible) { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.plan-name { font-size: 15px; }
.plan-flag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #FFC94D; color: #2A2100; }
.plan-price { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.plan-units, .plan-trial { font-size: 12px; color: var(--ink-muted); }
.reg-done { text-align: left; }
.reg-done-icon { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; background: var(--success-soft, #E3F4EA); color: var(--success, #1E7A4C); margin-bottom: 18px; }
@media (min-width: 960px) {
  .register { grid-template-columns: minmax(400px, 44%) 1fr; }
  .reg-art { position: sticky; top: 0; height: 100vh; }
  .reg-art .pm-register { height: 100%; }
  .reg-main { align-items: center; padding: 40px 32px; }
  .reg-brand { display: none; }
}
@media (max-width: 959.98px) {
  .reg-art .pm-register .pm-copy { padding: 22px 22px 0; }
  .reg-art .pm-register .pm-scene { max-height: 220px; }
  .reg-art .pm-register .pm-body, .reg-art .pm-register .pm-actions { display: none; }
}

/* ---------- Business details and payment methods ---------- */
.tax-box { margin-top: 18px; border: 1px solid var(--line-card); border-radius: var(--radius-sm); padding: 0 16px; }
.tax-box > summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 15px; }
.tax-box[open] { padding-bottom: 16px; }
.pay-methods { display: grid; gap: 10px; }
.pay-method { margin: 0; border: 1px solid var(--line-card); border-radius: 14px; padding: 4px 16px 4px; background: var(--surface-card); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.pay-method.is-on { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); padding-bottom: 16px; }
.pay-method legend { padding: 0; float: left; width: 100%; }
.pay-toggle { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.pay-toggle input { width: 20px; height: 20px; accent-color: var(--ink-strong); }
.pay-name { font-weight: 600; font-size: 15px; }
.pay-fields { clear: both; }

/* ---------- Setup wizard ---------- */
.setup { min-height: 100vh; background: var(--surface-page); padding-bottom: 60px; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 880px; margin: 0 auto; padding: 18px 18px 6px; }
.setup-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.setup-brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.setup-brand b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-brand small { font-size: 12px; color: var(--ink-muted); }
.setup-mark { width: 24px; height: 34px; fill: none; stroke: var(--ink-strong); stroke-width: 3; flex: none; }
.setup-steps { max-width: 880px; margin: 0 auto; padding: 8px 18px 4px; overflow-x: auto; }
.setup-steps ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; min-width: max-content; }
.setup-steps li a, .setup-steps .step-off { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; text-decoration: none; color: var(--ink-secondary); font-size: 13px; font-weight: 500; }
.setup-steps .step-off { opacity: .55; }
.setup-steps li a:hover { background: var(--surface-sunken); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-card); border: 1.5px solid var(--line-control); font-size: 12px; font-weight: 700; }
.setup-steps .is-current a { background: var(--surface-card); color: var(--ink-strong); box-shadow: 0 1px 0 var(--line-card); }
.setup-steps .is-current .step-dot { background: #10343A; border-color: #10343A; color: #fff; }
.setup-steps .is-done .step-dot { background: var(--success-soft, #E3F4EA); border-color: transparent; color: var(--success, #1E7A4C); }
.setup-main { max-width: 880px; margin: 0 auto; padding: 12px 18px; }
.setup-card { background: var(--surface-card); border: 1px solid var(--line-card); border-radius: 20px; padding: 28px clamp(18px, 4vw, 36px); }
.setup-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.015em; }
.setup-sub { margin: 6px 0 22px; color: var(--ink-secondary); max-width: 62ch; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-row); }
.setup-actions-end { display: flex; gap: 10px; flex-wrap: wrap; }
.setup-units { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.setup-unit { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-card); border-radius: 14px; }
.setup-unit .grow { flex: 1; min-width: 0; }
.setup-unit .row-sub { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.unit-form { margin: 0 0 16px; padding: 18px; }
.unit-form .mini-title { margin-top: 0; }
.radio-set { border: 0; padding: 0; margin: 16px 0 0; }
.radio-set legend { font-size: 13px; font-weight: 600; color: var(--ink-secondary); padding: 0; margin-bottom: 6px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 14px; cursor: pointer; }
.radio-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink-strong); flex: none; }
.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.plan-use { font-size: 14px; color: var(--ink-secondary); margin: -8px 0 16px; }
.add-unit { width: 100%; justify-content: center; border-style: dashed; }
.temp-pass { display: block; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); font-size: 14px; }
.temp-pass code { font-size: 15px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #fff; }
.danger-link { color: var(--danger); }
.setup-start .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

/* ---------- Plan (subscription) ---------- */
.sub-section { margin-top: 24px; }
.section-title { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.sub-now { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 24px; align-items: center; padding: 24px; border-left: 5px solid var(--success-bar, #2E9E6B); }
.sub-warning { border-left-color: var(--warning-bar); }
.sub-danger { border-left-color: var(--danger); }
.sub-info { border-left-color: var(--info-bar); }
.sub-kicker { margin: 0; font-size: 13px; color: var(--ink-muted); }
.sub-plan { margin: 2px 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.sub-price { font-size: 15px; font-weight: 500; color: var(--ink-secondary); margin-left: 6px; }
.sub-state { margin: 0; color: var(--ink-secondary); }
.sub-pending { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 14px; }
.sub-use-n { margin: 2px 0 8px; font-size: 15px; }
.sub-use-n b { font-size: 24px; }
.sub-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.sub-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.sub-card.is-current { border-color: #10343A; box-shadow: 0 0 0 1px #10343A; }
.sub-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub-card h3 { margin: 0; font-size: 18px; }
.sub-tag { margin: 0; font-size: 13px; color: var(--ink-muted); }
.sub-card-price { margin: 10px 0 0; font-size: 22px; font-weight: 600; }
.sub-units { margin: 0; font-size: 13px; color: var(--ink-secondary); }
.sub-features { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 6px; font-size: 14px; flex: 1; align-content: start; }
.sub-features li { display: flex; gap: 8px; align-items: flex-start; }
.sub-features svg { color: var(--success, #1E7A4C); flex: none; margin-top: 2px; }
.sub-card .ar-btn { justify-content: center; }
.how-to-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.htp { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-sunken); font-size: 14px; }
.sub-total { margin: 14px 0 0; font-size: 15px; }
@media (max-width: 640px) { .sub-now { grid-template-columns: 1fr; } }

/* ---------- Platform ---------- */
.pf-panel > * + * { margin-top: 18px; }
.pf-tiles { margin-bottom: 18px; }
.pf-search { max-width: 260px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.pf-table th, .pf-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line-row); vertical-align: top; }
.pf-table thead th { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.pf-table tbody th { font-weight: 400; }
.pf-table .num { text-align: right; }
.pf-table .row-sub { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 3px; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pf-sub-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px; border-radius: 12px; background: var(--surface-sunken); }
.pf-sub-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-muted); }
.pf-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; margin-top: 14px; }
.pf-plan { padding: 18px; }
.pf-promo { display: grid; gap: 18px; }
.role-help { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-secondary); display: grid; gap: 4px; }
.input-sm { height: 36px; font-size: 14px; }
.team-list { margin-bottom: 8px; }
.team-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.team-gap { margin-top: 28px; }
.link-box { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.link-box .input { flex: 1 1 280px; }

/* ---------- Chat ---------- */
.chat-page { max-width: var(--content-max); }
.chat-title { margin-bottom: 14px; }
.chat-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; height: calc(100dvh - 250px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-list { border-right: 1px solid var(--line-card); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 12px; border-bottom: 1px solid var(--line-row); }
.chat-list ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.chat-item:hover { background: var(--surface-sunken); }
.chat-item.is-open { background: var(--surface-selected); }
.chat-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-time { font-size: 12px; color: var(--ink-muted); flex: none; }
.chat-item-sub { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.is-unread .chat-item-sub { color: var(--ink-strong); font-weight: 600; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #10343A; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.chat-pane { min-width: 0; min-height: 0; display: flex; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-muted); padding: 24px; }
.chat-empty svg { color: var(--ink-placeholder); }
.chat-thread { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-row); }
.chat-head-text { min-width: 0; }
.chat-name { margin: 0; font-size: 16px; font-weight: 600; }
.chat-status { margin: 1px 0 0; font-size: 13px; color: var(--ink-muted); }
.chat-back { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-start { margin: auto; text-align: center; color: var(--ink-muted); }
.chat-start .unit-icon { margin: 0 auto 10px; }
.chat-day { text-align: center; margin: 14px 0 8px; font-size: 12px; color: var(--ink-muted); }
.msg { position: relative; display: flex; align-items: center; gap: 6px; max-width: 100%; }
.msg.mine { flex-direction: row-reverse; }
.msg.first { margin-top: 8px; }
.msg-col { position: relative; display: flex; flex-direction: column; align-items: flex-start; max-width: min(72%, 520px); }
.msg.mine .msg-col { align-items: flex-end; }
.msg-name { font-size: 12px; color: var(--ink-muted); margin: 0 12px 3px; }
.msg-bubble { display: flex; flex-direction: column; gap: 6px; padding: 9px 13px; border-radius: 18px; background: var(--surface-neutral); color: var(--ink-strong); font-size: 15px; line-height: 1.4; word-break: break-word; outline-offset: 2px; }
.msg.mine .msg-bubble { background: #10343A; color: #fff; }
.msg.mine .msg-bubble a { color: #FFD76A; }
.msg:not(.mine):not(.first) .msg-bubble { border-top-left-radius: 6px; }
.msg:not(.mine):not(.last) .msg-bubble { border-bottom-left-radius: 6px; }
.msg.mine:not(.first) .msg-bubble { border-top-right-radius: 6px; }
.msg.mine:not(.last) .msg-bubble { border-bottom-right-radius: 6px; }
.msg.unsent .msg-bubble { background: transparent; border: 1px solid var(--line-control); color: var(--ink-muted); font-style: italic; }
.msg-edited { font-size: 11px; opacity: .7; align-self: flex-end; }
.msg-img { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; }
.msg-img img { display: block; max-width: 260px; max-height: 260px; width: auto; height: auto; border-radius: 12px; }
.msg-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .14); color: inherit; text-decoration: none; }
.msg:not(.mine) .msg-file { background: #fff; }
.msg-file span { display: flex; flex-direction: column; min-width: 0; }
.msg-file b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.msg-file small { font-size: 12px; opacity: .75; }
.msg-quote { display: block; max-width: 100%; margin-bottom: -6px; padding: 7px 12px 12px; border-radius: 14px; background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-quote span { display: block; font-size: 11px; font-weight: 600; }
.msg-rx { display: flex; gap: 2px; margin-top: -6px; z-index: 1; }
.msg.mine .msg-rx { margin-right: 6px; }
.rx { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px; border-radius: 11px; border: 1px solid var(--line-card); background: var(--surface-card); font-size: 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.rx.is-mine { border-color: #10343A; }
.rx small { font-size: 11px; color: var(--ink-muted); }
.msg-seen { font-size: 11px; color: var(--ink-muted); margin: 3px 4px 0; }
.msg-tools { display: flex; gap: 0; opacity: 0; pointer-events: none; transition: opacity .12s; }
.msg-tools .ar-iconbtn { width: 32px; height: 32px; color: var(--ink-muted); }
.msg:hover .msg-tools, .msg:focus-within .msg-tools, .msg.is-active .msg-tools { opacity: 1; pointer-events: auto; }
.msg.is-flash .msg-bubble { animation: msg-flash 1.2s ease; }
@keyframes msg-flash { 30% { box-shadow: 0 0 0 4px #FFC94D; } }
.msg-pop { position: absolute; bottom: calc(100% + 4px); z-index: 5; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-card); box-shadow: 0 6px 24px rgba(22, 22, 29, .18); }
.msg:not(.mine) .msg-pop { left: 0; } .msg.mine .msg-pop { right: 0; }
.msg-pop[role=menu] { flex-direction: column; border-radius: 12px; min-width: 120px; }
.msg-pop button { border: 0; background: none; font: inherit; cursor: pointer; padding: 6px 10px; border-radius: 999px; font-size: 20px; }
.msg-pop[role=menu] button { font-size: 14px; text-align: left; border-radius: 8px; }
.msg-pop button:hover, .msg-pop button:focus-visible { background: var(--surface-sunken); }
.chat-new { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 8px 14px; background: #10343A; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(16, 52, 58, .35); }
.chat-new svg { transform: rotate(-90deg); vertical-align: -2px; }
.chat-composer { border-top: 1px solid var(--line-row); padding: 10px 12px; background: var(--surface-card); }
.chat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px 10px; font-size: 13px; color: var(--ink-secondary); }
.bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-sunken); }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input { flex: 1; resize: none; min-height: 40px; max-height: 140px; padding: 9px 14px; border-radius: 20px; border: 0; background: var(--surface-neutral); font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink-strong); }
.chat-input:focus { outline: 2px solid #10343A; outline-offset: 1px; }
.chat-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: #10343A; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-send:disabled { opacity: .5; }
.chat-error { margin: 8px 4px 0; font-size: 13px; color: var(--danger); }
.chat-lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 14, .88); display: flex; align-items: center; justify-content: center; padding: 24px; }
.chat-lightbox[hidden] { display: none; }
.chat-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.chat-lightbox .ar-iconbtn { position: absolute; top: 14px; right: 14px; color: #fff; }
@media (max-width: 899.98px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100dvh - 250px); }
  .chat-page.has-open .chat-list { display: none; }
  .chat-page:not(.has-open) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
  .chat-page.has-open .chat-title { display: none; }
  .msg-col { max-width: 82%; }
}
@media (hover: none) { .msg-tools { display: none; } .msg.is-active .msg-tools { display: flex; } }

/* Tenant chat fills the space between the header and the bottom menu. */
.t-chat { height: calc(100dvh - 190px); min-height: 420px; display: flex; border-radius: 20px; overflow: hidden; background: var(--surface-card); border: 1px solid var(--line-card); }
.t-nav-item { position: relative; }
.t-nav-item .ar-nav-badge { top: 2px; }
.view-only { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunken); color: var(--ink-secondary); font-size: 14px; }
.read-only .form-actions, .read-only .dropzone, .read-only .up-actions, .read-only #icon-editor, .read-only section[aria-labelledby="up-h"],
.read-only [data-remove], .read-only [data-del], .read-only .ph-tools, .read-only .form-card .ar-btn-primary, .read-only #ct-zone .dropzone { display: none !important; }
.msg-video { display: block; max-width: 300px; max-height: 320px; border-radius: 12px; background: #000; }
.bar-file img { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.bar-file .ar-iconbtn { width: 24px; height: 24px; }

/* ---------- Plan pill: Free · Trial · Subscribed ---------- */
.plan-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid transparent; }
.plan-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.plan-pill-free { background: #EEF0F6; color: #4A4F63; border-color: #D9DCE8; }
.plan-pill-trial { background: #FFF3D6; color: #8A5A00; border-color: #F5D98C; }
.plan-pill-trial .plan-pill-dot { animation: pill-blink 1.6s ease-in-out infinite; }
.plan-pill-paid { background: linear-gradient(135deg, #E2F8EE, #D3F1FF); color: #0F6B47; border-color: #A8E3C8; }
.plan-pill-due { background: #FDE6E4; color: #A12A20; border-color: #F3B9B3; }
a.plan-pill:hover { filter: brightness(.97); }
a.plan-pill:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
.pm .plan-pill { box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); }
@keyframes pill-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .plan-pill-trial .plan-pill-dot { animation: none; } }
@media (max-width: 719.98px) { .ar-topbar .plan-pill { height: 28px; font-size: 12px; } }
@media (max-width: 719.98px) {
  .ar-topbar-end { flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; max-width: 100%; }
  .ar-topbar-end .plan-pill { order: 9; }
  .ar-account-text small { display: none; }
  .ar-account { padding-right: 12px; }
}

/* ---------- Vouchers ---------- */
.voucher-row { display: flex; gap: 8px; flex-wrap: wrap; }
.voucher-row .input, .voucher-row .ar-appinput { flex: 1 1 180px; text-transform: uppercase; letter-spacing: .04em; }
.voucher-box { margin-top: 14px; }
.voucher-box > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: #4B2470; padding: 4px 0; }
.voucher-box[open] > summary { margin-bottom: 8px; }
.voucher-note { margin: 6px 0 0; font-size: 13px; min-height: 1em; }
.voucher-note.is-good { color: #0F6B47; font-weight: 600; }
.voucher-note.is-bad { color: var(--danger); }
.voucher-card { display: flex; gap: 18px; align-items: flex-start; background: linear-gradient(120deg, #FFF8EC, #FBEFFF); border-color: #F0D6F5; }
.voucher-card .grow { flex: 1; min-width: 0; }
.voucher-art { width: 52px; height: 52px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #A3366F, #F07C45); box-shadow: 0 8px 18px -8px rgba(163, 54, 111, .7); }
.voucher-code { font-family: var(--font-sans); letter-spacing: .05em; }
@media (max-width: 520px) { .voucher-card { flex-direction: column; } }
/* The registration panel is narrow but tall: show the whole scene, not the banner's cropped strip. */
@container (max-width: 640px) {
  .pm-register .pm-art { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .pm-register .pm-scene { margin-top: 0; }
}
@media (min-width: 960px) { .pm-register .pm-scene { max-height: 56vh; width: 100%; } .pm-register .pm-art { display: flex; align-items: flex-end; justify-content: center; } }

/* ---------- Settings → Tenants ---------- */
.tn-list > li.tn-unit { display: block; padding: 14px 0; }
.tn-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tn-row .unit-icon { margin-top: 2px; }
.tn-row .row-main { flex: 1 1 240px; }
.tn-vacant { color: var(--ink-muted); font-weight: 500; }
.tn-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; margin-left: auto; }
.tn-form { margin-top: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line-card); display: flex; flex-direction: column; gap: 14px; }
.tn-form-title { margin: 0; font-size: 16px; font-weight: 700; }
.tn-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tn-legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--ink-secondary); }
.tn-pw-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tn-pw-row .input { flex: 1 1 200px; font-size: 16px; letter-spacing: .02em; }
.tn-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line-card); cursor: pointer; }
.tn-status:has(input:checked) { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); }
.tn-status > span { display: flex; flex-direction: column; gap: 4px; }
.tn-status.is-locked { opacity: .55; cursor: not-allowed; }
.tn-status input { margin-top: 4px; }
.tn-sent { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tn-message { margin: 0; padding: 10px 12px; width: 100%; box-sizing: border-box; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tn-sent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
