/* Foliage on the web: warm ink on dark, smoky translucent glass over the painting (Panel.swift's Ink and glass). The app is
   always dark, as the apps' chrome is, whatever the system's appearance. */
:root {
  --text: 243, 236, 224;                 /* Ink.text (0.953, 0.925, 0.878) */
  --ink: rgb(var(--text));
  --dim: rgba(var(--text), .6);
  --supporting: rgba(var(--text), .82);
  --faint: rgba(var(--text), .35);
  --line: rgba(var(--text), .16);
  --panel: 22, 18, 14;                   /* Ink.panel (0.086, 0.071, 0.055) */
  --stage: #14110e;                      /* Ink.stage */
  --accent: rgb(237, 163, 84);           /* Ink.accent */
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--stage); color: var(--ink); font: 16px/1.3 var(--sans);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(var(--text), .55); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { display: block; flex: none; }
.caps { font: 500 10px/1.3 var(--sans); text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }

#painting { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; background: var(--stage); }
#chrome { position: fixed; inset: 0; pointer-events: none; }
#chrome > * { pointer-events: none; }
#chrome .glass, #chrome button, #chrome canvas, #chrome input, #chrome .sheet, #chrome .hit { pointer-events: auto; }

/* ─── Liquid glass: smoke behind clear glass, which lends a lit rim and bends the light at its edges ─── */
.glass {
  --smoke: .5;
  position: relative;
  background: rgba(var(--panel), var(--smoke));
  -webkit-backdrop-filter: blur(3px) saturate(1.45) brightness(1.04);
  backdrop-filter: blur(3px) saturate(1.45) brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),       /* the lit top edge */
    inset 0 -1px 0 rgba(255, 255, 255, .07),
    inset 1px 0 0 rgba(255, 255, 255, .08), inset -1px 0 0 rgba(255, 255, 255, .08),
    inset 0 0 0 .5px rgba(255, 255, 255, .14),
    inset 0 10px 24px -14px rgba(255, 255, 255, .16), /* the glass's body catching the light */
    0 10px 34px -8px rgba(0, 0, 0, .38), 0 1px 3px rgba(0, 0, 0, .2);
}
/* the rim's refraction: a thin bright band that brightens and blurs the paint just inside the edge */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1.5px;
  background: linear-gradient(160deg, rgba(255,255,255,.42), rgba(255,255,255,.06) 32%, rgba(255,255,255,0) 55%, rgba(255,255,255,.12) 85%, rgba(255,255,255,.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .55;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(var(--panel), calc(.42 + var(--smoke) * .2)); }
}

/* ─── desktop ─── */
.desktop .chrome { position: absolute; inset: 0; transition: opacity .25s ease-out; }
.desktop.resting .chrome, .desktop.resting .hover-card { opacity: 0; transition: opacity 1.2s ease-in-out; }
.desktop.resting .chrome * { pointer-events: none !important; }

.panel { position: absolute; left: calc(20px + env(safe-area-inset-left)); top: calc(16px + env(safe-area-inset-top)); width: 360px; padding: 20px; border-radius: 16px;
  transition: opacity .2s ease-out, transform .2s ease-out; }
.panel-hidden .panel, .panel-hidden .calendar { opacity: 0; transform: translateX(-8px); pointer-events: none !important; }
.panel-hidden .panel *, .panel-hidden .calendar * { pointer-events: none !important; }   /* (#chrome's buttons and canvases take it back otherwise) */
.panel-hidden .calendar { transform: none; }
.panel .search { display: none; }
.panel.searching .face { display: none; }
.panel.searching .search { display: block; }
.head { display: flex; align-items: flex-start; gap: 12px; }
.place-head { flex: 1; min-width: 0; margin: 0; font: inherit; }
.place { display: block; width: 100%; }
.heading { display: block; margin: 0; font: italic 400 32px/1.12 var(--serif); letter-spacing: -.005em; color: var(--ink); overflow-wrap: break-word; }
.round { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--text), .11);
  transition: background .15s, transform .12s; }
.round:hover { background: rgba(var(--text), .18); }
.round:active { transform: scale(.94); }
.status { display: flex; align-items: center; gap: 7px; font-size: 16px; color: var(--supporting); max-height: 0; opacity: 0; overflow: hidden;
  transition: opacity .2s ease-out, max-height .2s ease-out, margin .2s ease-out; }
.status.shown { max-height: 80px; opacity: 1; margin-top: 10px; }
.spinner { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1.6px solid rgba(var(--text), .25); border-top-color: rgba(var(--text), .85);
  animation: spin .9s linear infinite; }
.status:not(.shown) .spinner { animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.moment { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--supporting); font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.moment .grow { flex: 1; }
.readout { display: inline-flex; align-items: center; min-height: 36px; color: var(--supporting); }
/* as WeatherReadout spaces them: half the type size after the dot, under a third between the icon and the temperature */
.readout .dot-sep { margin-right: 8px; }
.readout .wx-icon { width: 19px; display: grid; place-items: center; margin-right: 4px; }
.readout .wx-temp { min-width: 2.6em; }
.now { color: var(--accent); padding: 6px 0 6px 6px; }
.now:hover { filter: brightness(1.12); }
.legend { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.legend-bar { display: flex; gap: 1px; height: 7px; border-radius: 4px; overflow: hidden; }
.legend-bar i { display: block; min-width: 1px; }
.species { display: flex; flex-direction: column; gap: 8px; max-height: 0; overflow: hidden auto; transition: max-height .2s ease-out, opacity .2s; opacity: 0; scrollbar-width: thin; }
.species.open { max-height: 230px; opacity: 1; }
.sp { display: flex; align-items: center; gap: 9px; font-size: 16px; color: var(--supporting); }
.sp i { width: 9px; height: 9px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 .5px var(--faint); }
.sp span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp .pct { font-variant-numeric: tabular-nums; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; color: var(--supporting); align-self: flex-start; padding: 2px 0; }
.more .icon { transition: transform .2s; }
.more.open .icon { transform: rotate(180deg); }

.search-row { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--supporting); }
.search-row .icon:first-child { width: 22px; }
.search input { flex: 1; min-width: 0; height: 32px; font: 16px var(--sans); color: var(--ink); background: none; border: 0; outline: none; caret-color: var(--ink);
  -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--supporting); }
.search-row:focus-within { border-bottom-color: rgba(var(--text), .5); }   /* (the field's own outline is off) */
.search input::-webkit-search-cancel-button { display: none; }
.search .cancel { width: 32px; height: 32px; display: grid; place-items: center; color: var(--supporting); }
.results, .recents { display: flex; flex-direction: column; padding-top: 4px; }
.recents .caps { padding: 10px 0 2px; }
.result { padding: 6px 0; font-size: 16px; color: var(--supporting); border-radius: 6px; }
.result:hover, .result:focus-visible { color: var(--ink); }
.search.touch input { height: 44px; }
.search.touch .cancel { width: 44px; height: 44px; }
.search.touch .result { padding: 10px 0; }

.show-panel { position: absolute; left: calc(20px + env(safe-area-inset-left)); top: calc(16px + env(safe-area-inset-top)); display: none; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px; font: italic 14px var(--serif); opacity: .001; transition: opacity .2s; }
.panel-hidden .show-panel { display: inline-flex; }
.show-panel:hover, .show-panel:focus-visible { opacity: 1; }

.calendar { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 48px), 1400px);
  padding: 8px 20px 0; border-radius: 14px; transition: opacity .2s ease-out; }
.bars { display: block; width: 100%; height: 92px; cursor: pointer; touch-action: none; }
.bar-label { position: absolute; top: -26px; transform: translateX(-50%); padding: 4px 9px; border-radius: 7px; font: 500 11.5px var(--sans);
  font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .12s; pointer-events: none !important; }
.bar-label.shown { opacity: 1; }

.hover-card { position: fixed; left: 0; top: 0; width: 280px; padding: 16px 18px; border-radius: 14px; opacity: 0; pointer-events: none !important;
  transition: opacity .15s ease-out; }
.hover-card.shown { opacity: 1; }
.hover-card .name, .tree-face .name { font: 400 22px/1.2 var(--serif); }
.hover-card .latin, .tree-face .latin { font: italic 14px/1.3 var(--serif); color: var(--dim); margin-top: 1px; }
.hover-card .stage, .tree-face .stage { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-top: 12px; }
.hover-card .stage i, .tree-face .stage i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hover-card .caps, .tree-face .caps { margin-top: 6px; }
.hover-card .blurb, .tree-face .blurb { font-size: 12.5px; line-height: 1.55; color: rgba(var(--text), .82); margin: 12px 0 0; }

.popover { position: fixed; z-index: 10; width: 280px; padding: 18px; border-radius: 14px; opacity: 0; transform: translateY(-4px) scale(.98);
  transition: opacity .18s ease-out, transform .18s ease-out; user-select: text; -webkit-user-select: text; }
.popover.shown { opacity: 1; transform: none; }
.pop-title { font: 500 15px var(--sans); }
.pop-reading { display: flex; align-items: center; gap: 8px; font-size: 20px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.pop-detail { font-size: 13px; line-height: 1.45; color: var(--supporting); margin: 10px 0 0; }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.credits { font-size: 12px; line-height: 1.5; color: var(--dim); margin: 0; }
.credits a { color: var(--ink); }

/* ─── notices: no WebGPU, and on an iPhone or iPad the App Store ─── */
#notice { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 20;
  background: radial-gradient(120% 90% at 50% 20%, rgba(20,17,14,.35), rgba(20,17,14,.82)); opacity: 0; transition: opacity .4s ease-out; }
#notice.shown { opacity: 1; }
.notice-card { width: min(420px, 100%); padding: 28px 26px 22px; border-radius: 22px; text-align: center; --smoke: .62; }
.notice-card img { width: 76px; height: 76px; border-radius: 17px; margin: 0 auto 14px; display: block; box-shadow: 0 6px 20px rgba(0,0,0,.35), 0 0 0 .5px rgba(255,255,255,.15); }
.notice-card h2 { margin: 0; font: italic 400 30px/1.15 var(--serif); }
.notice-card p { margin: 10px 0 0; font-size: 16px; line-height: 1.45; color: var(--supporting); }
.notice-card .store { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; width: 100%; height: 50px; border-radius: 25px;
  background: var(--ink); color: #17150f; font: 600 17px var(--sans); text-decoration: none; }
.notice-card .later { display: block; width: 100%; margin-top: 10px; padding: 12px; font-size: 16px; color: var(--supporting); }
.boot { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 15px; }

/* ─── touch: the sheet (a phone upright) and the dial (a phone on its side, a tablet) ─── */
.safe-probe { position: fixed; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.touch #painting, #painting { transition: transform .42s cubic-bezier(.3, 1.12, .4, 1); will-change: transform; }
#painting.resting { transition: transform .2s ease-in; }
.tree-light { position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 50%; pointer-events: none !important; mix-blend-mode: screen; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 246, 226, .34), rgba(255, 246, 226, .14) 55%, rgba(255, 246, 226, 0));
  transition: opacity .12s ease-out, transform .42s cubic-bezier(.3, 1.12, .4, 1); }
.tree-light.on { opacity: 1; }
.tree-light.resting { transition: opacity .12s ease-out, transform .2s ease-in; }

.touch .head { display: flex; align-items: flex-start; gap: 12px; }
.touch .place { padding: 4px 0; }
.round.big { width: 48px; height: 48px; margin: 2px -4px 0 0; }
.round.small { width: 44px; height: 44px; background: rgba(var(--text), .1); margin: -6px -6px 0 0; }
.round.big:active, .round.small:active { transform: scale(.9); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.moment.touch { height: 36px; margin-top: -4px; gap: 8px; }
.moment.touch .now { padding: 0 4px; height: 100%; }
.touch .status.shown { margin-top: 8px; }
.card-face.enter, .card.enter .card-face { animation: face .32s cubic-bezier(.3, 1.1, .4, 1); }
@keyframes face { from { opacity: 0; transform: translateY(8px); } }

.tree-head { display: flex; align-items: flex-start; gap: 12px; }
.tree-head .swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 8px; box-shadow: inset 0 0 0 .5px var(--faint); }
.tree-head .names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tree-face .name { font-size: 25px; }
.tree-face .latin { font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: rgba(var(--text), .1); }
.tree-face .blurb { font-size: 14.5px; line-height: 1.5; margin-top: 10px; }
.tree-wait { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }

.legend-bar.thin { height: 6px; gap: 1.5px; border-radius: 3px; }
.rows .sp { min-height: 30px; gap: 12px; }
.rows .sp i { width: 12px; height: 12px; }
.open .rows .sp, .rows-scroll.open .sp { animation: row .42s cubic-bezier(.3, 1.25, .4, 1) both; animation-delay: calc(var(--i) * 16ms); }
@keyframes row { from { opacity: 0; transform: translateY(-8px); } }

.sheet { position: absolute; left: 0; right: 0; top: 0; border-radius: 30px 30px 0 0; display: flex; flex-direction: column; overflow: hidden;
  touch-action: none; transition: transform .42s cubic-bezier(.3, 1.12, .4, 1); will-change: transform; }
.sheet.dragging { transition: none; }
.sheet.resting { transition: transform .2s ease-in; }
.handle { width: 40px; height: 5px; border-radius: 3px; background: var(--faint); margin: 7px auto 4px; }
.sheet .card-face { padding: 0 20px; }
.bands { display: block; touch-action: none; }
.bands.straight { width: 100%; height: 124px; margin-top: 10px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.sheet-gap { height: 14px; }
.sheet-list { overflow: hidden; flex: none; pointer-events: none !important; touch-action: none; }
.sheet-list.open { pointer-events: auto !important; }
.sheet-list-inner { padding: 4px 20px 12px; will-change: transform; }
.sheet-list .legend-bar { margin-bottom: 14px; }
/* a phone's search: glass over the whole screen above the keyboard (--vh, the visual viewport's height), its corners rounded as
   the card's, the field at the top and the places scrolling under it */
.search-screen { position: fixed; z-index: 3; top: calc(env(safe-area-inset-top) + 10px);
  left: calc(env(safe-area-inset-left) + 10px); right: calc(env(safe-area-inset-right) + 10px);
  height: calc(var(--vh, 100dvh) - env(safe-area-inset-top) - 20px); border-radius: 28px; overflow: hidden auto; touch-action: pan-y;
  overscroll-behavior: contain; padding: 12px 20px 0; animation: screen-in .3s cubic-bezier(.3, 1.05, .4, 1); }
.search-screen .search-row { position: sticky; top: 0; z-index: 1; padding-top: 4px; }
.search-screen .search { padding-bottom: 20px; }
.touch.screen-search .sheet, .touch.screen-search .dial { opacity: 0; transition: opacity .2s; }
.touch.screen-search .sheet *, .touch.screen-search .dial * { pointer-events: none !important; }
@keyframes screen-in { from { opacity: 0; transform: translateY(18px); } }

.dial { position: absolute; inset: 0; transition: opacity .2s ease-out; }
.dial.resting { opacity: 0; transition: opacity .13s ease-in; }
.dial.resting * { pointer-events: none !important; }
.dial .card { touch-action: none; position: absolute; left: calc(env(safe-area-inset-left) + 20px); top: calc(env(safe-area-inset-top) + 16px); width: 400px; border-radius: 26px;
  padding: 10px 18px 2px; max-height: calc(100% - env(safe-area-inset-top) - 32px); overflow: hidden; display: flex; flex-direction: column;
  transition: width .42s cubic-bezier(.3, 1.05, .4, 1); }
.dial.phone .card { left: calc(env(safe-area-inset-left) + 14px); top: calc(env(safe-area-inset-top) + 12px); width: 360px; }
.dial .card.tree { padding: 16px 18px; }
.dial .card.searching { width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 40px); height: calc(100% - env(safe-area-inset-top) - 38px); }
.dial.phone .card.searching { width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 28px); }
.card-search { display: none; overflow: auto; padding-bottom: 18px; touch-action: pan-y; }
.card.searching .card-face, .card.searching .species-block { display: none; }
.card.searching .card-search { display: block; }
.species-block { margin-top: 12px; }
.species-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; font-size: 16px; color: var(--supporting); }
.species-toggle .icon { transition: transform .3s; }
.species-toggle.open .icon { transform: rotate(180deg); }
.rows-scroll { max-height: 0; overflow: hidden auto; touch-action: pan-y; transition: max-height .44s cubic-bezier(.3, 1.05, .4, 1); padding-bottom: 0; }
.rows-scroll.open { max-height: max(120px, calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 230px)); padding-bottom: 8px; }
.disc { position: absolute; border-radius: 50%; pointer-events: none !important; }
.disc::before { border-radius: 50%; }
.dial .bands.ring { position: absolute; right: 0; bottom: 0; transition: opacity .2s; }
.dial.searching .bands.ring, .dial.searching .disc { opacity: 0; pointer-events: none !important; }

/* ─── the first painting being made: Foliage on the dark stage, a stroke going across, what's happening (one face: the serif) ─── */
#loading { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; background: var(--stage);
  transition: opacity 1.2s ease-in-out; }
#loading.gone { opacity: 0; pointer-events: none; }
.loading-inner { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 520px; font-family: var(--serif);
  animation: rise 1s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.loading-title { margin: 0; font: italic 400 clamp(34px, 7vw, 46px)/1.1 var(--serif); color: var(--ink); }
/* the brush going across: laid on from the left, lifting off at the right, again */
.loading-stroke { position: relative; width: 168px; height: 4px; margin-top: 30px; overflow: hidden; border-radius: 2px; }
.loading-stroke i { position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(90deg, rgba(var(--text), .05), rgba(237, 163, 84, .75) 55%, rgba(var(--text), .85));
  transform-origin: left; animation: stroke 2.2s cubic-bezier(.45, .05, .25, 1) infinite; }
@keyframes stroke {
  0% { transform: scaleX(0); opacity: 1; }
  62% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
.loading-status { margin: 16px 0 0; font-size: 16px; line-height: 1.45; color: var(--supporting); min-height: 1.45em; }
.loading-retry { margin-top: 18px; padding: 10px 20px; border-radius: 22px; background: rgba(var(--text), .11); font: 16px var(--serif); }
.loading-retry:hover { background: rgba(var(--text), .18); }
#loading.failed .loading-stroke { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .loading-stroke i { animation-duration: 4s; }
  .loading-inner, .card-face.enter, .card.enter .card-face, .rows .sp, .search-screen { animation: none !important; }
  /* the springs go: things move into place on a short ease, or just fade */
  .sheet, #painting, .tree-light, .dial .card, .rows-scroll { transition-timing-function: ease-out !important; transition-duration: .15s !important; }
}
#chrome { transition: opacity .8s ease-out .3s; }
#chrome.waiting { opacity: 0; pointer-events: none; }
#chrome.waiting * { pointer-events: none !important; }
.notice-card a.later { text-decoration: none; text-align: center; }
