/* Вечера: a soft glow, calm cards. The colours are a palette (see the tokens below), the same whatever Telegram's own theme is. No holiday motifs. */

:root {
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --w: min(100vw, 440px);
  --edge: calc(50% - var(--w) / 2);
}

/*
 * Colours. Everything below this block uses only these names, so a palette
 * is one list. Without data-theme on <html> the first one is used.
 *
 *   accent       - the main colour: buttons, what is chosen, what is agreed
 *   accent-text  - the same colour dark or light enough to be read as text
 *   second       - what waits for an answer, and the "хочу ..." signals
 *   ink          - text on a button filled with the accent
 *   card-hi      - a surface one step off the card: thumbs, chips, quiet buttons
 *   float / nav / toast - things that hang over the page
 *   glow, light  - the soft colour in the background
 */

/* cream: a light, warm room */
:root,
:root[data-theme="cream"] {
  color-scheme: light;
  --pin-done: #b9aca0;
  --danger: #c8503f;
  --outer: #ece4d9;
  --bg0: #fcf8f2;
  --bg1: #f9f3ea;
  --bg2: #f5ecdf;
  --card: #ffffff;
  --card-hi: #f4ece1;
  --field: #ffffff;
  --line: rgba(70, 45, 30, 0.1);
  --text: #2c2430;
  --muted: rgba(44, 36, 48, 0.64);
  --faint: rgba(44, 36, 48, 0.44);
  --accent: #e8775a;
  --accent-hi: #f0916f;
  --accent-deep: #de6044;
  --accent-text: #c4502f;
  --ink: #ffffff;
  --second: #8473cf;
  --second-text: #6455b3;
  --him: #86b6f2;
  --her: #f4a6b8;
  --ava-ink: #241d2c;
  --shine: rgba(255, 255, 255, 0.4);
  --lift: 0 14px 30px -22px rgba(90, 55, 30, 0.45);
  --float: rgba(255, 255, 255, 0.9);
  --nav: rgba(253, 249, 243, 0.9);
  --toast: rgba(44, 36, 48, 0.95);
  --toast-text: #fcf8f2;
  --off: #e6ddd2;
  --off-text: #a3978c;
  --glow-1: rgba(232, 119, 90, 0.16);
  --glow-2: rgba(132, 115, 207, 0.12);
  --light-0: #f6b48f;
  --light-1: #c9bbf3;
  --light-2: #f7c9a8;
  --light-3: #b9c8f5;
  --sky: 2.4;
  --hot: #ef8a62;
  --cold: #7ea6ea;
  --globe-sea-1: #d9eaf4;
  --globe-sea-2: #93bcd6;
  --globe-land: #fbf1df;
  --globe-coast: #c79f74;
  --globe-border: rgba(120, 85, 50, 0.3);
  --globe-grid: rgba(50, 90, 120, 0.12);
  --globe-rim: rgba(90, 65, 45, 0.3);
  --globe-home: #2c2430;
}

/* sage: light and fresh */
:root[data-theme="sage"] {
  color-scheme: light;
  --pin-done: #a7b3aa;
  --danger: #c2553f;
  --outer: #dfe6df;
  --bg0: #f7f9f5;
  --bg1: #f2f6f0;
  --bg2: #eaf1e8;
  --card: #ffffff;
  --card-hi: #ebf1e9;
  --field: #ffffff;
  --line: rgba(30, 55, 45, 0.1);
  --text: #1f2b27;
  --muted: rgba(31, 43, 39, 0.64);
  --faint: rgba(31, 43, 39, 0.44);
  --accent: #4c9c88;
  --accent-hi: #63b09c;
  --accent-deep: #3a8773;
  --accent-text: #2c7663;
  --ink: #ffffff;
  --second: #e38a5c;
  --second-text: #b9602f;
  --him: #86b6f2;
  --her: #f4a6b8;
  --ava-ink: #1d2623;
  --shine: rgba(255, 255, 255, 0.35);
  --lift: 0 14px 30px -22px rgba(30, 60, 50, 0.45);
  --float: rgba(255, 255, 255, 0.9);
  --nav: rgba(247, 250, 246, 0.9);
  --toast: rgba(31, 43, 39, 0.95);
  --toast-text: #f7f9f5;
  --off: #dde5dc;
  --off-text: #94a199;
  --glow-1: rgba(76, 156, 136, 0.16);
  --glow-2: rgba(227, 138, 92, 0.1);
  --light-0: #a9d8c9;
  --light-1: #f3cfae;
  --light-2: #bfe3d2;
  --light-3: #c4d6f3;
  --sky: 2.4;
  --hot: #ef9a62;
  --cold: #6fa8d8;
  --globe-sea-1: #d6edeb;
  --globe-sea-2: #8fc0c4;
  --globe-land: #f6f0dc;
  --globe-coast: #9fa57b;
  --globe-border: rgba(70, 95, 60, 0.3);
  --globe-grid: rgba(40, 90, 90, 0.12);
  --globe-rim: rgba(40, 70, 60, 0.3);
  --globe-home: #1f2b27;
}

/* night: deep blue with one warm colour */
:root[data-theme="night"] {
  color-scheme: dark;
  --pin-done: #7d87a3;
  --danger: #ff9d9d;
  --outer: #070a12;
  --bg0: #0d1120;
  --bg1: #11172a;
  --bg2: #172038;
  --card: rgba(255, 255, 255, 0.05);
  --card-hi: rgba(255, 255, 255, 0.09);
  --field: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: rgba(238, 241, 248, 0.66);
  --faint: rgba(238, 241, 248, 0.42);
  --accent: #ffb38a;
  --accent-hi: #ffc9aa;
  --accent-deep: #ff9868;
  --accent-text: #ffc9aa;
  --ink: #2a1408;
  --second: #9aa8ff;
  --second-text: #b6c0ff;
  --him: #8fb8ff;
  --her: #ffa9c2;
  --ava-ink: #11172a;
  --shine: rgba(255, 255, 255, 0.45);
  --lift: none;
  --float: rgba(13, 17, 32, 0.76);
  --nav: rgba(13, 17, 32, 0.84);
  --toast: rgba(32, 40, 64, 0.96);
  --toast-text: #eef1f8;
  --off: #2a3350;
  --off-text: #8b93ab;
  --glow-1: rgba(255, 152, 104, 0.14);
  --glow-2: rgba(154, 168, 255, 0.16);
  --light-0: #ffb38a;
  --light-1: #9aa8ff;
  --light-2: #ff9868;
  --light-3: #6f86ff;
  --sky: 1;
  --hot: #ffb38a;
  --cold: #7f95ff;
  --globe-sea-1: #2c3d6e;
  --globe-sea-2: #0f1730;
  --globe-land: #5f6f96;
  --globe-coast: rgba(255, 201, 170, 0.55);
  --globe-border: rgba(238, 241, 248, 0.16);
  --globe-grid: rgba(238, 241, 248, 0.06);
  --globe-rim: rgba(255, 179, 138, 0.4);
  --globe-home: #eef1f8;
}

/* dusk: the first look - plum and amber */
:root[data-theme="dusk"] {
  color-scheme: dark;
  --pin-done: #9a8fa8;
  --danger: #f29ca8;
  --outer: #0c0813;
  --bg0: #150f22;
  --bg1: #1b1428;
  --bg2: #2c1b33;
  --card: rgba(255, 255, 255, 0.055);
  --card-hi: rgba(255, 255, 255, 0.1);
  --field: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f6ecdf;
  --muted: rgba(246, 236, 223, 0.64);
  --faint: rgba(246, 236, 223, 0.4);
  --accent: #ffb86b;
  --accent-hi: #ffc98a;
  --accent-deep: #ff9f5a;
  --accent-text: #ffc98a;
  --ink: #2a1608;
  --second: #f29ca8;
  --second-text: #f29ca8;
  --him: #9cc0ff;
  --her: #f29ca8;
  --ava-ink: #1b1428;
  --shine: rgba(255, 255, 255, 0.45);
  --lift: none;
  --float: var(--float);
  --nav: rgba(24, 17, 36, 0.78);
  --toast: rgba(40, 28, 52, 0.94);
  --toast-text: #f6ecdf;
  --off: #4a3a4f;
  --off-text: #a8989c;
  --glow-1: rgba(255, 150, 90, 0.2);
  --glow-2: rgba(242, 156, 168, 0.18);
  --light-0: #ffb86b;
  --light-1: #c8a6ff;
  --light-2: #ff9f5a;
  --light-3: #8f8cff;
  --sky: 1;
  --hot: #ffb86b;
  --cold: #8f8cff;
  --globe-sea-1: #3d3166;
  --globe-sea-2: #191230;
  --globe-land: #6d5879;
  --globe-coast: rgba(255, 208, 156, 0.55);
  --globe-border: rgba(246, 236, 223, 0.16);
  --globe-grid: rgba(246, 236, 223, 0.06);
  --globe-rim: rgba(255, 184, 107, 0.4);
  --globe-home: #f6ecdf;
}

/* tokens end */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--outer);
}

body {
  position: relative;
  width: var(--w);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 38%, var(--bg2) 100%) fixed;
  color: var(--text);
  font: 400 16px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body.paged {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- the sky */

#sky {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--edge);
  width: var(--w);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#sky::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -30%;
  height: 70%;
  background: radial-gradient(ellipse at 50% 100%, var(--glow-1), transparent 62%);
}

#sky i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 66%);
  opacity: calc(var(--o) * var(--sky));
  animation: drift var(--d) ease-in-out infinite alternate, twinkle var(--t) ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes drift {
  to {
    transform: translate3d(var(--dx), var(--dy), 0);
  }
}

@keyframes twinkle {
  from {
    opacity: calc(var(--o) * var(--sky) * 0.35);
  }
}

/* ---------------------------------------------------------- the layout */

#app {
  position: relative;
  z-index: 1;
  padding: 26px 20px calc(96px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

h1,
h2,
h3,
.serif {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 33px;
  line-height: 1.1;
  margin-top: 6px;
}

h2 {
  font-size: 27px;
  line-height: 1.12;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
}

.sect {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.sect small,
.hint {
  font-size: 13px;
  color: var(--faint);
}

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 16px;
}

.card,
.row,
.link-row,
.stat,
.seg,
.btn,
.chip {
  box-shadow: var(--lift);
}

/* a picture in place of an emoji: sized by the text around it */
.pic {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.3em;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------- buttons */

.main-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent-deep) 70%, transparent), inset 0 1px 0 var(--shine);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.main-fallback:active,
.btn:active,
.chip:active {
  transform: scale(0.97);
}

.btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-hi);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  color: var(--ink);
}

.btn.quiet {
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  box-shadow: none;
}

.two {
  display: flex;
  gap: 10px;
}

.two > * {
  flex: 1;
}

/* a line that has nothing to say takes no room */
.hint:empty {
  display: none;
}

/* something that waits without urgency: a day being looked for, an evening that did not happen */
.card.calm {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--text) 18%, transparent);
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.card.calm .invite-body {
  margin-top: 6px;
}

/* the day an evening was moved away from */
.plan-top.moved h1 {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* the colour of a trip's pin, next to its row */
.side .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}

/* "хочу сюда" on a trip, with a line about what it does */
.want {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-hi);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.2s ease;
}

.chip.quiet {
  background: transparent;
  color: var(--muted);
}

.chip.on {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 700;
}

.pill.rose {
  background: color-mix(in srgb, var(--second) 16%, transparent);
  color: var(--second-text);
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
}

.link-row.on {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.link-row.on span:last-child {
  color: var(--accent-text);
}

.link-row span:last-child {
  color: var(--faint);
  font-weight: 400;
}

/* ---------------------------------------------------------------- home */

.hero {
  position: relative;
  display: block;
  width: 100%;
  min-height: 196px;
  padding: 18px 132px 20px 18px;
  overflow: hidden;
  text-align: left;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--second) 10%, transparent) 55%, var(--card));
  box-shadow: 0 24px 60px -28px color-mix(in srgb, var(--accent-deep) 60%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hero .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hero h2 {
  font-size: 29px;
}

.hero-what {
  margin-top: 12px;
  font-weight: 700;
}

.hero-detail {
  margin-top: 2px;
  color: var(--muted);
}

.hero-art {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 100px;
  transform: translateY(-50%) rotate(4deg);
}

.hero-art .poster {
  box-shadow: 0 18px 34px -12px rgba(0, 0, 0, 0.7);
}

.hero-emoji {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 4%, transparent) 70%);
  font-size: 50px;
  transform: rotate(-4deg);
}

.empty {
  padding: 26px 20px;
  text-align: center;
}

.empty h3 {
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
}

/* all the evenings in a row */
.trail {
  display: flex;
  gap: 10px;
  margin: 0 -20px;
  padding: 2px 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.trail::-webkit-scrollbar {
  display: none;
}

.token {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 52px;
}

.token i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card-hi);
  font-style: normal;
  font-size: 21px;
}

.token small {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}

.token.soon i {
  border-color: color-mix(in srgb, var(--accent) 80%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.token.soon small {
  color: var(--accent-text);
}

.token.wait i {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--text) 45%, transparent);
  background: transparent;
}

.token.add i {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.trail-note {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

/* an incoming "хочу ..." and an invitation */
.wish-in {
  border-color: color-mix(in srgb, var(--second) 32%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--second) 18%, transparent), var(--card));
  box-shadow: 0 20px 50px -30px color-mix(in srgb, var(--second) 90%, transparent);
}

.wish-in-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.wish-in-top .big {
  font-size: 34px;
  line-height: 1;
}

.wish-in-top b {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.wish-in-top small {
  color: var(--faint);
  font-size: 13px;
}

/* the place a "хочу в поездку" is about */
.wish-in-top .where {
  display: block;
  margin: 2px 0 1px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--second-text);
}

.invite {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.invite-body {
  display: block;
  width: 100%;
  margin: 8px 0 14px;
  text-align: left;
}

.invite-body p {
  margin-top: 4px;
}

.invite-body p:first-of-type {
  font-weight: 700;
}

/* "Хочу ...": hold a tile to send it */
.wishes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.wish {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 10px 6px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--second) 20%, transparent);
  background: color-mix(in srgb, var(--second) 8%, transparent);
  touch-action: pan-y;
  -webkit-touch-callout: none;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.wish::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, color-mix(in srgb, var(--second) 55%, transparent), color-mix(in srgb, var(--accent) 40%, transparent));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
}

.wish.holding {
  transform: scale(0.95);
  box-shadow: 0 0 34px -6px color-mix(in srgb, var(--second) 80%, transparent);
}

.wish.holding::before {
  transform: scaleY(1);
  transition: transform 0.75s linear;
}

.wish.sent {
  animation: sent 0.6s ease;
}

@keyframes sent {
  30% {
    transform: scale(1.08);
    box-shadow: 0 0 46px 0 color-mix(in srgb, var(--accent) 90%, transparent);
  }
}

.wish i,
.wish span {
  position: relative;
  font-style: normal;
}

.wish i {
  font-size: 30px;
  line-height: 1;
}

.wish span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.wish.add {
  flex-direction: row;
  min-height: 52px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  background: transparent;
  color: var(--muted);
}

.wish.add i {
  font-size: 20px;
}

.spark {
  position: fixed;
  z-index: 60;
  font-size: 34px;
  pointer-events: none;
  animation: fly 1s ease-out forwards;
}

@keyframes fly {
  to {
    transform: translate(-50%, -190px) scale(1.5);
    opacity: 0;
  }
}

.wish-out {
  font-size: 14px;
  color: var(--muted);
}

.wish-out b {
  color: var(--accent-text);
}

/* --------------------------------------------------------------- lists */

.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
}

.row .thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--card-hi);
  font-size: 26px;
}

.row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row .thumb.tall {
  height: 78px;
}

.row .body {
  flex: 1;
  min-width: 0;
}

.row .body b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .body small {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
}

.row .body small.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row .side {
  flex: none;
  color: var(--faint);
  font-size: 13px;
}

.row.dim {
  opacity: 0.6;
}

.row.sel {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.row .body b.wrap {
  white-space: normal;
}

.ava {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: var(--ava-ink);
  font-size: 11.5px;
  font-weight: 700;
  font-style: normal;
  vertical-align: middle;
}

.ava.two {
  width: 26px;
  height: 26px;
  font-size: 10.5px;
  letter-spacing: -0.02em;
}

.ava + .ava {
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--bg1);
}

/* ------------------------------------------------------------- posters */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}

.tile-idea {
  display: block;
  text-align: left;
  min-width: 0;
}

.tile-idea > b {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-idea > small {
  display: block;
  color: var(--faint);
  font-size: 12px;
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 78% 14%, hsl(calc(var(--h) + 40) 80% 72% / 0.55), transparent 42%),
    linear-gradient(160deg, hsl(var(--h) 46% 34%), hsl(calc(var(--h) + 55) 52% 15%));
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.poster > span {
  color: #fbf3e8;
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.14;
  text-align: left;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.poster > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster > em {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  font-style: normal;
}

.poster .both {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--float);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.tile-idea.sel .poster {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 34px -4px color-mix(in srgb, var(--accent) 80%, transparent);
}

.tile-idea.done .poster {
  opacity: 0.5;
}

.tile-idea.plus .poster {
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed color-mix(in srgb, var(--text) 30%, transparent);
  color: var(--muted);
  font-size: 34px;
  font-weight: 300;
}

.seg {
  display: flex;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.seg button {
  flex: 1;
  min-height: 40px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14.5px;
  transition: background 0.2s ease, color 0.2s ease;
}

.seg button.on {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-text);
}

/* --------------------------------------------------------------- trips */

.globe-card {
  position: relative;
  margin: -4px 0 -6px;
}

.globe-card::before {
  content: "";
  position: absolute;
  inset: 6% 12%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 68%);
  filter: blur(26px);
  pointer-events: none;
}

.globe {
  position: relative;
  display: block;
  width: 100%;
  height: min(80vw, 330px);
  touch-action: pan-y;
  cursor: grab;
}

.globe-zoom {
  position: absolute;
  right: 0;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.globe-zoom button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--float);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}

.keys i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}

.flag {
  display: inline-block;
  flex: none;
  width: 30px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

.row .thumb img.flag {
  width: 36px;
  height: 27px;
}

.row .body small.when-line {
  color: var(--accent-text);
  font-weight: 700;
}

.trip-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.trip-name + .muted {
  margin-top: 8px;
}

.trip-name span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-top .trip-when {
  margin: 12px 0 0;
}

.plan-top .trip-when:empty {
  display: none;
}

.still {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.text-btn {
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.when {
  display: flex;
  gap: 10px;
}

.when label {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.when .field {
  min-width: 0;
  min-height: 50px;
  padding: 12px 10px;
}

.wx-sum {
  font-size: 14.5px;
  color: var(--muted);
}

.wx-sum b {
  color: var(--text);
}

/* two weeks ahead: a row of days to scroll */
.strip {
  display: flex;
  gap: 4px;
  margin: 0 -16px;
  padding: 2px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.day {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 58px;
  padding: 8px 2px;
  border-radius: 14px;
  font-size: 13px;
}

.day:first-child {
  background: var(--card-hi);
}

.day.in {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 80%, transparent);
}

.day-name {
  color: var(--muted);
  font-weight: 700;
}

.day.weekend .day-name {
  color: var(--second-text);
}

.day-date {
  color: var(--faint);
  font-size: 11.5px;
}

.day-icon {
  font-size: 23px;
  line-height: 1.2;
}

.day-max {
  font-size: 15.5px;
  font-weight: 700;
}

.day-min {
  color: var(--muted);
}

.day-rain {
  min-height: 1em;
  color: var(--him);
  font-size: 11.5px;
  font-weight: 700;
}

/* by month: a bar from the night to the day temperature, on one scale for the year */
.months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin: 0 -8px;
}

.month {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px 0;
  font-size: 10.5px;
}

.month-max {
  font-size: 11px;
  font-weight: 700;
}

.month-min {
  color: var(--muted);
}

.month-name {
  color: var(--muted);
  font-weight: 700;
}

.month.now .month-name {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.month.in {
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.month.in .month-name {
  color: var(--accent-text);
}

.bar {
  position: relative;
  width: 7px;
  height: 84px;
  border-radius: 4px;
  background: var(--card-hi);
}

.bar i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--lo);
  height: var(--h);
  min-height: 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--hot), var(--cold));
}

.month-rain {
  color: var(--him);
  font-size: 10.5px;
}

/* --------------------------------------------------------------- pages */

#page {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--edge);
  width: var(--w);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 20px calc(110px + var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 50% 112%, var(--glow-1), transparent 55%),
    radial-gradient(circle at 88% -4%, var(--glow-2), transparent 38%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 40%, var(--bg2) 100%);
}

#page > * {
  flex: none;
}

#page.in {
  animation: slide 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide {
  from {
    transform: translateY(26px);
    opacity: 0;
  }
}

body.has-page-back #page {
  padding-top: 70px;
}

.back-fallback {
  position: fixed;
  top: 16px;
  left: calc(var(--edge) + 16px);
  z-index: 45;
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--float);
  font-size: 26px;
  line-height: 1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.has-page-back .back-fallback {
  display: block;
}

.main-fallback {
  position: fixed;
  left: calc(var(--edge) + 16px);
  bottom: calc(16px + var(--safe-b));
  z-index: 45;
  width: calc(var(--w) - 32px);
}

.main-fallback:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.steps {
  display: flex;
  gap: 6px;
}

.steps i {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--card-hi);
}

.steps i.on {
  background: linear-gradient(90deg, var(--accent-hi), var(--accent-deep));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
}

.field {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field);
  outline: none;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.field:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.field::placeholder {
  color: var(--faint);
}

textarea.field {
  min-height: 84px;
  resize: none;
}

label.lbl {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/* the calendar */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-head h3 {
  text-transform: capitalize;
}

.cal-head button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-hi);
  font-size: 20px;
}

.cal-head button:disabled {
  opacity: 0.25;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-week span {
  padding-bottom: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cal-day:active {
  transform: scale(0.92);
}

.cal-day.past {
  color: var(--faint);
  opacity: 0.5;
  pointer-events: none;
}

.cal-day.me {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.cal-day.they {
  border-color: color-mix(in srgb, var(--second) 65%, transparent);
  border-style: dashed;
}

.cal-day.both {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 90%, transparent);
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--accent) 42%, transparent), color-mix(in srgb, var(--accent) 14%, transparent));
  box-shadow: 0 0 20px -2px color-mix(in srgb, var(--accent) 60%, transparent);
}

.cal-day.sel {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  color: var(--ink);
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--accent-deep) 80%, transparent);
}

.cal-day.today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

.cal-day u {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--second);
  box-shadow: 0 0 6px var(--second);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  vertical-align: -2px;
}

.legend u {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--second);
  vertical-align: 1px;
}

/* a day of a trip that has its dates: a short bar, told from the dot of an evening by its shape too */
.cal-day u.trip {
  top: 6px;
  right: auto;
  left: 5px;
  width: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--cold);
  box-shadow: none;
}

.legend u.trip {
  width: 11px;
  height: 4px;
  border-radius: 2px;
  background: var(--cold);
  vertical-align: 3px;
}

.legend i.they {
  border-color: color-mix(in srgb, var(--second) 65%, transparent);
  border-style: dashed;
}

.legend i.both {
  border-color: color-mix(in srgb, var(--accent) 90%, transparent);
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* what an evening can be: a tap leads to choosing what exactly, then when */
.starts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 12px 6px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--lift);
  transition: transform 0.15s ease;
}

.start:active {
  transform: scale(0.96);
}

.start i {
  font-style: normal;
  font-size: 32px;
  line-height: 1;
}

.start span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

/* the "+" in the row of evenings points here */
.starts.nudge .start {
  animation: nudge 0.5s ease;
}

.starts.nudge .start:nth-child(3n + 2) {
  animation-delay: 0.06s;
}

.starts.nudge .start:nth-child(3n) {
  animation-delay: 0.12s;
}

@keyframes nudge {
  40% {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  }
}

/* a plan, an idea */
.plan-top {
  text-align: center;
}

.plan-top .pills {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.plan-top h1 {
  font-size: 34px;
}

.plan-top .what {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
}

.plan-art {
  display: block;
  width: 46%;
  margin: 4px auto 0;
}

.plan-art .poster {
  box-shadow: 0 26px 60px -22px color-mix(in srgb, var(--accent-deep) 70%, transparent);
}

.plan-emoji {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 3%, transparent) 70%);
  font-size: 64px;
}

.center {
  text-align: center;
}

.photo {
  width: 100%;
  border-radius: 20px;
}

.memo {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.memo .ava {
  flex: none;
  margin-top: 3px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stepper div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-hi);
  font-size: 20px;
  line-height: 1;
}

.stepper b {
  min-width: 26px;
  text-align: center;
  font-size: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 16px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: center;
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-text);
}

.stat small {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.memory {
  display: block;
  width: 100%;
  text-align: left;
}

.memory .when {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--faint);
}

.memory .photo {
  margin: 10px 0 4px;
  max-height: 260px;
  object-fit: cover;
}

.memory .memo {
  margin-top: 10px;
}

.memory .hint {
  margin-top: 8px;
}

/* ----------------------------------------------------------------- nav */

#nav {
  position: fixed;
  left: var(--edge);
  bottom: 0;
  z-index: 20;
  display: flex;
  width: var(--w);
  padding: 6px 12px calc(6px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--nav);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

#nav button {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 700;
  transition: color 0.2s ease;
}

#nav button[hidden] {
  display: none;
}

/* the tab named after the other one: a long name is cut, a number says what waits for an answer */
#nav button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nav .badge {
  position: absolute;
  top: 1px;
  left: calc(50% + 5px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--second);
  color: var(--bg0);
  font-size: 10.5px;
  font-style: normal;
  line-height: 17px;
  text-align: center;
}

#nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#nav button.on {
  color: var(--accent-text);
}

#nav button.on svg {
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 90%, transparent));
}

#toast {
  color: var(--toast-text);
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  z-index: 70;
  max-width: calc(var(--w) - 48px);
  padding: 11px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--toast);
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.gate {
  display: grid;
  place-content: center;
  gap: 10px;
  min-height: 80dvh;
  text-align: center;
}

.gate p {
  color: var(--muted);
}

#dev-theme {
  top: 42px !important;
}

#dev,
#dev-theme {
  position: fixed;
  top: 10px;
  right: calc(var(--edge) + 10px);
  z-index: 80;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--float);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
