/* =====================================================================================================================================
   SAVANNAH AI - FROSTED GLASS. Loaded last. Every large floating surface (sheets, menus, popovers, modals, the ATHERION workspace, the drawer, the
   composer and the header controls) is real frosted glass: a heavy blur that turns whatever is behind it into colour and light, a milky tint, a
   fine rim. The look of the iOS menu: nothing behind it stays readable.

   Safari-safe on purpose:
     - plain blur() / saturate() / brightness() only, always with the -webkit- twin. A backdrop-filter that includes url(#svg) makes Safari drop the
       blur entirely (text behind stayed crisp on iPhone), so none is used anywhere.
     - nothing INSIDE a frosted surface carries its own backdrop-filter (nested ones also make WebKit drop the parent's blur).
   Every colour comes from the theme tokens, so all palettes, light and dark, keep working.
   ===================================================================================================================================== */
/* Material: CORAL (the owner's choice, and the default everywhere). The tint follows the accent token, so it is coral by default and stays in harmony
   if someone picks Sage. Light is the default mode; dark keeps the same warm frost over graphite. */
:root {
  --fr-blur: blur(46px) saturate(1.45) brightness(1.06);
  --fr-blur-light: blur(32px) saturate(1.5) brightness(1.05);
  --fr-tint: linear-gradient(160deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .24) 60%), linear-gradient(rgba(var(--sv-accent-rgb), .10), rgba(var(--sv-accent-rgb), .10)), rgba(255, 245, 241, .74);
  --fr-line: 1px solid rgba(255, 255, 255, .85);
  --fr-border: rgba(255, 255, 255, .85);
  --fr-rim: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(var(--sv-accent-rgb), .08), 0 24px 60px -20px rgba(120, 60, 45, .26);
  --lgf-fill: linear-gradient(160deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .24)), linear-gradient(rgba(var(--sv-accent-rgb), .07), rgba(var(--sv-accent-rgb), .07)), rgba(255, 246, 242, .56);
}
:root[data-mode="dark"], [data-mode="dark"] {
  --fr-blur: blur(46px) saturate(1.45) brightness(1.1);
  --fr-blur-light: blur(32px) saturate(1.6) brightness(1.08);
  --fr-tint: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 58%), linear-gradient(rgba(var(--sv-accent-rgb), .16), rgba(var(--sv-accent-rgb), .16)), rgba(var(--sv-elevated-rgb), .68);
  --fr-line: 1px solid rgba(255, 228, 220, .22);
  --fr-border: rgba(255, 228, 220, .22);
  --fr-rim: inset 0 1px 0 rgba(255, 236, 230, .24), inset 0 -1px 0 rgba(0, 0, 0, .16), 0 24px 60px -18px rgba(0, 0, 0, .6);
  --lgf-fill: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)), linear-gradient(rgba(var(--sv-accent-rgb), .12), rgba(var(--sv-accent-rgb), .12)), rgba(var(--sv-elevated-rgb), .64);
}

/* ---- large floating surfaces: full frost ---- */
.panel-sheet, .cl-sheet, .modal, .modal-content, .notice-modal, .chat-menu, .composer-sheet, .glass-select-menu, .pop, .popover,
.account-menu, .glass-menu, .cc-pop, .cc-sheet, .vs-sheet, .attach-menu, .glass-popover, .cc-panel, .sidebar {
  background: var(--fr-tint) !important;
  border-color: var(--fr-border);
  box-shadow: var(--fr-rim) !important;
  -webkit-backdrop-filter: var(--fr-blur) !important;
  backdrop-filter: var(--fr-blur) !important;
}
/* ---- composer and the small header controls: lighter frost (they sit over text, so they stay a little clearer) ---- */
.lg-float, .lg-pill, .lg-dock, .lg-composer,
.chat-header .chat-header-menu-toggle, .chat-header .header-ring, .chat-header .menu-button, .chat-header .activity-button, .chat-header .chat-header-actions > button,
.cc-header .cc-icon-btn, .cc-search-field, .cc-search-close,
.nav-back, .menu-toggle, .bell-btn, .notif-bell, .topbar .icon-btn, #settings-orb, .cc-capsule.alt, .jump-latest {
  -webkit-backdrop-filter: var(--fr-blur-light) !important;
  backdrop-filter: var(--fr-blur-light) !important;
}
/* the composer holds the text being typed: frosted, but never heavier than 24px (pinned by tests/studio-e2e-chat-v1.test.ts) */
.composer, .composer-dock .composer { -webkit-backdrop-filter: blur(24px) saturate(1.6) brightness(1.08) !important; backdrop-filter: blur(24px) saturate(1.6) brightness(1.08) !important; }

/* ---- nothing nested inside a frosted surface blurs on its own: a second backdrop-filter inside makes WebKit drop the parent's ---- */
:is(.panel-sheet, .cl-sheet, .modal, .modal-content, .notice-modal, .chat-menu, .composer-sheet, .glass-select-menu, .pop, .popover, .account-menu, .glass-menu, .cc-pop, .cc-sheet, .vs-sheet, .attach-menu, .glass-popover, .cc-panel, .sidebar, .composer)
  :is(.card, .sh-card, .bd-card, .cl-group, .sv-group, .state, .cc-card, .btn, .chip, .stat, .task-card, .cc-row, .cc-tool, .cc-details, .cl-card, .cl-segs, .table-scroll, .attachment-card, .output-card, .pq-item, .approval-policy-option, .recovery-panel, .mcp-proposal, .cn-card, .sv-device, .cc-allowance, .cc-radio, .sv-note, .aura-banner, button, input, textarea, select) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ---- dim layers behind a sheet stay a quiet scrim, not a second blur (the sheet itself does the frosting) ---- */
.sidebar-overlay, .cl-sheet-backdrop, .cc-overlay { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }


/* ---- Light (the default): the layers behind a sheet are a soft warm veil, not the black dimming that dark mode uses, so frosted glass stays bright ---- */
:root:not([data-mode="dark"]) .sidebar-overlay { background: rgba(70, 40, 30, .14) !important; }
:root:not([data-mode="dark"]) .cl-sheet-backdrop.in, :root:not([data-mode="dark"]) .cc-overlay, :root:not([data-mode="dark"]) .vs-backdrop.open { background: rgba(70, 40, 30, .16) !important; }
html.sheet-open:not([data-mode="dark"]) .app-shell { filter: brightness(.94) saturate(.95); }

/* ---- fallbacks: no backdrop-filter support, or a person who asked for less transparency, gets the same layout on solid surfaces ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --fr-tint: rgb(var(--sv-elevated-rgb)); --lgf-fill: rgb(var(--sv-elevated-rgb)); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --fr-tint: rgb(var(--sv-elevated-rgb)); --lgf-fill: rgb(var(--sv-elevated-rgb)); }
  .panel-sheet, .cl-sheet, .modal, .modal-content, .notice-modal, .chat-menu, .composer-sheet, .glass-select-menu, .pop, .popover,
  .account-menu, .glass-menu, .cc-pop, .cc-sheet, .vs-sheet, .attach-menu, .glass-popover, .cc-panel, .sidebar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* Founder / origin signature (About only). Restrained: small type, wide tracking, three hairlines in India's flag order. */
.founder-sig { margin: 28px 0 8px; padding: 0 4px; text-align: left; }
.founder-sig-name { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; color: var(--text, inherit); }
.founder-sig-role { margin: 2px 0 14px; font-size: .8rem; color: var(--text-muted, var(--muted, inherit)); opacity: .8; }
.founder-sig-origin { margin: 0 0 8px; font-size: .68rem; letter-spacing: .22em; font-weight: 600; color: var(--text, inherit); }
.founder-sig-lines { display: grid; gap: 3px; width: 64px; }
.founder-sig-lines i { display: block; height: 2px; border-radius: 1px; }
.founder-sig-lines .saffron { background: #FF9933; }
.founder-sig-lines .white { background: #FFFFFF; box-shadow: 0 0 0 .5px rgba(128, 128, 128, .55); }   /* the outline keeps the white line visible on both dark and light backgrounds */
.founder-sig-lines .green { background: #138808; }

.founder-sig-co { margin: -8px 0 14px; font-size: .7rem; letter-spacing: .26em; font-weight: 600; color: var(--text-muted, var(--muted, inherit)); opacity: .85; }
/* Thirukkural 619: the closing reflection of the Founder Story. Quiet: no card, no banner; theme text colours and a neutral hairline above it (design-token colours only). */
.kural { margin: 34px 0 6px; padding: 22px 4px 0; text-align: left; border-top: 1px solid rgba(var(--sv-text-rgb, 128, 128, 128), .18); }
.kural-ref { margin: 0 0 14px; font-family: "Noto Serif Tamil", "Tamil Sangam MN", "Noto Sans Tamil", serif; font-size: .78rem; letter-spacing: .04em; color: var(--sv-text-2, var(--text-muted, inherit)); }
.kural-ta { margin: 0; padding: 0; border: 0; display: grid; gap: 4px; font-family: "Noto Serif Tamil", "Tamil Sangam MN", "Noto Sans Tamil", serif; font-weight: 500; font-size: clamp(.74rem, 3.45vw, 1.45rem); line-height: 1.9; color: var(--sv-text, var(--text, #efe8d6)); }
.kural-ta span { display: block; }
.kural-en { margin: 14px 0 12px; font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: 1.02rem; line-height: 1.55; color: var(--sv-text, var(--text, #efe8d6)); opacity: .9; }
.kural-by { margin: 0; font-family: "Noto Serif Tamil", "Tamil Sangam MN", "Noto Sans Tamil", serif; font-size: .86rem; color: var(--sv-text-2, var(--text-muted, var(--muted, inherit))); }
