:root {
  --ink: #132238;
  --muted: #66758c;
  --line: #dce4ed;
  --paper: #f5f8fb;
  --white: #ffffff;
  --navy: #132b46;
  --blue: #1473e6;
  --teal: #11a8a0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(290px, 340px) minmax(430px, 1fr); }
.control-panel { height: 100vh; display: flex; flex-direction: column; background: #f9fbfd; border-right: 1px solid var(--line); overflow: hidden; }
.brand-block { display: flex; gap: 11px; align-items: center; padding: 18px 16px 14px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #162f4e, #0b7d92); color: white; font-size: 12px; font-weight: 850; letter-spacing: .08em; box-shadow: 0 8px 20px rgba(19, 43, 70, .18); }
.eyebrow { margin: 0 0 4px; color: #728096; font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand-block h1 { margin: 0; font-size: 15px; line-height: 1.2; letter-spacing: -.02em; }
.library-stats { margin: 0 16px 14px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; }
.library-stats div { padding: 8px 7px; border-right: 1px solid var(--line); }
.library-stats div:last-child { border: 0; }
.library-stats strong, .library-stats span { display: block; }
.library-stats strong { font-size: 15px; }
.library-stats span { margin-top: 1px; color: var(--muted); font-size: 10px; }
.search-wrap { position: relative; margin: 0 16px 12px; }
.search-wrap > span { position: absolute; left: 13px; top: 50%; translate: 0 -53%; color: #75849a; font-size: 22px; }
.search-wrap input { width: 100%; height: 42px; padding: 0 38px; border: 1px solid #ccd7e4; border-radius: 10px; outline: 0; background: white; color: var(--ink); transition: border .15s, box-shadow .15s; }
.search-wrap input:focus { border-color: #3997e8; box-shadow: 0 0 0 3px rgba(20, 115, 230, .12); }
.clear-search { position: absolute; right: 7px; top: 7px; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #708096; cursor: pointer; }
.filter-tabs { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 9px; background: #e9eef4; }
.filter-tabs button { min-height: 30px; border: 0; border-radius: 7px; background: transparent; color: #637188; font-size: 11px; font-weight: 750; cursor: pointer; }
.filter-tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(18, 36, 58, .12); }
.control-section { margin: 0 16px 14px; }
.control-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #65748a; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.control-title button { padding: 2px 4px; border: 0; background: transparent; color: #1676aa; font-size: 9px; font-weight: 800; cursor: pointer; }
.source-list { max-height: 215px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: white; }
.source-option { display: grid; grid-template-columns: 17px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 43px; padding: 6px 8px; border-bottom: 1px solid #edf1f5; cursor: pointer; }
.source-option:last-child { border: 0; }
.source-option:hover { background: #f3f8fb; }
.source-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #b9c7d5; border-radius: 4px; background: white; color: transparent; font-size: 10px; font-weight: 900; }
.source-option input:checked + .custom-check { border-color: #1682b2; background: #1682b2; color: white; }
.source-copy { min-width: 0; }
.source-copy strong, .source-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-copy strong { font-size: 10px; }
.source-copy small { margin-top: 2px; color: #8490a0; font-size: 8px; }
.source-option b { min-width: 24px; padding: 2px 5px; border-radius: 9px; background: #eaf0f4; color: #65768b; font-size: 9px; text-align: center; }
.selection-note { margin: 5px 2px 0; color: #8a96a6; font-size: 8px; }
.sort-label { display: block; margin-bottom: 6px; color: #65748a; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.control-section select { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #ccd7e3; border-radius: 8px; outline: 0; background: white; color: #415168; font-size: 10px; }
.scan-status { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--line); background: #f2f6f9; }
.scan-status i { width: 7px; height: 7px; border-radius: 50%; background: #27b67b; box-shadow: 0 0 0 3px rgba(39,182,123,.13); }
.scan-status span, .scan-status strong { display: block; }
.scan-status span { color: #7e8b9b; font-size: 8px; }
.scan-status strong { margin-top: 2px; color: #44546a; font-size: 9px; }
.results-panel { height: 100vh; display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--line); background: #fcfdfe; overflow: hidden; }
.results-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 15px 15px 11px; border-bottom: 1px solid var(--line); }
.results-header h2 { margin: 0; font-size: 17px; }
.results-header > span { min-width: 32px; padding: 5px 8px; border-radius: 14px; background: #e5f1f7; color: #176c91; font-size: 10px; font-weight: 850; text-align: center; }
.workflow-list { flex: 1; overflow-y: auto; padding: 6px 7px 16px; scrollbar-color: #c4d0dc transparent; }
.workflow-row { width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px; align-items: center; min-height: 46px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; transition: background .12s, border .12s; }
.workflow-row:hover { background: #eef4f8; }
.workflow-row.selected { border-color: #b9d8ee; background: #e5f3fa; box-shadow: inset 3px 0 #1683ba; }
.row-icon { color: #3c89ab; font-size: 12px; }
.row-copy { min-width: 0; }
.row-copy strong, .row-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-copy strong { color: #24364e; font-size: 10px; font-weight: 720; }
.row-copy small { margin-top: 2px; color: #8290a3; font-size: 8px; }
.asset-count { min-width: 25px; padding: 3px 6px; border-radius: 12px; background: #d9edf6; color: #17678b; font-size: 10px; font-weight: 800; text-align: center; }
.asset-count.empty { background: #edf1f4; color: #95a0ae; }
.empty-list { padding: 44px 16px; text-align: center; color: #7a8798; }
.empty-list span { display: block; font-size: 36px; }
.empty-list strong { display: block; margin-top: 8px; color: #43536a; }
.empty-list p { margin: 4px 0; font-size: 12px; }

.detail-panel { min-width: 0; height: 100vh; overflow-y: auto; background: radial-gradient(circle at 85% 0%, rgba(31, 157, 170, .06), transparent 28%), var(--paper); }
.detail-topbar { height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(10px); }
.detail-topbar p { margin: 0; color: #8190a3; font-size: 11px; }
.detail-topbar p span { color: #2b74a2; font-weight: 750; }
.detail-topbar p b { padding: 0 9px; color: #b2bdc9; }
.source-pill { display: flex; align-items: center; gap: 7px; color: #6e7c90; font-size: 10px; }
.source-pill i { width: 7px; height: 7px; border-radius: 50%; background: #27b67b; box-shadow: 0 0 0 3px rgba(39, 182, 123, .13); }
.detail-content { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 60px; }
.workflow-header { display: flex; gap: 20px; align-items: flex-start; }
.workflow-glyph { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid #bfd5e5; border-radius: 16px; background: linear-gradient(145deg, #edf8fc, #d9eef5); color: #16718e; font-size: 14px; font-weight: 900; box-shadow: 0 9px 24px rgba(35, 89, 119, .12); }
.title-stack { min-width: 0; }
.title-stack h2 { margin: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; overflow-wrap: anywhere; }
.workflow-video { width: fit-content; max-width: min(680px, 100%); display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 13px; padding: 9px 11px; border: 1px solid #d4e0e9; border-radius: 10px; background: rgba(255,255,255,.82); color: inherit; text-decoration: none; box-shadow: 0 4px 14px rgba(31,55,79,.04); transition: border-color .15s, box-shadow .15s, translate .15s; }
.workflow-video:hover { translate: 0 -1px; border-color: #e05a64; box-shadow: 0 7px 18px rgba(54,64,83,.09); }
.workflow-video:focus-visible { outline: 3px solid rgba(20,115,230,.2); outline-offset: 2px; }
.video-play { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #ef3340; color: white; font-size: 11px; box-shadow: 0 4px 10px rgba(239,51,64,.22); }
.workflow-video span:nth-child(2) { min-width: 0; }
.workflow-video small, .workflow-video strong { display: block; }
.workflow-video small { margin-bottom: 2px; color: #7a8798; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.workflow-video strong { overflow: hidden; color: #34485f; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.workflow-video b { color: #8794a4; font-size: 12px; }
.title-stack code { display: block; margin-top: 10px; color: #718096; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 31px 0 42px; }
.metric-card { position: relative; padding: 18px 20px; overflow: hidden; border: 1px solid #d7e1ea; border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 7px 20px rgba(32, 55, 80, .04); }
.metric-card::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 68px; height: 68px; border: 12px solid #edf4f7; border-radius: 50%; }
.metric-card span, .metric-card small { display: block; color: #7d8999; }
.metric-card span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 5px 0 1px; color: var(--navy); font-size: 27px; line-height: 1; }
.metric-card small { font-size: 10px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 15px; }
.section-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.section-heading > span { color: #8290a3; font-size: 10px; font-weight: 750; }
.asset-groups { display: grid; gap: 13px; }
.asset-group { overflow: hidden; border: 1px solid #d6e0ea; border-radius: 14px; background: rgba(255,255,255,.88); box-shadow: 0 6px 20px rgba(31, 55, 79, .04); }
.asset-group > header { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 17px; border-bottom: 1px solid #e2e8ef; background: #fbfcfd; }
.asset-group h4 { flex: 1; margin: 0; font-size: 12px; }
.asset-group header > span:last-child { min-width: 24px; padding: 2px 7px; border-radius: 10px; background: #eaf0f4; color: #708095; font-size: 9px; font-weight: 800; text-align: center; }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: #7a8da5; box-shadow: 0 0 0 3px rgba(122,141,165,.12); }
.category-dot.violet { background: #805ad5; } .category-dot.cyan { background: #1593a6; } .category-dot.amber { background: #d59016; }
.category-dot.rose { background: #d14a74; } .category-dot.blue { background: #3478d4; } .category-dot.indigo { background: #5a67d8; }
.category-dot.lime { background: #6d9c2f; } .category-dot.orange { background: #db6d22; } .category-dot.pink { background: #c94f9a; }
.category-dot.green { background: #26966b; }
.asset-list { padding: 5px 0; }
.asset-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 48px; padding: 7px 14px; border-bottom: 1px solid #edf1f5; }
.asset-item:last-child { border: 0; }
.file-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #d6e3eb; border-radius: 7px; background: #eef5f8; color: #3e708a; font-size: 9px; font-weight: 900; }
.asset-item code { min-width: 0; color: #33475e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.asset-item button { min-width: 68px; padding: 6px 9px; border: 1px solid #d8e1e9; border-radius: 7px; background: white; color: #66758a; font-size: 9px; font-weight: 750; cursor: pointer; opacity: .1; transition: opacity .12s, border .12s, color .12s; }
.asset-item:hover button, .asset-item button:focus-visible { opacity: 1; }
.asset-item button:hover { border-color: #91bdd5; color: #1b779f; }
.no-assets { padding: 68px 24px; border: 1px dashed #cbd7e2; border-radius: 16px; background: rgba(255,255,255,.66); text-align: center; }
.no-assets > span { display: block; color: #80a6b8; font-size: 34px; }
.no-assets h3 { margin: 11px 0 5px; font-size: 17px; }
.no-assets p { width: min(520px, 100%); margin: 0 auto; color: #748398; font-size: 12px; line-height: 1.6; }
.no-selection { display: grid; min-height: 100vh; place-content: center; padding: 20px; text-align: center; color: #758398; }
.no-selection strong { color: #33475e; }
.no-selection p { margin: 5px 0 0; font-size: 12px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 235px minmax(270px, 320px) minmax(400px, 1fr); }
}

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
  .control-panel, .results-panel { height: 54vh; min-height: 430px; }
  .detail-panel { height: auto; min-height: 52vh; overflow: visible; }
  .detail-topbar { padding: 0 20px; }
  .source-pill { display: none; }
  .detail-content { width: calc(100% - 32px); padding-top: 28px; }
  .metric-grid { grid-template-columns: 1fr; gap: 8px; margin: 24px 0 32px; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .metric-card strong { grid-row: 1 / 3; grid-column: 2; }
  .asset-item button { opacity: 1; }
}

@media (max-width: 470px) {
  .app-shell { display: block; }
  .control-panel, .results-panel { height: auto; min-height: 0; max-height: none; border-right: 0; }
  .source-list { max-height: 170px; }
  .workflow-list { max-height: 45vh; }
  .brand-block { padding-inline: 16px; }
  .library-stats, .search-wrap { margin-left: 16px; margin-right: 16px; }
  .workflow-header { gap: 13px; }
  .workflow-glyph { width: 48px; height: 48px; border-radius: 13px; }
  .title-stack h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.loading-screen{min-height:100vh;display:grid;place-items:center;background:#f5f8fb}.loading-card{display:grid;gap:6px;padding:24px 28px;border:1px solid #dce4ed;border-radius:14px;background:white;box-shadow:0 12px 34px rgba(19,43,70,.08)}.loading-card span{color:#66758c;font-size:12px}.loading-card.error{border-color:#e6b8b8}.clear-search{display:block}.brand-block{position:relative}.logout-link{margin-left:auto;color:#65748a;font-size:9px;font-weight:800;text-decoration:none}.logout-link:hover{color:#1473e6}
