/* Site chrome. Never changes between calendar themes. */
:root {
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --ink: #18213A;
  --muted: #4A5571;
  --muted-2: #556079;
  --line: #DCE1EA;
  --field: #B9C2D2;
  --accent: #2B54E0;
  --accent-ink: #2443B8;
  --accent-soft: #EEF2FD;
  --danger: #B3261E;
  --danger-soft: #FDECEC;
  --ok: #1E6B3A;
  --warn-bg: #FFF6E0;
  --warn-line: #E8D29A;
  --warn-ink: #4D4223;
  --head: 'Playfair Display', Georgia, serif;
  --text: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); }
a:hover { color: #1C3BB0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (min-width: 720px) { .wrap { padding-left: 32px; padding-right: 32px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.brand-name { font-family: var(--head); font-weight: 700; letter-spacing: -0.01em; }

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0;
  font-weight: 600; font-size: 16px; text-decoration: none; text-align: center;
  background: var(--accent); color: #FFFFFF;
}
.btn:hover { background: #2347C4; color: #FFFFFF; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 28px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-outline { background: transparent; color: var(--accent-ink); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: rgba(24, 33, 58, 0.06); color: var(--ink); }
.btn-text { background: transparent; color: var(--accent-ink); min-height: 44px; padding: 0 10px; }
.btn-text:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: rgba(24, 33, 58, 0.07); }

/* Language picker: a compact dropdown (js/lang-picker.js) ------------ */
.lang-picker { position: relative; display: inline-flex; flex: 0 0 auto; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 12px;
  border: 1px solid #C9D0DC; border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 14px/1 var(--text); letter-spacing: 0.02em;
}
.lp-btn:hover { background: rgba(24, 33, 58, 0.06); }
.lp-chev { transition: transform 0.15s ease; }
.lang-picker.is-open .lp-chev { transform: rotate(180deg); }
.lp-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; min-width: 184px;
  margin: 0; padding: 6px; list-style: none; border-radius: 14px;
  background: #FFFFFF; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(10, 18, 40, 0.22);
}
.lp-menu[hidden] { display: none; }
.lp-menu button {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: 500 16px/1.2 var(--text); text-align: left;
}
.lp-menu button:hover, .lp-menu button:focus-visible { background: var(--accent-soft); }
.lp-menu button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.lp-menu button[aria-checked="true"] { font-weight: 700; }
.lp-tick { color: var(--accent); visibility: hidden; }
.lp-menu button[aria-checked="true"] .lp-tick { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .lp-chev { transition: none; } }

/* Forms --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--field); border-radius: 12px; background: #FFFFFF; color: var(--ink);
  font-size: 16px;
}
.textarea { padding: 12px; line-height: 1.45; resize: vertical; min-height: 96px; }
.textarea::placeholder, .input::placeholder { color: #6B7590; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.form-msg { font-size: 14px; line-height: 1.45; min-height: 0; }
.form-msg.is-error { color: var(--danger); }
.form-msg.is-ok { color: var(--ok); }
.char-count { font-size: 13px; color: var(--muted-2); text-align: right; }

/* Subscribe form ------------------------------------------------------ */
.subscribe { display: flex; flex-direction: column; gap: 12px; }
.subscribe-row { display: flex; flex-wrap: wrap; gap: 10px; }
.subscribe-row .input { flex: 1 1 220px; min-height: 52px; font-size: 17px; }
.subscribe-row .btn { min-height: 52px; }

/* Landing ------------------------------------------------------------- */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 18px; padding-bottom: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.logo .brand-name { font-size: 20px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.site-nav .nav-link { color: var(--ink); text-decoration: none; font-weight: 500; min-height: 44px; display: none; align-items: center; }
@media (min-width: 820px) { .site-nav .nav-link { display: inline-flex; } }
.site-nav .btn { min-height: 44px; }
@media (max-width: 640px) { .site-nav .btn { display: none; } }
/* "My calendars" stays visible on phones too. */
.site-nav .nav-my { display: inline-flex; }
/* Phones: logo, "My calendars" and the language picker share one row in every language. */
@media (max-width: 480px) {
  .site-header { gap: 8px; flex-wrap: nowrap; }
  .site-header .logo { gap: 8px; flex: 0 0 auto; }
  .site-header .logo .brand-name { font-size: 18px; }
  .site-header .site-nav { gap: 4px; flex-wrap: nowrap; flex: 0 1 auto; min-width: 0; }
  .site-nav .nav-my { font-size: 15px; padding: 0 6px; text-align: right; line-height: 1.2; min-width: 0; }
  .site-header .lp-btn { padding: 0 8px 0 10px; gap: 4px; }
}
/* The narrowest phones: "My calendars" stays on one line next to the logo and language. */
@media (max-width: 359px) {
  .site-header .logo .brand-name { font-size: 16px; }
  .site-nav .nav-my { font-size: 13px; padding: 0 4px; white-space: nowrap; }
  .site-header .lp-btn { padding: 0 6px 0 8px; gap: 2px; }
}
.app-header .header-my { margin-left: auto; font-weight: 600; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent-ink); }

/* My calendars (/my) ---------------------------------------------------- */
.my-page { max-width: 640px; padding-top: 12px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 16px; }
.my-page h1 { font-family: var(--head); font-weight: 700; font-size: clamp(30px, 6vw, 40px); line-height: 1.1; }
.my-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.my-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.my-card h2 { font-family: var(--head); font-weight: 700; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.my-for { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.my-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.my-actions .btn { width: 100%; }
.my-actions .my-remove { color: var(--danger); align-self: flex-start; width: auto; }
.my-actions .my-remove:hover { background: var(--danger-soft); color: var(--danger); }
@media (min-width: 640px) {
  .my-actions { flex-direction: row; flex-wrap: wrap; }
  .my-actions .btn { width: auto; }
}
.my-empty { background: #FFFFFF; border: 1px dashed var(--field); border-radius: 16px; padding: 24px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 64px; padding-top: 24px; padding-bottom: 72px; }
.hero-copy { flex: 1.4 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-family: var(--head); font-weight: 700; font-size: clamp(32px, 5vw, 66px); line-height: 1.07; letter-spacing: -0.025em; }
@media (max-width: 359px) { .hero h1 { font-size: 28px; } }
.hero .lead { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { font-size: 15px; color: var(--muted-2); }
.section-white { background: #FFFFFF; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 40px; }
.h2 { font-family: var(--head); font-weight: 700; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.14; letter-spacing: -0.02em; max-width: 17em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.steps li { display: flex; flex-direction: column; gap: 12px; }
.step-num { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 18px; }
.steps h3 { font-size: 22px; font-weight: 600; }
.steps p { font-size: 17px; line-height: 1.55; color: var(--muted); }
.section-dark { background: var(--ink); color: #F3F5F8; }
.section-dark .h2 { color: #FFFFFF; }
.section-dark .lead { color: #B8C1D6; font-size: 18px; line-height: 1.55; }
.news-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 24px; padding: 28px 20px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
@media (min-width: 720px) { .news-card { padding: 48px; } }
.news-card > div, .news-card > form { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.news-card .h3 { font-family: var(--head); font-weight: 700; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.02em; }
.news-card p { font-size: 17px; line-height: 1.6; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 36px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 15px; color: var(--muted-2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--muted-2); min-height: 44px; display: inline-flex; align-items: center; }

/* Landing: hero, "behind every door", showcase, pricing --------------------- */
.hero-art { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-card { width: 300px; max-width: 100%; transform: rotate(2.5deg); }
.hero-caption { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.badge-gold { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 5px 11px; border-radius: 999px; background: linear-gradient(180deg, #F7E3A3, #D9AE55); color: #3A2410; max-width: 100%; }
.behind { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 48px 72px; }
.behind-art { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.behind-phone { width: 340px; max-width: 100%; border-radius: 28px; background: #101B3B; padding: 26px 18px 18px; box-shadow: 0 30px 60px -28px rgba(16, 27, 59, 0.6); }
.behind-sheet { background: #FBF4E2; color: #1B2440; border-radius: 20px; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid #E2C275; }
.small-date { font-size: 13px; color: #5A5440; }
.ex-kind { margin-top: 2px; font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 600; font-size: 30px; line-height: 1.05; }
.ex-photo { display: block; width: 100%; height: 150px; border-radius: 12px; }
.ex-text { font-size: 17px; line-height: 1.5; }
.ex-voice, .ex-song { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.ex-voice { background: #EDE3C8; }
.ex-song { border: 1px solid #D9CCA8; }
.ex-play { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: #1B2440; color: #FBF4E2; display: flex; align-items: center; justify-content: center; }
.ex-note { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: #1B2440; color: #FBF4E2; display: flex; align-items: center; justify-content: center; }
.behind .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.ex-bar { height: 4px; border-radius: 999px; background: #CDBF98; }
.ex-time { font-size: 13px; color: #5A5440; }
.ex-prov { font-size: 12px; font-weight: 400; color: #5A5440; }
.ex-playtext { font-size: 13px; font-weight: 600; }
.behind-copy { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.feat { display: flex; gap: 16px; align-items: flex-start; }
.feat-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.feat h3 { font-size: 19px; font-weight: 600; }
.feat p { margin-top: 4px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.designs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.designs-head > div:first-child { display: flex; flex-direction: column; gap: 12px; max-width: 36em; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); gap: 4px; }
.tab { border: 0; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; background: transparent; color: #C9D0E2; }
.tab[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); }
.section-dark :focus-visible { outline-color: #FFFFFF; }
.showcase { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.stage { flex: 0 0 auto; width: 300px; max-width: 100%; }
.ds-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ds-intro { font-size: 15px; color: #DDE3F0; }
.ds-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-content: start; }
.ds-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); text-align: left; color: #FFFFFF; min-height: 72px; }
.ds-item.on { background: rgba(255, 255, 255, 0.14); border-color: #FFFFFF; }
.ds-name { display: block; font-size: 16px; font-weight: 600; }
.ds-line { display: block; font-size: 13px; line-height: 1.4; color: #B8C1D6; margin-top: 2px; }
.lpanel { width: 300px; max-width: 100%; padding: 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; }
.lpanel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lpanel-grid .door { aspect-ratio: 1 / 1; font-size: 16px; }
.plans { display: flex; flex-wrap: wrap; gap: 24px; }
.plan { flex: 1 1 320px; min-width: 0; border-radius: 24px; padding: 28px 22px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 720px) { .plan { padding: 36px; } }
.plan-free { background: #FFFFFF; border: 1px solid var(--line); }
.plan-premium { background: var(--ink); color: #FFFFFF; box-shadow: 0 30px 60px -30px rgba(16, 27, 59, 0.7); }
.plan-top { display: flex; flex-direction: column; gap: 6px; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan h3 { font-size: 24px; font-weight: 600; }
.plan .price { font-family: var(--head); font-weight: 700; font-size: 36px; }
.plan-sub { font-size: 15px; color: var(--muted); }
.plan-premium .plan-sub { color: #C9D0E2; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.45; }
.plan li svg { flex: 0 0 auto; margin-top: 2px; }
.plan .btn { margin-top: auto; }
.plan .btn + .btn { margin-top: 10px; }
.plan-premium :focus-visible { outline-color: #FFFFFF; }
.plan-premium .btn-outline { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.7); }
.plan-premium .btn-outline:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.btn-gold { background: linear-gradient(180deg, #F7E3A3, #D9AE55); color: #3A2410; }
.btn-gold:hover { background: linear-gradient(180deg, #F9E9B6, #DDB866); color: #3A2410; }

/* App screens (create, edit, links) ------------------------------------ */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 0; min-height: 52px; }
.app-header h1 { font-family: var(--head); font-weight: 700; font-size: 18px; text-align: center; flex: 1 1 auto; }
/* Longer titles (Russian, Polish, Belarusian) stay on one line on a 390 px phone. */
@media (max-width: 400px) { .app-header h1 { font-size: 16px; } }
/* 320-359 px phones: the header (back, title, preview, language) never gets wider than the screen. */
.app-header > * { min-width: 0; }
.app-header h1 { overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .app-header { gap: 4px; padding: 8px 4px 0; }
  .app-header h1 { font-size: 15px; }
  .app-header .btn-text { padding-left: 6px; padding-right: 6px; }
  .app-header .lp-btn { padding: 0 6px 0 8px; gap: 2px; }
}
.back-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: transparent; border: 0; border-radius: 50%; text-decoration: none; flex: 0 0 auto; }
.back-btn:hover { background: rgba(24, 33, 58, 0.07); color: var(--ink); }
.step-of { margin-right: 12px; font-size: 14px; color: var(--muted); }
.app-body { padding: 4px 20px 140px; display: flex; flex-direction: column; gap: 20px; }
.app-title { font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.app-sub { font-size: 15px; line-height: 1.45; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
}
.bottom-bar > div { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.bottom-bar .note { text-align: center; font-size: 13px; color: var(--muted-2); }
.bottom-bar .form-msg { text-align: center; }

.audiences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.audience {
  min-height: 72px; padding: 12px; border-radius: 14px; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  background: #FFFFFF; border: 1px solid var(--line); color: var(--ink);
}
.audience[aria-checked="true"] { background: var(--accent-soft); border: 2px solid var(--accent); padding: 11px; }
.audience b { font-size: 16px; font-weight: 600; }
.audience span { font-size: 13px; line-height: 1.35; color: var(--muted); }

.tz-picker { position: relative; }
.tz-button { width: 100%; min-height: 48px; padding: 6px 12px; text-align: left; border: 1.5px solid var(--field); border-radius: 12px; background: #FFFFFF; font-size: 15px; line-height: 1.3; }
.tz-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #FFFFFF; display: flex; flex-direction: column; gap: 8px; }
.tz-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.tz-list button { width: 100%; min-height: 44px; padding: 6px 10px; text-align: left; border: 0; border-radius: 10px; background: transparent; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.tz-list button:hover, .tz-list button[aria-selected="true"] { background: var(--accent-soft); }
.tz-list small { color: var(--muted); white-space: nowrap; }

/* Step 2 ----------------------------------------------------------------- */
.progress-text { font-size: 14px; color: var(--muted); }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width 0.2s; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head h2 { font-size: 15px; font-weight: 600; }
.section-head p { font-size: 14px; color: var(--muted); }
.swatches { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 8px; margin: 0 -4px; scrollbar-width: thin; }
.swatch {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; padding: 0; border: 0;
  display: flex; align-items: center; justify-content: center;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.swatch .door { width: 20px; height: 24px; font-size: 11px; border-radius: 3px; }
.swatch .door { outline-offset: -3px; }
.door-list { display: flex; flex-direction: column; gap: 10px; }
.door-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 64px; border: 1px solid var(--line); border-radius: 14px; background: #FFFFFF; color: var(--ink);
}
.door-row.is-empty { border: 1.5px dashed var(--field); background: transparent; }
.door-row .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.door-row .kind { font-size: 13px; color: var(--muted); }
.door-row .preview { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door-row.is-empty .preview { color: var(--muted); }
.door-row .icons { display: flex; gap: 4px; color: var(--muted); flex: 0 0 auto; }
.badge { flex: 0 0 auto; width: 40px; height: 40px; font-size: 17px; }
.badge-empty { flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--muted-2); border: 1.5px dashed #9AA5BA; border-radius: 10px; }
.door-editor { border: 2px solid var(--accent); border-radius: 16px; background: #FFFFFF; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 12px; }
.door-editor-head { display: flex; align-items: center; gap: 12px; }
.door-editor-head h2 { font-size: 17px; font-weight: 600; flex: 1 1 auto; }
.ideas { background: var(--accent-soft); border-radius: 12px; padding: 12px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.ideas > p, .ideas .idea-actions, .ideas .idea-text { margin: 0 14px; }
.ideas-title { font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 14px 4px; scrollbar-width: thin; }
.chip {
  flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 12px; border-radius: 999px;
  font-weight: 500; font-size: 14px; border: 1.5px solid #C9D0DC; background: #FFFFFF; color: var(--ink);
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
.idea-text { font-size: 16px; line-height: 1.45; min-height: 46px; }
.idea-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 13px; padding-left: 10px; border-radius: 999px; background: #F3F5F8; border: 1px solid var(--line); color: var(--muted); }
.label-chip .icon-btn { width: 36px; height: 36px; position: relative; }
/* 44 px finger target around the small drawn button. */
.label-chip .icon-btn::before { content: ""; position: absolute; inset: -4px; }
.attach-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.attach-btn {
  min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; font-weight: 500; font-size: 13px; padding: 6px 4px; text-align: center;
  border: 1.5px solid #C9D0DC; background: #FFFFFF; color: var(--ink);
}
.attach-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.attach-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: #F3F5F8; }
.attach-panel .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.attach-panel .hint { font-size: 13px; line-height: 1.4; color: var(--muted); }
.photo-preview { position: relative; border-radius: 12px; overflow: hidden; background: #E4E8EF; }
.photo-preview img { width: 100%; max-height: 360px; object-fit: contain; }
.photo-preview .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(243, 245, 248, 0.75); font-weight: 600; }
.upload-bar { height: 6px; width: 70%; max-width: 240px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-bar > div { height: 100%; background: var(--accent); width: 0; }
.rec-box { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--danger-soft); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #C8102E; flex: 0 0 auto; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.35; } }
.rec-box .grow { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.rec-box .btn { background: #C8102E; }
.player { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--accent-soft); }
.player .grow { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.player .play { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.player .bar { height: 4px; border-radius: 999px; background: #C5D0F2; overflow: hidden; }
.player .bar > div { height: 100%; width: 0; background: var(--accent); }
.player .time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.link-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: #FFFFFF; }
.link-card .ico { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; background: var(--ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.link-card .meta { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-card .meta span:first-child { font-size: 13px; color: var(--muted); }
.link-card .meta span:last-child { font-size: 15px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.space-note { font-size: 13px; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 8px 10px; }
.danger-zone { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* Links screen ---------------------------------------------------------- */
.links-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.links-card.is-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.links-card.is-warn p.muted { color: var(--warn-ink); }
.links-card h2 { font-size: 18px; font-weight: 600; }
.link-box { padding: 12px; border-radius: 10px; background: var(--bg); font-size: 15px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.links-card.is-warn .link-box { background: #FFFFFF; }
.btn-pair { display: flex; gap: 8px; }
.btn-pair .btn { flex: 1 1 0; }

/* Toast ------------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  width: calc(100% - 40px); max-width: 480px; padding: 14px 16px; border-radius: 12px;
  background: #F3F5F8; color: var(--ink); font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.app .toast { background: var(--ink); color: #FFFFFF; }

/* Legal pages ------------------------------------------------------------ */
.legal { max-width: 760px; padding-top: 12px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 16px; }
.legal h1 { font-family: var(--head); font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
.legal h2 { font-size: 20px; margin-top: 16px; }
.legal p, .legal li { font-size: 16px; line-height: 1.65; color: #2A3450; }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.draft-banner { padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-weight: 600; }

/* Page-level messages --------------------------------------------------- */
.center-msg { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 40px 20px; }
.center-msg h1 { font-family: var(--head); font-size: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Premium sheet, design picker badges, settings ------------------------------ */
.upgrade { width: 100%; max-width: 560px; background: #FFFFFF; color: var(--ink); border-radius: 24px 24px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow-y: auto; }
.upgrade-head { display: flex; justify-content: space-between; align-items: center; }
.upgrade h2 { font-family: var(--head); font-size: 20px; line-height: 1.25; }
.upgrade-price { font-size: 15px; color: var(--muted); }
.upgrade-price b { font-family: var(--head); font-size: 22px; color: var(--ink); }
.upgrade ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upgrade li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.upgrade li svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.upgrade-action { display: flex; flex-direction: column; gap: 10px; }
.upgrade-beta { font-size: 14px; line-height: 1.5; color: var(--muted); }
.swatch { position: relative; }
.pdot { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, #F7E3A3, #D9AE55); border: 2px solid var(--bg); }
.pchip { display: inline-flex; align-items: center; font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: linear-gradient(180deg, #F7E3A3, #D9AE55); color: #3A2410; margin-left: 6px; }
.section-head p { display: flex; align-items: center; }
.cover-card { border: 1px solid var(--line); border-radius: 16px; background: #FFFFFF; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cover-card h2 { font-size: 15px; font-weight: 600; }
.cover-preview { position: relative; border-radius: 12px; overflow: hidden; background: #1D2440; aspect-ratio: 2 / 3; max-height: 320px; align-self: center; width: min(100%, 213px); }
.cover-preview > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview .cover-tiles { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; height: 100%; }
.cover-preview .cover-tiles img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(243, 245, 248, 0.8); font-weight: 600; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 17px; font-weight: 600; }
.card p { font-size: 15px; line-height: 1.5; color: var(--muted); }
.card .fine { font-size: 13px; color: var(--muted-2); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sw { flex: 0 0 auto; width: 52px; height: 32px; border-radius: 999px; border: 0; padding: 3px; display: flex; align-items: center; background: #B9C2D2; transition: background 0.2s; position: relative; }
/* The finger target is 44 px even though the drawn switch is 32 px tall. */
.sw::before { content: ""; position: absolute; inset: -6px -4px; }
.sw span { width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"] span { transform: translateX(20px); }
.kchips { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #C9D0DC; background: #FFFFFF; color: var(--ink); font-weight: 500; font-size: 14px; }
.kchip[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
.keep-row { display: flex; align-items: center; gap: 10px; }
.keep-row label { font-size: 14px; font-weight: 600; flex: 0 1 auto; }
/* The date field shrinks with the screen instead of running off its right edge. */
.keep-row .input { min-height: 44px; flex: 1 1 auto; min-width: 0; max-width: 100%; }
.danger-btn { min-height: 52px; border-radius: 14px; border: 1.5px solid #B42318; background: #FFFFFF; color: #B42318; font-weight: 600; font-size: 16px; }
.danger-btn:hover { background: var(--danger-soft); }
.album-overlay { position: fixed; inset: 0; z-index: 50; overflow-y: auto; }

/* Demo calendars (design picker, landing showcase) ------------------------- */
.pc-like { position: absolute; left: 0; top: 0; transform-origin: top left; }
.cframe { width: 300px; height: 540px; display: flex; flex-direction: column; justify-content: center; border-radius: 26px; overflow: hidden; box-shadow: 0 24px 50px -24px rgba(16, 27, 59, 0.55); }
.cframe > .lpanel { width: 300px; height: 540px; max-width: none; border-radius: 0; justify-content: center; }
.lpanel-grid button.door { padding: 0; cursor: pointer; }
.lpanel-grid .door.is-past { opacity: 0.55; }
.lpanel-grid .door.is-today { box-shadow: 0 0 0 3px #FFD36B, 0 0 20px rgba(255, 211, 107, 0.85); }
.lpanel-grid .door.pop { animation: doorpop 0.6s ease; }
@keyframes doorpop { 0% { transform: scale(1); } 40% { transform: scale(1.15) rotate(-4deg); } 100% { transform: scale(1); } }
.lpanel-grid .door:focus-visible { outline: 3px solid #2B54E0; outline-offset: 2px; }

/* Design picker (step 2), like the "Pick a design" prototype ------------------- */
.picker { display: flex; flex-direction: column; gap: 14px; }
.picker-tabs { display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 999px; background: #FFFFFF; border: 1px solid var(--line); gap: 4px; }
.picker-tabs button { border: 0; min-height: 44px; padding: 0 18px; border-radius: 999px; background: transparent; font-weight: 600; font-size: 15px; color: var(--muted); }
.picker-tabs button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 8px 20px 10px; margin: 0 -20px; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: thin; }
.pick { flex: 0 0 auto; width: 96px; border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; scroll-snap-align: start; color: var(--ink); }
.pick .mwrap { position: relative; border-radius: 14px; width: 96px; height: 173px; }
.pick .mini { width: 96px; height: 173px; border-radius: 12px; overflow: hidden; pointer-events: none; }
.pick .mini .pc, .pick .mini .cframe { box-shadow: none; }
.pick[aria-pressed="true"] .mwrap { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.pick .pdot { right: -6px; top: -6px; width: 18px; height: 18px; z-index: 2; }
.pick .nm { font-size: 13px; font-weight: 600; line-height: 1.25; }
.selinfo { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; scroll-margin-top: 16px; }
.selinfo b { font-size: 20px; font-weight: 600; }
.selinfo p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.design-preview { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.design-preview .live { width: min(100%, 320px); }
.design-preview .note { font-size: 13px; color: var(--muted); text-align: center; }

/* Wider screens ------------------------------------------------------------ */
.step2-aside { display: none; }
@media (min-width: 768px) {
  .app { padding-top: 12px; }
  .confirm-backdrop { align-items: center; padding: 24px; }
  .confirm, .upgrade { border-radius: 24px; max-width: 480px; }
}
@media (min-width: 1024px) {
  .app[data-screen="step2"] { max-width: 1000px; }
  .step2-layout { display: grid; grid-template-columns: minmax(0, 560px) 360px; gap: 40px; justify-content: center; align-items: start; }
  .step2-aside { display: block; position: sticky; top: 16px; padding-top: 24px; }
  .step2-aside .design-preview .live { width: 100%; }
  #screen-step2 .bottom-bar > div { max-width: 960px; display: grid; grid-template-columns: minmax(0, 560px) 360px; column-gap: 40px; row-gap: 6px; }
  #screen-step2 .bottom-bar > div > * { grid-column: 1; }
}
.cover-need { color: var(--muted); font-weight: 600; }

/* Confirmation dialog (partials.js confirmDialog): a bottom sheet on phones, a centred dialog on computers. */
.confirm-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(6, 10, 28, 0.72); display: flex; align-items: flex-end; justify-content: center; }
.confirm { width: 100%; max-width: 560px; background: #FBF4E2; color: #1B2440; border-radius: 24px 24px 0 0; padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; border-top: 4px solid #E2C275; }
.confirm.is-light { background: #FFFFFF; color: var(--ink); border-top: 0; }
.confirm h2 { font-size: 20px; font-weight: 600; }
.confirm p { font-size: 16px; line-height: 1.5; }
.confirm .go { min-height: 52px; border: 0; border-radius: 14px; background: #B42318; color: #FFFFFF; font: 600 16px var(--text); }
.confirm .keep { min-height: 52px; border: 1.5px solid currentColor; border-radius: 14px; background: transparent; color: inherit; font: 600 16px var(--text); }
.confirm :focus-visible { outline: 3px solid #2B54E0; outline-offset: 2px; }
@media (min-width: 768px) {
  .confirm-backdrop { align-items: center; padding: 24px; }
  .confirm { border-radius: 24px; padding-bottom: 24px; }
}
#change-tz { padding-inline: 2px; }

/* Premium codes, "Have a code?", email-my-links, AI ideas ---------------- */
.my-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.code-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.code-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.code-list code { font: 700 18px/1.2 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: 0.06em; color: var(--ink); }
.code-details { margin-top: 6px; }
.code-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent-ink); }
.code-form { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-row .input { flex: 1 1 160px; text-transform: uppercase; letter-spacing: 0.06em; }
.consent-check { align-items: flex-start; }
.upgrade-pack, .upgrade-fine { font-size: 14px; color: var(--muted); }
.ai-ideas { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.ai-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-list li { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.links-email h2 { font-size: 18px; font-weight: 600; }
.ai-ideas .fine { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Questions and answers ---------------------------------------------------- */
.faq-section { gap: 24px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.faq-item { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; }
.faq-item > summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font-weight: 600; font-size: 17px; list-style: none; gap: 12px; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: '+'; margin-left: auto; font-size: 22px; color: var(--accent-ink); }
.faq-item[open] > summary::after { content: '−'; }
.faq-item > p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
/* Autosave: one quiet line above the save button ("Saved ✓", "Saving…", offline with retry). */
.autosave { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 8px; min-height: 20px; font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }
.autosave.is-ok { color: var(--ok); }
.autosave.is-offline, .autosave.is-error { color: var(--danger); }
.autosave .btn-text { min-height: 36px; font-size: 13px; padding: 0 8px; position: relative; }
.autosave .btn-text::before { content: ""; position: absolute; inset: -4px 0; }
.draft-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; border-radius: 14px; background: #EEF2FD; color: var(--ink); font-size: 14px; }
.draft-note[hidden] { display: none; }
