:root {
  color-scheme: dark;
  --ui-bg: #17130f;
  --ui-bg-deep: #0e0b09;
  --ui-surface-1: rgba(42, 34, 28, .82);
  --ui-surface-2: rgba(54, 43, 35, .88);
  --ui-surface-3: rgba(67, 53, 42, .92);
  --ui-surface-4: rgba(27, 22, 18, .97);
  --ui-highlight: rgba(255, 246, 229, .09);
  --ui-border: rgba(239, 219, 188, .14);
  --ui-border-strong: rgba(244, 224, 194, .23);
  --ui-text-1: #fffaf1;
  --ui-text-2: #cbbdac;
  --ui-text-3: #948474;
  --ui-accent: #d6a044;
  --ui-accent-strong: #b97925;
  --ui-selection: #9a7396;
  --ui-success: #67bd7b;
  --ui-warning: #e3ad51;
  --ui-danger: #e77872;
  --ui-info: #8e9fbc;
  --ui-shadow-1: 0 14px 34px rgba(7, 4, 2, .2);
  --ui-shadow-2: 0 24px 70px rgba(7, 4, 2, .36);
  --ui-shadow-3: 0 30px 90px rgba(7, 4, 2, .52);
  --ui-blur-1: 18px;
  --ui-blur-2: 28px;
  --ui-radius-xs: 10px;
  --ui-radius-sm: 14px;
  --ui-radius-md: 20px;
  --ui-radius-lg: 28px;
  --ui-radius-xl: 34px;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-7: 32px;
  --ui-space-8: 40px;
  --app-max-width: 720px;
  --ui-shell: var(--app-max-width);
  --ui-dock-width: 688px;
  --ui-dock-height: 96px;
  --ui-dock-reserve: calc(var(--ui-dock-height) + 26px);
  --ui-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-fast: 150ms;
  --ui-base: 240ms;
  --ui-slow: 420ms;
  --ui-z-content: 1;
  --ui-z-sticky: 100;
  --ui-z-dock: 300;
  --ui-z-banner: 420;
  --ui-z-backdrop: 600;
  --ui-z-dialog: 620;
  --ui-z-picker: 640;
  --ui-z-confirmation: 660;
  --ui-z-toast: 700;

  /* Canonical shared UI contract. */
  --ui-bg-elevated: var(--ui-bg-deep);
  --ui-surface: var(--ui-surface-1);
  --ui-surface-hover: var(--ui-surface-2);
  --ui-surface-selected: color-mix(in srgb, var(--ui-selection) 18%, var(--ui-surface-2));
  --ui-primary: var(--ui-accent);
  --ui-primary-hover: var(--ui-accent-strong);
  --ui-primary-text: #21170f;
  --ui-text-secondary: var(--ui-text-2);
  --ui-text-muted: var(--ui-text-3);
  --ui-focus-ring: color-mix(in srgb, var(--ui-accent) 62%, transparent);
  --ui-backdrop: color-mix(in srgb, var(--ui-bg-deep) 64%, transparent);
  --ui-z-sticky-top-bar: 100;
  --ui-z-sticky-dock: 300;
  --ui-z-popover: 560;
  --ui-z-sheet: 610;

  /* Legacy names resolve to the same source of truth. */
  --ui-background: var(--ui-bg);
  --ui-surface-elevated: var(--ui-surface-2);
  --ui-text-primary: var(--ui-text-1);
  --ui-text-secondary: var(--ui-text-2);
  --ui-shadow: var(--ui-shadow-2);
  --ui-text: var(--ui-text-1);
  --ui-muted: var(--ui-text-2);
  --ui-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ui-glass: var(--ui-surface-1);
  --ui-glass-strong: var(--ui-surface-4);
  --ui-shadow-sm: var(--ui-shadow-1);
  --ui-shadow-lg: var(--ui-shadow-2);
  --ui-shadow-xl: var(--ui-shadow-3);
  --ui-blur: var(--ui-blur-1);
  --ui-blur-strong: var(--ui-blur-2);
  --ui-motion-slow: var(--ui-slow);
  --bg: var(--ui-bg);
  --bg2: var(--ui-bg-deep);
  --bg-soft: var(--ui-surface-4);
  --card: var(--ui-surface-1);
  --card-strong: var(--ui-surface-2);
  --card-2: var(--ui-surface-2);
  --panel: var(--ui-surface-2);
  --surface: var(--ui-surface-2);
  --line: var(--ui-border);
  --text: var(--ui-text-1);
  --muted: var(--ui-text-2);
  --accent: var(--ui-accent);
  --accent2: var(--ui-accent-strong);
  --primary: var(--ui-accent);
  --primary-2: var(--ui-accent-strong);
  --success: var(--ui-success);
  --warning: var(--ui-warning);
  --danger: var(--ui-danger);
  --info: var(--ui-info);
  --shadow: var(--ui-shadow-2);
  --radius: var(--ui-radius-md);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ui-bg: #f6efe4;
  --ui-bg-deep: #ebddcc;
  --ui-surface-1: rgba(255, 252, 246, .82);
  --ui-surface-2: rgba(255, 250, 241, .94);
  --ui-surface-3: rgba(255, 253, 249, .98);
  --ui-surface-4: rgba(255, 251, 244, .99);
  --ui-highlight: rgba(255, 255, 255, .88);
  --ui-border: rgba(80, 57, 36, .12);
  --ui-border-strong: rgba(80, 57, 36, .21);
  --ui-text-1: #2b2119;
  --ui-text-2: #69594b;
  --ui-text-3: #927f6d;
  --ui-accent: #b97425;
  --ui-accent-strong: #96571a;
  --ui-selection: #86627f;
  --ui-success: #287846;
  --ui-warning: #946016;
  --ui-danger: #b64747;
  --ui-info: #586b89;
  --ui-shadow-1: 0 14px 34px rgba(79, 49, 24, .08);
  --ui-shadow-2: 0 24px 60px rgba(79, 49, 24, .14);
  --ui-shadow-3: 0 34px 90px rgba(79, 49, 24, .21);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; overflow-x: clip; background: var(--ui-bg); }
body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(ellipse at 14% 4%, color-mix(in srgb, var(--ui-accent) 16%, transparent), transparent 42%),
    radial-gradient(ellipse at 92% 18%, color-mix(in srgb, var(--ui-selection) 10%, transparent), transparent 38%),
    radial-gradient(ellipse at 45% 100%, color-mix(in srgb, var(--ui-success) 6%, transparent), transparent 42%),
    linear-gradient(155deg, var(--ui-bg-deep), var(--ui-bg));
  background-attachment: fixed;
  color: var(--ui-text-1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: -20%;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 32%, color-mix(in srgb, var(--ui-accent) 10%, transparent), transparent 24%),
    radial-gradient(circle at 74% 48%, color-mix(in srgb, var(--ui-selection) 7%, transparent), transparent 22%);
  filter: blur(28px);
  animation: ui-aurora 22s ease-in-out 1 alternate both;
}
@keyframes ui-aurora { to { transform: translate3d(2.5%, -1.5%, 0) scale(1.03); } }

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: var(--ui-ease);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:not(.color-chip) { min-height: 44px; }
button[aria-label] { min-width: 44px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ui-focus-ring); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--ui-selection) 38%, transparent); }

.ui-visibility-modes {
  display: grid;
  grid-template-columns: repeat(var(--ui-visibility-columns, 3), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
}
.ui-visibility-modes > .ui-visibility-mode {
  min-width: 0;
  min-height: 48px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: calc(var(--ui-radius-sm) - 4px);
  background: transparent;
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.16;
  cursor: pointer;
  transition: color var(--ui-fast) ease, border-color var(--ui-fast) ease, background var(--ui-fast) ease;
}
.ui-visibility-mode.is-active {
  border-color: color-mix(in srgb, var(--ui-primary) 32%, transparent);
  background: var(--ui-surface-selected);
  color: var(--ui-text-primary);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--ui-primary) 10%, transparent);
}
.ui-visibility-mode:disabled,
.ui-visibility-option:has(input:disabled) {
  cursor: default;
  opacity: .68;
}
.ui-visibility-members-field[hidden] { display: none; }
.ui-visibility-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: var(--ui-space-2);
}
.ui-visibility-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  cursor: pointer;
}
.ui-visibility-option.is-checked {
  border-color: color-mix(in srgb, var(--ui-primary) 30%, transparent);
  background: var(--ui-surface-selected);
}
.ui-visibility-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ui-visibility-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-selection) 22%, var(--ui-surface-2));
  color: var(--ui-text-primary);
  font-size: 11px;
  font-weight: 850;
}
.ui-visibility-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-text-primary);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-visibility-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 7px;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
}
.ui-visibility-option.is-checked .ui-visibility-check {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: var(--ui-primary-text);
}
.ui-visibility-option:has(input:focus-visible) {
  outline: 3px solid var(--ui-focus-ring);
  outline-offset: 3px;
}
.ui-visibility-error,
.ui-visibility-empty {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.ui-visibility-error { color: var(--ui-danger); }
.ui-visibility-empty {
  grid-column: 1 / -1;
  padding: 10px 2px;
  color: var(--ui-text-muted);
}

.ui-assignee {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: var(--ui-space-2);
}
.ui-assignee-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  cursor: pointer;
}
.ui-assignee-option.is-checked {
  border-color: color-mix(in srgb, var(--ui-primary) 30%, transparent);
  background: var(--ui-surface-selected);
}
.ui-assignee-option:has(input:disabled) {
  cursor: default;
  opacity: .68;
}
.ui-assignee-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ui-assignee-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-selection) 22%, var(--ui-surface-2));
  color: var(--ui-text-primary);
  font-size: 11px;
  font-weight: 850;
}
.ui-assignee-avatar.is-none {
  color: var(--ui-text-muted);
}
.ui-assignee-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-text-primary);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-assignee-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 7px;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
}
.ui-assignee.is-single .ui-assignee-check {
  border-radius: 50%;
}
.ui-assignee-option.is-checked .ui-assignee-check {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: var(--ui-primary-text);
}
.ui-assignee-option:has(input:focus-visible) {
  outline: 3px solid var(--ui-focus-ring);
  outline-offset: 3px;
}
.ui-assignee-error,
.ui-assignee-empty {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.ui-assignee-error { color: var(--ui-danger); }
.ui-assignee-empty {
  padding: 10px 2px;
  color: var(--ui-text-muted);
}

@media (max-width: 380px) {
  .ui-visibility-mode { padding-inline: 5px; font-size: 11px; }
  .ui-visibility-members,
  .ui-assignee { grid-template-columns: 1fr; }
}

h1, h2, h3, h4, p { text-wrap: pretty; }
h1 { font-size: clamp(2rem, 5vw, 2.7rem); line-height: 1.02; letter-spacing: -.055em; }
h2 { font-size: clamp(1.65rem, 4vw, 2.15rem); line-height: 1.08; letter-spacing: -.045em; }
h3 { font-size: clamp(1.2rem, 3vw, 1.45rem); line-height: 1.16; letter-spacing: -.025em; }
h4 { font-size: 1rem; line-height: 1.24; letter-spacing: -.012em; }
.mini, .label-mini, .surface-mini, .children-brand-mini {
  color: var(--ui-text-3);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

main.app-shell,
main.app,
main.children-app {
  position: relative;
  z-index: var(--ui-z-content);
  width: min(100%, var(--ui-shell));
  max-width: var(--ui-shell);
  min-height: 100dvh;
  margin-inline: auto;
  padding: calc(max(18px, env(safe-area-inset-top)) + 70px) max(16px, env(safe-area-inset-right)) calc(var(--ui-dock-reserve) + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: transparent;
}
main.app-shell .screen,
main.app-shell > .children-screen,
main.app > .screen,
main.children-app > .children-screen { width: 100%; max-width: 100%; min-width: 0; }
main.app-shell.app-frame { width: 100%; max-width: 100%; margin: 0; }
.screen, .children-screen { display: grid; gap: var(--ui-space-4); }

.app-shell-root {
  position: fixed;
  z-index: var(--ui-z-sticky);
  inset: 0;
  pointer-events: none;
}
.app-shell-root > * { pointer-events: auto; }

.app-global-bar {
  position: fixed;
  z-index: calc(var(--ui-z-sticky) + 1);
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(var(--ui-shell), calc(100vw - 32px));
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  padding: 8px 9px 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background:
    linear-gradient(145deg, color-mix(in srgb, white 10%, transparent), transparent 48%),
    color-mix(in srgb, var(--ui-surface-2) 82%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 17%, transparent), var(--ui-shadow-1);
  backdrop-filter: blur(var(--ui-blur-1)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--ui-blur-1)) saturate(145%);
  transform: translateX(-50%);
}
.app-global-bar[hidden] { display: none; }
.app-global-bar[data-session-pending="true"],
.app-dock[data-session-pending="true"] {
  opacity: .78;
  filter: saturate(.72);
}
.app-global-bar[data-session-pending="true"] .app-sync-chip,
.app-dock[data-session-pending="true"] .app-dock-link,
.app-dock[data-session-pending="true"] .app-calendar-link {
  animation: app-shell-pending 1.25s ease-in-out infinite;
}
@keyframes app-shell-pending {
  0%, 100% { opacity: .42; }
  50% { opacity: .76; }
}
.app-global-brand {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ui-text-1);
  font-size: 14px;
  font-weight: 880;
  letter-spacing: -.015em;
  text-decoration: none;
}
.app-global-brand img {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: inset 0 1px 0 var(--ui-highlight), 0 7px 18px color-mix(in srgb, var(--ui-accent) 15%, transparent);
  transform-origin: 50% 58%;
  will-change: transform;
  animation: app-logo-levitate 7.2s ease-in-out infinite;
}

@keyframes app-logo-levitate {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-.35deg); }
  25% { transform: translate3d(1.5px, -2px, 0) rotate(.2deg); }
  55% { transform: translate3d(-1px, -3.5px, 0) rotate(.45deg); }
  78% { transform: translate3d(-1.5px, -1px, 0) rotate(-.1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-global-brand img,
  .app-global-bar[data-session-pending="true"] .app-sync-chip,
  .app-dock[data-session-pending="true"] .app-dock-link,
  .app-dock[data-session-pending="true"] .app-calendar-link {
    animation: none;
    transform: none;
    will-change: auto;
  }
}
.app-global-tools { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.app-global-menu-trigger,
.app-global-menu-close,
.app-dialog-close,
.app-picker-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-text-1);
  cursor: pointer;
  transition: transform var(--ui-fast), background var(--ui-fast), border-color var(--ui-fast);
}
.app-global-menu-trigger:hover,
.app-global-menu-close:hover,
.app-dialog-close:hover,
.app-picker-close:hover { border-color: var(--ui-border-strong); background: var(--ui-surface-3); }
.app-global-menu-trigger:active,
.app-global-menu-close:active,
.app-dialog-close:active,
.app-picker-close:active { transform: scale(.94); }
.app-global-menu-icon { width: 20px; height: 20px; }
.app-overlay-root { display: contents; }
.app-global-menu-backdrop,
.app-picker-backdrop,
.app-confirm-backdrop,
.app-file-source-backdrop,
.app-notification-backdrop,
.app-start-page-backdrop {
  position: fixed;
  z-index: calc(var(--ui-z-backdrop) + var(--ui-layer-offset, 0) + var(--ui-layer-order, 0));
  inset: 0;
  display: grid;
  place-items: start center;
  padding: max(82px, calc(env(safe-area-inset-top) + 70px)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--ui-bg-deep) 42%, transparent);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
}
.app-global-menu-backdrop { --ui-layer-offset: -40; }
.app-picker-backdrop,
.picker-sheet-backdrop { --ui-layer-offset: 40; }
.app-confirm-backdrop { --ui-layer-offset: 60; }
.app-file-source-backdrop { --ui-layer-offset: 40; }
.app-notification-backdrop,
.app-start-page-backdrop { --ui-layer-offset: 20; }
.sheet-backdrop,
.assign-sheet-backdrop,
.memory-modal-backdrop,
.scanner-sheet-backdrop { z-index: calc(var(--ui-z-backdrop) + var(--ui-layer-offset, 0) + var(--ui-layer-order, 0)); }
.app-global-menu-backdrop {
  place-items: start end;
  padding-right: max(16px, calc((100vw - min(var(--ui-shell), 100vw)) / 2));
}
.app-global-menu-backdrop[hidden],
.app-picker-backdrop[hidden],
.app-confirm-backdrop[hidden],
.app-file-source-backdrop[hidden],
.app-notification-backdrop[hidden],
.app-start-page-backdrop[hidden] { display: none; }
.app-global-menu,
.app-picker,
.app-confirm-dialog,
.app-file-source,
.app-notification-dialog,
.app-start-page-dialog {
  width: min(420px, 100%);
  max-height: calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface-4);
  box-shadow: var(--ui-shadow-3), inset 0 1px 0 var(--ui-highlight);
  color: var(--ui-text-1);
  animation: ui-dialog-in var(--ui-base) var(--ui-ease) both;
}
.app-picker,
.app-file-source,
.app-confirm-dialog,
.app-notification-dialog,
.ui-dialog-grid {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.app-picker-options,
.ui-dialog-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.app-picker-head,
.app-dialog-head,
.ui-dialog-grid .sheet-head,
.ui-dialog-grid .sheet-actions { background: transparent; }
.app-global-menu-head,
.app-picker-head,
.app-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
  padding: 9px 9px 12px;
}
.app-global-menu-head h2,
.app-picker-head h2,
.app-dialog-head h2 { margin: 2px 0 0; font-size: 1.35rem; }
.app-global-menu-panel {
  display: grid;
  gap: 2px;
}
.app-global-menu-panel > button,
.app-global-menu-panel > a {
  display: grid;
  width: 100%;
  min-height: 50px;
  align-content: center;
  gap: 1px;
  padding: 7px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ui-text-1);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app-global-menu-panel > button:hover,
.app-global-menu-panel > a:hover { background: var(--ui-surface-2); }
.app-global-menu-panel > [hidden] { display: none; }
.app-global-menu-panel span { font-size: 13px; font-weight: 800; }
.app-global-menu-panel small { color: var(--ui-text-3); font-size: 10px; font-weight: 650; }
.app-global-menu-panel .is-danger { margin-top: 4px; border-top: 1px solid var(--ui-border); border-radius: 0 0 12px 12px; color: var(--ui-danger); }
.app-confirm-dialog { width: min(440px, 100%); overflow: hidden; padding: 8px; }
.app-confirm-dialog > p { margin: 4px 13px 18px; color: var(--ui-text-2); }
.app-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ui-space-2); padding: 0 5px 5px; }
.app-confirm-actions.is-single { grid-template-columns: 1fr; }
.app-confirm-actions > button { min-height: 44px; }
.app-file-source { width: min(500px, 100%); overflow: hidden; padding: 8px; }
.app-file-source-options { display: grid; gap: 5px; padding: 0 3px 3px; }
.app-file-source-options > button {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-text-1);
  text-align: left;
  cursor: pointer;
}
.app-file-source-options > button:hover { border-color: var(--ui-border); background: var(--ui-surface-2); }
.app-file-source-options b { font-size: 14px; }
.app-file-source-options small { color: var(--ui-text-3); }
.member-picker-option { display: grid; grid-template-columns: auto 32px minmax(0, 1fr) auto; min-height: 54px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-surface-2); color: var(--ui-text-1); cursor: pointer; }
.member-picker-option input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.member-picker-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ui-accent) 18%, var(--ui-surface-3)); color: var(--ui-accent); font-size: 12px; font-weight: 900; }
.member-picker-option > b { opacity: 0; color: var(--ui-accent); }
.member-picker-option:has(input:checked) { border-color: color-mix(in srgb, var(--ui-accent) 48%, var(--ui-border)); background: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface-2)); }
.member-picker-option:has(input:checked) > b { opacity: 1; }
.sheet [hidden],
.create-list-panel [hidden],
.app-picker [hidden] { display: none !important; }
.app-picker-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 2px 2px; }
.app-picker-actions.is-date { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-picker-actions.is-required:not(.is-date) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-picker-actions > button { min-height: 44px; padding-inline: 8px; }
.app-roller-picker { display: grid; gap: 10px; }
.app-roller-grid { display: grid; gap: 10px; }
.app-roller-grid.is-time { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-roller-grid.is-date { grid-template-columns: minmax(70px, .8fr) minmax(110px, 1.4fr) minmax(88px, 1fr); }
.app-roller-field { min-width: 0; }
.app-roller-field > .label-mini { display: block; margin: 0 0 6px; text-align: center; }
.app-roller-window {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-4) 96%, transparent), transparent 32%, transparent 68%, color-mix(in srgb, var(--ui-surface-4) 96%, transparent)),
    color-mix(in srgb, var(--ui-surface-2) 88%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 7%, transparent), inset 0 -1px 0 color-mix(in srgb, black 10%, transparent);
}
.app-roller-window::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 5px;
  left: 5px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 42%, var(--ui-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--ui-accent) 11%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 9%, transparent), 0 4px 14px color-mix(in srgb, black 8%, transparent);
  content: "";
  pointer-events: none;
  transform: translateY(-50%);
}
.app-roller-column {
  position: relative;
  z-index: 1;
  height: 216px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 84px 5px;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  overscroll-behavior: contain;
}
.app-roller-column::-webkit-scrollbar { display: none; }
.app-roller-column:focus-visible { box-shadow: inset 0 0 0 2px var(--ui-focus); }
.app-roller-column [role="option"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ui-text-3);
  font: inherit;
  font-size: 16px;
  font-weight: 760;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  opacity: .58;
  scroll-snap-align: center;
}
.app-roller-column [role="option"].is-selected { color: var(--ui-text-1); font-size: 18px; font-weight: 900; opacity: 1; }
.app-roller-column [role="option"]:disabled { cursor: not-allowed; opacity: .18; }
.app-roller-status { min-height: 18px; margin: 0; color: var(--ui-text-2); font-size: 12px; font-weight: 750; text-align: center; }
.app-roller-manual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, .8fr); align-items: center; gap: 10px; }
.app-roller-manual > span { color: var(--ui-text-2); font-size: 12px; font-weight: 750; }
.app-roller-manual > input {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-text-1);
  font: inherit;
  font-weight: 800;
  text-align: center;
}
.app-roller-manual > input:focus-visible { border-color: var(--ui-focus); outline: 2px solid color-mix(in srgb, var(--ui-focus) 28%, transparent); outline-offset: 1px; }
.app-picker-error { margin: 0; color: var(--ui-danger); font-size: 12px; font-weight: 760; }

.card,
.surface-card,
.child-room-section,
.child-room-hero,
.workspace-hero,
.top-card,
.safe-top-card,
.children-top-shell,
.hero-card {
  border: 1px solid var(--ui-border);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--ui-highlight) 78%, transparent), transparent 42%),
    color-mix(in srgb, var(--ui-surface-1) 96%, var(--ui-bg));
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 8%, transparent), var(--ui-shadow-1);
}

.app-header {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px var(--ui-space-5);
  overflow: visible;
  border-radius: var(--ui-radius-xl);
}
.app-header::after {
  position: absolute;
  inset: 1px 18px auto;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, color-mix(in srgb, white 24%, transparent), transparent);
}
.app-header .topbar,
.app-header .logovo-home-header,
.app-header.safe-top-row,
.app-header.children-top-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--ui-space-5);
}
.app-header .logovo-home-header { grid-template-areas: "title"; grid-template-columns: minmax(0, 1fr); }
.app-header .logovo-title-wrap { grid-area: title; text-align: left; }
.app-header .hero-copy,
.app-header .safe-title-wrap,
.app-header .children-brand-block,
.app-header .logovo-title-wrap,
.app-header .topbar > div:first-child { min-width: 0; }
.app-header .topbar > div:first-child { padding-right: 0; }
.app-header h1, .app-header h2 { margin: 5px 0 0; padding: 0; color: var(--ui-text-1); }
.app-header p, .app-header .text, .app-header .logovo-family-line, .app-header .logovo-me-line {
  max-width: 52ch;
  margin: 8px 0 0;
  color: var(--ui-text-2);
  line-height: 1.45;
}
.app-header-tools,
.app-header .hero-actions,
.app-header .safe-top-actions,
.app-header .children-top-actions,
.app-header .top-actions,
.app-header .logovo-menu-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ui-space-2);
  margin-left: auto;
}
.app-header .logovo-menu-wrap { display: none; }
.app-header .app-context-copy { align-self: center; }
.app-header .app-context-copy > h1,
.app-header .app-context-copy > h2 { margin-top: 0; }
.app-context-back {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 3px;
  margin: 0 0 5px -5px;
  padding: 2px 6px 2px 2px;
  border-radius: 9px;
  color: var(--ui-text-2);
  font-size: 11px;
  font-weight: 780;
  text-decoration: none;
}
.app-context-back:hover { background: var(--ui-surface-2); color: var(--ui-text-1); }
.app-context-back svg { width: 18px; height: 18px; }
.children-section-tabs a,
#familyCopyInviteBtn,
#familyShareInviteBtn,
.switch-row { min-height: 44px; }
.app-context-action-icon { width: 20px; height: 20px; }
.app-header-list .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: var(--ui-space-3); }
.app-header-list .topbar > div:first-child { padding-right: 0; }
.app-header-list .hero-actions { display: flex; width: auto; align-items: center; gap: var(--ui-space-2); }
.app-header-list .hero-actions .theme-btn,
.app-header-list .hero-actions .icon-btn { width: 44px; min-width: 44px; }
.app-header-list .hero-actions .icon-btn { border: 1px solid color-mix(in srgb, white 16%, transparent); background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-strong)); color: #21170f; box-shadow: 0 10px 24px color-mix(in srgb, var(--ui-accent) 24%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.app-header-list .item-photo-slot { border-color: var(--ui-border); background: var(--ui-surface-1); color: var(--ui-text-2); box-shadow: inset 0 1px 0 var(--ui-highlight); }

.app-sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--ui-success) 36%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-success) 11%, transparent);
  color: var(--ui-text-1);
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
  transition: background var(--ui-base), border-color var(--ui-base), color var(--ui-base);
}
.app-sync-chip::before { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-success); content: ""; box-shadow: 0 0 12px color-mix(in srgb, var(--ui-success) 55%, transparent); }
.app-sync-chip[data-state="syncing"] { border-color: color-mix(in srgb, var(--ui-warning) 42%, transparent); background: color-mix(in srgb, var(--ui-warning) 11%, transparent); }
.app-sync-chip[data-state="syncing"]::before { background: var(--ui-warning); animation: ui-sync-pulse .9s infinite alternate; }
.app-sync-chip[data-state="updated"] { border-color: color-mix(in srgb, var(--ui-accent) 38%, transparent); background: color-mix(in srgb, var(--ui-accent) 11%, transparent); }
.app-sync-chip[data-state="updated"]::before { background: var(--ui-accent); }
.app-sync-chip[data-state="offline"], .app-sync-chip[data-state="realtime-offline"] { border-color: color-mix(in srgb, var(--ui-danger) 40%, transparent); background: color-mix(in srgb, var(--ui-danger) 10%, transparent); }
.app-sync-chip[data-state="offline"]::before, .app-sync-chip[data-state="realtime-offline"]::before { background: var(--ui-danger); }
@keyframes ui-sync-pulse { to { opacity: .32; transform: scale(.82); } }

.app-shell-icon,
.theme-btn,
.theme-toggle-btn,
.sheet-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-text-1);
  box-shadow: inset 0 1px 0 var(--ui-highlight);
  cursor: pointer;
  transition: transform var(--ui-fast) var(--ui-ease), background var(--ui-fast), border-color var(--ui-fast);
}
.app-shell-icon:hover, .theme-btn:hover, .theme-toggle-btn:hover, .sheet-close:hover { background: var(--ui-surface-3); border-color: var(--ui-border-strong); }
.app-shell-icon:active, .theme-btn:active, .theme-toggle-btn:active, .sheet-close:active { transform: scale(.94); }
.app-global-menu-close svg, .app-dialog-close svg, .app-picker-close svg, .sheet-close svg, .scanner-close-btn svg, .sheet-close-btn svg { width: 22px; height: 22px; }

.primary-btn, .secondary-btn, .danger-btn, .ghost-btn {
  min-height: 44px;
  border-radius: var(--ui-radius-sm);
  font-weight: 800;
  transition: transform var(--ui-fast) var(--ui-ease), filter var(--ui-fast), background var(--ui-fast);
}
.primary-btn { border: 1px solid color-mix(in srgb, white 16%, transparent); background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-hover)); color: var(--ui-primary-text); box-shadow: 0 12px 28px color-mix(in srgb, var(--ui-primary) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.28); }
.secondary-btn, .ghost-btn { border: 1px solid var(--ui-border); background: var(--ui-surface-2); color: var(--ui-text-1); box-shadow: inset 0 1px 0 var(--ui-highlight); }
.danger-btn { border: 1px solid color-mix(in srgb, var(--ui-danger) 36%, var(--ui-border)); background: color-mix(in srgb, var(--ui-danger) 15%, var(--ui-surface-2)); color: var(--ui-danger); box-shadow: inset 0 1px 0 var(--ui-highlight); }
.primary-btn:active, .secondary-btn:active, .danger-btn:active, .ghost-btn:active { transform: scale(.975); }

.app-dock {
  position: fixed;
  z-index: var(--ui-z-dock);
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: block;
  width: min(var(--ui-dock-width), calc(100vw - 20px));
  height: 96px;
  padding: 0;
  transform: translateX(-50%);
  isolation: isolate;
}
.app-dock[hidden] { display: none; }
.app-dock-surface { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 28px rgba(7, 4, 2, .32)); pointer-events: none; }
.app-dock-surface path,
.app-dock-surface rect { fill: color-mix(in srgb, var(--ui-surface-4) 88%, transparent); stroke: var(--ui-border-strong); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.app-dock-links { position: absolute; z-index: 1; right: 7px; bottom: 5px; left: 7px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.app-dock-link {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 2px 4px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--ui-text-3);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--ui-base), background var(--ui-base), transform var(--ui-fast) var(--ui-ease);
}
.app-dock-icon { width: 20px; height: 20px; flex: 0 0 20px; transition: transform var(--ui-base) var(--ui-ease); }
.app-dock-label { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.app-dock-link:hover { color: var(--ui-text-2); }
.app-dock-link:active { transform: scale(.94); }
.app-dock-link[aria-current="page"] { background: color-mix(in srgb, var(--ui-selection) 21%, transparent); color: var(--ui-text-1); }
.app-dock-link[aria-current="page"] .app-dock-icon { transform: translateY(-1px) scale(1.06); }
.app-dock-link.is-locked,
.app-calendar-link.is-locked { color: color-mix(in srgb, var(--ui-text-3) 72%, transparent); cursor: not-allowed; opacity: .72; }
.app-dock-link.is-locked:active,
.app-calendar-link.is-locked:active { transform: none; }
.app-calendar-link {
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  align-content: center;
  gap: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ui-text-1);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 18%, transparent);
  text-decoration: none;
  transition: transform var(--ui-base) var(--ui-ease), box-shadow var(--ui-base), filter var(--ui-base);
}
.app-calendar-day { font-size: 13px; font-weight: 900; line-height: 1; }
.app-calendar-month { color: var(--ui-text-3); font-size: 6.5px; font-weight: 850; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase; }
.app-calendar-link:hover { transform: translateX(-50%) translateY(-1px); background-color: var(--ui-surface-3); }
.app-calendar-link:active { transform: translateX(-50%) scale(.94); }
.app-calendar-link[aria-current="page"] { background: color-mix(in srgb, var(--ui-accent) 20%, transparent); color: var(--ui-text-1); box-shadow: inset 0 1px 0 color-mix(in srgb, white 18%, transparent), 0 0 0 2px color-mix(in srgb, var(--ui-accent) 12%, transparent); }
.app-calendar-link[aria-current="page"] .app-calendar-month { color: color-mix(in srgb, var(--ui-accent) 70%, var(--ui-text-2)); }

.is-child-session .app-context-back,
.is-child-session #childLogoutBtn { display: none !important; }

.compact-sort-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.compact-sort-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.compact-sort-trigger {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--ui-surface-2);
  color: var(--ui-text-1);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.compact-sort-trigger:hover,
.compact-sort-trigger.is-open { border-color: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-border)); background: color-mix(in srgb, var(--ui-accent) 12%, var(--ui-surface-2)); }
.compact-sort-menu {
  position: absolute;
  z-index: calc(var(--ui-z-sticky) + 2);
  top: calc(100% + 7px);
  right: 0;
  display: none;
  width: 190px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 14px;
  background: var(--ui-surface-4);
  box-shadow: var(--ui-shadow-2);
}
.compact-sort-wrap.open .compact-sort-menu { display: grid; }
.compact-sort-option {
  min-height: 38px;
  padding: 6px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ui-text-2);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.compact-sort-option:hover,
.compact-sort-option.active { background: var(--ui-surface-2); color: var(--ui-text-1); }

/* Branded form controls share one interaction and focus model. */
.ui-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.ui-datetime { position: relative; display: block; width: 100%; min-width: 0; }
.ui-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.ui-select-trigger,
.ui-datetime-trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--ui-surface-2) 86%, transparent);
  color: var(--ui-text-1);
  font-weight: 720;
  text-align: left;
  cursor: pointer;
}
.ui-select-trigger:hover,
.ui-datetime-trigger:hover { border-color: var(--ui-border-strong); background: var(--ui-surface-3); }
.ui-select-trigger:disabled,
.ui-datetime-trigger:disabled { opacity: .48; cursor: not-allowed; }
.ui-select-trigger svg,
.ui-datetime-trigger svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--ui-text-3); }
.app-picker { width: min(520px, 100%); }
.app-picker-options { display: grid; gap: 4px; padding: 0 3px 3px; }
.app-picker-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ui-text-1);
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}
.app-picker-option:hover { background: var(--ui-surface-2); }
.app-picker-option[aria-selected="true"] { border-color: color-mix(in srgb, var(--ui-selection) 48%, var(--ui-border)); background: color-mix(in srgb, var(--ui-selection) 17%, transparent); }
.app-picker-option b { color: var(--ui-accent); font-size: 17px; }
.app-picker-option:disabled { opacity: .42; cursor: not-allowed; }

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
  border: 1.5px solid var(--ui-border-strong);
  background: var(--ui-surface-2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
input[type="checkbox"] { border-radius: 7px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked { border-color: var(--ui-accent); background-color: var(--ui-accent); }
input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2119' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 16px;
}
input[type="radio"]:checked { box-shadow: inset 0 0 0 5px var(--ui-surface-4); }
input[type="checkbox"]:disabled,
input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
input[type="date"],
input[type="datetime-local"],
input[type="time"] { color-scheme: dark; }
:root[data-theme="light"] input[type="date"],
:root[data-theme="light"] input[type="datetime-local"],
:root[data-theme="light"] input[type="time"] { color-scheme: light; }

.ui-file-input { display: grid; gap: 8px; }
.ui-file-input > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ui-file-trigger {
  width: fit-content;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-text-1);
  font-weight: 800;
  cursor: pointer;
}
.ui-file-status { overflow: hidden; color: var(--ui-text-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* One elevation model for dialogs, sheets and viewers. */
.sheet-backdrop,
.assign-sheet-backdrop,
.memory-modal-backdrop,
.picker-sheet-backdrop,
.scanner-sheet-backdrop,
.app-confirm-backdrop,
.app-file-source-backdrop {
  position: fixed;
  z-index: calc(var(--ui-z-backdrop) + var(--ui-layer-offset, 0) + var(--ui-layer-order, 0));
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--ui-bg-deep) 64%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  overscroll-behavior: contain;
}
.sheet-backdrop.hidden, .assign-sheet-backdrop.hidden, .memory-modal-backdrop.hidden,
.picker-sheet-backdrop.hidden, .scanner-sheet-backdrop.hidden,
.app-confirm-backdrop[hidden], .app-file-source-backdrop[hidden],
.sheet-backdrop:not(.active):not([data-open="true"]):not(.memory-modal-backdrop):not(.hidden),
.assign-sheet-backdrop:not(.active),
.memory-modal-backdrop:not(.active):not([data-open="true"]),
.picker-sheet-backdrop:not(.active),
.scanner-sheet-backdrop:not(.active) { display: none; }
.sheet,
.assign-sheet,
.create-list-panel,
.memory-modal,
.picker-sheet,
.scanner-sheet,
.app-notification-dialog,
.app-confirm-dialog,
.app-file-source {
  position: relative;
  z-index: var(--ui-z-dialog);
  width: min(620px, 100%);
  max-height: min(860px, calc(var(--ui-viewport-height, 100dvh) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: hidden;
  padding: var(--ui-space-5);
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-xl);
  background:
    linear-gradient(145deg, color-mix(in srgb, white 11%, transparent), transparent 38%),
    var(--ui-surface-4);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 18%, transparent), var(--ui-shadow-3);
  color: var(--ui-text-1);
  animation: ui-dialog-in var(--ui-base) var(--ui-ease) both;
  overscroll-behavior: contain;
}
.app-photo-viewer {
  position: fixed;
  z-index: var(--ui-z-dialog);
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--ui-bg-deep) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.app-photo-viewer[hidden] { display: none; }
.app-photo-viewer-frame {
  position: relative;
  max-width: min(92vw, 820px);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid var(--ui-border-strong);
  border-radius: 24px;
  background: var(--ui-surface-4);
  box-shadow: var(--ui-shadow-3);
}
.app-photo-viewer-image { display: block; max-width: 100%; max-height: 88vh; object-fit: contain; background: var(--ui-bg-deep); }
.app-photo-viewer-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--ui-border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ui-bg-deep) 82%, transparent);
  color: var(--ui-text-1);
  box-shadow: var(--ui-shadow-2);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.sheet-backdrop.active > .create-list-panel { display: block; }
.ui-dialog-grid { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.ui-dialog-form { display: grid !important; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
.ui-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.sheet-head { position: relative; z-index: 2; display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: var(--ui-space-4); margin: calc(var(--ui-space-5) * -1) calc(var(--ui-space-5) * -1) 0; padding: var(--ui-space-5); border-bottom: 1px solid var(--ui-border); background: color-mix(in srgb, var(--ui-surface-4) 92%, transparent); backdrop-filter: blur(18px); }
.sheet-title { color: var(--ui-text-1); font-size: 1.45rem; font-weight: 900; letter-spacing: -.035em; }
.sheet-form { display: grid; gap: var(--ui-space-5); min-height: 0; }
.sheet-form > .ui-dialog-body { display: grid; gap: var(--ui-space-5); padding-block: var(--ui-space-4); }
.sheet-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: var(--ui-space-2);
  margin: 0 calc(var(--ui-space-5) * -1) calc(var(--ui-space-5) * -1);
  padding: var(--ui-space-4) var(--ui-space-5) var(--ui-space-5);
  background: linear-gradient(0deg, var(--ui-surface-4) 82%, transparent);
}
.sheet-actions > * { min-width: 0; min-height: 44px; }
.app-notification-dialog { grid-template-rows: auto minmax(0, 1fr) auto; }
.app-notification-body { min-height: 0; overflow: auto; padding: 0 13px; overscroll-behavior: contain; }
.app-notification-body p, .app-start-page-dialog > p { margin: 2px 0 14px; color: var(--ui-text-2); }
.app-notification-choice { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: var(--ui-space-4); border-bottom: 1px solid var(--ui-border); }
.app-notification-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ui-space-2); padding: 12px 5px 5px; }
.app-notification-actions button { min-height: 44px; padding: 0 14px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface-2); color: var(--ui-text-1); font-weight: 800; }
.app-notification-actions .is-primary { border-color: transparent; background: var(--ui-accent); color: #21170f; }
.app-start-page-dialog { display: grid; gap: 8px; }
.app-start-page-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 0 5px 5px; }
.app-start-page-options button { min-height: 48px; border: 1px solid var(--ui-border); border-radius: 13px; background: var(--ui-surface-2); color: var(--ui-text-1); font-weight: 800; cursor: pointer; }
.app-start-page-options button.is-selected { border-color: color-mix(in srgb, var(--ui-accent) 62%, var(--ui-border)); background: color-mix(in srgb, var(--ui-accent) 15%, var(--ui-surface-2)); }
@keyframes ui-dialog-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }

body.ui-layer-open { overflow: hidden; }
.logovo-float-banner {
  position: fixed;
  z-index: var(--ui-z-banner);
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--ui-dock-reserve) + env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 24px));
  pointer-events: none;
}
.logovo-float-banner-inner { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-md); background: var(--ui-surface-4); box-shadow: var(--ui-shadow-2); pointer-events: auto; backdrop-filter: blur(var(--ui-blur-2)); }
.logovo-float-banner-inner p { margin: 0; color: var(--ui-text-1); font-size: 13px; font-weight: 700; }
.logovo-float-banner-actions { display: flex; gap: 8px; }
.logovo-float-banner button { min-height: 40px; flex: 1; border: 0; border-radius: var(--ui-radius-sm); font-weight: 800; }
.logovo-banner-ghost { background: var(--ui-surface-2); color: var(--ui-text-1); }
.logovo-banner-primary { background: var(--ui-accent); color: #21170f; }

@media (max-width: 640px) {
  :root { --ui-dock-reserve: calc(var(--ui-dock-height) + 20px); }
  body { background-attachment: scroll; }
  main.app-shell, main.app, main.children-app { padding: calc(max(10px, env(safe-area-inset-top)) + 66px) max(10px, env(safe-area-inset-right)) calc(var(--ui-dock-reserve) + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .screen, .children-screen { gap: var(--ui-space-3); }
  .app-global-bar { width: calc(100vw - 20px); min-height: 54px; padding: 7px; border-radius: 18px; }
  .app-global-brand { gap: 8px; font-size: 13px; }
  .app-global-brand img { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  .app-global-menu-trigger { width: 44px; height: 44px; }
  .app-header { min-height: 0; padding: 15px var(--ui-space-4); border-radius: var(--ui-radius-lg); }
  .app-header .topbar, .app-header.safe-top-row, .app-header.children-top-shell { grid-template-columns: minmax(0, 1fr) auto; gap: var(--ui-space-3); }
  .app-header .logovo-home-header { grid-template-areas: "title"; grid-template-columns: minmax(0, 1fr); }
  .app-header .hero-actions, .app-header .safe-top-actions, .app-header .children-top-actions, .app-header .top-actions { align-self: start; }
  .app-header p { max-width: 36ch; font-size: 13px; }
  .app-header-list #listTitle { max-width: 230px; font-size: 30px; line-height: 1.02; }
  .app-dock { width: calc(100vw - 16px); height: 96px; }
  .app-dock-link { min-height: 52px; border-radius: 14px; font-size: 9px; }
  .app-dock-icon { width: 19px; height: 19px; flex-basis: 19px; }
  .app-calendar-link { top: 3px; width: 44px; height: 44px; border-radius: 15px; }
  .app-calendar-day { font-size: 13px; }
  .sheet-backdrop, .assign-sheet-backdrop, .memory-modal-backdrop, .picker-sheet-backdrop, .scanner-sheet-backdrop,
  .app-picker-backdrop, .app-file-source-backdrop, .app-notification-backdrop, .app-start-page-backdrop { place-items: end center; padding: max(10px, env(safe-area-inset-top)) 0 0; }
  .app-confirm-backdrop { place-items: center; padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
  .app-global-menu-backdrop { place-items: start end; padding: max(64px, env(safe-area-inset-top) + 52px) 12px max(12px, env(safe-area-inset-bottom)); }
  .app-global-menu { width: min(370px, calc(100vw - 24px)); min-height: 0; max-height: calc(var(--ui-viewport-height, 100dvh) - max(76px, env(safe-area-inset-top) + 64px)); border-radius: var(--ui-radius-lg); padding: 8px; }
  .app-picker, .app-file-source { width: 100%; max-height: calc(var(--ui-viewport-height, 100dvh) - max(10px, env(safe-area-inset-top))); border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--ui-radius-xl) var(--ui-radius-xl) 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); }
  .app-confirm-dialog { width: min(390px, 100%); max-height: calc(var(--ui-viewport-height, 100dvh) - 32px); border-radius: var(--ui-radius-lg); padding: 8px; }
  .sheet, .assign-sheet, .create-list-panel, .memory-modal, .picker-sheet, .scanner-sheet, .app-notification-dialog, .app-start-page-dialog { width: 100%; max-height: calc(var(--ui-viewport-height, 100dvh) - max(10px, env(safe-area-inset-top))); border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--ui-radius-xl) var(--ui-radius-xl) 0 0; padding: var(--ui-space-4) var(--ui-space-4) calc(var(--ui-space-5) + env(safe-area-inset-bottom)); }
  .sheet-head { margin: calc(var(--ui-space-4) * -1) calc(var(--ui-space-4) * -1) 0; padding: var(--ui-space-4); }
  .sheet-actions { margin: 0 calc(var(--ui-space-4) * -1) calc(var(--ui-space-4) * -1 - env(safe-area-inset-bottom)); padding: var(--ui-space-3) var(--ui-space-4) calc(var(--ui-space-4) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--ui-surface-4) 94%, transparent); backdrop-filter: blur(18px); }
  .logovo-float-banner { right: 8px; bottom: calc(var(--ui-dock-reserve) + env(safe-area-inset-bottom)); width: calc(100vw - 16px); }
}

.app-standalone body { background-attachment: scroll; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body::before { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
