/* RifmaGain "liquid glass" — only the bottom dock on a phone (decision of the owner, 16.11.2026:
   no glass on the header, dialogs or the wide/desktop layout). Loaded after skin.css.
   To switch it off: remove the glass.css <link> from index.html.
   Note: no "@media not (prefers-reduced-transparency)" wrapper — Safari/iOS does not know that feature
   and drops the whole block; the reduced-transparency case is handled as an override at the end. */

html[data-interface-style][data-theme=dark]{
  --glass-fill: color-mix(in srgb, var(--surface) 42%, transparent);
  --glass-sheen: linear-gradient(180deg, #ffffff24 0%, #ffffff0a 40%, #ffffff00 65%, #ffffff0d 100%);
  --glass-edge: #ffffff2e;
  --glass-hl: inset 0 1px 0 #ffffff4d, inset 0 -1px 0 #ffffff12;
  --glass-drop: 0 12px 34px #00000066, 0 1px 3px #00000040;
  --glass-pill: #ffffff1f;
}
html[data-interface-style][data-theme=light]{
  --glass-fill: color-mix(in srgb, #ffffff 50%, transparent);
  --glass-sheen: linear-gradient(180deg, #ffffffcc 0%, #ffffff4d 40%, #ffffff00 65%, #ffffff40 100%);
  --glass-edge: #ffffffd9;
  --glass-hl: inset 0 1px 0 #ffffff, inset 0 -1px 0 #ffffff99, inset 0 0 0 1px #0000000d;
  --glass-drop: 0 12px 30px #3a2f1a2e, 0 1px 3px #3a2f1a24;
  --glass-pill: #ffffffa6;
}

@media (max-width: 999px) {
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock{
    background: var(--glass-sheen), var(--glass-fill);
    -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid var(--glass-edge); border-radius: 26px;
    box-shadow: var(--glass-hl), var(--glass-drop);
  }
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock-item.active{
    background: var(--glass-pill); color: var(--ink); border-radius: 18px;
    box-shadow: inset 0 1px 0 #ffffff33, 0 1px 6px #0000001f;
  }
}

/* system setting "reduce transparency" (where supported) or no blur support: keep the solid dock */
@media (prefers-reduced-transparency: reduce) {
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock{
    background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock{ background: var(--surface); }
}

/* 26.11 — closer to iOS 26 Liquid Glass (as far as a web view allows: no real refraction on iOS).
   Clearer glass, a light rim brighter at the top-left, a soft inner glow, a sheen, and a glass "drop"
   under the active item that slides between items (dist/glass-dock.js). */
@media (max-width: 999px) {
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock{
    isolation: isolate; border-color: transparent;
    background: linear-gradient(180deg, #ffffff12, #ffffff03 55%, #ffffff0a), color-mix(in srgb, var(--surface) 30%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(2.1) brightness(1.06); backdrop-filter: blur(14px) saturate(2.1) brightness(1.06);
    box-shadow: inset 0 1px .5px #ffffff59, inset 0 -1px .5px #ffffff1a, inset 0 -12px 22px -14px #ffffff2e, 0 14px 34px #00000059, 0 2px 6px #00000033;
  }
  html[data-interface-style][data-theme=light] body.interface-v2 .mini-dock{
    background: linear-gradient(180deg, #ffffff8c, #ffffff40 55%, #ffffff59), color-mix(in srgb, #ffffff 35%, transparent);
    box-shadow: inset 0 1px .5px #ffffff, inset 0 -1px .5px #ffffff99, 0 12px 30px #3a2f1a2e, 0 1px 3px #3a2f1a24;
  }
  /* rim: a 1px gradient ring, brighter top-left and bottom-right like light on a glass edge */
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock::before{
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
    background: linear-gradient(135deg, #ffffffb3, #ffffff1f 28%, #ffffff0a 62%, #ffffff59);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  /* sheen: a soft highlight that makes the glass read as curved */
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock::after{
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background: radial-gradient(120% 90% at 18% -35%, #ffffff2b, transparent 55%), radial-gradient(70% 70% at 100% 130%, #ffffff14, transparent 60%);
  }
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock > .mini-dock-item{ position: relative; z-index: 1; }
  /* the sliding glass drop under the active item */
  .mini-dock-drop{
    position: absolute; left: 0; top: 0; z-index: 0; border-radius: 18px; pointer-events: none; opacity: 0;
    background: linear-gradient(180deg, #ffffff33, #ffffff0d 60%, #ffffff1a);
    box-shadow: inset 0 1px .5px #ffffff8c, inset 0 -1px .5px #ffffff2e, inset 0 0 12px #ffffff14, 0 6px 16px #00000040;
    -webkit-backdrop-filter: blur(4px) saturate(1.8) brightness(1.1); backdrop-filter: blur(4px) saturate(1.8) brightness(1.1);
    transition: transform .5s cubic-bezier(.3, 1.3, .45, 1), width .5s cubic-bezier(.3, 1.3, .45, 1), opacity .2s;
  }
  html[data-interface-style][data-theme=light] .mini-dock-drop{ background: linear-gradient(180deg, #ffffffd9, #ffffff8c); box-shadow: inset 0 1px 0 #fff, 0 4px 14px #3a2f1a2e; }
  html[data-interface-style][data-theme] body.interface-v2 .mini-dock.has-drop .mini-dock-item.active{ background: transparent; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .mini-dock-drop{ transition: opacity .2s; } }
@media (prefers-reduced-transparency: reduce) { .mini-dock-drop{ -webkit-backdrop-filter: none; backdrop-filter: none; } }
