/* flyouts.css — Start, Quick Settings, Notifications/calendar, menus and dialogs.
   Placement: flyouts sit `--flyout-gap` above the taskbar; Start is centered (or left-aligned with the taskbar), Quick Settings and Notifications dock to the right edge. */
.flyout-layer, #menu-layer, #dialog-layer { position: fixed; inset: 0; pointer-events: none; }
.flyout-layer > *, #menu-layer > *, #dialog-layer > * { pointer-events: auto; }
.flyout-layer { z-index: var(--z-flyout); } #menu-layer { z-index: var(--z-menu); } #dialog-layer { z-index: var(--z-dialog); }
.flyout { position: fixed; bottom: calc(var(--taskbar-h) + var(--flyout-gap)); display: flex; flex-direction: column; background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); border-radius: var(--r-xl); box-shadow: var(--shadow-flyout); opacity: 0; visibility: hidden; transform: translateY(18px); pointer-events: none; transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), visibility 0s linear var(--dur-base); }
.flyout.is-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }

/* ---- Start ---- */
.start { left: 50%; translate: -50% 0; width: min(var(--start-w), calc(100vw - 24px)); height: min(660px, calc(100vh - var(--taskbar-h) - 2 * var(--flyout-gap))); }
:root[data-taskbar-align="left"] .start { left: var(--flyout-gap); translate: none; }
.start__search { display: flex; align-items: center; gap: var(--sp-3); margin: 20px 28px 8px; padding: 0 14px; height: 40px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.start__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.start__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); }
.start__input::placeholder { color: var(--text-3); } .start__input::-webkit-search-cancel-button { display: none; }
.start__body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px 8px; }
.start__section-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; min-height: 28px; gap: var(--sp-4); }
.start__section-head h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.start__pinned { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.start-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: var(--r-md); transition: background var(--dur-fast); min-width: 0; }
.start-app:hover { background: var(--hover); } .start-app:active { background: var(--press); }
.start-app__label { font-size: var(--fs-sm); max-width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start__recent { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.start-rec { display: flex; align-items: center; gap: var(--sp-4); width: 100%; padding: 8px 10px; border-radius: var(--r-md); min-width: 0; }
.start-rec:hover { background: var(--hover); } .start-rec:active { background: var(--press); }
.start-rec__text { display: flex; flex-direction: column; min-width: 0; }
.start-rec__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); }
.start-rec__sub { font-size: var(--fs-xs); color: var(--text-3); }
.start__footer { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 20px 0 28px; border-top: 1px solid var(--glass-edge); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.start-user { display: flex; align-items: center; gap: var(--sp-4); padding: 6px 12px 6px 6px; border-radius: var(--r-md); }
.start-user:hover { background: var(--hover); } .start-user:active { background: var(--press); }
.start-all { display: flex; flex-direction: column; }
.start-all__letter { margin: 10px 0 2px; padding-left: 10px; color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.start-all__item { display: flex; align-items: center; gap: var(--sp-4); height: 38px; padding: 0 10px; border-radius: var(--r-md); }
.start-all__item:hover { background: var(--hover); } .start-all__item:active { background: var(--press); }
.start__results { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; overflow-y: auto; }
.start-res__group { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin: 14px 0 4px; color: var(--text-2); }
.start-res { display: flex; align-items: center; gap: var(--sp-4); padding: 8px 10px; border-radius: var(--r-md); text-align: left; position: relative; }
.start-res.is-selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.start-res__text { display: flex; flex-direction: column; min-width: 0; } .start-res__name { font-weight: var(--fw-medium); } .start-res__sub { font-size: var(--fs-xs); color: var(--text-3); }
.start-empty { margin: 32px auto; color: var(--text-3); }

/* ---- Quick Settings ---- */
.qs { right: var(--flyout-gap); width: min(var(--qs-w), calc(100vw - 24px)); padding: 16px; gap: 16px; }
.qs__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qs-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 76px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); transition: background var(--dur-fast), border-color var(--dur-fast); min-width: 0; }
.qs-tile:hover { background: var(--surface-3); } .qs-tile:active { background: var(--press); }
.qs-tile__text { display: flex; flex-direction: column; min-width: 0; }
.qs-tile__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: 1.2; }
.qs-tile__sub { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-tile[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.qs-tile[aria-pressed="true"]:hover { background: var(--accent-hover); } .qs-tile[aria-pressed="true"] .qs-tile__sub { color: inherit; opacity: .85; }
.qs__sliders { display: grid; gap: 6px; }
.qs-slider { display: flex; align-items: center; gap: 8px; } .qs-slider__icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text-2); }
.qs__foot { display: flex; align-items: center; justify-content: space-between; margin: 0 -16px -16px; padding: 8px 12px 8px 16px; border-top: 1px solid var(--glass-edge); border-radius: 0 0 var(--r-xl) var(--r-xl); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.qs-batt { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); } .qs__foot-actions { display: flex; gap: 2px; }

/* ---- Notifications + calendar ---- */
.np { right: var(--flyout-gap); width: min(var(--np-w), calc(100vw - 24px)); max-height: calc(100vh - var(--taskbar-h) - 2 * var(--flyout-gap)); overflow: hidden; }
.np__notifs { padding: 16px 16px 8px; display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; max-height: 46%; }
.np__head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 6px; } .np__head h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.np__list { overflow-y: auto; display: grid; gap: 6px; align-content: start; padding-right: 2px; }
.np-card { position: relative; display: flex; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.np-card__main { display: flex; gap: var(--sp-4); padding: 10px 40px 10px 12px; flex: 1; min-width: 0; border-radius: var(--r-md); } .np-card__main:hover { background: var(--hover); }
.np-card__text { display: flex; flex-direction: column; min-width: 0; } .np-card__app { font-size: var(--fs-xs); color: var(--text-3); }
.np-card__title { font-weight: var(--fw-medium); } .np-card__body { font-size: var(--fs-sm); color: var(--text-2); }
.np-card__dismiss { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; opacity: 0; transition: opacity var(--dur-fast); }
.np-card:hover .np-card__dismiss, .np-card:focus-within .np-card__dismiss { opacity: 1; }
.np-empty { padding: 20px 0; text-align: center; color: var(--text-3); }
.np-dnd { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); background: var(--accent-soft); font-size: var(--fs-sm); }
.np__cal { padding: 8px 16px 16px; border-top: 1px solid var(--glass-edge); background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; } .cal__title { font-size: var(--fs-md); font-weight: var(--fw-medium); } .cal__btns { display: flex; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__dow { text-align: center; font-size: var(--fs-xs); color: var(--text-3); padding: 4px 0; }
.cal__day { aspect-ratio: 1.15; max-height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-sm); margin: 0 auto; width: 100%; max-width: 38px; }
.cal__day:hover { background: var(--hover); } .cal__day.is-other { color: var(--text-3); }
.cal__day.is-selected { box-shadow: inset 0 0 0 1px var(--accent); }
.cal__day.is-today { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }

/* ---- Menus ---- */
.menu { position: fixed; min-width: 232px; max-width: 320px; padding: 4px; display: flex; flex-direction: column; overflow-y: auto; background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-radius: var(--r-lg); box-shadow: var(--shadow-menu); outline: none; animation: menu-in var(--dur-fast) var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu__item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border-radius: var(--r-sm); width: 100%; text-align: left; }
.menu__item:hover:not(:disabled), .menu__item:focus-visible, .menu__item.is-open { background: var(--hover); outline: none; }
.menu__item:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.menu__item:active:not(:disabled) { background: var(--press); }
.menu__item:disabled { color: var(--text-3); opacity: .6; }
.menu__check { width: 14px; display: grid; place-items: center; color: var(--accent); flex: none; }
.menu__icon, .menu__icon-gap { width: 16px; height: 16px; flex: none; }
.menu__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu__shortcut { color: var(--text-3); font-size: var(--fs-sm); margin-left: 16px; }
.menu__sep { height: 1px; margin: 4px 6px; background: var(--border); }
[data-menu-open] { background: var(--press) !important; }

/* ---- Dialog ---- */
.dlg-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 10, 22, .42); animation: fade-in var(--dur-base); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dlg { width: min(440px, 92vw); padding: 24px; border-radius: var(--r-xl); background: var(--glass-strong); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-flyout); display: grid; gap: 12px; animation: win-in var(--dur-base) var(--ease); }
.dlg__head { display: flex; align-items: center; gap: var(--sp-4); } .dlg__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.dlg__body { color: var(--text-2); line-height: 1.5; }
.dlg__actions { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: 8px; }
