/* ===== RAIL AND HOME v2 (2026-11-13, "calm") =====
 * Flat rows instead of raised buttons, groups that fold, a client switcher, and a home
 * page that leads with work in flight. Overrides the rules above; orange stays the rail.
 */
:root { --display: 'Bricolage Grotesque', 'Sora', 'Plus Jakarta Sans', sans-serif; --rail-ink: #2b1a04; }

.sidebar { background: #f29a1f; background-size: auto; gap: 10px; padding: 18px 10px 14px; border-right: 0; scrollbar-width: thin; scrollbar-color: rgba(43,26,4,0.25) transparent; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(43,26,4,0.25); }

.sidebar-brand { align-items: flex-start; gap: 0; padding: 0 8px 4px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.sidebar-kicker { font-family: inherit; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: rgba(43,26,4,0.72); }
.sidebar-title { font-family: var(--display); font-size: 18px; white-space: nowrap; font-weight: 800; letter-spacing: -0.03em; color: var(--rail-ink); text-align: left; }

.sidebar-client { flex-direction: row; align-items: center; gap: 6px; padding: 0; border: 0; background: none; }
.sidebar-client-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 7px; border-radius: 8px; background: rgba(255,255,255,0.3); cursor: pointer; }
.sidebar-client-row:hover { background: rgba(255,255,255,0.45); }
.sidebar-client-mark { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--sn-charcoal); color: #fff; font: 700 11px/22px 'Plus Jakarta Sans', sans-serif; text-align: center; }
.sidebar-client select { flex: 1; min-width: 0; width: auto; padding: 2px 0; border: 0; background: transparent; color: var(--rail-ink); font: 600 13px/1.3 'Plus Jakarta Sans', sans-serif; text-overflow: ellipsis; }
.sidebar-client-link { flex: none; font-size: 11.5px; font-weight: 600; color: rgba(43,26,4,0.75); padding: 4px 6px; border-radius: 6px; }
.sidebar-client-link:hover { background: rgba(255,255,255,0.3); text-decoration: none; color: var(--rail-ink); }
.sidebar-client-add { flex: 1; display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 8px; background: rgba(255,255,255,0.3); color: var(--rail-ink); font-size: 13px; font-weight: 600; text-align: left; }
.sidebar-client-add:hover { background: rgba(255,255,255,0.45); }
body[data-theme="dark-mode"] .sidebar-client select { background: transparent; color: var(--rail-ink); }

.sidebar-search { padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(43,26,4,0.18); background: none; color: rgba(43,26,4,0.8); font-size: 12.5px; }
.sidebar-search:hover { background: rgba(255,255,255,0.3); border-color: rgba(43,26,4,0.3); }
.sidebar-search kbd { font-family: inherit; border: 0; background: none; padding: 0; color: rgba(43,26,4,0.6); font-size: 11px; }

.sidebar-nav { gap: 2px; }
.nav-section { gap: 1px; }
.nav-section-label { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 8px 4px; font: 600 11.5px/1.3 'Plus Jakarta Sans', sans-serif; color: rgba(43,26,4,0.66); cursor: pointer; border-radius: 6px; }
.nav-section-label::before { content: none; }
.nav-section-label:hover { color: var(--rail-ink); }
.nav-section-label:focus-visible { outline: 2px solid var(--sn-charcoal); outline-offset: -2px; }
.nav-section-label > span:first-child::after { content: ' \203A'; display: inline-block; margin-left: 4px; transition: transform 0.15s; }
.nav-section-label[aria-expanded="true"] > span:first-child::after { transform: rotate(90deg); }
.nav-section-n { font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.8; }
.nav-section-items { display: flex; flex-direction: column; gap: 1px; }
.nav-section.is-closed .nav-section-items { display: none; }

.sidebar-tab { gap: 9px; padding: 5px 8px; border: 0; border-radius: 7px; background: none; box-shadow: none; font-size: 13px; font-weight: 500; color: var(--rail-ink); overflow: visible; transition: background 0.12s; }
.sidebar-tab::before { content: none; }
.sidebar-tab:hover { background: rgba(255,255,255,0.32); border: 0; box-shadow: none; transform: none; }
.sidebar-tab.active { background: var(--sn-charcoal); color: #fff; font-weight: 600; box-shadow: none; }
.sidebar-tab-icon { width: 18px; height: 18px; border-radius: 0; background: none; box-shadow: none; color: currentColor; }
.sidebar-tab-icon svg { width: 15px; height: 15px; }
.sidebar-tab-icon .ms-product-icon { width: 17px; height: 17px; }
.sidebar-tab:hover .sidebar-tab-icon { transform: none; }
.sidebar-tab.active .sidebar-tab-icon { box-shadow: none; }
.sidebar-tab-label { line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-tab-count { flex: none; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: 0.65; }
.sidebar-footer { padding-left: 8px; }
.sidebar-status { font-size: 11px; text-transform: none; letter-spacing: 0; color: rgba(43,26,4,0.7); }
.status-dot { box-shadow: none; background: #17794a; width: 6px; height: 6px; }
.portal-version { font-family: inherit; font-size: 11px; }
.portal-version a { color: rgba(43,26,4,0.7); }
.theme-toggle-btn { border: 0; background: none; border-radius: 7px; }
.theme-toggle-btn:hover { background: rgba(255,255,255,0.3); transform: none; filter: none; }

/* Home */
body[data-active-view="homeView"] .main-content { padding: 34px 44px 60px; }
.page-header { margin-bottom: 26px; }
.page-header-kicker:empty { display: none; }
.page-header-kicker { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.page-header-title { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; }
.page-header-subtitle { font-size: 14px; margin-top: 8px; }
.tool-grid { max-width: 1080px; display: flex; flex-direction: column; gap: 30px; }
.home-h { font: 600 12.5px/1.3 'Plus Jakarta Sans', sans-serif; color: var(--text-muted); margin-bottom: 8px; }
.resume-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.resume-card { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); color: var(--text-primary); text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.resume-card:hover { border-color: var(--text-primary); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(27,25,21,0.08); }
.resume-name { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.resume-sub { font-size: 12.5px; color: var(--text-secondary); }
.resume-bar { height: 4px; border-radius: 2px; background: var(--border-subtle); margin: 8px 0 2px; overflow: hidden; }
.resume-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent-primary); }
.dir { display: flex; flex-direction: column; }
.dir-row { display: grid; grid-template-columns: 22px minmax(150px, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 6px; border-top: 1px solid var(--border-subtle); color: var(--text-primary); text-decoration: none; font-size: 13.5px; border-radius: 0; transition: background 0.12s; }
.dir-row:hover { background: var(--bg-card-hover); }
.dir-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.dir-icon svg { width: 16px; height: 16px; }
.dir-icon .ms-product-icon { width: 19px; height: 19px; display: block; object-fit: contain; }
.dir-name { font-weight: 600; }
.dir-desc { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-state { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.dir-state.is-live { color: #17794a; font-weight: 600; }
body[data-theme="dark-mode"] .dir-state.is-live { color: #5fcf96; }
.tool-badge { font-family: inherit; }

@media (max-width: 860px) {
  body[data-active-view="homeView"] .main-content { padding: 18px 16px 40px; }
  .page-header-title { font-size: 30px; }
  .sidebar-brand { padding: 0 4px; }
  .dir-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .dir-desc { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar-tab, .resume-card, .dir-row, .nav-section-label > span:first-child::after { transition: none; } }
