:root {
  --ink: #20303a;
  --muted: #667781;
  --cream: #fff8ef;
  --paper: rgba(255, 255, 255, .88);
  --coral: #ef715b;
  --coral-dark: #c94f3c;
  --teal: #237a79;
  --line: rgba(32, 48, 58, .13);
  --shadow: 0 18px 55px rgba(58, 45, 35, .14);
  --radius: 28px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 8% 0%, #ffe0c1 0, transparent 35%), radial-gradient(circle at 95% 12%, #c6ece5 0, transparent 32%), var(--cream); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal); text-underline-offset: .2em; }
h1, h2, p { margin-top: 0; }
.eyebrow { display: block; margin-bottom: .55rem; color: var(--coral-dark); font-size: .76rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.brand { color: var(--ink); font-size: 1.15rem; font-weight: 900; text-decoration: none; letter-spacing: -.03em; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 1rem; max-width: 1240px; margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) clamp(1.15rem, 5vw, 4rem) .45rem; }
.hero-copy { min-width: 0; }
.hero .eyebrow { margin-bottom: .3rem; font-size: .68rem; }
.hero h1 { max-width: 850px; margin-bottom: .2rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: .96; letter-spacing: -.055em; }
.hero p { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: clamp(.86rem, 1.5vw, 1rem); }
.view-switch { display: inline-flex; flex: 0 0 auto; gap: .1rem; padding: .15rem; border: 1px solid rgba(32,48,58,.08); border-radius: 11px; background: rgba(255,255,255,.28); opacity: .72; transition: opacity .2s ease; }
.view-switch:hover, .view-switch:focus-within { opacity: 1; }
.view-switch button { display: inline-flex; align-items: center; gap: .25rem; min-height: 30px; padding: .35rem .5rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .7rem; font-weight: 700; cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: rgba(32,48,58,.09); color: var(--ink); }
#countdown-app { max-width: 1240px; min-height: 0; margin: 0 auto; padding: .25rem clamp(1rem, 5vw, 4rem) 1.25rem; }
.countdown-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(88%, 820px); gap: 1rem; overflow-x: auto; padding: .25rem .1rem .65rem; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-inline: contain; }
.countdown-track::-webkit-scrollbar { display: none; }
.layout-grid .countdown-track { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); grid-auto-columns: auto; overflow: visible; }
.countdown-card { position: relative; display: flex; height: clamp(360px, calc(100svh - 225px), 520px); min-height: 360px; overflow: hidden; border: 1px solid rgba(255,255,255,.68); border-radius: var(--radius); background: #254e53; box-shadow: var(--shadow); scroll-snap-align: center; isolation: isolate; }
.countdown-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.countdown-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,27,31,.06) 10%, rgba(15,27,31,.86) 100%); z-index: -1; }
.countdown-card.no-image { background: linear-gradient(145deg, #3c9992, #164d59); }
.countdown-content { align-self: flex-end; width: 100%; padding: clamp(1.35rem, 5vw, 3rem); color: white; }
.countdown-content h2 { margin-bottom: 1.25rem; font-size: clamp(2rem, 7vw, 4.5rem); line-height: .95; letter-spacing: -.045em; text-wrap: balance; }
.timer { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.4rem, 2vw, 1rem); }
.time-part { min-width: 0; padding: .85rem .3rem; border: 1px solid rgba(255,255,255,.25); border-radius: 18px; background: rgba(255,255,255,.12); text-align: center; backdrop-filter: blur(14px); }
.time-part strong { display: block; font-size: clamp(1.45rem, 7vw, 3rem); font-variant-numeric: tabular-nums; line-height: 1; }
.time-part span { display: block; margin-top: .35rem; font-size: clamp(.6rem, 2.4vw, .78rem); opacity: .84; text-transform: uppercase; letter-spacing: .06em; }
.track-help { display: flex; justify-content: space-between; align-items: center; margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.track-help[hidden] { display: none; }
.track-dots { display: flex; gap: .35rem; }
.track-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #b8c3c3; }
.track-dots button.active { width: 24px; border-radius: 99px; background: var(--coral); }
.empty-state { padding: 3rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: center; box-shadow: var(--shadow); }
.public-footer { display: flex; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 1.5rem clamp(1.15rem, 5vw, 4rem) max(2rem, env(safe-area-inset-bottom)); color: var(--muted); font-size: .82rem; }
.public-footer a { color: inherit; }
.admin-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 2rem; min-height: 68px; padding: max(.65rem, env(safe-area-inset-top)) max(1rem, calc((100vw - 1160px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,248,239,.88); backdrop-filter: blur(18px); }
.admin-top nav { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; }
.admin-top nav a, .link-button { padding: .65rem .2rem; border: 0; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; }
.admin-top nav a:hover, .link-button:hover { color: var(--ink); }
.admin-top nav form { margin: 0; }
.nav-toggle { display: none; margin-left: auto; padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); }
.admin-main { width: min(1160px, calc(100% - 2rem)); min-height: 70vh; margin: 0 auto; padding: 2.8rem 0; }
.page-title h1 { margin-bottom: 2rem; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.055em; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.toolbar p { max-width: 560px; margin: 0; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .75rem 1.1rem; border: 1px solid transparent; border-radius: 14px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--coral); color: #fff; box-shadow: 0 8px 22px rgba(239,113,91,.25); }
.button.primary:hover { background: var(--coral-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.danger { border-color: #f2c4bd; background: #fff7f5; color: #b33b2b; }
.admin-list { display: grid; gap: 1rem; }
.archive-folder { position: relative; padding: 1.3rem; border: 1px solid #dcc9a9; border-radius: 0 22px 22px 22px; background: rgba(255, 241, 207, .52); }
.archive-folder-tab { display: inline-flex; margin: -3.6rem 0 1.2rem -1.35rem; padding: .65rem 1.1rem; border: 1px solid #dcc9a9; border-bottom: 0; border-radius: 14px 14px 0 0; background: #fff1cf; color: #74551f; font-size: .78rem; font-weight: 850; letter-spacing: .04em; }
.admin-card { display: grid; grid-template-columns: 180px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 8px 30px rgba(58,45,35,.07); }
.admin-card > img { width: 100%; height: 100%; min-height: 190px; object-fit: cover; }
.admin-card.muted { opacity: .72; }
.admin-card-content { padding: 1.3rem; }
.admin-card h2 { margin: .45rem 0 .35rem; font-size: 1.5rem; }
.admin-card time { color: var(--muted); }
.status { display: inline-flex; padding: .25rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status.active { background: #d8f2e7; color: #176b51; }
.status.past { background: #ece8e2; color: #766d64; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.2rem; }
.actions form { margin: 0; }
.panel { max-width: 720px; padding: clamp(1.2rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.form-stack { display: grid; gap: 1.15rem; }
label, legend { font-weight: 720; }
input, select { width: 100%; min-height: 48px; margin-top: .45rem; padding: .72rem .85rem; border: 1px solid #cbd1cf; border-radius: 12px; background: white; color: var(--ink); font-size: 16px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(35,122,121,.3); outline-offset: 2px; }
label small { display: block; margin-top: .35rem; color: var(--muted); font-weight: 400; }
fieldset { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; }
.choice { display: flex; align-items: center; gap: .8rem; padding: .8rem; border-radius: 12px; background: white; }
.choice input { width: 20px; min-height: 20px; margin: 0; }
.choice span { display: grid; }
.choice small { color: var(--muted); font-weight: 400; }
.notice { max-width: 720px; margin-bottom: 1rem; padding: 1rem; border-radius: 14px; }
.notice.success { background: #d9f2e7; color: #175e49; }
.notice.error { background: #ffdfda; color: #8d3024; }
.upload-panel { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; max-width: none; margin-bottom: 1.5rem; }
.upload-panel small { grid-column: 1 / -1; color: var(--muted); }
.image-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.image-library figure { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 18px; background: white; }
.image-library img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.image-library figcaption { display: grid; gap: .25rem; padding: 1rem; }
.image-library small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.text-danger { justify-self: start; padding: .5rem 0; border: 0; background: none; color: #b33b2b; cursor: pointer; }
.inline-form { display: flex; align-items: end; gap: .75rem; }
.snapshot-list { max-width: 850px; margin-top: 1rem; }
.snapshot-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.snapshot-row div { display: grid; gap: .25rem; }
.snapshot-row small { color: var(--muted); }
.user-list { display: grid; max-width: 850px; margin-top: 1rem; gap: .75rem; }
.user-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.user-row > div:nth-child(2) { display: grid; gap: .25rem; }
.user-row small { color: var(--muted); }
.user-avatar { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; background: #d9eeeb; color: var(--teal); font-size: 1.35rem; font-weight: 900; }
.password-state { justify-self: start; margin-top: .2rem; padding: .2rem .5rem; border-radius: 99px; background: #fff0d5; color: #875b0a; font-size: .7rem; font-weight: 800; }
.password-state.ready { background: #d9f2e7; color: #175e49; }
.admin-footer { display: flex; justify-content: space-between; width: min(1160px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 max(2rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.login-page { display: grid; min-height: 100svh; place-items: center; padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)); }
.login-card { width: min(460px, 100%); padding: clamp(1.5rem, 6vw, 2.8rem); border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.login-card .brand { display: block; margin-bottom: 2.5rem; }
.login-card h1 { margin-bottom: .5rem; font-size: clamp(2.2rem, 8vw, 3.5rem); letter-spacing: -.055em; }
.login-card > p { color: var(--muted); }
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--muted); }
@media (max-width: 760px) {
  .hero { align-items: stretch; gap: .45rem; padding-top: max(.7rem, env(safe-area-inset-top)); padding-bottom: .3rem; flex-direction: column; }
  .hero h1 { font-size: clamp(1.85rem, 8vw, 2.35rem); }
  .hero p { display: block; overflow: hidden; max-width: 100%; font-size: .76rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .view-switch { align-self: flex-start; }
  #countdown-app { padding-inline: 0; }
  .countdown-track { grid-auto-columns: 88%; padding: .2rem 1rem .55rem; scroll-padding-inline: 1rem; }
  .layout-grid .countdown-track { grid-template-columns: 1fr; padding-inline: 1rem; }
  .countdown-card { height: clamp(360px, calc(100svh - 280px), 520px); min-height: 0; border-radius: 24px; }
  .track-help { padding-inline: 1rem; }
  .admin-top { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .admin-top nav { display: none; width: 100%; margin: 0; padding-bottom: .7rem; flex-direction: column; align-items: stretch; gap: 0; }
  .admin-top nav.open { display: flex; }
  .admin-top nav a, .link-button { display: block; width: 100%; padding: .8rem; text-align: left; }
  .toolbar, .snapshot-row { align-items: stretch; flex-direction: column; }
  .toolbar .button, .snapshot-row .button { width: 100%; }
  .admin-card { grid-template-columns: 100px 1fr; }
  .admin-card > img { min-height: 100%; }
  .upload-panel { grid-template-columns: 1fr; }
  .upload-panel small { grid-column: auto; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .user-row { grid-template-columns: 48px 1fr; }
  .user-row form { grid-column: 1 / -1; }
  .user-row .button { width: 100%; }
  .archive-folder { padding: .75rem; }
  .archive-folder-tab { margin-left: -.8rem; }
}
@media (max-width: 390px) {
  .timer { gap: .3rem; }
  .time-part { border-radius: 14px; }
  .time-part span { letter-spacing: 0; }
  .admin-card { grid-template-columns: 1fr; }
  .admin-card > img { height: 150px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .hero { align-items: end; flex-direction: row; padding-top: max(.4rem, env(safe-area-inset-top)); }
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: 1.65rem; }
  .countdown-card { height: clamp(240px, calc(100svh - 145px), 360px); }
  .countdown-content { padding-block: 1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
