/* The site of "מצפה חזון" (the sign in the valley says "כאן תקום עיר"): the valley fills the screen; over it, paper panels in the series' colours.
   Layout: a slim bar at the top (how many live here, the stages), a sheet at the bottom on a phone (a side panel on a wide
   screen) to find your tent, labels floating over the valley. */
:root {
  --paper: #fff8ec;        /* the panels: warm paper */
  --sand: #f2e2c4;         /* quiet buttons, chips */
  --sand-2: #e4cfa7;       /* lines on paper */
  --ink: #2b2118;          /* text: dark brown, never black */
  --ink-2: #6e5a45;        /* secondary text */
  --key: #ff9a3c;          /* the series' orange (KEY in overlay.js) */
  --key-ink: #2b1606;      /* text on orange */
  --key-deep: #c4600f;     /* the orange's edge */
  --night: rgba(36, 27, 19, 0.8);
  --display: 'Rubik', 'Heebo', 'Arial Hebrew', system-ui, sans-serif;
  --body: 'Heebo', 'Rubik', 'Arial Hebrew', system-ui, sans-serif;
  --gut: max(12px, env(safe-area-inset-left, 0px));
  --gut-r: max(12px, env(safe-area-inset-right, 0px));
  --lift: 0 12px 32px rgba(43, 33, 24, 0.26), 0 2px 6px rgba(43, 33, 24, 0.16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #d9bd92; color: var(--ink); font: 400 15px/1.45 var(--body); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--key-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
/* a tap is a tap (no wait for a double tap), and holding a button or the stick never selects text or opens a menu */
button, a, input, label, summary { touch-action: manipulation; }
/* the page itself never zooms (a pinch on the sheet used to blow the whole page up): only the valley takes gestures */
html { touch-action: pan-x pan-y; }
/* the round buttons in the bar look small, but take a finger: a clear ring of touch around each */
#bar .sky { position: relative; }
#bar .sky::after { content: ''; position: absolute; inset: -6px -4px; }
#bar, #walk, #tags, #grab, .btn, .pill { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* --- the loading poster: the sky at golden hour, the sign's words */
#poster { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; text-align: center; transition: opacity 0.7s ease 0.2s;
  background: linear-gradient(180deg, #5f8fc4 0%, #9cb7cf 34%, #f2d4a8 62%, #e2bb86 63%, #d6ad78 100%); }
#poster div { display: grid; gap: 10px; }
#poster b { font: 800 clamp(40px, 11vw, 72px)/1 var(--display); color: var(--ink); letter-spacing: -0.01em; }
#poster span { font: 500 16px var(--body); color: var(--ink-2); }
#poster.gone { opacity: 0; pointer-events: none; }
#loadbar { display: block; width: 160px; height: 4px; margin: 6px auto 0; border-radius: 2px; background: rgba(43, 33, 24, 0.14); overflow: hidden; }
#loadbar i { display: block; height: 100%; background: var(--key-deep); transform: scaleX(0.04); transform-origin: right; transition: transform 0.35s ease-out; }
#loadfail { display: grid; gap: 10px; max-width: 320px; margin: 8px auto 0; }
#loadfail span { line-height: 1.45; }

/* --- the top bar */
#bar { position: fixed; z-index: 10; top: calc(env(safe-area-inset-top, 0px) + 10px); left: var(--gut); right: var(--gut-r);
  background: var(--night); color: #fbefd9; border-radius: 16px; padding: 10px 14px 10px; box-shadow: var(--lift);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#bar .row { display: flex; align-items: center; gap: 10px; }
#bar .brand { font: 800 19px/1 var(--display); letter-spacing: -0.01em; white-space: nowrap; }
#bar .count { margin-inline-start: auto; font: 600 13px/1 var(--display); color: #e9d6b6; white-space: nowrap; }
#bar .count b { display: inline-block; min-width: 1.6em; padding: 4px 8px; border-radius: 8px; background: var(--key); color: var(--key-ink); font: 800 15px/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; }
#bar .sky { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 248, 236, 0.14); color: #fbefd9; font: 800 17px/1 var(--display); display: grid; place-items: center; }
#bar .count + .sky { margin-inline-start: 2px; }
.stages { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.stages li { position: relative; display: grid; justify-items: start; gap: 4px; font: 600 12px/1 var(--display); color: #c9b496; }
.stages li i { position: relative; width: 100%; height: 6px; border-radius: 3px; background: rgba(255, 248, 236, 0.16); overflow: hidden; }
.stages li i::after { content: ''; position: absolute; inset: 0; inset-inline-end: auto; width: calc(var(--fill, 0) * 100%); background: var(--key); border-radius: 3px; }
.stages li + li i { margin-inline-start: 3px; width: calc(100% - 3px); }
.stages li.done { color: #fbefd9; }
.stages li span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 248, 236, 0.3); margin-inline-end: 5px; vertical-align: 1px; }
.stages li.done span::before { background: var(--key); }
#bar .next { margin: 8px 0 0; font: 500 13px/1.3 var(--body); color: #f1dfc0; }
body.dream #bar .next { color: var(--key); font-weight: 700; }
/* a narrow phone: the name stays on one line; a big number goes without its word (the line below says it) */
@media (max-width: 420px) {
  #bar { padding-inline: 12px; }
  #bar .row { gap: 7px; }
  #bar .brand { font-size: 17px; }
  #bar .sky { width: 32px; height: 32px; font-size: 16px; }
  #bar.big #countw { display: none; }
}
@media (max-width: 350px) {
  #bar { padding-inline: 10px; }
  #bar .row { gap: 6px; }
  #bar .brand { font-size: 15px; }
  #bar .sky { width: 30px; height: 30px; font-size: 15px; }
  #bar .count b { font-size: 14px; padding: 4px 6px; }
  #bar #countw { display: none; }
  .chips { flex-wrap: wrap; }
}

/* --- labels over the valley */
#tags { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; white-space: nowrap; padding: 6px 11px 7px; border-radius: 999px;
  background: var(--paper); color: var(--ink); font: 700 13px/1 var(--display); box-shadow: 0 3px 10px rgba(43, 33, 24, 0.25); transition: opacity 0.2s; will-change: transform; }
.tag::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: inherit; }
.tag { border-top-color: var(--paper); }
.tag.hut { background: rgba(255, 248, 236, 0.92); font-weight: 600; }
.tag.mine, .tag.picked { background: var(--key); color: var(--key-ink); font-size: 14px; padding: 8px 13px 9px; }
.tag.mine::after, .tag.picked::after { border-top-color: var(--key); }
.tag.ghost { background: rgba(255, 248, 236, 0.9); outline: 2px dashed var(--key-deep); outline-offset: -2px; }
.tag.say { white-space: normal; width: max-content; max-width: 214px; padding: 9px 13px 10px; border-radius: 14px; font: 600 14px/1.35 var(--display); text-align: right; }
.tag.dim { opacity: 0; pointer-events: none; }

/* --- the sheet: at the bottom on a phone */
#sheet { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; max-height: min(72vh, 620px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 34px rgba(43, 33, 24, 0.24);
  padding: 4px var(--gut-r) calc(14px + env(safe-area-inset-bottom, 0px)) var(--gut); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
#grab { display: block; width: 100%; height: 26px; margin: 0 auto; touch-action: none; cursor: grab; border: 0; background: none; position: relative; }
#grab::before { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--sand-2); }
#home, #card, #future { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#sheet.low #home > :not(#find, .duo), #sheet.low #card > :not(.cardhead), #sheet.low #future > :not(.cardhead) { display: none; }

.today { display: flex; gap: 8px; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 12px; background: #fdebd2; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.35; }
.today .tq { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }      /* a long question takes two lines, not an ellipsis */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo .btn { padding-inline: 10px; }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.outline:active { background: var(--sand); }
.btn.wait { opacity: 0.6; pointer-events: none; animation: btnwait 1.1s ease-in-out infinite alternate; }
@keyframes btnwait { to { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) { .btn.wait { animation: none; } }
.today b { font-family: var(--display); }
.today::after { content: '←'; margin-inline-start: auto; color: var(--key-deep); font-weight: 700; }
.findhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.findhead label { font: 800 21px/1.1 var(--display); letter-spacing: -0.01em; }
.pill { margin-inline-start: auto; border: 0; border-radius: 999px; padding: 7px 12px; font: 700 13px/1 var(--display); white-space: nowrap; }
.pill.key { background: var(--key); color: var(--key-ink); }
.field { display: flex; align-items: stretch; height: 52px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; overflow: hidden; }
.field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0 12px 0 0; font: 500 17px var(--body); text-align: left; }
.field input::placeholder { color: #8a7660; text-align: right; direction: rtl; }
/* right to left: the name box, the @ just before the name, the button at the far end */
.field .at { display: grid; place-items: center; padding-inline: 2px 10px; color: var(--ink-2); font: 600 17px var(--body); }
.field button { flex: none; border: 0; background: var(--ink); color: var(--paper); padding: 0 18px; font: 700 16px var(--display); }
.field:focus-within { box-shadow: 0 0 0 3px rgba(255, 154, 60, 0.45); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); padding-block: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 40px; border: 0; border-radius: 999px; padding: 9px 14px; background: var(--sand); font: 600 14px/1 var(--display); color: var(--ink); white-space: nowrap; }
.chips button:active { background: var(--sand-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border: 0; border-radius: 14px; font: 700 16px/1.15 var(--display); text-decoration: none; text-align: center; }
.btn.key { background: var(--key); color: var(--key-ink); box-shadow: 0 3px 0 var(--key-deep); }
.btn.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-deep); }
.btn.light { background: var(--sand); color: var(--ink); }
.btn.grow, .grow.btn { flex: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link { border: 0; background: none; padding: 4px 2px; margin: -4px -2px; color: #a34f0a; font: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* cards */
.cardhead { display: flex; align-items: flex-start; gap: 12px; }
.cardhead > div { flex: 1; min-width: 0; }
.cardhead h2 { margin: 0; font: 800 21px/1.15 var(--display); letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; }
.cardhead .sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sand); font-size: 15px; display: grid; place-items: center; }
.swatch { flex: none; width: 40px; height: 40px; border-radius: 12px 12px 6px 6px; background: var(--c); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12); clip-path: polygon(50% 0, 100% 78%, 100% 100%, 0 100%, 0 78%); }
.swatch.ghost { background: rgba(255, 154, 60, 0.35); outline: 2px dashed var(--key-deep); outline-offset: -2px; clip-path: none; border-radius: 12px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
/* four facts: two by two (three in a row left the fourth alone under them) */
.facts:has(> li:nth-child(4):last-child) { grid-template-columns: 1fr 1fr; }
.facts li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #fbf0dc; }
.facts b { font: 800 17px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.facts span { font-size: 12.5px; color: var(--ink-2); }
.lead { margin: 0; font-size: 16px; line-height: 1.5; }
.small { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.small a { color: inherit; }
.why { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.why b { font-family: var(--display); }
.archive { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: #e8dcc6; aspect-ratio: 2 / 1; max-width: 100%; }
.archive img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; display: block; filter: sepia(0.18) contrast(1.04); }
.archive figcaption { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border-radius: 8px; background: rgba(43, 33, 24, 0.82); color: #fbefd9; font: 700 12px/1 var(--display); }
.credit { font-size: 12.5px; }

/* the stages */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--sand); }
.seg button { border: 0; border-radius: 10px; padding: 10px 4px; background: none; font: 700 15px/1 var(--display); color: var(--ink-2); }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(43, 33, 24, 0.16); }

/* what was built: its story */
.swatch.build { display: grid; place-items: center; background: var(--sand); clip-path: none; border-radius: 12px; font-size: 22px; box-shadow: none; }
.idea { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fdebd2; font: 700 17px/1.4 var(--display); border-inline-start: 4px solid var(--key); }
.tag.built { background: #fdebd2; }
.tag.built::after { border-top-color: #fdebd2; }

/* the resident card for a story */
.panel.story { max-width: 380px; gap: 12px; }
.storyimg { display: grid; place-items: center; min-height: 240px; }
.storyimg img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 16px; box-shadow: 0 6px 18px rgba(43, 33, 24, 0.25); }
.making { color: var(--ink-2); }

/* walking in the valley: the page steps aside for the picture, a thumb stick, one button for what's here */
.btn.walkin { background: var(--ink); color: var(--paper); }
body.walking #bar, body.walking #sheet, body.walking #tags { display: none !important; }
#walk { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#walk .hud { pointer-events: auto; border: 0; border-radius: 999px; background: var(--night); color: #fbefd9; font: 700 15px/1 var(--display); padding: 12px 16px; box-shadow: var(--lift); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* the way back: an arrow turned toward the hut (or your tent), how far; a tap walks you there */
#compass { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); left: max(12px, env(safe-area-inset-left, 0px)); min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
#compass i { display: inline-block; font-style: normal; color: var(--key); transition: transform 0.15s linear; }
#stick { transition: border-color 0.25s, box-shadow 0.25s; }
#stick.run { border-color: rgba(255, 179, 90, 0.85); }
#stick.float { pointer-events: none; }                               /* brought under the thumb: the picture keeps the touch */
#stick.sprint { border-color: var(--key); box-shadow: 0 0 0 4px rgba(255, 154, 60, 0.35), 0 0 22px rgba(255, 154, 60, 0.5); }
/* the stick takes a thumb that lands a little outside its ring */
#stick::before { content: ''; position: absolute; inset: -28px; border-radius: 50%; }
#walkexit { min-height: 44px; position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: max(12px, env(safe-area-inset-right, 0px)); }
#stick { pointer-events: auto; position: absolute; left: max(22px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 26px); width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 248, 236, 0.18); border: 2px solid rgba(255, 248, 236, 0.5); touch-action: none; display: grid; place-items: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#stick i { width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 248, 236, 0.85); box-shadow: 0 3px 10px rgba(43, 33, 24, 0.3); transition: transform 0.08s; }
.walkacts { position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); display: grid; justify-items: right; gap: 10px; }
#walk #act { background: var(--key); color: var(--key-ink); font-size: 17px; padding: 15px 20px; box-shadow: 0 3px 0 var(--key-deep), var(--lift); }
/* never over the stick: the button keeps to the room on its right, and a long label takes two lines */
#walk #act { max-width: calc(100vw - 132px - max(22px, env(safe-area-inset-left, 0px)) - max(18px, env(safe-area-inset-right, 0px)) - 14px); line-height: 1.2; text-align: center; }
#emo { width: 52px; height: 52px; padding: 0; font-size: 24px; display: grid; place-items: center; }
#emos { pointer-events: auto; display: grid; gap: 6px; background: var(--paper); border-radius: 16px; padding: 8px; box-shadow: var(--lift); }
#emos button { border: 0; background: var(--sand); border-radius: 10px; padding: 10px 14px; font: 600 15px var(--display); text-align: right; }
#bubbles { position: absolute; inset: 0; overflow: hidden; }
.bubble { position: absolute; left: 0; top: 0; max-width: min(78vw, 340px); padding: 10px 14px; border-radius: 16px; background: var(--paper); color: var(--ink); font: 600 15px/1.4 var(--display); box-shadow: var(--lift); }
.bubble::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--paper); }
@media (pointer: fine) { #stick { display: none; } }

/* the verification: three steps, the message to send, and the wait for it */
.vsteps { margin: 0; padding: 0; list-style: none; counter-reset: v; display: grid; gap: 12px; }
.vsteps li { counter-increment: v; display: grid; gap: 8px; padding-inline-start: 34px; position: relative; }
.vsteps li::before { content: counter(v); position: absolute; inset-inline-start: 0; top: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font: 800 13px/1 var(--display); }
.vsteps .msg { display: flex; gap: 8px; align-items: stretch; }
.vsteps code { flex: 1; min-width: 0; display: grid; place-items: center; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--key-deep); background: #fff; font: 800 18px/1.2 var(--display); letter-spacing: 0.04em; direction: rtl; user-select: all; -webkit-user-select: all; }
.vsteps .btn { min-height: 44px; }
.waiting { margin: 0; display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 14px; }
.waiting i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--sand-2); border-top-color: var(--key-deep); animation: vspin 0.9s linear infinite; }
@keyframes vspin { to { transform: rotate(1turn); } }
.verified { margin: 0; color: #2e7d32; font: 800 16px/1.3 var(--display); }
.err { margin: 0; color: #a3341a; font-weight: 600; }
.ok { color: #2e7d32; font-weight: 700; white-space: nowrap; }

/* the how-it-works box */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(30, 22, 14, 0.5); }
.copyurl { width: 100%; height: 48px; border: 2px solid var(--ink); border-radius: 12px; padding: 0 12px; background: #fff; font: 500 15px var(--body); color: var(--ink); }
.panel { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; background: var(--paper); border-radius: 22px; padding: 22px 20px 18px; box-shadow: var(--lift); display: grid; gap: 14px; }
.panel h2 { margin: 0; font: 800 23px/1.15 var(--display); text-wrap: balance; }
.panel h3 { margin: 4px 0 -6px; font: 800 16px/1.2 var(--display); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li > span { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--sand); display: grid; place-items: center; font-size: 19px; }
.steps b { display: block; font: 800 16px/1.3 var(--display); }
.panel p.grow { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fdebd2; font-size: 14.5px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.log li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.log b { font: 700 13px var(--display); color: var(--key-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }

#toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--bar-bottom, 118px) + 10px); max-width: calc(100% - 32px); width: max-content;
  padding: 10px 14px; border-radius: 12px; background: var(--night); color: #fbefd9; font: 600 14px/1.35 var(--display); text-align: center; box-shadow: var(--lift); pointer-events: none; }

/* the link-preview picture */
#ogtitle { display: none; }
body.og #bar, body.og #sheet, body.og #tags, body.og #toast, body.og #poster { display: none !important; }
#toast.low { top: auto; bottom: calc(var(--free-bottom, 300px) + 12px); }
/* walking: the bar and the panel are away, the word goes up top, clear of the stick and the buttons */
body.walking #toast { top: calc(env(safe-area-inset-top, 0px) + 64px); bottom: auto; left: 50%; max-width: min(520px, calc(100% - 32px)); }
body.og #ogtitle { display: grid; gap: 10px; position: fixed; z-index: 30; top: 44px; right: 56px; left: 56px; }
body.og #ogtitle b { font: 800 84px/1 var(--display); color: var(--ink); letter-spacing: -0.015em; text-shadow: 0 2px 0 rgba(255, 248, 236, 0.6); }
body.og #ogtitle span { font: 600 30px/1.2 var(--display); color: var(--ink); }

/* a wide screen: the sheet becomes a panel on the right, the bar stays over the valley beside it */
@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {
  #sheet { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 16px); bottom: auto; width: 380px; max-height: calc(100% - 32px);
    border-radius: 20px; padding: 16px 18px 18px; box-shadow: var(--lift); }
  #grab { display: none; }
  #bar { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 380px + 16px); left: auto; width: min(480px, calc(100% - 380px - 48px)); top: calc(env(safe-area-inset-top, 0px) + 16px); }
  #toast { left: calc((100% - 412px) / 2); top: auto; bottom: 28px; max-width: calc(100% - 412px - 32px); }
  .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #sheet { width: 340px; }
  #bar .brand, #bar #countw { display: none; }                         /* a phone on its side: the count and the buttons fit */
  #bar { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 340px + 16px); width: min(420px, calc(100% - 340px - 48px)); }
  .stages { display: none; }
}
/* a tablet standing up: the phone's sheet, but not wider than a phone's */
@media (min-width: 600px) and (max-width: 899px) and (orientation: portrait) {
  #sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
}
/* a short phone (Instagram's own browser leaves little height): with a card open, the bar keeps only its first row, so
   the tent still shows between it and the card */
@media (max-height: 640px) and (orientation: portrait) { body.carding #bar .stages, body.carding #bar .next { display: none; } }
/* typing on a small phone: the keyboard takes half the screen, the bar steps aside so the search stays in view */
@media (max-height: 560px) and (orientation: portrait) { body.typing #bar, body.typing #tags, body.typing #toast { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
