/* metabase_viewer | Studio-grade dashboard styling, with no JS/CSS framework beyond Shiny. */
:root {
  --canvas: #f5f7fb; --card: #ffffff; --ink: #1d2740; --ink-strong: #121b31;
  --muted: #8290a7; --line: #e8ecf4; --line-soft: #f0f2f8;
  --primary: #545beb; --primary-weak: #eef0ff; --accent: #15b7bd;
  --rail: #10182b; --rail-secondary: #19223a;
  --shadow: 0 10px 36px rgba(31,44,92,.042); --shadow-hover: 0 15px 32px rgba(38,53,112,.11);
}
:root[data-theme="dark"] {
  --canvas: #101524; --card: #192139; --ink: #dee5f6; --ink-strong: #f5f7ff;
  --muted: #9da9c0; --line: #2b3550; --line-soft: #283249;
  --primary: #9398ff; --primary-weak: #2d3456; --accent: #45d4ca;
  --rail: #0a1020; --rail-secondary: #19223a;
  --shadow: 0 10px 36px rgba(0,0,0,.12); --shadow-hover: 0 16px 34px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0 !important; padding: 0 !important; background: var(--canvas) !important; color: var(--ink);
  font-family: "DM Sans","Inter","Segoe UI",system-ui,sans-serif !important; font-size: 14px; }
body>.container-fluid { padding: 0 !important; max-width: none; }
button, input, select { font-family: inherit; }
button { transition: background .15s ease, color .15s ease, border .15s ease, box-shadow .15s ease, transform .15s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(96,105,238,.35) !important; outline-offset: 2px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary); }
.app-icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0,1fr); }
.rail { background: var(--rail); color: #f5f6ff; min-height: 100vh; position: sticky; top: 0; height: 100vh;
  padding: 28px 15px 20px; display: flex; flex-direction: column; z-index: 15; }
.brand { padding: 3px 12px 39px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(130deg,#7b83fc,#5b54d5); box-shadow: 0 7px 20px rgba(105,100,244,.26); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-type strong { display: block; font-weight: 800; color: #fff; font-size: 17px; letter-spacing: -.7px; line-height: 1.15; }
.brand-type strong span { color: #aeb6ff; }
.brand-type small { display: block; color: #73819f; font-size: 9px; letter-spacing: 1.8px; margin-top: 7px; font-weight: 750; }
.rail-block { min-height: 290px; }
.rail-label { color: #7282a1; font-size: 10px; font-weight: 750; letter-spacing: 1.8px; padding: 0 14px; margin-bottom: 15px; }
.rail-nav { display: grid; gap: 4px; }
.rail-link { border: 0; background: transparent; color: #a2adc6; width: 100%; text-align: left; padding: 12px 13px;
  display: flex; align-items: center; gap: 12px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.rail-link:hover { background: rgba(130,145,221,.10); color: #fff; }
.rail-link.is-active { background: #2c365a; color: #fcfcff; box-shadow: inset 3px 0 #7b82fa; }
.rail-link.is-active svg { color: #a5acff; }
.rail-info { margin-top: 46px; padding-bottom: 26px; }
.rail-status { display: flex; gap: 11px; align-items: flex-start; margin: 10px 10px 13px; padding: 15px 12px;
  border: 1px solid #2a3551; border-radius: 11px; background: #1b2540; color: #c8cfee; font-size: 12px; }
.rail-status strong { display:block; font-size: 12px; color: #f5f6ff; line-height: 1.2; }
.rail-status small { color: #93a1be; font-size: 11px; margin-top: 5px; display:block; }
.state-dot { width: 9px; height: 9px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #31d2ac; box-shadow: 0 0 0 4px #214739; }
.state-dot.state-empty { background: #efa865; box-shadow: 0 0 0 4px #503828; }
.rail-foot { margin-top: auto; display: flex; gap: 10px; padding: 17px 12px 5px; border-top: 1px solid #29344a; align-items: center; }
.rail-foot-icon { width: 36px; height: 36px; display:flex; justify-content:center; align-items:center;
  color: #b8b9ff; background: #272c52; border-radius: 10px; }
.rail-foot strong { color: #e9ecfa; display: block; font-size: 11px; }
.rail-foot small { color: #8593af; display: block; font-size: 10px; margin-top: 3px; }
.workspace { min-width: 0; display:flex; flex-direction:column; }
.topbar { min-height: 82px; border-bottom: 1px solid var(--line); background: var(--card);
  padding: 13px clamp(20px, 3.4vw, 51px); display:flex; align-items:center; justify-content:space-between; gap:20px; }
.topbar-crumb { display:flex; gap: 10px; align-items:center; color:var(--muted); font-size: 12px; }
.topbar-crumb .app-icon:first-child { color:var(--primary); width: 17px; }
.topbar-crumb .app-icon:nth-of-type(2) { width: 13px; }
.topbar-crumb strong { color:var(--ink-strong); font-weight:750; }
.topbar-tools { display:flex; align-items:center; gap:12px; }
.mobile-brand { display: none; }
.top-search { position: relative; display: flex; align-items: center; color: var(--muted); width: min(340px, 29vw); }
.top-search>.app-icon { position: absolute; left:14px; width:16px; pointer-events:none; z-index:2; }
.top-search>.form-group { margin:0; width:100%; }
.top-search input.form-control { border: 1px solid var(--line); background: var(--canvas); border-radius: 10px; height: 39px;
  padding: 7px 35px 7px 41px; color: var(--ink); font-size: 12px; box-shadow: none; }
.top-search input:focus { border-color: #969cff; box-shadow: 0 0 0 3px rgba(99,104,246,.10); }
.top-search kbd { position: absolute; right:12px; top:10px; background:var(--card); color:var(--muted);
  border: 1px solid var(--line); border-radius: 4px; font-size:10px; padding: 1px 6px; }
.icon-button { background: transparent; border:1px solid var(--line); color:var(--muted);
  width:39px; height:39px; display:flex; align-items:center; justify-content:center; border-radius:10px; }
.icon-button:hover { color:var(--primary); background:var(--primary-weak); }
.button, button.btn.button, a.btn.button { border-radius:10px !important; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 11px 17px; white-space:nowrap; font-size:12px; line-height: 1.2; font-weight:750;
  border: 1px solid transparent; box-shadow: none; text-decoration:none; }
.button .app-icon { width:16px; height:16px; }
.button:hover { transform: translateY(-1px); }
button.button-primary, .button-primary.btn { background:#5a60e8; color:#fff; border-color:#5a60e8; }
button.button-primary:hover, .button-primary.btn:hover { background:#464ccf; color:#fff; }
.button-outline.btn, button.button-outline { color:var(--ink); background:var(--card); border-color:var(--line); }
.button-outline.btn:hover, button.button-outline:hover { border-color:#9a9ffa; color:var(--primary); background:var(--primary-weak); }
.button-plain.btn, button.button-plain { border-color:transparent; background:transparent; color:var(--muted); }
.button-plain.btn:hover, button.button-plain:hover { color:var(--primary); background:var(--primary-weak); }
.button-small.btn, button.button-small { padding:9px 13px; font-size:11px; }
.button-white.btn { background:white; border-color:white; color:#474fcb; }
.button-white.btn:hover { background:#f0f0ff; color:#373fa6; }
.button-hero-ghost.btn, button.button-hero-ghost { background:rgba(255,255,255,.11); color:white; border-color:rgba(255,255,255,.3); }
.button-hero-ghost.btn:hover { background:rgba(255,255,255,.22); color:#fff; }
.stage { width:100%; max-width: 1640px; margin:0 auto; padding: 39px clamp(20px,3.4vw,51px) 18px;
  flex:1; min-width:0; }
.page-intro { margin: 0 0 26px; }
.eyebrow { display:flex; align-items:center; gap:9px; font-size: 10px; font-weight: 850; letter-spacing:2.2px; color:var(--primary); margin-bottom:13px; }
.eyebrow-dot { width:7px; height:7px; border-radius:50%; background:#17b9ae; box-shadow:0 0 0 4px #d5f5ef; }
.page-intro h1 { font-size:clamp(29px, 3vw, 42px); letter-spacing:-1.8px; line-height:1.13; margin:0; color:var(--ink-strong); font-weight:800; }
.gradient-text { background: linear-gradient(95deg,#535de0 15%,#9385ed 85%); color:transparent; background-clip:text; -webkit-background-clip:text; }
.page-intro>p { color:var(--muted); font-size:13px; margin:13px 0 0; line-height:1.6; }
.page-intro.compact { margin-bottom:26px; }
.page-intro.compact h1 { font-size:clamp(30px, 3vw, 40px); }
.hero { display:flex; position:relative; align-items:center; justify-content:space-between; min-height:260px; overflow:hidden;
  background: linear-gradient(109deg,#424bd1 0%,#6666e9 58%,#8274f1 100%); border-radius:18px;
  box-shadow: 0 18px 35px rgba(97,98,228,.18); color:white; margin-bottom:22px; }
.hero:before { content:""; position:absolute; width:550px; height:550px; border:1px solid rgba(255,255,255,.14);
  border-radius:50%; right:-110px; top:-235px; }
.hero:after { content:""; position:absolute; width:390px; height:390px; border:1px solid rgba(255,255,255,.10);
  border-radius:50%; right:40px; top:-155px; }
.hero-content { position:relative; padding:33px 38px; z-index:2; max-width:590px; }
.hero-chip { display:inline-flex; gap:7px; align-items:center; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.18);
  padding:5px 9px; border-radius:6px; font-size:9px; font-weight:800; letter-spacing:1.5px; }
.hero-chip .app-icon { height:12px; width:12px; }
.hero h2 { margin:17px 0 10px; color:#fff; font-size:clamp(27px,2.6vw,39px); font-weight:800; letter-spacing:-1px; line-height:1.14; }
.hero p { color:#e7e8ff; line-height:1.6; font-size:12px; max-width:430px; margin:0; }
.hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:25px; }
.hero-art { width:33%; max-width:390px; align-self:stretch; display:flex; align-items:center; justify-content:center;
  position:relative; z-index:1; }
.orb { position:absolute; border: 1px solid rgba(255,255,255,.14); border-radius:50%; }
.orb-one { width:300px; height:300px; right:0; top:-48px; }
.orb-two { width:215px; height:215px; right:48px; top:-6px; background:rgba(255,255,255,.028); }
.hero-mini-card { position:relative; transform:rotate(-8deg); width:181px; height:174px;
  background:rgba(255,255,255,.19); border:1px solid rgba(255,255,255,.45); border-radius:19px;
  box-shadow:0 18px 46px rgba(27,26,126,.22); backdrop-filter:blur(8px); padding:23px; display:flex; flex-direction:column; gap:10px; }
.hero-mini-card .app-icon { width:26px; height:26px; margin-bottom:5px; color:#fff; }
.hero-mini-card span { color:#dedbff; font-size:12px; font-family:Consolas,monospace; }
.hero-mini-card strong { color:#fff; font-size:19px; letter-spacing:-.4px; font-weight:750; }
.metrics-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:17px; margin:0 0 22px; }
.metric-card { padding:22px 22px 19px; background:var(--card); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow); min-width:0; }
.metric-top { color:var(--muted); display:flex; justify-content:space-between; align-items:center; gap:7px; font-size:11px; font-weight:680; }
.metric-top .app-icon { color:var(--primary); background:var(--primary-weak); padding:7px; width:33px; height:33px; border-radius:9px; }
.metric-value { font-weight:800; font-size:31px; letter-spacing:-1.1px; margin-top:11px; color:var(--ink-strong); }
.metric-sub { font-size:11px; color:var(--muted); margin-top:5px; }
.two-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-bottom:21px; }
.content-card { background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); border-radius:15px; padding:25px 25px 22px; min-width:0; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:22px; }
.section-heading h3, .results-head h3 { margin:0; font-size:15px; letter-spacing:-.25px; font-weight:800; color:var(--ink-strong); }
.section-heading p, .results-head p { color:var(--muted); font-size:11px; margin:6px 0 0; }
.section-note { font-size:10px; font-weight:850; letter-spacing:1.5px; color:var(--muted); }
.bar-stack { display:grid; gap:14px; }
.bar-row-label { display:flex; justify-content:space-between; align-items:center; gap:15px; font-size:11px; margin-bottom:6px;
  font-weight:740; color:var(--ink); font-family:"DM Sans",system-ui,sans-serif; }
.bar-count { color:var(--muted); font-weight:670; font-size:11px; }
.bar-track { width:100%; background:var(--line-soft); border-radius:99px; height:7px; overflow:hidden; }
.bar-fill { height:100%; background:linear-gradient(90deg,#545ee8,#9794fb); border-radius:99px; }
.bar-link { color:var(--ink); border:0; background:transparent; padding:0; font-size:11px; font-weight:740; }
.bar-link:hover { color:var(--primary); }
.source-stats { display:grid; gap:15px; }
.small-meta { display:flex; justify-content:space-between; align-items:baseline; gap:12px; border-bottom:1px solid var(--line-soft); padding-bottom:10px; font-size:11px; }
.small-meta strong { font-weight:750; max-width:65%; overflow-wrap:anywhere; text-align:right; }
.muted { color:var(--muted); }
.source-footnote { margin:3px 0 0; font-size:11px; color:var(--muted); line-height:1.55; }
.source-empty { display:flex; gap:13px; align-items:center; flex-wrap:wrap; }
.source-empty p { flex:1 0 100%; color:var(--muted); }
.step-list { display:grid; gap:17px; }
.step-list>div { display:flex; gap:14px; }
.step-list>div>span { width:32px; height:32px; flex:0 0 auto; border-radius:9px; background:var(--primary-weak);
  color:var(--primary); display:flex; justify-content:center; align-items:center; font-size:11px; font-weight:850; }
.step-list strong { font-size:12px; font-weight:760; }
.step-list p { color:var(--muted); margin:5px 0 0; font-size:11px; line-height:1.5; }
.empty-state { min-height:205px; padding:35px 20px; display:flex; flex-direction:column; align-items:center; text-align:center; justify-content:center; }
.empty-icon { display:flex; align-items:center; justify-content:center; width:52px; height:52px;
  border-radius:15px; background:var(--primary-weak); color:var(--primary); margin-bottom:15px; }
.empty-icon svg { width:25px; height:25px; }
.empty-state h3 { font-size:14px; color:var(--ink-strong); font-weight:800; margin:0 0 7px; }
.empty-state p { color:var(--muted); max-width:350px; margin:0; line-height:1.6; font-size:11px; }
/* Catalogue */
.catalogue-toolbar { display:flex; align-items:end; gap:15px; margin-bottom:24px; }
.catalogue-toolbar .stretch { flex:1; min-width:160px; }
.catalogue-toolbar .select-wrap { width:194px; }
.catalogue-toolbar .select-wrap.narrow { width:132px; }
.form-group { margin-bottom:0; }
.form-group>label, .shiny-input-container>label { font-size:10px; font-weight:800; color:var(--muted); letter-spacing:.25px; margin:0 0 7px; }
.form-control, .form-select, .selectize-input { background:var(--card) !important; color:var(--ink) !important;
  border-color:var(--line) !important; box-shadow:none !important; border-radius:9px !important; min-height:40px;
  font-size:12px; }
.form-control:focus, .form-select:focus { border-color:#9097ff !important; box-shadow:0 0 0 3px rgba(99,104,246,.1) !important; }
.input-with-icon { position:relative; }
.input-with-icon>.app-icon { position:absolute; left:13px; bottom:11px; color:var(--muted); width:17px; z-index:2; pointer-events:none; }
.input-with-icon input { padding-left:39px; }
.catalogue-toolbar .shiny-input-container, .filters-grid .shiny-input-container,
.inspector-search-row .shiny-input-container { width:100% !important; }
.list-heading { display:flex; justify-content:space-between; border-top:1px solid var(--line); padding-top:19px;
  margin-bottom:18px; align-items:center; color:var(--ink-strong); font-size:12px; font-weight:800; }
.list-heading .shiny-input-container { display:flex; flex-direction:row-reverse; align-items:center; gap:8px;
  width:auto !important; font-weight:500; }
.list-heading .form-check { margin:0; }
.list-heading .form-check-label { color:var(--muted); font-size:11px; font-weight:650; }
.dataset-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.dataset-tile { display:flex; flex-direction:column; min-width:0; padding:19px 18px 15px;
  border:1px solid var(--line); border-radius:13px; transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease; }
.dataset-tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); border-color:#c6cafa; }
.tile-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.tile-code { font-size:11px; font-weight:800; color:var(--primary); background:var(--primary-weak); border-radius:6px;
  max-width:calc(100% - 40px); overflow-wrap:anywhere; padding:6px 8px; }
.favorite-btn { border:none; color:#bcc5d6; background:transparent; padding:3px; }
.favorite-btn svg { width:19px; height:19px; }
.favorite-btn:hover, .favorite-btn.is-favorite { color:#ffb447; }
.favorite-btn.is-favorite svg { fill:#ffcd6a; }
.dataset-tile h3 { font-size:13px; font-weight:770; color:var(--ink-strong); margin:15px 0 16px; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:36px; }
.tile-metrics { display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:10px; margin-top:auto; }
.tile-metrics span, .tile-footer span { display:flex; align-items:center; gap:5px; }
.tile-metrics .app-icon, .tile-footer .app-icon { width:13px; height:13px; }
.tile-footer { display:flex; align-items:center; justify-content:space-between; gap:5px; margin-top:16px;
  padding-top:12px; border-top:1px solid var(--line-soft); color:var(--muted); font-size:10px; }
.tile-open { background:var(--primary-weak); border:0; color:var(--primary); border-radius:8px; width:29px;
  height:29px; display:flex; align-items:center; justify-content:center; }
.tile-open:hover { background:#dfe1ff; }
.tile-open svg { width:15px; }
.pager { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-top:20px;
  border-top:1px solid var(--line); padding-top:17px; color:var(--muted); font-size:11px; font-weight:700; }
/* Raw explorer */
.filter-card { margin-bottom:21px; }
.filters-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.filter-footer { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-top:20px; }
.filter-left { display:flex; gap:9px; flex-wrap:wrap; }
.subtle-tip { color:var(--muted); font-size:10px; display:flex; gap:6px; align-items:center; }
.subtle-tip .app-icon { width:14px; height:14px; }
.results-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:17px; }
.table-tools { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.table-tools>.shiny-input-container { width:auto !important; min-width:108px; }
.table-tools select { font-size:11px; padding:8px 26px 8px 9px; min-height:35px; }
.table-scroll { width:100%; overflow:auto; border:1px solid var(--line); border-radius:11px; }
.mb-table { width:100%; border-spacing:0; border-collapse:collapse; font-size:12px; white-space:nowrap; }
.mb-table th { padding:14px 16px; text-align:left; color:var(--muted); background:var(--canvas);
  font-size:10px; font-weight:850; letter-spacing:1px; border-bottom:1px solid var(--line); }
.mb-table td { padding:12px 16px; color:var(--ink); border-bottom:1px solid var(--line-soft); }
.mb-table tbody tr:hover td { background:var(--primary-weak); }
.mb-table tbody tr:last-child td { border-bottom:0; }
.mb-table .action-col { width:44px; text-align:center; }
.dataset-cell { color:var(--primary); background:transparent; border:0; font-weight:800; padding:0; }
.dataset-cell:hover { text-decoration:underline; }
.dimension-pill { display:inline-block; border:1px solid var(--line); background:var(--canvas); padding:5px 9px;
  color:var(--ink); border-radius:6px; font-size:11px; font-weight:700; }
.position-code, .position-chip code { color:var(--ink); font-family:"Cascadia Code",Consolas,"Liberation Mono",monospace; font-size:11px; }
.mini-copy { border:0; background:transparent; color:var(--muted); display:flex; align-items:center; padding:4px; }
.mini-copy:hover { color:var(--primary); }
.mini-copy svg { width:16px; height:16px; }
/* Inspector */
.inspector-hero { margin-bottom:20px; padding:28px 29px; border-radius:16px; color:white; overflow:hidden;
  display:flex; align-items:center; justify-content:space-between; gap:22px;
  background:linear-gradient(115deg,#293a8d,#4f58c6 62%,#7671e4 100%); box-shadow:var(--shadow); }
.inspector-tag { font-size:10px; letter-spacing:1.8px; color:#d2dcff; font-weight:850; display:flex; gap:8px; align-items:center; }
.inspector-tag .app-icon { width:16px; height:16px; }
.inspector-code-line { display:flex; gap:13px; align-items:center; margin:13px 0 5px; }
.inspector-code-line h2 { margin:0; font-size:30px; color:#fff; font-weight:800; letter-spacing:-1px; overflow-wrap:anywhere; }
.copy-inline { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22);
  color:#fff; display:flex; align-items:center; justify-content:center; border-radius:8px; width:30px; height:30px; }
.copy-inline .app-icon { width:16px; height:16px; }
.inspector-subtitle { color:#f0efff; margin:7px 0 15px; font-size:12px; line-height:1.5; }
.inspector-stats { display:flex; flex-wrap:wrap; gap:15px; color:#e0e3ff; font-size:11px; }
.inspector-stats span { display:flex; align-items:center; gap:6px; }
.inspector-stats .app-icon { width:14px; height:14px; }
.inspector-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; align-items:center; max-width:390px; }
.inspector-official { color:white; font-size:11px; display:inline-flex; align-items:center; gap:6px; padding:7px 2px; }
.inspector-official:hover { color:#d2d6ff; }
.inspector-official svg { width:14px; height:14px; }
.dimension-panel { margin-bottom:20px; }
.dimension-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.dimension-tile { position:relative; border:1px solid var(--line); border-radius:11px; background:var(--card);
  padding:16px 14px; text-align:left; display:flex; flex-direction:column; gap:7px; color:var(--ink); min-height:110px; }
.dimension-tile:hover { border-color:#adaffa; transform:translateY(-1px); }
.dimension-tile.is-selected { border-color:#7479f1; background:var(--primary-weak); box-shadow:0 0 0 2px rgba(107,110,238,.07); }
.dimension-icon { color:var(--primary); margin-bottom:3px; }
.dimension-icon svg { width:19px; height:19px; }
.dimension-name { font-weight:810; font-size:12px; overflow-wrap:anywhere; }
.dimension-number { font-size:10px; color:var(--muted); }
.dimension-chevron { position:absolute; right:11px; top:15px; color:var(--muted); width:14px; height:14px; }
.inspector-search-row { display:flex; gap:12px; align-items:end; margin-bottom:18px; }
.inspector-search-row>.shiny-input-container:nth-child(1) { max-width:230px; }
.inspector-search-row>.shiny-input-container:nth-child(2) { flex:1; }
.inspector-search-row .button { margin-bottom:1px; }
.position-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.position-chip { border:1px solid var(--line); border-radius:9px; background:var(--canvas); display:flex;
  justify-content:space-between; gap:8px; align-items:center; padding:10px 10px 10px 13px; min-width:0; }
.position-chip code { overflow-wrap:anywhere; overflow:hidden; }
.position-chip button { border:0; background:transparent; color:var(--muted); padding:3px; flex:0 0 auto; }
.position-chip button:hover { color:var(--primary); }
.position-chip button svg { width:14px; height:14px; }
/* Comparison */
.compare-panel>.shiny-input-container { max-width:100%; margin-bottom:22px; }
.compare-panel .selectize-control.multi .selectize-input { min-height:47px; padding:8px; }
.compare-panel .selectize-control.multi .selectize-input>div { background:var(--primary-weak); color:var(--primary); border-radius:6px;
  padding:5px 7px; font-size:11px; }
.selectize-dropdown { background:var(--card); color:var(--ink); border:1px solid var(--line); }
.selectize-dropdown .active { background:var(--primary-weak); color:var(--primary); }
.compare-insight { display:flex; gap:12px; align-items:center; padding:17px; margin-bottom:15px; border-radius:10px;
  background:var(--primary-weak); color:var(--primary); }
.compare-insight>.app-icon { width:24px; height:24px; }
.compare-insight strong { font-size:13px; }
.compare-insight p { color:var(--muted); margin:4px 0 0; font-size:11px; }
.comparison-exists { color:var(--ink); }
.comparison-missing { color:#b0bacc; font-style:italic; font-size:10px; }
/* Notifications and footer */
.toast-pop { position:fixed; bottom:26px; right:29px; z-index:2000; border-radius:10px; padding:12px 19px;
  background:#202a45; color:white; box-shadow:0 11px 24px rgba(7,14,42,.25); font-size:12px;
  opacity:0; transform:translateY(15px); pointer-events:none; transition:opacity .17s,transform .17s; }
.toast-pop.visible { opacity:1; transform:translateY(0); }
.page-footer { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:26px 0 13px;
  color:var(--muted); font-size:11px; }
.page-footer span { margin:0 7px; }
.page-footer a { display:flex; align-items:center; gap:4px; color:var(--muted); }
.page-footer a:hover { color:var(--primary); }
.page-footer .app-icon { width:12px; height:12px; }
.shiny-notification { border-radius:10px; box-shadow:var(--shadow-hover); }
/* Responsive improvements */
@media(max-width:1260px) {
  .dataset-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dimension-grid, .position-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .metrics-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .top-search { width:250px; }
}
@media(max-width:1020px) {
  .app-shell { grid-template-columns:207px minmax(0,1fr); }
  .brand { padding:3px 5px 38px; }
  .brand-type strong { font-size:14px; }
  .rail { padding-left:10px; padding-right:10px; }
  .two-columns { grid-template-columns:1fr; }
  .hero-art { width:27%; }
  .filters-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dimension-grid, .position-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .topbar { padding-inline:24px; }
}
@media(max-width:760px) {
  .app-shell { display:block; }
  .rail { position:fixed; top:auto; bottom:0; left:0; right:0; min-height:auto; height:68px;
    padding:4px 5px; border-top:1px solid #323c58; }
  .rail>.brand, .rail .rail-label, .rail-info, .rail-foot { display:none; }
  .rail-block { min-height:auto; }
  .rail-nav { display:flex; justify-content:space-around; gap:1px; }
  .rail-link { display:flex; flex:1; flex-direction:column; align-items:center; gap:4px; padding:9px 2px;
    font-size:9px; border-radius:8px; text-align:center; }
  .rail-link .app-icon { width:20px; height:20px; }
  .rail-link.is-active { box-shadow:inset 0 3px #858cf8; }
  .topbar { min-height:64px; padding:12px 18px; }
  .topbar-crumb { display:none; }
  .mobile-brand { display:flex; align-items:center; gap:8px; font-size:12px; }
  .mobile-brand>.app-icon { color:var(--primary); }
  .topbar-tools { gap:7px; }
  .top-search { width:0; overflow:hidden; }
  .stage { padding:28px 17px 78px; }
  .page-intro h1 { font-size:32px; }
  .hero-art { display:none; }
  .hero-content { padding:30px 25px; }
  .hero { min-height:240px; }
  .metrics-grid { gap:10px; }
  .metric-card { padding:17px 15px; }
  .metric-value { font-size:25px; }
  .content-card { padding:19px 15px; }
  .catalogue-toolbar { flex-wrap:wrap; }
  .catalogue-toolbar .stretch { flex:1 1 100%; }
  .catalogue-toolbar .select-wrap { flex:1 1 40%; }
  .catalogue-toolbar .select-wrap.narrow { flex:1 1 30%; }
  .dataset-grid { grid-template-columns:1fr; }
  .filter-footer { flex-direction:column; align-items:flex-start; }
  .subtle-tip { display:none; }
  .inspector-hero { flex-direction:column; align-items:flex-start; padding:23px 18px; }
  .inspector-actions { justify-content:flex-start; }
  .inspector-code-line h2 { font-size:24px; }
  .results-head { align-items:flex-start; }
  .table-tools { width:100%; }
  .page-footer { padding-bottom:10px; }
}
@media(max-width:450px) {
  .filters-grid, .dimension-grid, .position-grid { grid-template-columns:1fr; }
  .inspector-search-row { flex-wrap:wrap; }
  .inspector-search-row>.shiny-input-container:nth-child(1) { max-width:100%; }
  .inspector-search-row>.shiny-input-container:nth-child(2) { flex:1 1 100%; }
  .pager .button-small.btn { padding:9px 9px; }
}

/* SDMX label enrichment: unobtrusive, readable and compatible with dark mode. */
.labels-panel { margin-bottom:20px; position:relative; overflow:hidden;
  background: linear-gradient(130deg,var(--card) 64%,var(--primary-weak)); }
.labels-heading { display:flex; gap:16px; align-items:center; }
.labels-illustration { width:52px; height:52px; border-radius:15px; flex:0 0 auto;
  background:var(--primary-weak); color:var(--primary); display:grid; place-items:center;
  border:1px solid var(--line); }
.labels-illustration svg { width:25px; height:25px; }
.labels-eyebrow { color:var(--primary); font-size:10px; font-weight:850; letter-spacing:1.5px;
  margin-bottom:5px; }
.labels-intro h3 { margin:0; font-size:16px; font-weight:820; color:var(--ink-strong); }
.labels-intro p { margin:6px 0 0; max-width:760px; font-size:12px; line-height:1.55; color:var(--muted); }
.labels-controls { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px;
  margin-top:20px; }
.labels-controls>.shiny-input-container { width:170px !important; margin-bottom:0; }
.labels-controls .button { min-height:40px; }
.labels-state { display:flex; gap:10px; margin-top:18px; padding:12px 14px;
  border:1px dashed var(--line); border-radius:10px; color:var(--muted);
  background:var(--canvas); font-size:11px; line-height:1.6; align-items:center; flex-wrap:wrap; }
.labels-state>.app-icon { width:16px; height:16px; color:var(--primary); }
.labels-state strong { color:var(--ink); margin-right:6px; }
.labels-state small { margin-left:auto; color:var(--muted); font-size:10px; }
.labels-state-ready { border-style:solid; }
.labels-ready-mark { color:#18a88b; display:inline-flex; }
.labels-ready-mark svg { width:17px; height:17px; }
.dimension-description { color:var(--muted); font-size:11px; line-height:1.4;
  min-height:2.5em; max-width:100%; overflow-wrap:anywhere; }
.dimension-tile:has(.dimension-description) { min-height:148px; }
.label-stack { display:flex; flex-direction:column; gap:5px; align-items:flex-start; }
.label-stack small { max-width:250px; color:var(--muted); font-size:10px; line-height:1.4;
  white-space:normal; overflow-wrap:anywhere; }
.position-label-table, .metabase-annotated-table { white-space:normal; }
.position-label-table th:nth-child(1) { min-width:180px; width:27%; }
.position-label-table td { padding:14px 17px; line-height:1.6; }
.position-label-table tbody tr:nth-child(even) td { background:color-mix(in srgb,var(--canvas),transparent 48%); }
.position-label-table tbody tr:hover td { background:var(--primary-weak); }
.value-description { color:var(--ink); overflow-wrap:anywhere; }
.code-label-cell { max-width:500px; min-width:180px; line-height:1.5;
  overflow-wrap:anywhere; }
.missing-translation { font-size:11px; font-style:italic; color:var(--muted); opacity:.75; }
@media(max-width:760px) {
  .labels-heading { align-items:flex-start; }
  .labels-illustration { width:42px; height:42px; }
  .labels-illustration svg { width:21px; height:21px; }
  .labels-controls { align-items:stretch; }
  .labels-controls>.shiny-input-container { flex:1 1 100%; width:100% !important; }
  .labels-controls .button { flex:1 1 auto; }
  .labels-state small { flex-basis:100%; margin-left:28px; }
  .position-label-table th:first-child { min-width:125px; }
}

/* v1.2: Keep the native language menu outside the former clipping boundary. */
.labels-panel { overflow:visible; }
.labels-controls { position:relative; z-index:4; }
.labels-controls>.shiny-input-container { min-width:190px; width:190px !important; }
.labels-controls select.form-control,
.labels-controls select.form-select { width:100% !important; min-width:0; font-size:14px; font-weight:650; padding-right:33px; }
.labels-state { align-items:flex-start; }
.labels-status-body { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1 1 320px; }
.labels-status-body strong { font-size:12px; }
.labels-state-success { border-color:#54b6a9; }
.labels-state-warning { border-color:#e5ab4d; }
.labels-state-error { border-color:#e17887; }
.label-feedback-message { font-weight:680; color:var(--ink); padding-top:4px; }
.label-feedback-errors { color:#b4565e; font-size:11px; word-break:break-word; }
:root[data-theme="dark"] .label-feedback-errors { color:#ffb5bd; }
/* A label export is always valid for a selected dimension, even when some
   API descriptions are absent. Never style the link as disabled by default. */
a.labelled-export.shiny-download-link { cursor:pointer; opacity:1; }
.compare-select-wrap { width:100%; min-width:0; margin-bottom:22px; }
.compare-select-wrap>.shiny-input-container,
.compare-select-wrap .selectize-control,
.compare-select-wrap .selectize-input { width:100% !important; max-width:none !important; }
.compare-select-wrap .selectize-control.multi .selectize-input {
  min-height:56px; padding:11px 13px; font-size:16px !important;
  display:flex; align-items:center; gap:5px; flex-wrap:wrap;
}
.compare-select-wrap .selectize-control.multi .selectize-input>div {
  font-size:14px !important; padding:7px 11px; max-width:100%; white-space:normal;
}
.compare-select-wrap .selectize-input input { font-size:16px !important; min-width:240px !important; flex:1 1 240px; }
.compare-select-wrap .selectize-dropdown .option { font-size:14px; line-height:1.5; padding:9px 12px; white-space:normal; }
.compare-select-wrap .selectize-dropdown { width:100% !important; }
@media(max-width:760px) {
  .labels-controls>.shiny-input-container { flex:1 1 100%; width:100% !important; }
  .compare-select-wrap .selectize-input input { min-width:120px !important; }
}

/* Eurostat-only branding; v2.0 has no menus or modal data-source options. */
.brand-mark { background:transparent; box-shadow:none; border-radius:11px; }
.brand-mark img { width:37px; height:37px; display:block; border-radius:11px; }
.mobile-brand-mark { width:24px; height:24px; display:block; border-radius:6px; }
.app-version-badge { display:inline-flex; align-items:center; margin-left:9px !important;
  border:1px solid var(--line); background:var(--primary-weak); color:var(--primary);
  border-radius:999px; font-size:10px; padding:3px 8px; font-weight:800; letter-spacing:.2px; }
.snapshot-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.snapshot-actions .btn { white-space:normal; text-align:center; }
.snapshot-feedback { display:flex; align-items:flex-start; gap:9px; margin-top:14px;
  padding:12px 14px; font-size:12px; line-height:1.5; border-radius:9px;
  color:var(--ink); border:1px solid var(--line); background:var(--canvas); }
.snapshot-feedback .app-icon { width:15px; height:15px; flex:0 0 auto; margin-top:1px; }
.snapshot-feedback-success { background:rgba(24,165,118,.07); border-color:rgba(24,165,118,.26); }
.snapshot-feedback-error { background:rgba(221,70,82,.08); border-color:rgba(221,70,82,.26); }
.snapshot-feedback-warning { background:rgba(212,151,41,.10); border-color:rgba(212,151,41,.27); }
@media(max-width:640px) { .snapshot-actions .btn { flex:1 1 100%; } }

/* v2.0 release marker; no top-right Source or Eurostat data control. */
.version-chip { display:inline-flex; align-items:center; justify-content:center; padding:5px 9px; border:1px solid rgba(92,97,240,.24); border-radius:999px; background:rgba(92,97,240,.08); color:var(--primary,#5558e9); font:700 11px/1.2 system-ui,sans-serif; white-space:nowrap; letter-spacing:.015em; }
@media(max-width:700px) { .topbar-version { display:none; } }

/* Opt-in code descriptions in Row explorer, preserving the raw table by default. */
.row-label-tools, .compare-label-tools {
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px;
  padding:12px 0 15px; border-top:1px solid var(--line-soft);
}
.row-label-tools { margin-top:3px; }
.row-label-tools>.shiny-input-container, .compare-label-tools>.shiny-input-container { margin:0; }
.row-label-tools>.shiny-input-container:first-child { flex:1 1 235px; align-self:center; }
.row-label-tools>.shiny-input-container:first-child label { color:var(--ink); font-size:12px; font-weight:680; }
.row-label-tools>.shiny-input-container:nth-child(2),
.compare-label-tools>.shiny-input-container:first-child { width:160px !important; }
.row-label-tools .btn, .compare-label-tools .btn { white-space:normal; }
.inline-label-status {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  padding:10px 12px; margin-bottom:14px; border:1px solid var(--line);
  background:var(--canvas); border-radius:9px; color:var(--muted);
  font-size:11px; line-height:1.55;
}
.inline-label-status>.app-icon { flex:0 0 16px; width:16px; height:16px; color:var(--primary); }
.inline-label-status .label-feedback-errors { flex:1 1 100%; }
.metabase-annotated-table td:first-child { min-width:210px; max-width:300px; }
.metabase-annotated-table td:nth-child(2) { min-width:140px; max-width:290px; }
.metabase-annotated-table .label-stack small { font-size:11px; line-height:1.45; }

/* Comparison: actual union/intersection of dimension position codes. */
.compare-label-tools { border-top:0; padding:0 0 14px; }
.compare-label-ok { color:var(--ink); }
.comparison-overlap-table { white-space:normal; }
.comparison-overlap-table th { white-space:normal; min-width:100px; font-size:10px; }
.comparison-overlap-table td { vertical-align:middle; }
.comparison-overlap-table .overlap-count { font-variant-numeric:tabular-nums; font-weight:700; }
.compare-dimension-link {
  display:flex; flex-direction:column; gap:7px; align-items:flex-start;
  width:100%; min-width:175px; border:0; padding:2px 0;
  background:transparent; cursor:pointer; text-align:left;
}
.compare-dimension-link .dimension-pill { text-decoration:underline; text-decoration-color:var(--line); text-underline-offset:3px; }
.compare-dimension-link:hover .dimension-pill,
.compare-dimension-link:focus-visible .dimension-pill { color:var(--primary); text-decoration-color:var(--primary); }
.compare-dimension-link small { color:var(--muted); font-size:10px; font-weight:500; line-height:1.45; overflow-wrap:anywhere; }
.compare-dimension-link:focus-visible { outline:2px solid var(--primary); border-radius:4px; }
.compare-details-panel { margin-top:20px; scroll-margin-top:20px; }
.compare-details-filters { display:grid; grid-template-columns:1.05fr 1.1fr 1.25fr; gap:13px; align-items:end; margin:16px 0 20px; }
.compare-details-filters>.shiny-input-container { width:100% !important; min-width:0; margin-bottom:0; }
.compare-details-filters label { font-size:11px; font-weight:750; color:var(--ink); }
.compare-details-filters select, .compare-details-filters input { width:100%; min-width:0; }
.compare-detail-summary { border:1px solid var(--line); background:var(--canvas); border-radius:10px; padding:13px 15px; margin-bottom:15px; }
.compare-detail-heading { display:flex; flex-wrap:wrap; gap:8px 22px; justify-content:space-between; align-items:center; }
.compare-detail-heading strong { color:var(--ink-strong); font-size:13px; }
.compare-detail-heading span { font-size:11px; color:var(--muted); }
.compare-detail-metrics { display:flex; flex-wrap:wrap; gap:10px 25px; margin-top:10px; font-size:11px; color:var(--muted); }
.compare-detail-metrics strong { font-variant-numeric:tabular-nums; color:var(--primary); font-size:14px; }
.comparison-matrix-table { white-space:normal; }
.comparison-matrix-table th { white-space:normal; }
.comparison-matrix-table td { min-width:88px; overflow-wrap:anywhere; }
.comparison-matrix-table td:nth-child(2) { min-width:185px; max-width:420px; }
.comparison-matrix-table td:nth-child(n+4),
.comparison-matrix-table th:nth-child(n+4) { text-align:center; }
.membership-yes, .membership-no, .overlap-shared, .overlap-different { font-size:11px; font-weight:720; }
.membership-yes, .overlap-shared { color:#138c72; }
.membership-no { color:var(--muted); opacity:.65; }
.overlap-different { color:var(--primary); }
:root[data-theme="dark"] .membership-yes,
:root[data-theme="dark"] .overlap-shared { color:#59d5ac; }
.compare-details-panel>.pager { flex-wrap:wrap; }
@media (max-width:900px) {
  .compare-details-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .compare-details-filters>.shiny-input-container:last-child { grid-column:1 / -1; }
}
@media (max-width:640px) {
  .row-label-tools>.shiny-input-container:first-child { flex:1 1 100%; }
  .row-label-tools>.shiny-input-container:nth-child(2),
  .compare-label-tools>.shiny-input-container:first-child { flex:1 1 100%; width:100% !important; }
  .row-label-tools .btn, .compare-label-tools .btn { flex:1 1 auto; }
  .compare-details-filters { grid-template-columns:1fr; }
  .compare-details-filters>.shiny-input-container:last-child { grid-column:auto; }
  .comparison-overlap-table th { min-width:90px; }
}
