/* App shell: the sidebar rail (icons never move when it opens or closes, only the labels fade), the top bar that stays
   put, and the platform-wide search. Instrument tokens; no new Tailwind classes. */

/* ---- sidebar rail ---------------------------------------------------------------------------------------- */
.sk-aside { width: 256px; transition: width .2s var(--sk-ease-standard); }
.sk-aside[data-rail="true"] { width: 72px; }

/* Every row keeps its icon at the same x (22px inside a 14px gutter) whether the rail is open or not. */
.sk-rail-gutter { padding-left: 14px; padding-right: 14px; }
.sk-brand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 20px 14px 20px 19px; overflow: hidden; text-align: left; transition: opacity var(--sk-dur-fast); }
.sk-brand:hover { opacity: .8; }
.sk-rail .sk-nav-item { height: 40px; padding: 0 12px; gap: 12px; border-radius: 10px; }
.sk-rail .sk-nav-item > .sk-fade:first-of-type { flex: 1; text-align: left; }

.sk-rail .sk-fade { opacity: 1; visibility: visible; transition: opacity .16s var(--sk-ease-standard) .05s, visibility 0s; white-space: nowrap; }
/* hidden labels leave the page for screen readers and text search once they have faded */
.sk-rail[data-collapsed="true"] .sk-fade { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .08s, visibility 0s .08s; }

/* section captions turn into a hairline in the rail */
.sk-rail-caption { position: relative; height: 34px; margin-top: 10px; padding: 0 12px; display: flex; align-items: flex-end; padding-bottom: 6px; overflow: hidden; white-space: nowrap; }
.sk-rail-caption::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 1px; background: var(--hair-2); opacity: 0; transition: opacity .16s; }
.sk-rail[data-collapsed="true"] .sk-rail-caption::after { opacity: 1; }

/* counters: a pill when open, a lit dot on the icon when closed */
.sk-nav-dot { position: absolute; top: -3px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 6px rgba(255,106,31,.7); opacity: 0; transition: opacity .16s; }
.sk-rail[data-collapsed="true"] .sk-nav-dot[data-on="true"] { opacity: 1; }

/* the collapse key keeps its chevron in place, the label and the [ hint fade */
.sk-rail .sk-collapse { width: 100%; padding: 0 14px; overflow: hidden; }
.sk-rail .sk-collapse[data-rail="true"] { width: 100%; padding: 0 14px; justify-content: flex-start; }

/* user row */
.sk-rail .sk-user { height: 48px; padding: 0 6px; gap: 10px; border-radius: 10px; }

/* the page makes room for the rail with a short slide instead of a jump */
@media (min-width: 768px) {
  .sk-shell-main { padding-left: 256px; transition: padding-left .2s var(--sk-ease-standard); }
  .sk-shell-main[data-narrow="true"] { padding-left: 72px; }
}
.sk-aside { z-index: 40; }

/* ---- top bar --------------------------------------------------------------------------------------------- */
.sk-topbar-grid { display: grid; grid-template-columns: 1fr auto 1fr; }
@media (min-width: 640px) { .sk-topbar-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 34rem) minmax(0, 1fr); } }
/* A medium window has no room for the search to sit under the open rail: it starts after the narrow rail instead.
   Wide windows keep it exactly centred. Either way the rail's state never matters. */
@media (min-width: 768px) and (max-width: 1099px) { .sk-topbar-grid.sk-topbar { padding-left: calc(72px + 20px); } }

.sk-topbar-search { display: none; }
@media (min-width: 640px) { .sk-topbar-search { display: block; } .sk-search-btn { display: none !important; } }

/* ---- search ---------------------------------------------------------------------------------------------- */
.gs { position: relative; width: 100%; }
.gs-field { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 14px; border-radius: 10px; color: var(--g-400); font-size: 14px; transition: box-shadow var(--sk-dur-fast); }
.gs-field:focus-within { box-shadow: var(--sh-well), 0 0 0 1px rgba(255,106,31,.55); }
.gs-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--g-100); font-size: 14px; }
.gs-field input::placeholder { color: var(--g-500); }
.gs-slash { flex-shrink: 0; }
.gs-field:focus-within .gs-slash { display: none; }
.gs-clear { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--g-500); cursor: pointer; }
.gs-clear:hover { color: var(--g-100); background: rgba(255,255,255,.08); }

.gs-panel { position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; border-radius: 14px; box-shadow: var(--sh-plate), 0 24px 48px -12px rgba(0,0,0,.7); animation: gsIn .14s var(--sk-ease-out); }
@keyframes gsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gs-group + .gs-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--hair); }
.gs-group-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--g-500); }
.gs-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; color: var(--g-200); cursor: pointer; }
.gs-item[data-active="true"] { background: rgba(255,255,255,.08); box-shadow: inset 2px 0 0 var(--signal); }
.gs-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--well); box-shadow: var(--sh-well); color: var(--g-400); }
.gs-item[data-active="true"] .gs-ic { color: var(--signal-hi); }
.gs-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gs-title { font-size: 14px; font-weight: 500; color: var(--g-100); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-clamp { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; font-weight: 400; }
.gs-sub { font-size: 12px; color: var(--g-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-note { padding: 14px 12px; font-size: 13px; color: var(--g-500); }
.gs-foot { margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--g-600); }

/* phone: a full-screen sheet */
.gs-overlay { position: fixed; inset: 0; z-index: 60; padding: 12px 14px; background: var(--canvas); overflow-y: auto; }
.gs-sheet .gs-panel { position: static; margin-top: 10px; max-height: none; box-shadow: none; background: transparent; animation: none; border: 0; }
.gs-cancel { padding: 2px 4px 2px 10px; border: 0; background: none; color: var(--signal-hi); font-size: 14px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .sk-aside, .sk-shell-main, .gs-panel { transition: none !important; animation: none !important; } .sk-rail .sk-fade { transition: none !important; } }
