/* thisismylife.lol: mobile-first, dark mode only */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface2: #1d1d22;
  --surface3: #25252b;
  --line: #303037;
  --text: #ececef;
  --muted: #8c8c95;
  --faint: #4d4d55;
  --yellow: #ffe600;
  --yellow-soft: rgba(255, 230, 0, 0.14);
  --accent: #d4f6ff;
  --accent-glow: rgba(140, 225, 255, 0.55);
  --red: #ff3a46;
  --icon-fill: #2a2a30;
  --font: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --emoji-font: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ---- top bar --------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: rgba(13, 13, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.logo { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.logo .l-my { color: var(--yellow); }
.logo .l-bio { color: var(--text); }
.logo .l-lol { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.btn {
  height: 36px; padding: 0 14px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.15s var(--ease-bounce), background 0.2s;
}
.btn:active { transform: scale(0.94); }
.btn-primary { background: var(--yellow); color: #111; box-shadow: 0 0 18px rgba(255, 230, 0, 0.25); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--text); }
.btn-danger { border: 1.5px solid rgba(255, 58, 70, 0.6); color: #ff8a92; }
.btn-icon { width: 36px; padding: 0; justify-content: center; border: 1.5px solid var(--line); font-size: 20px; line-height: 1; }

/* ---- menu ----------------------------------------------------------- */
.menu {
  position: fixed; z-index: 60; top: calc(58px + env(safe-area-inset-top)); right: max(12px, calc(50vw - 228px));
  min-width: 210px; padding: 6px;
  background: #19191e; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  animation: pop-in 0.18s var(--ease-bounce);
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 11px; font-size: 15px; text-align: left;
}
.menu button:active { background: var(--surface3); }
.menu .mi-ico { width: 22px; text-align: center; }

/* ---- intro ------------------------------------------------------------ */
.intro { padding: 10px 8px 6px; }
.intro-card {
  padding: 10px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.06);
}
.intro-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.born { font-size: 17px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.born select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffe600'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--yellow); font: inherit; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 5px 28px 5px 10px;
}
.born .age { color: var(--muted); font-size: 14px; }
.hint { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 13px; text-align: center; }
.opt-toggle {
  margin-left: auto; height: 32px; padding: 0 5px 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--surface2); border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.opt-toggle .ot-ico { display: inline-flex; }
.ot-sw { position: relative; width: 30px; height: 18px; border-radius: 9px; background: #3a3a42; transition: background-color 0.2s; }
.ot-sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #c9c9d0; transition: transform 0.22s var(--ease-bounce), background-color 0.2s;
}
.opt-toggle.on { color: var(--text); border-color: rgba(255, 230, 0, 0.5); }
.opt-toggle.on .ot-sw { background: var(--yellow); }
.opt-toggle.on .ot-sw::after { transform: translateX(12px); background: #111; }
.hint b { color: var(--yellow); font-weight: 600; }

/* ---- mock ads ----------------------------------------------------------- */
.mock-slot {
  position: relative; margin: 12px 10px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #6d6d76; font-size: 13px;
  background: repeating-linear-gradient(135deg, #141417 0 10px, #18181c 10px 20px);
  border: 1px dashed #2b2b31;
}
.mock-slot::before {
  content: 'Ad'; position: absolute; top: 5px; left: 7px;
  font-size: 10px; font-weight: 600; color: #7d7d86;
  border: 1px solid #3a3a42; border-radius: 4px; padding: 0 4px;
}
.slot-banner { height: 60px; }
.slot-rect { height: 250px; max-width: 300px; margin: 18px auto; }
.slot-infeed { height: 100px; margin: 22px 4px; }
.mock-slot .slot-copy b { display: block; color: #9a9aa3; font-weight: 600; font-size: 14px; }

/* ---- graph -------------------------------------------------------------- */
#graph { padding: 2px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.year-group { display: flex; flex-direction: column; gap: 3px; }

.block {
  --emo: 26px; --lab: 32px; --sub: 36px; --div: 24px; --bar-h: 22px;
  position: relative;
  display: grid;
  grid-template-columns: var(--emo) auto minmax(0, 1fr) var(--div) var(--div); /* emoji | year label | bar | eye | divide */
  grid-template-rows: auto auto auto;
  align-content: start; /* a month stretched to its row-mate's height keeps its rows at the top */
  column-gap: 4px; row-gap: 4px;
  padding: 2px 5px 3px 3px;
  background: var(--bg, var(--surface));
  border-radius: 10px;
  transition: background-color 0.3s;
}
.block.lvl-1 { /* a month: OCT 10 | bar | eye (no emoji, no divide button) */
  grid-template-columns: auto minmax(0, 1fr) var(--div);
  border-radius: 8px;
}
/* a split year's months: two subcolumns, JAN | FEB ... NOV | DEC. A hidden
   month stays a slim bar at the top of its cell, so a row only shrinks when
   both of its months are hidden. */
.month-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px 4px; align-items: stretch; /* as wide as the year, like the image */
}
.month-grid > .hblock { align-self: start; }

.emoji {
  grid-column: 1; grid-row: 1;
  font-family: var(--emoji-font);
  font-size: 19px; line-height: 1; height: var(--bar-h);
  display: grid; place-items: center;
  user-select: none;
}
.emoji.pop { animation: emoji-pop 0.42s var(--ease-bounce); }

.label {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; justify-content: center; line-height: 1;
  min-width: 0; user-select: none;
}
.label b { font-size: 12px; font-weight: 600; color: var(--txt, var(--text)); transition: color 0.3s; }
.label small { font-size: 9px; color: var(--soft, var(--muted)); margin-top: 1px; white-space: nowrap; }

.bar {
  grid-column: 3; grid-row: 1;
  position: relative; height: var(--bar-h);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
}
.track {
  position: absolute; inset: 1px 0; border-radius: 7px;
  background: var(--track, #0f0f12);
  transition: background-color 0.3s;
}
.track .mid { position: absolute; left: 50%; top: 5px; bottom: 5px; width: 1px; background: rgba(255, 255, 255, 0.08); }
.fill {
  position: absolute; top: 2px; bottom: 2px; border-radius: 5px;
  display: flex; align-items: center; padding: 0 5px;
  min-width: max-content;
  font-size: 10.5px; font-weight: 700; line-height: 1; white-space: nowrap;
  color: var(--numc, #0d0d0f);
  transition: background-color 0.2s;
}
.fill.pos { left: 50%; justify-content: flex-end; }
.fill.neg { right: 50%; justify-content: flex-start; }
.fill.zero { left: 50%; transform: translateX(-50%); justify-content: center; padding: 0 6px; }
.fill.pos.at-sug { padding-right: 11px; }
.fill.neg.at-sug { padding-left: 11px; }
.bar.derived .fill {
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.13) 0 4px, transparent 4px 8px);
}
.suggest { /* suggested value: a down arrow fully inside the dark track */
  position: absolute; top: 2px; width: 12px; height: 16px; margin-left: -6px; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M4.5 1.5h3v7h3L6 14.5 1.5 8.5h3z' fill='%23ffe600' stroke='%230d0d0f' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 2px rgba(255, 230, 0, 0.55));
  transform-origin: 50% 100%;
  transition: left 0.45s var(--ease-bounce), opacity 0.25s;
  pointer-events: none;
}
.suggest.ping { animation: sug-ping 0.7s ease-out; }
.bar.dragging .track { box-shadow: inset 0 0 0 1.5px rgba(212, 246, 255, 0.55); }

.divide, .eye {
  grid-column: 5; grid-row: 1; align-self: center; justify-self: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--well, #111);
  color: rgba(255, 230, 0, 0.8);
  display: grid; place-items: center;
  transition: transform 0.2s var(--ease-bounce), background-color 0.3s;
}
.divide svg, .eye svg { width: 11px; height: 11px; fill: currentColor; }
.divide:active { transform: scale(0.85) rotate(-10deg); }
.eye { grid-column: 4; color: rgba(212, 246, 255, 0.7); }
.lvl-1 .label { grid-column: 1; }
.lvl-1 .bar { grid-column: 2; }
.lvl-1 .eye { grid-column: 3; }
.mtag { /* the month's tilted name and number (ui/graph.js monthLabelSvg), as in the image */
  display: block; overflow: visible; margin: 0 2px 0 3px;
  width: calc(var(--lw) * 1px * var(--kf, 1)); height: calc(var(--lh) * 1px * var(--kf, 1));
  font-family: var(--font); font-weight: 700; fill: var(--txt, var(--text)); transition: fill 0.3s;
}
.eye:active { transform: scale(0.85); }

/* a hidden block: a thin gray bar, left out of the image; tap to show it */
.hblock {
  position: relative; display: block; width: 100%; height: 16px; border-radius: 6px;
  background: #2b2b31; transition: background-color 0.2s;
}
.hblock::after { content: ''; position: absolute; inset: -5px 0; } /* a taller touch target */
.hblock:hover { background: #3a3a42; }
.divide.merge { color: rgba(212, 246, 255, 0.85); }

/* events row */
.events {
  grid-column: 1 / -1; grid-row: 2;
  position: relative; height: 20px;
  border: 1px solid transparent; border-radius: 7px;
  background: var(--well, rgba(0, 0, 0, 0.25));
  transition: height 0.25s var(--ease-bounce), border-color 0.2s, background-color 0.3s;
  touch-action: pan-y;
}
.lvl-1 .events { height: 18px; }
.events.drop-target { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow-soft); }
.add-small {
  position: absolute; top: 0; left: 0;
  border-radius: 50%; border: 1.5px solid rgba(255, 230, 0, 0.5); color: rgba(255, 230, 0, 0.85);
  transition: left 0.28s var(--ease-bounce), top 0.28s var(--ease-bounce);
}
.add-small::before, .add-small::after { /* the plus, centered in the circle */
  content: ''; position: absolute; left: 50%; top: 50%; width: 58%; height: max(2px, 10%);
  border-radius: 2px; background: currentColor; transform: translate(-50%, -50%);
}
.add-small::after { transform: translate(-50%, -50%) rotate(90deg); }
.ev, .more {
  position: absolute; top: 0; left: 0;
  width: var(--s); height: var(--s);
  border-radius: calc(var(--s) * 0.27);
  border: max(1.5px, calc(var(--s) * 0.05)) solid var(--c, #808080);
  background: var(--icon-fill);
  display: grid; place-items: center;
  font-size: calc(var(--s) * 0.34); font-weight: 600; letter-spacing: 0.01em;
  color: #ededf0;
  box-shadow: 0 0 0 1px rgba(13, 13, 15, 0.95), 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: left 0.28s var(--ease-bounce), top 0.28s var(--ease-bounce), width 0.2s, height 0.2s, opacity 0.2s, border-color 0.2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ev.enter { animation: icon-enter 0.35s var(--ease-bounce); }
/* vector glyphs (web/src/icons.js): 78% of the chip, 2-unit round strokes */
.ev .glyph {
  width: calc(var(--s) * 0.78); height: calc(var(--s) * 0.78);
  overflow: visible; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ev .glyph .f { fill: currentColor; fill-rule: evenodd; stroke: none; }
.ev .glyph .b { fill: currentColor; fill-rule: evenodd; }
.ev .glyph .d { stroke-dasharray: 0.01 3.4; }
.ev .glyph .k { fill: var(--icon-fill); stroke: var(--icon-fill); stroke-width: 5; }
.ev .glyph .c { stroke: var(--icon-fill); }
.ev .glyph .e { fill: var(--icon-fill); fill-rule: evenodd; stroke: none; }
.ev.lifting { opacity: 0.35; }
.more {
  border-color: rgba(212, 246, 255, 0.7); color: var(--accent);
  box-shadow: 0 0 0 1px rgba(13, 13, 15, 0.9);
  font-size: calc(var(--s) * 0.34);
}

/* text row */
.text { grid-column: 1 / -1; grid-row: 3; position: relative; }
.text textarea {
  display: block; width: 100%; height: 19px; min-height: 19px; max-height: 32px;
  resize: none; overflow: hidden;
  padding: 2px 7px; border-radius: 6px;
  background: var(--well, rgba(0, 0, 0, 0.25)); color: var(--txt, var(--text));
  border: 1px solid transparent;
  font: 400 11.5px/13px var(--font);
  transition: border-color 0.2s, background 0.2s;
}
.text textarea::placeholder {
  color: var(--faint2, var(--faint)); opacity: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.text textarea:focus { outline: none; border-color: rgba(255, 230, 0, 0.55); }
.text .count {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: var(--muted); pointer-events: none;
  background: var(--well); padding: 0 3px; border-radius: 4px;
}
.text .count.full { color: var(--yellow); }

/* ---- sheet (event browser) --------------------------------------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); animation: fade-in 0.2s; }
.sheet { /* floats above the bottom edge, rounded all round */
  position: absolute; left: 8px; right: 8px; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 480px;
  height: min(86dvh, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; overflow: hidden;
  background: #131316; border-radius: 22px; border: 1px solid #2c2c33;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: sheet-in 0.32s var(--ease-bounce);
}
.sheet.closing { animation: sheet-out 0.2s ease-in forwards; }
.sheet-head { padding: 8px 14px 10px; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #3a3a42; margin: 0 auto 10px; }
.sheet-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.sheet-title h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sheet-title h2 span { color: var(--yellow); }
.sheet-title .sel-count { font-size: 13px; color: var(--muted); }
.sel-box { display: flex; align-items: center; gap: 8px; }
.clear-btn { font-size: 13px; font-weight: 500; color: var(--accent); padding: 3px 9px; border-radius: 9px; background: var(--surface3); }
.clear-btn:active { transform: scale(0.95); }
.search-row { display: flex; gap: 8px; }
.search {
  flex: 1; position: relative;
}
.search input {
  width: 100%; height: 40px; border-radius: 12px;
  background: #1d1d22; border: 1.5px solid #2e2e35; color: var(--text);
  font: 400 15px var(--font); padding: 0 12px 0 34px;
}
.search input:focus { outline: none; border-color: rgba(212, 246, 255, 0.55); }
.search::before {
  content: ''; position: absolute; left: 12px; top: 13px; width: 11px; height: 11px;
  border: 2px solid var(--muted); border-radius: 50%;
}
.search::after {
  content: ''; position: absolute; left: 23px; top: 25px; width: 6px; height: 2px;
  background: var(--muted); transform: rotate(45deg); border-radius: 1px;
}
.seg { display: flex; border: 1.5px solid #2e2e35; border-radius: 12px; overflow: hidden; }
.seg button { width: 38px; height: 37px; display: grid; place-items: center; color: var(--muted); }
.seg button.on { background: var(--surface3); color: var(--yellow); }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 16px;
}
.sheet-body.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; align-content: start; }
.sheet-body.list { display: flex; flex-direction: column; gap: 2px; }
.pick { position: relative; display: flex; align-items: center; gap: 12px; border-radius: 12px; text-align: left; }
.pick .ev { position: relative; }
.grid .pick { justify-content: center; aspect-ratio: 1; }
.grid .pick .pname { display: none; }
.list .pick { padding: 5px 8px; min-height: 48px; }
.pick .pname { font-size: 15px; }
.pick.sel { background: var(--yellow-soft); }
.pick.sel .ev { box-shadow: 0 0 0 2.5px var(--yellow), 0 0 14px rgba(255, 230, 0, 0.5); }
.pick.sel::after {
  content: '✓'; position: absolute; top: 3px; right: 5px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--yellow); color: #111; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.list .pick.sel::after { top: 50%; right: 10px; transform: translateY(-50%); }
.pick.last .ev { animation: icon-enter 0.35s var(--ease-bounce); }
.no-results { grid-column: 1 / -1; padding: 40px 10px; text-align: center; color: var(--muted); }
.sheet-foot {
  border-top: 1px solid #25252b; padding: 10px 16px 12px;
  background: #161619;
}
.ev-info { margin-top: 8px; min-height: 58px; text-align: center; }
.ev-info b { display: block; font-size: 15px; font-weight: 600; }
.ev-info p { margin: 3px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev-info.empty { color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* intensity slider */
.islider { user-select: none; }
.islider.off { opacity: 0.35; pointer-events: none; }
.is-track { position: relative; height: 36px; touch-action: none; cursor: ew-resize; }
.is-grad {
  position: absolute; left: 0; right: 0; top: 14px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #ff0000, #808080 50%, #00ff00);
}
.is-dim { position: absolute; top: 12px; height: 12px; background: rgba(13, 13, 15, 0.7); }
.is-dim.l { left: -1px; border-radius: 5px 0 0 5px; }
.is-dim.r { right: -1px; border-radius: 0 5px 5px 0; }
.is-rec {
  position: absolute; top: 10px; height: 16px; border-radius: 6px;
  box-shadow: 0 0 0 1.5px rgba(212, 246, 255, 0.8), 0 0 10px var(--accent-glow);
}
.is-zero { position: absolute; left: 50%; top: 9px; height: 18px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.5); border-radius: 1px; }
.is-thumb {
  position: absolute; top: 2px; width: 32px; height: 32px; margin-left: -16px;
  border-radius: 50%; background: #0d0d0f; border: 3px solid var(--c, #808080);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  box-shadow: 0 0 0 2px #0d0d0f, 0 3px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s var(--ease-bounce);
}
.is-track.active .is-thumb { transform: scale(1.12); }
.is-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.is-labels .typ { color: var(--accent); }

/* ---- modal ---------------------------------------------------------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-wrap .backdrop { z-index: 0; }
.card {
  position: relative; z-index: 1; width: min(92vw, 380px);
  background: #17171b; border: 1px solid #2c2c33; border-radius: 22px;
  padding: 20px 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: pop-in 0.25s var(--ease-bounce);
}
.card h3 { margin: 0 0 6px; padding: 0 28px; font-size: 19px; font-weight: 600; text-align: center; } /* padding: clear of the close button */
.card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; text-align: center; }
.card .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.card .x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 22px; }
.ev-pop .big { display: flex; justify-content: center; margin: 4px 0 14px; }
.ev-pop .big .ev { position: relative; }
.ev-pop h3 { text-align: center; }
.ev-pop p { text-align: center; }

/* ---- toast ------------------------------------------------------------------ */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: min(440px, calc(100vw - 32px));
  background: #222228; border: 1px solid #36363e; border-radius: 14px;
  padding: 10px 14px; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s var(--ease-bounce);
}
.toast button { color: var(--accent); font-weight: 600; text-shadow: 0 0 8px var(--accent-glow); }

/* ---- drag and drop ------------------------------------------------------ */
.ghost {
  position: fixed; z-index: 100; pointer-events: none; left: 0; top: 0;
  transform-origin: center;
}
.ghost .ev { position: relative; transform: scale(1.3) rotate(-6deg); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6), 0 0 0 1.5px #0d0d0f; transition: none; }
.trash {
  position: fixed; z-index: 95; left: 0; right: 0; bottom: 0; height: 96px;
  display: grid; place-items: end center; padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(255, 40, 60, 0.32));
  color: #ffc2c7; font-weight: 600; font-size: 15px;
  pointer-events: none;
  animation: fade-in 0.2s;
}
.trash.over { background: linear-gradient(transparent, rgba(255, 40, 60, 0.6)); color: #fff; }

/* ---- export preview ------------------------------------------------------- */
.export-card { width: min(94vw, 440px); max-height: 88dvh; display: flex; flex-direction: column; }
.export-imgs { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.export-imgs img { width: 100%; border-radius: 12px; border: 1px solid #2c2c33; background: #0d0d0f; }
.export-meta { font-size: 12px; color: var(--muted); text-align: center; }
.code-pill { font-family: ui-monospace, Menlo, monospace; color: var(--yellow); letter-spacing: 0.08em; }

.foot { padding: 8px 18px 20px; color: #5d5d66; font-size: 12px; text-align: center; }

/* ---- animations -------------------------------------------------------------- */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 230, 0, 0.55); transform: scale(1); }
  50% { transform: scale(1.08); }
  70% { box-shadow: 0 0 0 12px rgba(255, 230, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 230, 0, 0); transform: scale(1); }
}
@keyframes emoji-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes sug-ping { 0% { transform: scale(1.18); filter: drop-shadow(0 0 5px rgba(255, 230, 0, 1)); } 100% { transform: none; filter: drop-shadow(0 0 2px rgba(255, 230, 0, 0.55)); } }
@keyframes icon-enter { 0% { transform: scale(0.2) rotate(-25deg); opacity: 0; } 100% { opacity: 1; } }
@keyframes pop-in { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateY(calc(100% + 24px)); } to { transform: translateY(0); } }
@keyframes sheet-out { from { transform: translateY(0); } to { transform: translateY(calc(100% + 24px)); } }
@keyframes toast-in { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---- share (main call to action) ---------------------------------------- */
#app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.share-fab {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  height: 54px; padding: 0 26px 0 20px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--yellow); color: #111;
  font-size: 18px; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 230, 0, 0.5);
  animation: fab-glow 2.8s ease-in-out infinite;
  transition: transform 0.18s var(--ease-bounce), opacity 0.2s;
}
.share-fab svg { width: 22px; height: 22px; }
.share-fab:active { transform: translateX(-50%) scale(0.94); }
.share-fab.busy { opacity: 0.75; pointer-events: none; }
.share-fab.busy svg { animation: spin 0.9s linear infinite; }
.share-fab .sub { font-size: 12px; font-weight: 500; opacity: 0.7; }
body.dragging .share-fab { opacity: 0; pointer-events: none; }
@keyframes fab-glow {
  0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 230, 0, 0.45); }
  50% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 9px rgba(255, 230, 0, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social a {
  flex: 1 1 40%; text-align: center; text-decoration: none;
  padding: 9px 10px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: var(--surface3); color: var(--text);
}
.social a:active { transform: scale(0.96); }

/* ---- profile card (optional) ----------------------------------------------- */
#profile { padding: 0 8px; margin-bottom: 4px; }
.profile-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 4px; border-radius: 10px; background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.prow { display: flex; gap: 3px; align-items: stretch; }
.pname-in {
  flex: 1; min-width: 0; height: 30px; padding: 0 9px; border-radius: 7px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; color: var(--text);
  font: 600 15px var(--font);
}
.pname-in::placeholder { color: var(--faint); font-weight: 400; }
.pname-in:focus { outline: none; border-color: rgba(255, 230, 0, 0.55); }
.sex {
  width: 32px; border-radius: 7px; background: rgba(0, 0, 0, 0.3);
  color: var(--muted); font-size: 17px; line-height: 1;
}
.sex.on { background: rgba(212, 246, 255, 0.14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.45); }
.pwell {
  flex: 1; min-width: 0; min-height: 30px; padding: 3px 5px; border-radius: 7px;
  background: rgba(0, 0, 0, 0.3); text-align: left;
  display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
}
.pw-empty { color: rgba(255, 230, 0, 0.75); font-size: 13px; padding: 0 3px; }
.pchip {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--surface3); font-size: 11.5px; font-weight: 600; color: var(--text);
}
.pc-ico { font-family: var(--emoji-font); font-size: 14px; line-height: 1; }
.chooser .pick { gap: 10px; }
.ch-ico { width: 30px; text-align: center; font-family: var(--emoji-font); font-size: 20px; line-height: 1; }
.ch-ico.txt { font-family: var(--font); font-size: 10.5px; font-weight: 700; color: var(--accent);
  border: 1.5px solid rgba(212, 246, 255, 0.5); border-radius: 7px; padding: 4px 0; }

/* ---- session 3: age / month-name column, overshooting icons, sex colors ---- */
.label { flex-direction: row; align-items: center; }
/* year blocks: year | candle | age touching; fixed cells keep the bars in line
   (Fredoka has no tabular digits). Hidden ages leave only the year, and the bar
   grows into the space. */
.label.ylabel { grid-column: 2; gap: 0; white-space: nowrap; }
.ylabel .yr { display: inline-block; width: 4.15ch; }
.ylabel .age { display: inline-block; min-width: calc(var(--age-ch, 2) * 1.05ch); }
.ylabel b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; } /* year and age share one font */
.candle { font-family: var(--emoji-font); font-size: 12px; font-weight: 400; line-height: 1; }
#graph.hide-age .ylabel .candle, #graph.hide-age .ylabel .age { display: none; }
.events { overflow: visible; background-clip: padding-box; } /* the transparent border stays unpainted */
.sex-f { color: rgba(255, 111, 174, 0.6); }
.sex-m { color: rgba(90, 169, 255, 0.6); }
.sex-f.on { color: #ff6fae; background: rgba(255, 111, 174, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 111, 174, 0.5); }
.sex-m.on { color: #5aa9ff; background: rgba(90, 169, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(90, 169, 255, 0.5); }
