@import url('/mobile-editorial-fonts.css');
/* Explicit /mobile entrypoints only; standalone desktop views retain their layout. */
@media (max-width: 1100px) {
  html[data-experience='mobile'] { scroll-padding-top: 144px; }
  html[data-experience='mobile'] body:has(#f) .wrap {
    padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
  html[data-experience='mobile'] body:has(#f) header.top {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    gap: 8px;
    background: var(--bg);
  }
  html[data-experience='mobile'] body:has(#f) .brand { min-width: 0; gap: 8px; }
  html[data-experience='mobile'] body:has(#f) .brand .sub { letter-spacing: .06em; line-height: 1.5; }
  html[data-experience='mobile'] body:has(#f) .tabs { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 8px; }
  html[data-experience='mobile'] body:has(#f) :is(.tabs button, .btn, .opts label, .qhelp, .dtab, .chip) { min-height: 44px; }
  html[data-experience='mobile'] body:has(#f) :is(.burger, .star, .qhelp, #sheet .x, #navclose) { width: 44px !important; height: 44px !important; flex: none; }
  html[data-experience='mobile'] body:has(#f) :is(input[type='text'], input[type='date'], input[type='time'], select, textarea) {
    min-height: 44px;
    font-size: 16px;
    min-width: 0;
    scroll-margin-block: 152px 24px;
  }
  html[data-experience='mobile'] body:has(#f) :is(.card, .page, fieldset) { padding-inline: 14px; }
  html[data-experience='mobile'] body:has(#f) .actions { gap: 10px; }
  html[data-experience='mobile'] body:has(#f) .actions .btn { flex: 1 1 auto; }
  html[data-experience='mobile'] body:has(#f) :is(.card h2, .page h2, #sheet h3) { min-width: 0; overflow-wrap: anywhere; }
  html[data-experience='mobile'] body:has(#f) :is(.rep dd, .refs, .side, .note) { overflow-wrap: anywhere; }
  html[data-experience='mobile'] body:has(#f) .hexs { grid-template-columns: minmax(0, 1fr); }
  html[data-experience='mobile'] body:has(#f) .bookcover { grid-template-columns: minmax(90px, 28%) minmax(0, 1fr); gap: 14px; align-items: start; }
  html[data-experience='mobile'] body:has(#f) .cover b { font-size: clamp(15px, 4.2vw, 22px); text-align: center; }
  html[data-experience='mobile'] body:has(#f) .cover span { font-size: 8px; letter-spacing: .06em; text-align: center; }
  html[data-experience='mobile'] body:has(#f) .stage { max-height: calc(100dvh - 150px); min-height: 220px; }
  html[data-experience='mobile'] body:has(#f) #sheet .box {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)));
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    scroll-padding-block: 16px;
  }
  html[data-experience='mobile'] body:has(#f) #sheet .x { position: sticky; top: 0; background: var(--bg2); z-index: 2; }
  html[data-experience='mobile'] body:has(#f) #nav .panel {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    width: min(420px, 94vw);
  }
  html[data-experience='mobile'] body:has(#f) #nav a { min-height: 48px; }
  html[data-experience='mobile'] body:has(#f) #toast { max-width: calc(100vw - 24px); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; }

  /* Matches: preserve graph coordinates, gestures and filtering; enlarge only UI controls. */
  html[data-experience='mobile'] body.mob :is(#mcrumb > button, #mHome, #close, #edgecard .x, #guideX, #mlX) {
    min-width: 44px;
    min-height: 44px;
  }
  html[data-experience='mobile'] body.mob #mHome { display: grid; place-items: center; }
  html[data-experience='mobile'] body.mob #mcrumb .msel { min-height: 44px; max-width: 48%; }
  html[data-experience='mobile'] body.mob #mcrumb .msel select { font-size: 16px; }
  html[data-experience='mobile'] body.mob :is(#q, #galcard input, #galcard select) { font-size: 16px; min-height: 44px; }
  html[data-experience='mobile'] body.mob :is(#results button, #panel .pill, #panel .more, #msheet .pill, #galcard button, #mylibCard button, #edgecard .go) { min-height: 44px; }
  html[data-experience='mobile'] body.mob #mdock .tool-btn { min-height: 52px; gap: 4px; }
  html[data-experience='mobile'] body.mob #mdock .tool-btn .ts { font-size: 10px; }
  html[data-experience='mobile'] body.mob .fold { min-height: 44px; top: -30px; }
  html[data-experience='mobile'] body.mob #panel #pFold { top: -14px; }
  html[data-experience='mobile'] body.mob #results { max-height: min(360px, 45dvh); overscroll-behavior: contain; }
  html[data-experience='mobile'] body.mob #panel {
    max-height: min(72dvh, calc(100dvh - 100px - env(safe-area-inset-top, 0px)));
    padding-inline: 16px;
    overscroll-behavior: contain;
    overflow-x: hidden;
    scroll-padding-block: 52px 20px;
  }
  html[data-experience='mobile'] body.mob :is(#panel h2, #panel .def, #edgecard, #galcard) { overflow-wrap: anywhere; }
  html[data-experience='mobile'] body.mob #msheet {
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px)));
    overscroll-behavior: contain;
    scroll-padding-block: 72px 20px;
  }
  html[data-experience='mobile'] body.mob #msheet .ghead { gap: 12px; }
  html[data-experience='mobile'] body.mob #msheetBody input[type='range'] { min-height: 44px; }
  html[data-experience='mobile'] body.mob #msheetBody .dual { min-height: 44px; }
  html[data-experience='mobile'] body.mob #msheetBody .dual .trk { top: 20px; }
  html[data-experience='mobile'] body.mob #msheetBody .dual .t0 { top: 14px; }
  html[data-experience='mobile'] body.mob #msheetBody .dual input::-webkit-slider-thumb { width: 26px; height: 26px; }
  html[data-experience='mobile'] body.mob #msheetBody .dual input::-moz-range-thumb { width: 26px; height: 26px; }
  html[data-experience='mobile'] body.mob #galcard {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-height: min(78dvh, calc(100dvh - 96px));
    overscroll-behavior: contain;
  }
  html[data-experience='mobile'] body.mob #mylibCard {
    top: auto !important;
    bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 220px) !important;
    overscroll-behavior: contain;
  }
  html[data-experience='mobile'] body.mob #edgecard { max-height: 70dvh; overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 1100px) and (max-height: 500px) {
  html[data-experience='mobile'] body:has(#f) header.top { position: relative; }
  html[data-experience='mobile'] body:has(#f) .stage { max-height: none; min-height: 240px; }
  html[data-experience='mobile'] body.mob #panel { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); }
  html[data-experience='mobile'] body.mob #galcard { max-height: calc(100dvh - 24px); }
  html[data-experience='mobile'] body.mob #mylibCard { bottom: 12px; max-height: calc(100dvh - 24px) !important; z-index: 9 !important; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-experience='mobile'] body.mob :is(#msheet, #mdock, #mcrumb),
  html[data-experience='mobile'] body:has(#f) #toast { transition: none; }
}

/* Keep the full location trail readable without shrinking phone controls. */
@media (max-width: 480px) {
  html[data-experience='mobile'] body.mob #mcrumb {
    display: grid;
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
    gap: 2px;
  }
  html[data-experience='mobile'] body.mob #mHome { grid-column: 1; grid-row: 1; }
  html[data-experience='mobile'] body.mob #mUp { grid-column: 2; grid-row: 1; }
  html[data-experience='mobile'] body.mob #mcrumb .msel { grid-column: 3; grid-row: 1; max-width: none; min-width: 0; margin-left: 0; }
  html[data-experience='mobile'] body.mob #mMore { grid-column: 4; grid-row: 1; }
  html[data-experience='mobile'] body.mob #mPath { grid-column: 1 / -1; grid-row: 2; min-height: 44px; padding-inline: 8px; border-top: 1px solid var(--line); }
  html[data-experience='mobile'] body.mob #mPath button { flex-shrink: 0; max-width: none; min-height: 44px; }
}

/* A single sticky action row keeps Close/Hide alongside Fold throughout detail scrolling. */
@media (max-width: 1100px) {
  html[data-experience='mobile'] body.mob #panel .mobile-panel-controls {
    position: sticky;
    top: -22px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -22px -16px 12px;
    padding: 8px 16px;
    background: #101416;
    border-bottom: 1px solid var(--line);
  }
  html[data-experience='mobile'] body.light.mob #panel .mobile-panel-controls { background: #fdfcf9; }
  html[data-experience='mobile'] body.mob #panel .mobile-panel-controls :is(#pFold, #close, #phide) {
    position: static;
    float: none;
    transform: none;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    flex: none;
  }
  html[data-experience='mobile'] body.mob #panel .mobile-panel-controls #pFold { margin-right: auto; }
  html[data-experience='mobile'] body.mob #panel .mobile-panel-controls #close { order: 3; }
}

/* Dedicated Inner Explore flow at every explicit mobile viewport width. */
html[data-experience='mobile'] body:has(#f) .wrap { max-width:720px; }
html[data-experience='mobile'] body:has(#f) [hidden] { display:none!important; }
html[data-experience='mobile'] body:has(#f) .fgrid { display:block; }
html[data-experience='mobile'] body:has(#f) .hero { padding-block:20px; }
html[data-experience='mobile'] body:has(#f) .hero h2 { font-size:32px; }
html[data-experience='mobile'] body:has(#f) .hero > p:first-of-type { display:none; }
html[data-experience='mobile'] body:has(#f) .hero > .mono { font-size:0; }
html[data-experience='mobile'] body:has(#f) .hero > .mono::after { content:'Your inner atlas';font-size:11px; }
html[data-experience='mobile'] .mi-progress { display:flex;gap:8px;margin:12px 0 20px; }
html[data-experience='mobile'] .mi-progress button { flex:1;min-height:44px;border:1px solid var(--line);border-radius:14px;background:var(--panel); }
html[data-experience='mobile'] .mi-progress button[aria-current='step'] { border-color:var(--ember);color:var(--ember); }
html[data-experience='mobile'] .mi-step-title { font:32px var(--serif);margin:0 0 8px;scroll-margin-top:150px; }
html[data-experience='mobile'] .mi-step-status { font-size:12px;color:var(--muted);margin-bottom:20px; }
html[data-experience='mobile'] .mi-step-actions { display:flex;justify-content:space-between;gap:12px;margin-top:18px; }
html[data-experience='mobile'] .mi-step-actions button { flex:1;min-height:48px; }
html[data-experience='mobile'] .mi-example { margin-top:14px;text-align:center; }
html[data-experience='mobile'] .mi-result-nav { padding:22px 0; }
html[data-experience='mobile'] .mi-result-nav h2 { font:32px var(--serif); }
html[data-experience='mobile'] .mi-result-nav > div { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
html[data-experience='mobile'] .mi-result-nav button { border:1px solid var(--line);border-radius:18px;background:var(--panel);padding:18px;text-align:left;min-height:120px; }
html[data-experience='mobile'] .mi-result-nav b { display:block;font:22px var(--serif);margin-bottom:12px; }
html[data-experience='mobile'] .mi-result-nav span { font-size:12px;color:var(--muted); }
html[data-experience='mobile'] body:has(#f) #cards { display:block; }
html[data-experience='mobile'] body:has(#f) #cards > article { margin-bottom:14px; }
html[data-experience='mobile'] .mi-path-detail > summary { min-height:48px;padding:14px 0;cursor:pointer;color:var(--ember); }
html[data-experience='mobile'] #mm-discover { position:fixed;inset:0;z-index:1000;background:var(--bg);color:var(--ink);overflow:auto;padding:20px max(18px,calc((100vw - 680px)/2)) calc(28px + env(safe-area-inset-bottom)); }
html[data-experience='mobile'] #mm-discover[hidden],html[data-experience='mobile'] #mm-discover [hidden],html[data-experience='mobile'] #mm-open[hidden] {display:none!important;}
html[data-experience='mobile'] #mm-discover header { display:flex;align-items:center;justify-content:space-between;gap:16px;font:10px var(--mono);text-transform:uppercase;letter-spacing:.1em; }
html[data-experience='mobile'] #mm-discover header button { width:44px;height:44px;font-size:26px; }
html[data-experience='mobile'] #mm-discover h1 { font:42px var(--serif,serif);line-height:1.05;margin:28px 0 14px; }
html[data-experience='mobile'] #mm-discover p { color:var(--muted);line-height:1.5; }
html[data-experience='mobile'] #mm-discover form { margin:28px 0; }
html[data-experience='mobile'] #mm-discover label { display:block;font-size:12px;margin-bottom:10px; }
html[data-experience='mobile'] #mm-discover form > div { display:flex;border:1px solid var(--line);border-radius:16px;padding:6px; }
html[data-experience='mobile'] #mm-discover input { flex:1;min-width:0;background:transparent;border:0;padding:8px;font-size:16px;color:inherit; }
html[data-experience='mobile'] #mm-discover button { cursor:pointer;background:transparent;color:inherit;border:0;min-height:44px; }
html[data-experience='mobile'] #mm-discover h2 { font:20px var(--serif,serif);margin-top:28px; }
html[data-experience='mobile'] .mm-destinations { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
html[data-experience='mobile'] #mm-discover .mm-destinations button { border:1px solid var(--line);border-radius:18px;padding:18px;min-height:104px;text-align:left;font-size:18px;overflow-wrap:anywhere; }
html[data-experience='mobile'] #mm-discover .mm-continue { display:block;width:100%;border-top:1px solid var(--line);margin-top:24px;padding-top:16px;text-align:left; }
html[data-experience='mobile'] #mm-open { position:fixed;right:12px;top:64px;z-index:45;min-height:44px;border:1px solid var(--line);border-radius:999px;padding:8px 16px;background:var(--bg);color:var(--ink); }
html[data-experience='mobile'] body:has(#f) #formview .hero { position:relative;padding:12px 44px 10px 0; }
html[data-experience='mobile'] body:has(#f) #formview .hero h2 { font-size:26px;line-height:1.15;margin:0 0 8px; }
html[data-experience='mobile'] body:has(#f) #formview .hero .qhelp { position:absolute;right:0;top:8px; }
html[data-experience='mobile'] body:has(#f) #formview .hero p { font-size:12px;margin:0;line-height:1.4; }
html[data-experience='mobile'] body:has(#f) #cards .card .head { display:grid;grid-template-columns:24px minmax(0,1fr) 44px;gap:8px;align-items:start; }
html[data-experience='mobile'] body:has(#f) #cards .card .head h2 { min-width:0;font-size:25px;line-height:1.15; }
html[data-experience='mobile'] body:has(#f) #cards .card .head .tag { grid-column:2;grid-row:2;justify-self:start;white-space:normal;line-height:1.4; }
html[data-experience='mobile'] body:has(#f) #cards .card .head .star { grid-column:3;grid-row:1;width:44px;height:44px; }

/* The standalone reading rooms share the catalog typography; orb/map canvases retain their skin. */
html[data-experience='mobile'] body:has(#f),
html[data-experience='mobile'] body:has(.mobile-matches-discovery) { font-family:'Public Sans',Arial,sans-serif; }
html[data-experience='mobile'] body:has(#f) :is(h1,h2,h3,p,button,input,select,textarea,label,a) { font-family:'Public Sans',Arial,sans-serif; letter-spacing:normal; }
html[data-experience='mobile'] body:has(#f) :is(.card,.page,fieldset,.btn,.tabs button,.chip,input,select,textarea) { border-radius:0; box-shadow:none; }
html[data-experience='mobile'] body:has(#f) :is(header.top,.page h2,.card h2) { border-bottom:2px solid currentColor; padding-bottom:12px; }

html[data-experience='mobile'] #mm-discover { font-family:'Public Sans',Arial,sans-serif; border-radius:0; }
html[data-experience='mobile'] #mm-discover :is(h1,h2,p,button,input,label) { font-family:'Public Sans',Arial,sans-serif; letter-spacing:normal; }
html[data-experience='mobile'] #mm-discover :is(button,input,form>div) { border-radius:0; box-shadow:none; }
html[data-experience='mobile'] #mm-discover header { border-bottom:3px solid currentColor; padding-bottom:12px; }

/* Inner Explore uses the same flat mobile reading surfaces as the Library. */
html[data-experience='mobile']:has(#f) { --bg:#151515; --bg2:#1c1c1b; --panel:#151515; --panel2:#ffffff06; --ink:#f4f4f1; --muted:#bcbcb7; --faint:#999; --line:#555; --line2:#666; --ember:#eeaa80; --sans:'Public Sans',Arial,sans-serif; --serif:'Public Sans',Arial,sans-serif; }
html[data-experience='mobile'][data-theme='light']:has(#f) { --bg:#fff; --bg2:#f6f6f3; --panel:#fff; --panel2:#00000004; --ink:#171717; --muted:#555; --faint:#666; --line:#b8b8b5; --line2:#999; --ember:#a7542f; }
html[data-experience='mobile'] body:has(#f) :is(.tabs,.burger,.star,.opts label,.tag,.side,.callout,.page,.mi-progress button,.mi-result-nav button,#sheet .box,#sheet .x,#sheet .meta span,.planets div,.hex,.honest) { border-radius:0; box-shadow:none; }
html[data-experience='mobile'] body:has(#f) .btn:not(.ghost) { background:var(--ink); color:var(--bg); box-shadow:none; }
/* Keep the compact header below the status bar in installed iOS apps. */
html[data-experience='mobile'] body:has(#f) header.top { padding-block:calc(8px + env(safe-area-inset-top, 0px)) 8px; gap:8px; background:var(--bg); }
html[data-experience='mobile'] body:has(#f) .wrap { padding-left:max(12px, env(safe-area-inset-left, 0px)); padding-right:max(12px, env(safe-area-inset-right, 0px)); }
html[data-experience='mobile'] body:has(#f) .brand h1 { font-size:22px; }
html[data-experience='mobile'] body:has(#f) .brand h1 i { font-style:normal; }
html[data-experience='mobile'] body:has(#f) .brand .sub { font-size:9px; }
html[data-experience='mobile'] body:has(#f) .tabs { padding:0; background:transparent; }
html[data-experience='mobile'] body:has(#f) .tabs button { flex:1 0 auto; font-size:10px; padding-inline:10px; }
html[data-experience='mobile'] body:has(#f) .mi-result-nav { padding:14px 0; }
html[data-experience='mobile'] body:has(#f) .mi-result-nav h2 { font-size:26px; line-height:1.2; margin:10px 0 18px; }
html[data-experience='mobile'] body:has(#f) .mi-result-nav > div { gap:0; border-top:2px solid var(--ink); }
html[data-experience='mobile'] body:has(#f) .mi-result-nav button { min-height:96px; padding:12px; border:0; border-bottom:1px solid var(--line); background:transparent; }
html[data-experience='mobile'] body:has(#f) .mi-result-nav button+button { border-left:1px solid var(--line); }
html[data-experience='mobile'] body:has(#f) .mi-result-nav b { font:500 18px/1.25 var(--sans); margin-bottom:6px; }
html[data-experience='mobile'] body:has(#f) #cards .card { padding:12px; margin-bottom:10px; }
html[data-experience='mobile'] body:has(#f) #cards .card .head h2 { font-size:20px; padding-bottom:8px; }
html[data-experience='mobile'] body:has(#f) .mi-path-detail > summary { padding-block:10px; min-height:44px; }
html[data-experience='mobile'] body:has(#f) .side { padding:12px; }
html[data-experience='mobile'] body:has(#f) #sheet h3 { font-size:24px; padding-right:48px; line-height:1.2; }
html[data-experience='mobile'] body:has(#f) #sheet .desc { font-size:15px; line-height:1.55; }
html[data-experience='mobile'] body:has(#f) #sheet .x { float:none; position:sticky; display:grid; place-items:center; margin-left:auto; top:0; }
html[data-experience='mobile'] body:has(#f) .q>label { font-size:14px; }
html[data-experience='mobile'] body:has(#f) .opts label { padding:7px 10px; font-size:12px; }
html[data-experience='mobile'] body:has(#f) .mi-step-title { font-size:26px; }
html[data-experience='mobile'] body:has(#f) :is(.mi-step-status,.mi-progress) { margin-bottom:12px; }
html[data-experience='mobile'] body:has(#f) .hexs { grid-template-columns:minmax(0,1fr); }
html[data-experience='mobile'] body:has(#f) :is(.sky>div,.rd,.qhelp) { border-radius:0; box-shadow:none; }
@media(max-width:360px) {
 html[data-experience='mobile'] body:has(#f) .tabs button { padding-inline:6px; font-size:9px; letter-spacing:0; }
}

/* Comparison cards must shrink inside the reading panel, including translated names. */
html[data-experience='mobile'] body:has(#f) .pairs { grid-template-columns:minmax(0,1fr); }
html[data-experience='mobile'] body:has(#f) .pair { min-width:0; padding:10px; border-radius:0; }
html[data-experience='mobile'] body:has(#f) .pair .vs { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:6px; }
html[data-experience='mobile'] body:has(#f) .pair .vs > div { min-width:0; overflow-wrap:anywhere; }
html[data-experience='mobile'] body:has(#f) .pair .ent { max-width:100%; white-space:normal; text-align:inherit; overflow-wrap:anywhere; }
html[data-experience='mobile'] body:has(#f) .star[aria-pressed='true'] { background:var(--ink); color:var(--bg); border-color:var(--ink); box-shadow:none; }
html[data-experience='mobile'] body:has(#f) #toast { width:max-content; max-width:calc(100vw - 24px); padding:8px 12px; border-radius:0; font-size:12px; line-height:1.4; bottom:calc(12px + env(safe-area-inset-bottom)); }
/* Discovery is a full-screen page above the galaxy, including in installed mode. */
html[data-experience='mobile'] #mm-discover { padding-top:calc(20px + env(safe-area-inset-top, 0px)); }

/* Installed phones retain notch clearance when rotated to a wide viewport. */
html[data-experience='mobile'] #mm-open { top:calc(64px + env(safe-area-inset-top,0px)); right:calc(12px + env(safe-area-inset-right,0px)); }
html[data-experience='mobile'] #mm-discover { padding-left:calc(18px + env(safe-area-inset-left,0px)); padding-right:calc(18px + env(safe-area-inset-right,0px)); }
@media (max-width:1100px) and (max-height:500px) {
 html[data-experience='mobile'] body.mob #galcard { bottom:calc(12px + env(safe-area-inset-bottom,0px)); max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
 html[data-experience='mobile'] body.mob #mylibCard { bottom:calc(12px + env(safe-area-inset-bottom,0px)); max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) !important; }
}
