/* iPhone Explorer - namespaced, simplified, lightweight */
.iphone-explorer {
    /* Solarized-inspired palette */
    --iex-bg:#002b36; /* base03 */
    --iex-surface:#073642; /* base02 */
    --iex-surface-alt:#004052; /* deep cyan */
    --iex-border:#0d3f4c;
    --iex-border-accent:#146173;
    --iex-text:#93a1a1; /* base1 */
    --iex-text-dim:#586e75; /* base01 */
    --iex-accent:#268bd2; /* blue */
    --iex-accent-fg:#ffffff;
    --iex-accent-alt:#2aa198; /* cyan */
    --iex-warn:#b58900; /* yellow */
    --iex-focus-ring:0 0 0 2px #002b36,0 0 0 4px var(--iex-accent);
    --iex-radius-xs:3px;
    --iex-radius-sm:4px;
    --iex-radius-md:6px;
    --iex-radius-lg:8px;
    --iex-grid-gap:1rem;
    --scaling-factor:0.3;
    color:var(--iex-text);
    font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif;
    background:var(--iex-bg);
    -webkit-font-smoothing:antialiased;
    position:relative;
}

.iphone-explorer * { box-sizing:border-box; }
.iphone-explorer a { color:var(--iex-accent); text-decoration:none; }
.iphone-explorer a:hover { text-decoration:underline; }

/* Structural layout containers */
.iphone-explorer .layout { display:flex; flex-direction:column; gap:var(--iex-grid-gap); }
@media (min-width:920px){
    .iphone-explorer .layout { flex-direction:row; align-items:stretch; }
    .iphone-explorer .sidebar { width:280px; flex:0 0 auto; }
    .iphone-explorer .main { flex:1 1 auto; min-width:0; }
}

/* Panels */
.iphone-explorer .panel { background:var(--iex-surface); padding:1rem 1.1rem; display:flex; flex-direction:column; gap:.85rem; }
.iphone-explorer .panel.alt { background:var(--iex-surface-alt); }
.iphone-explorer .panel h2,.iphone-explorer .panel h3 { margin:0; font-weight:600; font-size:0.95rem; letter-spacing:.5px; text-transform:uppercase; color:var(--iex-text-dim); }

/* Variant ribbon */
.iphone-explorer .variant-ribbon { display:flex; flex-wrap:wrap; gap:.55rem .6rem; align-items:center; row-gap:.55rem; }
.iphone-explorer .sort-group, .iphone-explorer .variant-group, .iphone-explorer .spec-group, .iphone-explorer .year-range { position:relative; display:flex; align-items:center; gap:.45rem; }
.iphone-explorer .variant-chip { position:relative; font-size:.68rem; letter-spacing:.5px; text-transform:uppercase; padding:.42rem .6rem; border:1px solid var(--iex-border); border-radius:var(--iex-radius-sm); cursor:pointer; background:var(--iex-surface-alt); color:var(--iex-text-dim); transition:background .15s,color .15s,border-color .15s; }
.iphone-explorer .variant-chip[data-active="1"] { background:var(--iex-accent); color:var(--iex-accent-fg); border-color:var(--iex-accent); }
.iphone-explorer .variant-chip:focus-visible { outline:none; box-shadow:var(--iex-focus-ring); }

/* Year slider (noUiSlider overrides) */
.iphone-explorer .year-range { padding:.25rem 0 .5rem; width:100%; flex:1 1 100%; }
.iphone-explorer .year-range .ribbon-label { flex:0 0 auto; }
.iphone-explorer .ribbon-slider { flex:1 1 auto; min-width:160px; }
.iphone-explorer .year-range { align-items:center; }
.iphone-explorer .year-range .ribbon-label { font-weight:600; letter-spacing:.5px; text-transform:uppercase; font-size:.65rem; color:var(--iex-text); }
.iphone-explorer .year-range .slider-value { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); background:rgba(0,0,0,0.35); padding:2px 6px; border-radius:6px; font-size:.6rem; line-height:1; pointer-events:none; white-space:nowrap; }
.iphone-explorer .year-range #year-slider { position:relative; flex:1 1 auto; }
.iphone-explorer .year-range .noUi-horizontal { height:10px; }
.iphone-explorer .year-range .noUi-target { height:10px; }
.iphone-explorer .year-range .noUi-handle { top:50%; transform:translate(-50%, -50%); }
.iphone-explorer .year-range .noUi-target { background:var(--iex-surface-alt); border:1px solid var(--iex-border); box-shadow:inset 0 0 0 1px rgba(255,255,255,0.04); }
.iphone-explorer .year-range .noUi-connect { background:linear-gradient(90deg,var(--iex-accent), var(--iex-accent-alt)); }
.iphone-explorer .year-range .noUi-handle { width:16px; height:16px; border-radius:50%; background:var(--iex-accent); border:1px solid var(--iex-border-accent); box-shadow:0 0 0 2px var(--iex-bg),0 0 0 3px var(--iex-accent); cursor:pointer; }
.iphone-explorer .year-range { padding-bottom:1.1rem; }
/* Position tooltips below handles */
.iphone-explorer .year-range .noUi-tooltip { top:135%; bottom:auto; transform:translate(-50%, 0); }
.iphone-explorer .year-range .noUi-handle:focus-visible { outline:none; box-shadow:0 0 0 2px var(--iex-bg),0 0 0 4px var(--iex-accent); }
.iphone-explorer .year-range .noUi-handle:before,.iphone-explorer .year-range .noUi-handle:after { display:none; }

/* Controls */
.iphone-explorer .controls-row { display:flex; flex-wrap:wrap; gap:.75rem; align-items:center; }
.iphone-explorer select.sort-select { background:var(--iex-surface-alt); color:var(--iex-text); border:1px solid var(--iex-border); border-radius:var(--iex-radius-sm); padding:.48rem .65rem; font-size:.75rem; }
.iphone-explorer select.sort-select:focus-visible { outline:none; box-shadow:var(--iex-focus-ring); }
/* Compact sort combo */
.iphone-explorer .combo-trigger { background:var(--iex-surface-alt); border:1px solid var(--iex-border); color:var(--iex-text); border-radius:var(--iex-radius-sm); padding:.5rem .6rem; font-size:.7rem; font-weight:600; display:inline-flex; gap:.35rem; align-items:center; cursor:pointer; letter-spacing:.5px; text-transform:uppercase; transition:background .18s,color .18s,border-color .18s, box-shadow .18s; }
.iphone-explorer .combo-trigger:hover { background:var(--iex-accent-alt); color:#fff; border-color:var(--iex-accent-alt); }
.iphone-explorer .combo-trigger:focus-visible { outline:none; box-shadow:var(--iex-focus-ring); }
.iphone-explorer .combo-trigger[aria-expanded="true"] { background:var(--iex-accent); color:var(--iex-accent-fg); border-color:var(--iex-accent); }
.iphone-explorer .sort-combo-dropdown { position:absolute; top:100%; left:0; margin-top:.35rem; background:var(--iex-surface-alt); border:1px solid var(--iex-border); border-radius:8px; padding:.4rem .45rem; display:flex; flex-direction:column; gap:.25rem; z-index:150; min-width:140px; }
.iphone-explorer .sort-combo-dropdown[hidden]{ display:none !important; }
.iphone-explorer .sort-combo-option { background:transparent; border:1px solid transparent; color:var(--iex-text-dim); font-size:.68rem; text-align:left; padding:.35rem .45rem; border-radius:6px; cursor:pointer; }
.iphone-explorer .sort-combo-option.active, .iphone-explorer .sort-combo-option:hover { background:var(--iex-accent); color:var(--iex-accent-fg); border-color:var(--iex-accent); }
/* Variant dropdown */
.iphone-explorer .variant-trigger { background:var(--iex-surface-alt); border:1px solid var(--iex-border); color:var(--iex-text); border-radius:var(--iex-radius-sm); padding:.5rem .6rem; font-size:.7rem; font-weight:600; cursor:pointer; transition:background .18s,color .18s,border-color .18s, box-shadow .18s; }
.iphone-explorer .variant-trigger:hover { background:var(--iex-accent-alt); color:#fff; border-color:var(--iex-accent-alt); }
.iphone-explorer .variant-trigger:focus-visible { outline:none; box-shadow:var(--iex-focus-ring); }
.iphone-explorer .variant-trigger[aria-expanded="true"] { background:var(--iex-accent); color:var(--iex-accent-fg); border-color:var(--iex-accent); }
.iphone-explorer .variant-dropdown { position:absolute; top:100%; left:0; margin-top:.4rem; background:var(--iex-surface-alt); border:1px solid var(--iex-border); border-radius:10px; padding:.6rem .7rem .55rem; display:flex; flex-direction:column; gap:.55rem; min-width:200px; z-index:160; box-shadow:0 6px 18px -6px rgba(0,0,0,0.5); }
.iphone-explorer .variant-dropdown[hidden]{ display:none !important; }
.iphone-explorer .variant-options { display:flex; flex-direction:column; gap:.4rem; max-height:240px; overflow:auto; }
.iphone-explorer .variant-options label { display:flex; gap:.45rem; align-items:center; font-size:.65rem; font-weight:600; color:var(--iex-text); cursor:pointer; transition:color .15s, background .15s; padding:.25rem .35rem; border-radius:6px; }
.iphone-explorer .variant-options label:hover { background:var(--iex-surface-alt); }
.iphone-explorer .variant-options input[type=checkbox]{ width:14px; height:14px; }

/* Timeline & device cards */
/* Horizontal timeline track (restored original visual architecture) */
.iphone-explorer .timeline-wrapper { margin-top: 20px; width:100%; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; padding:.4rem 0 1rem 0; background:linear-gradient(145deg,var(--iex-surface),var(--iex-bg) 70%); box-shadow:inset 0 0 0 1px var(--iex-border); }
.iphone-explorer .timeline { display:grid; grid-auto-flow:column; grid-auto-columns:min-content; grid-template-rows:auto auto 1fr auto; align-items:end; gap:0 1rem; padding:1.1rem 1rem 1.0rem 1rem; width:max-content; margin:0 auto; }
.iphone-explorer .timeline { justify-items:center; }
.iphone-explorer .phone-container { display:contents; }
.iphone-explorer .spec-box { grid-row:2; background:var(--iex-surface-alt); color:var(--iex-text); font-weight:600; font-size:.65rem; padding:.3rem .55rem; border-radius:1em; text-align:center; margin-bottom:.45rem; white-space:nowrap; border:1px solid var(--iex-border); justify-self:center; }
.iphone-explorer .phone-graphic-area { position:relative; display:flex; justify-content:center; align-items:flex-end; grid-row:3; justify-self:center; }
.iphone-explorer .phone-graphic-area { min-width:70px; }
.iphone-explorer .phone-outline { border:1px solid var(--iex-border-accent); border-radius:8px; box-sizing:border-box; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,0.45); transition:background-color .25s ease, border-color .25s ease; width:100%; max-width:120px; }
.iphone-explorer .delta-text { font-size:13px; font-weight:600; color:#cb4b16; text-shadow:0 0 2px rgba(0,0,0,0.35); mix-blend-mode:normal; }
.iphone-explorer .delta-text.significant-jump { color:#dc5d1f; }
.iphone-explorer .phone-name { grid-row:4; font-weight:600; font-size:.68rem; padding-top:.55rem; text-align:center; color:var(--iex-text); max-width:105px; justify-self:center; }
.iphone-explorer .timeline-wrapper::-webkit-scrollbar { height:8px; }
.iphone-explorer .timeline-wrapper::-webkit-scrollbar-track { background:transparent; }
.iphone-explorer .timeline-wrapper::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1); border-radius:4px; }
/* Variant coloring (lightweight flat fills) */
/* Warmer Solarized variant fills */
/* Variant fills (removed pale yellow, use cohesive warm set) */
/* Muted darker palette for variant fills (no bright oranges) */
.iphone-explorer .variant-standard .phone-outline, .iphone-explorer .variant-se .phone-outline { background:linear-gradient(182deg,#08323d,#042027); }
.iphone-explorer .variant-pro .phone-outline { background:linear-gradient(182deg,#0d3642,#07232b); }
.iphone-explorer .variant-pro-max .phone-outline { background:linear-gradient(182deg,#113b30,#0a2a22); }
.iphone-explorer .variant-mini .phone-outline { background:linear-gradient(182deg,#1d3146,#0f1d28); }
.iphone-explorer .variant-air .phone-outline { background:linear-gradient(182deg,#2a2e4a,#14182b); }
.iphone-explorer .variant-plus .phone-outline { background:linear-gradient(182deg,#173045,#0b1e2b); }

/* Themed spec select */
/* Unified combo dropdowns (sort & display) */
.iphone-explorer .sort-group,
.iphone-explorer .display-group { flex-wrap:nowrap; }
/* .sort-combo-trigger and .display-combo-trigger now inherit styles via .combo-trigger class */
.iphone-explorer .sort-combo-dropdown,
.iphone-explorer .display-combo-dropdown { position:absolute; top:100%; left:0; margin-top:.35rem; background:var(--iex-surface-alt); border:1px solid var(--iex-border); border-radius:8px; padding:.45rem .5rem; display:flex; flex-direction:column; gap:.3rem; z-index:140; min-width:160px; }
.iphone-explorer .display-combo-dropdown[hidden],
.iphone-explorer .sort-combo-dropdown[hidden] { display:none !important; }
.iphone-explorer .sort-combo-option,
.iphone-explorer .display-combo-option { background:transparent; border:1px solid transparent; color:var(--iex-text); font-size:.68rem; text-align:left; padding:.38rem .5rem; border-radius:6px; cursor:pointer; }
.iphone-explorer .sort-combo-option.active,
.iphone-explorer .display-combo-option.active { background:var(--iex-accent); color:var(--iex-accent-fg); border-color:var(--iex-accent); }
.iphone-explorer .sort-combo-option:hover:not(.active),
.iphone-explorer .display-combo-option:hover:not(.active) { background:var(--iex-accent-alt); color:#fff; border-color:var(--iex-accent-alt); }
.iphone-explorer .display-group .ribbon-label, .iphone-explorer .sort-group .ribbon-label { flex:0 0 auto; }
.iphone-explorer .display-group, .iphone-explorer .sort-group { flex:0 0 auto; }
.iphone-explorer .year-range { flex:0 0 auto; }
.iphone-explorer .variant-group { flex:0 0 auto; }
.iphone-explorer .variant-ribbon { flex-wrap:wrap; }
.iphone-explorer .explorer-ribbon { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content: center; column-gap:1rem; row-gap:.35rem; }
/* Force year slider row full width above other controls */
.iphone-explorer .explorer-ribbon .year-range { order:0; }
.iphone-explorer .explorer-ribbon .sort-group,
.iphone-explorer .explorer-ribbon .display-group,
.iphone-explorer .explorer-ribbon .variant-group { order:1; }

/* Ensure dropdowns anchor correctly near triggers (create containing block) */
.iphone-explorer .ribbon-section { position:relative; }

/* Center spec pill and name width alignment */
.iphone-explorer .spec-box, .iphone-explorer .phone-name { margin-left:auto; margin-right:auto; }

/* Device silhouette */
.iphone-explorer .device-svg { width:54px; height:auto; stroke-width:1.2; }
.iphone-explorer .device-svg .bezel { fill:#000; stroke:#444; }
.iphone-explorer .device-svg .screen { fill:#111; stroke:#222; }

/* Specs table */
.iphone-explorer table.specs { width:100%; border-collapse:collapse; font-size:.72rem; }
.iphone-explorer table.specs th,.iphone-explorer table.specs td { padding:.45rem .55rem; border-bottom:1px solid var(--iex-border); text-align:left; }
.iphone-explorer table.specs th { font-weight:600; font-size:.65rem; color:var(--iex-text-dim); letter-spacing:.5px; text-transform:uppercase; }
.iphone-explorer table.specs tbody tr:hover { background:var(--iex-surface-alt); }

/* Utilities */
.iphone-explorer .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.iphone-explorer [hidden] { display:none !important; }
.legend-dynamic {
    text-align: center;
    font-size: 0.7rem;
}
@media (prefers-reduced-motion:no-preference){
    .iphone-explorer .device-card { will-change:background,border-color; }
}

/* Info carousel - auto-fading knowledge slides */
.iphone-explorer .info-carousel { margin:1.5rem 0 1rem; padding:1rem 1.2rem; background:linear-gradient(135deg,var(--iex-surface-alt),var(--iex-surface)); border:1px solid var(--iex-border); border-radius:var(--iex-radius-lg); min-height:80px; }
.iphone-explorer .carousel-inner { position:relative; min-height:60px; }
.iphone-explorer .carousel-slide { width:100%; }
.iphone-explorer .carousel-slide p { margin:0; line-height:1.5; font-size:.82rem; color:var(--iex-text); text-align:center; font-style:italic; }

/* Narrow adjustments */
@media (max-width:480px){
    .iphone-explorer .variant-chip { flex:1 1 calc(50% - .35rem); text-align:center; }
    .iphone-explorer .timeline { grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:.75rem; }
}

/* End iPhone Explorer */

/* Slider tooltip translucency override (placed at end for precedence) */
.iphone-explorer .noUi-tooltip { background:rgba(255,255,255,0.78)!important; color:#062a31!important; border:1px solid rgba(0,0,0,0.25)!important; border-radius:4px; font-size:.6rem; padding:2px 5px; backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); box-shadow:0 2px 4px rgba(0,0,0,0.35); }
