/* SwaDharma shared controls. Loaded after the legacy stylesheet. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  min-height: 44px !important;
  font-size: 16px !important;
  min-width: 0;
  max-width: 100%;
}

.input, .select, .textarea {
  border-color: var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 400;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}
.field { min-width: 0; }
.field label, .field > span, .field > legend {
  color: var(--label-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.field > small, .field-hint, .field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.req, .field .req { color: var(--alert); }
.field .field-error, .field > small.field-error, .ui-field-error {
  display: block;
  margin: 6px 0 0;
  color: var(--alert);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
:is(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--alert);
  box-shadow: var(--error-focus-ring);
}
.input[readonly], .textarea[readonly] { color: var(--read-only-ink); background: var(--read-only-bg); }
.input:disabled, .select:disabled, .textarea:disabled {
  color: var(--disabled-ink);
  background-color: var(--disabled-bg);
  opacity: 1;
  cursor: not-allowed;
}
textarea { resize: vertical; }
input[type="date"], input[type="month"] { cursor: pointer; font-variant-numeric: tabular-nums; }
.form-grid { gap: 14px; }
.form-section { padding: 16px 18px 18px; border-radius: var(--radius-xl); background: var(--paper); }
.field .checkbox-row, .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.checkbox-row:has(input:checked) { border-color: var(--brand-action); background: var(--brand-soft); }
.checkbox-row:has(input:disabled) { cursor: not-allowed; }
input[type="checkbox"], input[type="radio"], .checkbox-row input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--brand-action);
}
.checkbox-set { display: grid; gap: 8px; }
.matrix-cell:has(input[type="checkbox"]) { min-width: 44px; height: 44px; }
.matrix-cell input { cursor: pointer; }
.ui-check-target { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; vertical-align: middle; cursor: pointer; }
.field .ui-required-hint, .ui-required-hint { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: -1px !important; padding: 0 !important; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.field > .ui-character-count { margin-top: 6px; text-align: right; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ui-money-input { position: relative; width: 100%; min-width: 0; }
.ui-money-input > input { width: 100%; padding-left: 32px !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-money-input > .ui-money-prefix { position: absolute; inset: 0 auto 0 12px; display: flex; align-items: center; pointer-events: none; color: var(--money-prefix); font-size: 13px; font-weight: 500; }
.field .ui-switch-row, .ui-switch-row { min-height: 44px; border-radius: var(--radius-lg); }
.ui-switch-row:has(input:checked) { background: var(--brand-soft); }
.ui-switch-row > .ui-switch-input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 38px !important;
  height: 22px !important;
  min-width: 38px !important;
  min-height: 22px !important;
  flex: 0 0 38px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--switch-off);
  cursor: pointer;
  transition: background-color .16s ease;
}
.ui-switch-row > .ui-switch-input::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: var(--radius-pill); background: var(--white); transition: transform .16s ease; }
.ui-switch-row > .ui-switch-input:checked { background: var(--brand-primary); }
.ui-switch-row > .ui-switch-input:checked::before { transform: translateX(16px); }
.ui-switch-row > .ui-switch-input:disabled { opacity: .65; cursor: not-allowed; }
.settings-form > button[type="submit"] { display: flex; margin-left: auto; margin-top: 12px; position: sticky; bottom: 0; z-index: 1; }

/* The real select remains the form control; only its long-option picker is enhanced. */
select:not([multiple]) {
  appearance: none;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 36px !important;
  background-image: var(--select-chevron-image);
  background-position: right 11px center;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}
select:not([multiple]):hover:not(:disabled) { border-color: var(--select-hover-border); }
@supports (appearance: base-select) {
  select:not([multiple]):not([data-search-picker-open]), ::picker(select) { appearance: base-select; }
  /* The customizable select is a block-start button unless its selected label
     is explicitly centred. Keep the original select and native option semantics. */
  select:not([multiple]) { display: inline-flex; align-items: center; }
  select::picker-icon { display: none; }
  ::picker(select) {
    margin: 4px 0;
    padding: 6px;
    max-height: min(340px, 60vh);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-menu);
  }
  select option { min-height: 40px; padding: 9px 12px; border-radius: var(--radius-xs); font-size: 16px; }
  select option:hover { background: var(--row-hover); }
  select option:checked { color: var(--plum-800); background: var(--brand-soft); font-weight: 600; }
  select optgroup { color: var(--muted); font-size: 12px; font-weight: 700; }
}
.ui-select-picker {
  position: fixed;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-menu);
}
.ui-select-search-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; }
.ui-select-search-row input { width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 0 11px; }
.ui-select-search-row button { flex: 0 0 44px; width: 44px; padding: 0; }
.ui-select-options { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.ui-select-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.ui-select-option.is-active, .ui-select-option:hover { background: var(--brand-soft); }
.ui-select-option[aria-selected="true"] { color: var(--plum-700); font-weight: 700; }
.ui-select-option:disabled { color: var(--muted); }
.ui-select-group { padding: 9px 12px 5px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ui-select-empty { padding: 16px 12px; color: var(--muted); font-size: 14px; }
.combo-option { min-height: 44px; font-size: 16px; font-weight: 400; }
.combo-menu { padding: 6px; border-radius: var(--radius-lg); box-shadow: var(--shadow-menu); }

.form-alert, .auth-error:not([hidden]) {
  border: 1px solid var(--alert-border);
  border-left: 5px solid var(--alert);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--alert-ink);
  background: var(--alert-bg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.auth-error[hidden] { display: none; }
/* Reserve desktop scrollbar space while overlays lock background scrolling;
   phone sheets keep the full visual viewport. */
@media (min-width: 901px) {
  html:has(body.workspace-visible) { scrollbar-gutter: stable; }
}
.ui-overlay-open { overflow: hidden; }
.modal-backdrop { z-index: 110; background: var(--dialog-scrim); backdrop-filter: blur(3px); }
.drawer, .modal { z-index: 120; background: var(--paper); box-shadow: var(--shadow-dialog); }
.modal {
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border-radius: var(--radius-dialog);
}
.modal.ui-standard-dialog { width: min(470px, calc(100vw - 32px)); }
.modal.ui-action-dialog { width: min(500px, calc(100vw - 32px)); }
.ui-confirm-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ui-confirm-heading > svg { width: 20px; height: 20px; color: var(--brand-action); }
.ui-confirm-heading > h3 { margin: 0; }
.ui-confirm-message { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.modal > form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-header, .drawer-header { flex: 0 0 auto; padding: 20px 22px; }
.modal-header h2, .modal-header h3 { font-family: var(--font-serif); font-size: 21px; font-weight: 600; line-height: 1.2; }
.drawer-header h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.modal-header p, .drawer-header p { font-size: 12px; line-height: 1.45; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 21px 22px; background: var(--paper); overscroll-behavior: contain; }
.drawer { width: min(520px, 100vw); height: 100dvh; border-radius: 16px 0 0 16px; }
.drawer-body { padding: 20px; background: var(--paper); overscroll-behavior: contain; }
/* Existing editors keep their form nodes and handlers. Their overlay follows
   the family's centred dialog/editor pattern; record details remain drawers. */
.drawer:has(> form) {
  top: 50%; right: auto; left: 50vw; bottom: auto;
  width: min(470px, calc(100vw - 32px)); height: auto;
  max-height: calc(100dvh - 32px); border-radius: var(--radius-dialog);
  transform: translate(-50%, -50%);
  transition: none;
}
.drawer.open:has(> form) { transform: translate(-50%, -50%); }
.drawer.is-wide:has(> form) { width: min(720px, calc(100vw - 32px)); }
.drawer.is-full:has(> form) { width: min(1360px, calc(100vw - 32px)); }
.drawer:has(> form) > form { height: auto; max-height: calc(100dvh - 32px); min-height: 0; }
.drawer:has(> form) .drawer-header h2 { font-size: 21px; }
.drawer:has(> form) .drawer-body { min-height: 0; padding: 21px 22px; }
.drawer:has(> form) .drawer-actions, .modal .modal-actions { position: static; }
@media (min-width: 721px) {
  .drawer-actions > :is(button, a), .modal-actions > :is(button, a) { width: auto; }
}
@media (min-width: 681px) {
  .drawer.is-full .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.modal-actions, .drawer-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 22px;
  background: var(--action-footer-bg);
}
.modal-actions > :is(.primary,.danger), .drawer-actions > :is(.primary,.danger) { order: 2; }
.modal-actions > .secondary, .drawer-actions > .secondary { order: 1; }
.modal-actions:has(> .primary) > .danger, .drawer-actions:has(> .primary) > .danger { order: 0; margin-right: auto; }
.modal-actions .danger, .drawer-actions .danger { background: var(--danger-button); color: var(--white); border-color: var(--danger-button); }
.modal-actions .danger:hover, .drawer-actions .danger:hover { background: var(--danger-button-hover); }

.empty-state { min-height: 240px; padding: 24px 20px; gap: 12px; align-content: center; font-size: 13px; line-height: 1.5; }
.empty-state strong, .empty-state h3 { display: block; margin: 0 0 5px; font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.empty-state > div { max-width: 390px; }
.empty-state .ui-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-dialog); background: var(--plum-100); color: var(--plum-600); }
.empty-state .ui-empty-icon svg { width: 26px; height: 26px; }

/* Family stat tiles: decoration has no accessible name or interaction. */
:is(.kpi, .dashboard-metric):has(> .ui-stat-icon) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: auto auto auto;
  align-content: start;
  column-gap: 8px;
  row-gap: 6px;
  min-height: 111px;
}
:is(.kpi, .dashboard-metric) > span:not(.ui-stat-icon) { grid-column: 1; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
:is(.kpi, .dashboard-metric) > strong { grid-column: 1; grid-row: 2; min-width: 0; overflow-wrap: anywhere; }
:is(.kpi, .dashboard-metric) > small { grid-column: 1 / -1; grid-row: 3; min-width: 0; overflow-wrap: anywhere; }
:is(.kpi, .dashboard-metric) > .ui-stat-icon {
  display: grid;
  place-items: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xl);
  background: var(--brand-soft);
  color: var(--brand-action);
  align-self: start;
}
:is(.kpi, .dashboard-metric).warn > .ui-stat-icon { background: var(--brand-secondary-soft); color: var(--brand-secondary-ink); }
:is(.kpi, .dashboard-metric).good > .ui-stat-icon { background: var(--blue-soft); color: var(--complement-accent); }
:is(.kpi, .dashboard-metric) > .ui-stat-icon svg { width: 22px; height: 22px; }

.toast-region { top: max(16px, env(safe-area-inset-top)); right: 16px; bottom: auto; z-index: 160; gap: 12px; max-height: calc(100dvh - 100px); overflow-y: auto; padding: 2px; }
.toast {
  width: min(460px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: start;
  padding: 14px 12px 14px 18px;
  border: 1px solid var(--toast-success-border);
  border-left: 5px solid var(--toast-success-accent);
  border-radius: var(--radius-dialog);
  background: var(--toast-success);
  color: var(--white);
  box-shadow: var(--shadow-toast);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  animation: ui-toast-in .16s ease both;
}
.toast.is-error { border-color: var(--toast-error-border); border-left-color: var(--toast-error-accent); background: var(--toast-error); }
.toast > svg { width: 24px; height: 24px; margin: 2px 0 0; color: currentColor; fill: none; stroke: currentColor; }
.toast > span { padding-top: 2px; overflow-wrap: anywhere; }
.toast .toast-dismiss { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid var(--toast-dismiss-border); border-radius: var(--radius-md); color: var(--white); background: transparent; display: grid; place-items: center; }
.toast .toast-dismiss svg { width: 20px; height: 20px; margin: 0; color: currentColor; }
.toast .toast-dismiss:hover { background: var(--toast-dismiss-hover); }
.toast :focus-visible { outline-color: var(--white); }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) { .toast-region { top: max(76px, env(safe-area-inset-top)); } }
@media (max-width: 720px) {
  .drawer:has(> form), .drawer.is-wide:has(> form), .drawer.is-full:has(> form) {
    top: auto; right: 0; bottom: 0; left: 0; width: 100%;
    max-height: calc(100dvh - 16px); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    transform: none;
  }
  .drawer.open:has(> form) { transform: none; }
  .drawer:has(> form) > form { max-height: calc(100dvh - 16px); }
  .modal { top: auto; bottom: 0; left: 0; width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px 18px 0 0; transform: none; }
  .modal.ui-standard-dialog, .modal.ui-action-dialog { width: 100%; }
  .modal.open { transform: none; }
  .modal::before { content: ""; width: 40px; height: 4px; min-height: 4px; margin: 10px auto 0; border-radius: var(--radius-pill); background: var(--sheet-handle); }
  .modal-actions { padding-bottom: max(15px, env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .drawer:has(> form) .drawer-body { padding: 16px; }
  .form-grid, .drawer.is-full .form-grid, .drawer.is-full .form-section { grid-template-columns: minmax(0, 1fr); }
  .modal-header, .drawer-header, .modal-body, .drawer-body { padding: 16px; }
  .modal-actions, .drawer-actions { padding: 15px 16px max(15px, env(safe-area-inset-bottom)); }
  .form-section { padding: 16px; }
  .empty-state { padding: 24px 16px; }
  .drawer { border-radius: 0; }
}
@media (max-width: 560px) {
  .modal-actions > button, .drawer-actions > button { flex: 1 1 100%; }
}
/* Only animate entry. These persistent hosts change size and form/detail layout
   between uses; interpolating their old transforms made editors fly across the
   screen and clearing their content during exit produced a visible collapse. */
.drawer, .modal { transition: none; }
.drawer { --overlay-entry-x: 12px; --overlay-entry-y: 0px; }
.drawer:has(> form), .modal { --overlay-entry-x: 0px; --overlay-entry-y: 10px; }
.drawer.open, .modal.open { animation: ui-overlay-enter 160ms ease-out both; }
@keyframes ui-overlay-enter {
  from { opacity: 0; translate: var(--overlay-entry-x) var(--overlay-entry-y); }
  to { opacity: 1; translate: 0 0; }
}
@media (max-width: 680px) {
  .form-progress { gap: 6px; }
  .form-progress > span { flex-basis: 100%; }
}
@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 print { .toast-region, .ui-select-picker, .ui-overlay-notice-region { display: none !important; } }

/* Keep translated quick actions inside their grid cells. */
.dashboard-action-grid .secondary { min-width: 0; height: auto; white-space: normal; overflow-wrap: anywhere; }
/* Notices announce errors without covering overlay close or save controls. */
.toast-region, .toast { pointer-events: none; }
.toast .toast-dismiss { pointer-events: auto; }
/* Background notices stay below the active dialog. Dialog feedback has its own
   space in the layout instead of floating over fields, headings or actions. */
.drawer.open ~ .toast-region, .modal.open ~ .toast-region { z-index: 115; top: auto; bottom: max(84px, env(safe-area-inset-bottom)); }
.ui-overlay-notice-region { flex: 0 0 auto; display: grid; gap: 8px; max-height: min(200px, 25dvh); overflow-y: auto; padding: 10px 22px; border-top: 1px solid var(--line); background: var(--paper); overscroll-behavior: contain; }
.ui-overlay-notice-region:empty { display: none; }
.ui-overlay-notice-region > .toast { width: 100%; max-width: none; align-items: center; gap: 8px; padding: 10px 12px; box-shadow: none; font-size: 14px; }
@media (max-width: 680px) { .ui-overlay-notice-region { padding-inline: 16px; } }


/* Single-line controls share one text box; multiline notes intentionally start
   at the top. A 24px line box fits Kannada and Devanagari marks without clipping. */
.input:not(textarea):not([type="file"]), select:not([multiple]),
input[type="date"], input[type="month"], input[type="number"],
input[type="search"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"] {
  height: 44px;
  line-height: 24px;
  padding-top: 0;
  padding-bottom: 0;
}
input::-webkit-datetime-edit, input::-webkit-datetime-edit-fields-wrapper { padding: 0; }
textarea.input, textarea.textarea, textarea { height: auto; min-height: 96px !important; padding-top: 10px; padding-bottom: 10px; line-height: 1.5; }
select[multiple] { height: auto; min-height: 96px !important; padding: 8px 10px; line-height: 1.5; }
select[multiple] option { padding: 6px 2px; }
.combo-input { padding-right: 36px; }
.combo-option, .ui-select-option { line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }

/* Register filters form a full-width group below the register summary. The
   container width, including the pinned sidebar, determines the number of tracks. */
.panel:has(> .panel-header > .filter-grid) { container-type: inline-size; container-name: register; }
.panel-header:has(> .filter-grid) { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.panel-header > .filter-grid { width: 100%; min-width: 0; max-width: none; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 12px; }
.panel-header > .property-filter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.panel-header > .filter-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-header > .filter-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-header > .filter-grid :is(.column-toggle, .column-toggle > summary) { min-width: 0; width: 100%; }
@container register (max-width: 900px) {
  .panel-header > .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel-header > .filter-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container register (max-width: 620px) {
  .panel-header > .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-header > .property-filter-grid > .compact-filter:last-child { grid-column: 1 / -1; }
}
@container register (max-width: 620px) and (min-width: 351px) {
  .panel-header > .property-filter-grid > .compact-filter:nth-child(3) { grid-column: 1 / -1; }
  .panel-header > .property-filter-grid > .compact-filter:last-child { grid-column: auto; }
}
@container register (max-width: 350px) {
  .panel-header > .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-header > .property-filter-grid > .compact-filter:last-child { grid-column: auto; }
}

/* The existing organisation input remains the combobox and form value owner. */
.login-organisation-picker { position: relative; min-width: 0; }
.login-organisation-picker #loginOrganisation { padding-left: 40px; padding-right: 88px; }
.login-organisation-search-icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
#loginOrganisation::-webkit-search-cancel-button { display: none; }
.login-organisation-picker :is(#loginOrganisationToggle, #loginOrganisationClear) { position: absolute; top: 0; width: 44px; min-width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.login-organisation-picker #loginOrganisationToggle { right: 0; }
.login-organisation-picker #loginOrganisationClear { right: 42px; }
.login-organisation-picker [hidden] { display: none !important; }
#loginOrganisationResults { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; max-height: min(280px, 38dvh); margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-menu); }
#loginOrganisationResults [role="option"] { display: grid; align-content: center; gap: 3px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); text-align: left; font-size: 15px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
#loginOrganisationResults [role="option"] > strong { min-width: 0; font-weight: 600; }
#loginOrganisationResults [role="option"] > span { min-width: 0; font-size: 12px; color: var(--muted); }
#loginOrganisationResults [role="option"]:is(:hover, :focus-visible, [aria-selected="true"], .is-active) { color: var(--brand-action); background: var(--brand-soft); }
#loginOrganisationStatus { display: block; margin-top: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
#platformLoginToggle { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--brand-action); font-size: 13px; font-weight: 600; white-space: normal; }
#platformLoginToggle:hover { background: var(--brand-soft); }

@media (max-width: 600px) {
  #demoToolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  #demoToolbar #demoBack { grid-column: 1; grid-row: 1; }
  #demoToolbar #demoReset { grid-column: 2; grid-row: 1; }
  #demoToolbar #demoPersona { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
  #demoToolbar .demo-caption { grid-column: 1 / -1; grid-row: 3; width: auto; margin: 0; }
}
