/*
 * Fimino Liquid Linen Executive — structural-background-safe visual layer.
 * Source of truth: UX-UI_Plan/DESIGN.md
 *
 * Rule: glass belongs to interactive objects and cards, not to large structural
 * containers. Headers, page frames, rails and layout wrappers stay visually
 * quiet/transparent so the glass objects inside them can read clearly.
 */
:root{
  --numa-canvas:#f5f8f6;
  --numa-canvas-warm:#edf3f0;
  --numa-ink:#1b1c1e;
  --numa-sage:#255345;
  --numa-glass-1:rgba(255,255,255,.78);
  --numa-glass-2:rgba(255,255,255,.92);
  --numa-glass-3:rgba(255,255,255,.96);
  --numa-glass-card:var(--numa-glass-1);
  --numa-glass-control:rgba(255,255,255,.72);
  --numa-glass-control-strong:var(--numa-glass-2);
  --numa-glass-overlay:var(--numa-glass-3);
  --numa-glass-line:rgba(45,65,56,.10);
  --numa-glass-highlight:rgba(255,255,255,.88);
  --numa-shadow-card:0 10px 28px -22px rgba(37,64,52,.28),0 1px 2px rgba(37,64,52,.035);
  --numa-shadow-control:0 8px 24px -16px rgba(44,54,49,.34),0 2px 8px -6px rgba(44,54,49,.16);
  --numa-blur-card:20px;
  --numa-blur-control:18px
}

body.numa-liquid-app{
  color:var(--numa-ink);
  background-color:var(--numa-canvas);
  background-image:
    radial-gradient(70rem 34rem at 2% -8%,rgba(255,255,255,.94),transparent 68%),
    radial-gradient(55rem 32rem at 102% 10%,rgba(225,239,232,.48),transparent 68%),
    linear-gradient(155deg,#fff 0%,var(--numa-canvas) 60%,var(--numa-canvas-warm) 100%)
}

/* -------------------------------------------------------------------------
   STRUCTURAL BACKGROUNDS
   -------------------------------------------------------------------------
   These are layout scaffolds, not glass objects. Keep them transparent/quiet.
   This is intentionally stronger than the Tailwind utility classes already in
   the HTML because the original classes paint a large frosted rectangle.
*/
body.numa-liquid-app #ws-cal-header,
body.numa-liquid-app #ws-cal-header>header,
body.numa-liquid-app #ws-topbar-desktop,
body.numa-liquid-app #ws-plan-day>section.sticky,
body.numa-liquid-app #ws-dashboard-screen{
  background:transparent!important;
  background-color:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important
}

/* -------------------------------------------------------------------------
   GLASS CONTROLS INSIDE STRUCTURAL CHROME
   ------------------------------------------------------------------------- */
body.numa-liquid-app #ws-cal-header>header>a[aria-label="Startseite"],
body.numa-liquid-app #ws-cal-header .numa-family-switcher,
body.numa-liquid-app #ws-mobile-avatar-btn,
body.numa-liquid-app #ws-topbar-desktop>a[aria-label="Startseite"],
body.numa-liquid-app #ws-topbar-desktop .numa-family-switcher,
body.numa-liquid-app #ws-topbar-desktop button[aria-label],
body.numa-liquid-app #ws-topbar-desktop a[aria-label]{
  background:linear-gradient(145deg,rgba(255,255,255,.52),rgba(245,250,247,.40))!important;
  border:1px solid rgba(255,255,255,.76)!important;
  box-shadow:
    var(--numa-shadow-control),
    inset 0 1px 0 rgba(255,255,255,.86),
    inset 0 -1px 0 rgba(37,83,69,.035)!important;
  -webkit-backdrop-filter:blur(var(--numa-blur-control)) saturate(145%);
  backdrop-filter:blur(var(--numa-blur-control)) saturate(145%)
}

/* Fimino is intentionally light-only; no OS-dark glass overrides. */

body.numa-liquid-app #ws-cal-header .numa-family-switcher{
  border-radius:999px!important
}

body.numa-liquid-app #ws-cal-header>header>a[aria-label="Startseite"],
body.numa-liquid-app #ws-mobile-avatar-btn{
  border-radius:999px!important
}

/* Dropdown is an object, so it may be glass. */
body.numa-liquid-app .numa-family-dropdown,
body.numa-liquid-app #user-profile-dropdown{
  background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(255,255,255,.82))!important;
  border-color:rgba(255,255,255,.78)!important;
  box-shadow:0 18px 44px -22px rgba(44,54,49,.30),inset 0 1px 0 #fff!important;
  -webkit-backdrop-filter:blur(24px) saturate(150%);
  backdrop-filter:blur(24px) saturate(150%)
}

/* -------------------------------------------------------------------------
   CONTENT CARDS
   ------------------------------------------------------------------------- */
body.numa-liquid-app .tactile-card,
body.numa-liquid-app .followup,
body.numa-liquid-app #ws-panel-more [data-more],
body.numa-liquid-app.notifications-page main>section{
  background:linear-gradient(145deg,rgba(255,255,255,.86),rgba(255,255,255,.70));
  border-color:var(--numa-glass-line);
  box-shadow:var(--numa-shadow-card),inset 0 1px 0 var(--numa-glass-highlight);
  -webkit-backdrop-filter:blur(var(--numa-blur-card)) saturate(135%);
  backdrop-filter:blur(var(--numa-blur-card)) saturate(135%)
}

/* Existing dedicated glass primitives retain their own shape/interaction. */
body.numa-liquid-app .lg-glass{
  border-color:rgba(255,255,255,.72);
  box-shadow:
    0 14px 34px -20px rgba(38,50,44,.26),
    inset 0 1px 0 rgba(255,255,255,.92),
    inset 0 -1px 0 rgba(45,35,25,.045)
}

/* Bottom nav is itself a compact floating object, unlike the full header. */
body.numa-liquid-app nav[aria-label="Primary"]{
  position:fixed;
  left:50%!important;
  right:auto!important;
  width:min(360px,calc(100vw - 32px));
  max-width:none!important;
  margin-inline:0!important;
  padding:8px!important;
  gap:4px!important;
  box-sizing:border-box;
  transform:translateX(-50%);
  isolation:isolate;
  background:rgba(231,239,235,.78)!important;
  border-color:rgba(54,78,67,.14)!important;
  box-shadow:0 5px 16px -13px rgba(25,46,36,.34),inset 0 1px 0 rgba(255,255,255,.54)!important;
  -webkit-backdrop-filter:blur(18px) saturate(125%);
  backdrop-filter:blur(18px) saturate(125%)
}

/* Keep the navigation material quiet; the selected tab carries the emphasis. */
body.numa-liquid-app nav[aria-label="Primary"]::before{
  content:none
}

body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill{
  z-index:0;
  top:9px;
  height:44px;
  background:#2f6653!important;
  border:1px solid rgba(26,67,52,.20);
  box-shadow:0 2px 5px -4px rgba(20,52,40,.42)!important;
  will-change:transform
}

body.numa-liquid-app nav[aria-label="Primary"] button{
  height:44px;
  min-height:44px
}

body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill::after{
  content:none
}

body.numa-liquid-app nav[aria-label="Primary"] button{
  -webkit-tap-highlight-color:transparent
}

body.numa-liquid-app nav[aria-label="Primary"] button:focus-visible{
  outline:2px solid #255345;
  outline-offset:2px
}




@media(prefers-reduced-transparency:reduce){
  body.numa-liquid-app nav[aria-label="Primary"]{
    background:rgba(231,239,235,.98)!important;
    -webkit-backdrop-filter:none;
    backdrop-filter:none
  }
  body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill{
    background:#255345!important
  }
  
}

/* Every page header follows the same transparent structural treatment. */
body.numa-liquid-app:not(:has(#ws-workspace))>header{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important
}

/* Dialogs/sheets are bounded foreground objects. */
body.numa-liquid-app [role="dialog"],
body.numa-liquid-app dialog,
body.numa-liquid-app [aria-modal="true"]{
  background-color:var(--numa-glass-overlay);
  border-color:rgba(255,255,255,.80);
  box-shadow:0 28px 70px -30px rgba(30,28,26,.38),inset 0 1px 0 #fff;
  -webkit-backdrop-filter:blur(30px) saturate(150%);
  backdrop-filter:blur(30px) saturate(150%)
}

/* More: glass grouped rows, transparent surrounding panel. */
body.numa-liquid-app #ws-panel-more{
  background:transparent!important
}
/* The fixed mobile dock overlays the scrollport. Leave enough scrollable
   space after Logout to lift the entire row above the dock and home inset. */
@media(max-width:1023px){
  body.numa-liquid-app #ws-panel-more{
    min-height:0;
    padding-bottom:calc(96px + env(safe-area-inset-bottom,0px));
    scroll-padding-bottom:calc(96px + env(safe-area-inset-bottom,0px));
  }
  body.numa-liquid-app #ws-panel-more>div{
    flex-shrink:0;
  }
}
body.numa-liquid-app #ws-panel-more [data-more]{
  overflow:hidden
}
body.numa-liquid-app #ws-panel-more [data-more]>a{
  min-height:68px
}
body.numa-liquid-app #ws-panel-more [data-more]>a+a{
  border-top-color:rgba(45,65,56,.07)
}
body.numa-liquid-app #ws-panel-more [data-more]>a:hover{
  background-color:rgba(236,245,240,.42)
}

/* Form material only where the form itself is the bounded object. */
body.numa-liquid-app.notifications-page :where(input:not([type="checkbox"]),select),
body.numa-liquid-app.settings-page main :where(input:not([type="checkbox"]),textarea,select){
  background-color:rgba(255,255,255,.72);
  border-color:rgba(40,30,20,.09);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78)
}
body.numa-liquid-app.notifications-page :where(input:not([type="checkbox"]),select):focus-visible,
body.numa-liquid-app.settings-page main :where(input:not([type="checkbox"]),textarea,select):focus-visible{
  border-color:var(--numa-sage);
  box-shadow:0 0 0 4px rgba(37,83,69,.10),inset 0 1px 0 #fff;
  outline:none
}

/* Accessibility only; do not alter product transforms or geometry. */
body.numa-liquid-app :where(a,button,input,textarea,select,summary,[tabindex]:not([tabindex="-1"])):focus-visible{
  outline:2px solid var(--numa-sage);
  outline-offset:3px
}
body.numa-liquid-app :where(button[aria-label],a[aria-label],.back){
  min-width:44px;
  min-height:44px
}
body.numa-liquid-app :where(time,[data-time],input[type="time"],input[type="date"]){
  font-variant-numeric:tabular-nums
}

/* Operational state tokens remain separate from family identity colours. */
body.numa-liquid-app :where([data-state="conflict"],.numa-state-conflict){--numa-state-ink:#c2410c;--numa-state-bg:#fff7ed}
body.numa-liquid-app :where([data-state="delta"],.numa-state-delta){--numa-state-ink:#b45309;--numa-state-bg:#fef3c7}
body.numa-liquid-app :where([data-state="resolved"],.numa-state-resolved){--numa-state-ink:#047857;--numa-state-bg:#ecfdf5}

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  body.numa-liquid-app #ws-cal-header>header>a[aria-label="Startseite"],
  body.numa-liquid-app #ws-cal-header .numa-family-switcher,
  body.numa-liquid-app #ws-mobile-avatar-btn,
  body.numa-liquid-app .tactile-card,
  body.numa-liquid-app #ws-panel-more [data-more],
  body.numa-liquid-app nav[aria-label="Primary"],
  body.numa-liquid-app [role="dialog"]{
    background:rgba(231,239,235,.98)!important
  }
}

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

.dark body.numa-liquid-app,
body.numa-liquid-app.dark{
  --numa-canvas:#101614;
  --numa-canvas-warm:#0b100e;
  --numa-ink:#eef5f1;
  --numa-glass-card:rgba(28,38,34,.72);
  --numa-glass-control:rgba(28,38,34,.66);
  --numa-glass-overlay:rgba(23,31,28,.94);
  --numa-glass-line:rgba(255,255,255,.11);
  background-image:
    radial-gradient(55rem 30rem at 0% 0%,rgba(55,96,79,.22),transparent 65%),
    linear-gradient(155deg,#14201b 0%,#0c1210 72%,#090d0c 100%)
}


/* -------------------------------------------------------------------------
   Figma iOS 26 Liquid Glass / node 1:2 — mobile floating tab material.
   Translate the Figma's 45px blur, specular edge and inset shade to the
   current Fimino three-tab navigation. Never change tab/route semantics.
   No Figma sample wallpaper or example Command/Inbox icons are imported.
   ------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  body.numa-liquid-app nav[aria-label="Primary"] {
    background:rgba(255,255,255,.12)!important;
    border:1px solid rgba(255,255,255,.64)!important;
    border-radius:999px!important;
    box-shadow:
      0 10px 28px -14px rgba(24,44,36,.22),
      0 1px 3px rgba(15,35,27,.12),
      inset 0 1.5px 1px rgba(255,255,255,.95),
      inset 0 -1.5px 2px rgba(43,69,57,.17),
      inset 1px 0 1px rgba(255,255,255,.60),
      inset -1px 0 1px rgba(255,255,255,.55)!important;
    -webkit-backdrop-filter:blur(45px) saturate(165%) contrast(105%);
    backdrop-filter:blur(45px) saturate(165%) contrast(105%);
    overflow:visible;
  }
  body.numa-liquid-app nav[aria-label="Primary"]::before {
    content:"";
    position:absolute;
    inset:1px;
    z-index:-1;
    border-radius:inherit;
    pointer-events:none;
    background:
      linear-gradient(172deg,rgba(255,255,255,.42),rgba(255,255,255,.025) 42%,rgba(38,75,58,.055) 82%,rgba(255,255,255,.15));
    box-shadow:inset 0 1px 2px rgba(255,255,255,.60);
  }
  body.numa-liquid-app nav[aria-label="Primary"]::after {
    content:"";
    position:absolute;
    inset:-1px;
    z-index:-1;
    border-radius:inherit;
    pointer-events:none;
    border:1px solid rgba(255,255,255,.25);
    filter:blur(1.5px);
  }
  body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill {
    background:rgba(40,86,67,.82)!important;
    border:1px solid rgba(255,255,255,.44);
    border-radius:999px;
    box-shadow:
      0 3px 8px -4px rgba(22,50,38,.45),
      inset 0 1px 1px rgba(255,255,255,.42),
      inset 0 -1px 2px rgba(0,0,0,.15)!important;
    -webkit-backdrop-filter:blur(16px) saturate(145%);
    backdrop-filter:blur(16px) saturate(145%);
  }
  body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill::after {
    content:"";
    position:absolute;
    inset:1px;
    border-radius:inherit;
    pointer-events:none;
    border-top:1px solid rgba(255,255,255,.42);
    border-bottom:1px solid rgba(0,0,0,.10);
  }
}
@media (prefers-reduced-transparency:reduce) {
  body.numa-liquid-app nav[aria-label="Primary"] {
    background:rgba(242,248,244,.98)!important;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
  }
  body.numa-liquid-app nav[aria-label="Primary"] #ws-nav-pill {
    background:#255345!important;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
  }
}

/* PR #6: Fimino icon-only segmented mobile nav over iOS Liquid Glass. */
body.numa-liquid-app nav[aria-label="Primary"].numa-segmented{
  display:flex; align-items:center; width:min(288px,calc((100vw - 32px) * .8));
  padding:3px!important; gap:3px!important; border-radius:999px;
}
body.numa-liquid-app nav[aria-label="Primary"] .ws-mobile-dock-item{
  /* 52px dock → 65px total height (+25%), including 3px padding and border. */
  flex:1 1 0; min-width:0; height:57px; min-height:57px; padding:0;
  display:flex; align-items:center; justify-content:center; border-radius:999px;
  -webkit-tap-highlight-color:transparent;
}
body.numa-liquid-app nav[aria-label="Primary"] .ws-dock-icon{
  display:block; flex:none; width:24px; height:24px; fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linejoin:round; stroke-linecap:round; overflow:visible;
}
body.numa-liquid-app nav[aria-label="Primary"] .ws-mobile-dock-item.is-active{
  background:#255345; color:#fff;
  box-shadow:inset 0 1px 1px rgba(255,255,255,.28), 0 3px 8px rgba(24,52,42,.17);
}
body.numa-liquid-app nav[aria-label="Primary"] .ws-mobile-dock-item:focus-visible{
  outline:2px solid #255345;outline-offset:2px;
}
@media(min-width:1024px){
  body.numa-liquid-app nav[aria-label="Primary"].numa-segmented{display:none!important}
}
@media(prefers-reduced-transparency:reduce){
  body.numa-liquid-app nav[aria-label="Primary"].numa-segmented{
    background:rgba(241,248,244,.98)!important; backdrop-filter:none; -webkit-backdrop-filter:none;
  }
}

/* Keep editable text above Safari's focus-zoom threshold. This stylesheet is
   also loaded by standalone Stitch pages, outside the React document.
   Match touch devices as well as narrow layouts (including landscape/tablets).
   Keep browser pinch zoom available; do not scale inputs down with transforms. */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea,
  select,
  [contenteditable]:not([contenteditable="false"]) {
    font-size: 17px !important;
  }
}

/* Mobile chrome floats over the scrollports, so "transparent" reveals the
   moving page rather than an empty white strip outside the scrolling content.
   The initial inset clears the 44px controls + 20px vertical padding + border;
   it belongs INSIDE the scroller and moves away when the user scrolls. */
@media(max-width:1023px){
  body.numa-liquid-app:has(#ws-workspace){
    --ws-mobile-header-height:66px;
  }
  body.numa-liquid-app #ws-cal-header{
    position:absolute!important;
    top:0;
    left:0;
    right:0;
  }
  body.numa-liquid-app #ws-workspace{
    grid-template-rows:minmax(0,1fr);
    overflow:hidden;
  }
  body.numa-liquid-app #ws-panel-more,
  body.numa-liquid-app #ws-panel-tasks,
  body.numa-liquid-app #ws-panel-plan{
    padding-top:calc(var(--ws-mobile-header-height) + 12px);
    scroll-padding-top:calc(var(--ws-mobile-header-height) + 12px);
  }
  body.numa-liquid-app #ws-right{
    height:100%;
    min-height:0;
    /* Form controls must stay below the floating household switcher even
       after a long conversation scrolls. Inset the scrollport itself. */
    padding-top:var(--ws-mobile-header-height);
  }
  body.numa-liquid-app #panel-copilot{
    padding-top:0;
    scroll-padding-top:12px;
  }
  body.numa-liquid-app #ws-center{
    padding-top:var(--ws-mobile-header-height);
    scroll-padding-top:var(--ws-mobile-header-height);
  }
  body.numa-liquid-app #ws-dashboard-screen{
    padding-top:calc(var(--ws-mobile-header-height) + 32px);
    scroll-padding-top:var(--ws-mobile-header-height);
  }
}
