@import url("https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap");

:root {
  color-scheme: light;
  font-family: Play, Arial, sans-serif;
}
body {
  --paper: #fff8f6; --surface: #fff; --header: #fae4df; --ink: #000;
  --subtle: #505759; --line: #dfd9d7; --primary: #ef3124; --action: #111;
  --soft: #f0efed; --peach: #ffd9d0; --shape-side: #d9d9d6;
  --danger: #9c2019; --focus: #af241e;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
a { color: var(--ink); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a, p, li, td, h3 { overflow-wrap: anywhere; }
.shell { width: min(880px, calc(100% - 36px)); margin-inline: auto; }
.site-chrome { background: var(--header); border-bottom: 1px solid var(--line); }
.masthead { display: grid; gap: .75rem; padding-block: .8rem .75rem; }
.brand-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.wordmark { font-size: 1.55rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.event-date { font-weight: 700; white-space: nowrap; }
.tabs {
  position: relative; isolation: isolate; overflow: visible;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 3px; padding: 4px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 2px 8px #241a2e0c;
}
.tabs a {
  position: relative; z-index: 1;
  min-height: 42px; display: grid; place-items: center;
  padding: .45rem .25rem; border-radius: 999px; font-size: .98rem;
  text-align: center; text-decoration: none; font-weight: 700;
}
.tabs a[aria-current] { background: var(--primary); color: #000; }
.tabs .icon-tab { min-width: 46px; }
.screen-icon { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.screen-icon .play-bg { fill: #ffb4b0; stroke: none; }
.screen-icon .play-mark { fill: var(--primary); stroke: none; }
.hero { isolation: isolate; position: relative; display: grid; place-items: center; padding: .5rem 1rem; min-height: 84px; margin: .65rem 0 .9rem; text-align: center; }
.hero::before, .hero::after, .hero h1::before { content: ""; pointer-events: none; position: absolute; z-index: -1; }
.hero::before { inset: 17% 53% 18% 7%; transform: rotate(-8deg); background: var(--shape-side); border-radius: 64% 36% 58% 42%; }
.hero::after { inset: 23% 6% 23% 59%; background: var(--peach); transform: rotate(-11deg); border-radius: 52% 48% 61% 39%; }
.hero h1::before { inset: 13% 11%; background: var(--primary); border-radius: 46% 54% 42% 58% / 51% 35% 65% 49%; transform: rotate(2deg); }
h1 { z-index: 0; color: #fff; margin: 0; padding-inline: .6rem; font-size: clamp(1.35rem, 5.7vw, 2.55rem); letter-spacing: -.035em; line-height: 1.05; }
h2, h3, p { margin: 0 0 .6rem; }
h2 { font-size: clamp(1.2rem, 4.5vw, 1.55rem); letter-spacing: -.025em; }
h3 { font-size: 1.08rem; }
p:last-child { margin-bottom: 0; }
button, input, select, textarea { font: inherit; }
label { display: grid; gap: .35rem; font-weight: 700; }
input:not([type=checkbox]), select, textarea { min-height: 44px; width: 100%; padding: .5rem .65rem; background: #fff; border: 1px solid #9d8da0; color: var(--ink); border-radius: 10px; }
.button, .text-button { cursor: pointer; color: var(--ink); font-weight: 700; }
.button { display: inline-grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; background: var(--surface); text-decoration: none; }
.button.primary { background: var(--action); color: #fff; border-color: var(--action); }
.button.full { display: grid; width: 100%; margin-top: .7rem; }
.button:disabled { opacity: .55; cursor: default; }
.text-button { background: none; border: 0; min-height: 36px; padding: .3rem 0; text-decoration: underline; text-underline-offset: .18em; }
.danger { color: var(--danger); }
.card, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(.8rem, 3vw, 1.2rem); }
.empty { color: var(--subtle); }
.columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: .75rem; align-items: start; }
.columns.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: .65rem; justify-items: start; }
.stack > label, .stack > fieldset { width: 100%; }
.narrow { max-width: 480px; margin-inline: auto; }
.notice { padding: .7rem .85rem; background: var(--soft); border-radius: 10px; margin-bottom: .65rem; }
.notice.error { color: #801d2c; background: #fce4ed; }
.topic-list, .booking-list { padding: 0; margin: 0; list-style: none; display: grid; gap: .4rem; }
.topic-caption { display: grid; grid-template-columns: minmax(0,1fr) minmax(2.6rem, auto); gap: .55rem; align-items: center; min-width: 0; width: 100%; }
.topic-caption > strong { overflow-wrap: anywhere; }
.speaker, .schedule-grid small { color: var(--subtle); font-size: .83rem; font-weight: 400; }
.topic-caption > .speaker { max-width: 12ch; overflow-wrap: anywhere; text-align: right; }
.own-topic, .reserve-topic { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 54px; }
.result-card, .vote-option {
  display: grid; align-items: stretch; gap: .45rem; min-height: 58px; padding: .65rem .75rem;
  background: var(--category-soft, var(--surface)); border: 1px solid var(--line);
  border-left: 4px solid var(--category-color, var(--primary)); border-radius: 12px;
}
.result-card { box-shadow: 0 2px 5px #241a2e09; }
.vote-confirm { display: inline-flex; gap: .4rem; background: var(--peach); font-weight: 700; border-radius: 999px; padding: .25rem .7rem; }
.results-heading { margin-bottom: .35rem; }
.live-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .79rem; color: var(--subtle); }
.live-status::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .5rem; }
.vote-grid { display: grid; gap: .4rem; }
.vote-option { cursor: pointer; }
.vote-option > label { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .65rem; width: 100%; cursor: pointer; }
.vote-topic-caption { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .75rem; min-width: 0; width: 100%; }
.vote-topic-caption > strong { overflow-wrap: anywhere; }
.topic-meta {
  display: inline-flex; align-items: center; justify-content: flex-end; justify-self: end;
  max-width: min(46vw, 22rem); padding: .25rem .55rem; border: 1px solid var(--category-color);
  border-radius: 999px; background: #fff; color: var(--category-color); text-align: right;
  font-size: .8rem; line-height: 1.2; overflow-wrap: anywhere;
}
.topic-meta .speaker { color: inherit; }
.topic-meta .topic-speaker { font-weight: 700; }
.vote-option:has(input:checked) { border-color: var(--category-color); box-shadow: 0 0 0 2px color-mix(in srgb,var(--category-color) 25%,transparent); }
.vote-option input { accent-color: var(--primary); width: 1.1rem; height: 1.1rem; margin: 0; flex-shrink: 0; }
.vote-bar { width: 100%; position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; background: var(--paper); border-top: 1px solid var(--line); }
.vote-bar output { font-weight: 700; }
.schedule-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.schedule-grid { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.schedule-grid .time-col { width: 20%; }
.schedule-grid th, .schedule-grid td { text-align: left; overflow-wrap: anywhere; }
.schedule-grid thead th {
  padding: .85rem 1rem; background: #fff; color: #812638; font-weight: 700;
  border-bottom: 1px solid #eee4e2;
}
.schedule-grid tbody th, .schedule-grid tbody td {
  height: 76px; padding: .65rem 1rem; vertical-align: middle; background: #fff;
  border-bottom: 1px solid #eee4e2;
}
.schedule-grid tbody tr:last-child > * { border-bottom: 0; }
.schedule-grid tbody th { position: relative; font-size: 1.16rem; line-height: 1.15; }
.schedule-grid tbody th small { display: block; margin-top: .3rem; color: #81787a; font-size: .78rem; font-weight: 400; }
.schedule-grid td > div { min-width: 0; }
.schedule-grid td small { line-height: 1.2; }
.reserve, #draft > form, #draft > p { margin-top: .75rem; }
.reserve ul { margin-top: .65rem; }
summary { cursor: pointer; font-weight: 700; }
.stats { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit,minmax(min(100%,130px),1fr)); }
.stats strong { display: block; font-size: 1.18rem; }
.stats span { color: var(--subtle); font-size: .92rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .85rem; }
.admin-panel > summary { font-size: clamp(1.15rem,4vw,1.45rem); font-weight: 700; }
.admin-panel[open] > summary { margin-bottom: 1rem; }
.admin-panel-body { display: grid; gap: .85rem; }
.section { margin-block: 1.25rem; scroll-margin-top: .65rem; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .15rem .6rem; }
.section-heading > h2 { margin: 0; }
.actions, .inline { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions, .booking-list { margin-top: .65rem; }
.inline { align-items: center; justify-content: space-between; padding-top: .25rem; }
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; width: 100%; }
.table-wrap th, .table-wrap td { text-align: left; padding: .4rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap .vote-total { width: 1%; text-align: center; white-space: nowrap; }
.table-wrap .voter-names { min-width: 9rem; color: var(--subtle); }
.voter-names span, .voter-names strong { display: block; }
.voter-names span { margin-bottom: .15rem; font-size: .78rem; font-weight: 400; }
.voter-names strong { color: var(--ink); font-size: .9rem; }
.table-wrap tr:last-child td { border-bottom: 0; }
.foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem .8rem; margin-top: 1.75rem; padding: .75rem 0 1rem; border-top: 1px solid var(--line); color: var(--subtle); font-size: .86rem; }
.organizers-link { font-weight: 700; text-align: center; }
.admin-account { display: inline-flex; align-items: center; gap: .65rem; }
.admin-account form { margin: 0; }
.hint { color: var(--subtle); font-size: .8rem; font-weight: 400; }
.topic-explanation { margin-top: .3rem; font-size: .86rem; color: var(--subtle); }
.topic-explanation summary { font-size: .78rem; }
.topic-explanation p { margin-top: .3rem; white-space: pre-wrap; }
.result-card-head { min-width: 0; }
.vote-option > .topic-explanation, .result-card > .topic-explanation {
  width: 100%; margin: .1rem 0 0; padding-top: .45rem; border-top: 1px solid color-mix(in srgb,var(--category-color) 28%,transparent);
}
.vote-option > .topic-explanation summary, .result-card > .topic-explanation summary {
  width: fit-content; color: var(--category-color); font-weight: 700;
}
.vote-option > .topic-explanation p, .result-card > .topic-explanation p {
  width: 100%; margin: .4rem 0 0; padding: .6rem .7rem; border-radius: 8px;
  background: #ffffffb8; color: var(--ink); line-height: 1.45;
}
.vote-count { flex: 0 0 auto; padding: .25rem .55rem; border-radius: 999px; background: var(--soft); color: var(--subtle); font-size: .78rem; white-space: nowrap; }
.category-legend { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.category-legend span { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; border-radius: 999px; padding: .2rem .55rem; background: #fff; border: 1px solid var(--category-color); color: #303030; font-size: .76rem; font-weight: 700; }
.category-legend span::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--category-color); }
[data-category="Поделиться"] { --category-color: #ef3124; --category-soft: #fae8ec; }
[data-category="Создать"] { --category-color: #2878d0; --category-soft: #e8f1fa; }
[data-category="Обсудить"] { --category-color: #8c4fc4; --category-soft: #f2eafa; }
[data-category="Объединиться"] { --category-color: #16845b; --category-soft: #e5f3ee; }
.schedule-grid .schedule-topic, .schedule-grid .schedule-booking {
  position: relative; display: block; min-height: 54px; padding: .5rem .7rem .5rem 1.25rem;
  border-radius: 9px; background: var(--category-soft, #f4edf8);
}
.schedule-grid .schedule-topic::before, .schedule-grid .schedule-booking::before {
  content: ""; position: absolute; left: .55rem; top: .6rem; bottom: .6rem; width: 3px;
  border-radius: 99px; background: var(--category-color, #812638);
}
.schedule-grid .schedule-topic strong, .schedule-grid .schedule-booking strong { display: block; line-height: 1.15; }
.schedule-grid .schedule-topic small { display: inline; color: #81787a; font-size: .78rem; font-weight: 400; }
.schedule-grid .schedule-topic small + small::before { content: " · "; }
.schedule-comment-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: min(340px,calc(100vw - 24px)); padding: .55rem .7rem; border: 1px solid #d7c8c9; border-radius: 9px; background: #fff; color: var(--ink); box-shadow: 0 8px 24px #45201e2b; font-size: .82rem; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; }
.schedule-grid .schedule-votes { color: #81787a; }
.schedule-grid .schedule-free { display: flex; align-items: center; min-height: 54px; color: #81787a; }
.schedule-grid .schedule-booking { --category-color: #812638; --category-soft: #fae8ec; }
.schedule-grid [data-category="Поделиться"] { --category-soft: #fae8ec; }
.schedule-grid [data-category="Создать"] { --category-soft: #e8f1fa; }
.schedule-grid [data-category="Обсудить"] { --category-soft: #f2eafa; }
.schedule-grid [data-category="Объединиться"] { --category-soft: #e5f3ee; }
.schedule-grid .common-row th, .schedule-grid .common-row td {
  height: 30px; padding: .25rem 1rem; background: #fffaf8; color: #81787a;
  font-size: .78rem; font-weight: 400; border-bottom: 1px solid #eadfdd;
}
.schedule-grid .common-row .common-title { color: #812638; }
.schedule-grid .common-row .common-title strong { font-weight: 700; }
.schedule-grid tr.is-current > * { background: #f5cdd5; }
.schedule-grid tr.is-current > th:first-child { border-left: 6px solid #b51d3b; padding-left: calc(1rem - 6px); }
.schedule-grid tr:not(.common-row).is-current > th:first-child::after {
  content: "Сейчас"; display: inline-block; margin: .28rem 0 0 .55rem; padding: .22rem .75rem;
  border-radius: 999px; background: #812638; color: #fff; font-size: .72rem; font-weight: 700;
  vertical-align: middle;
}
.block-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: .65rem; margin-bottom: 1.2rem; }
.block-form { display: grid; gap: .5rem; }
.test-time { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.draft-controls { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.draft-controls .test-time { margin-bottom: 0; }
.schedule-editor-help { margin: 0 0 .35rem; color: var(--subtle); font-size: .86rem; }
.schedule-editor-status { min-height: 1.25em; margin: 0 0 .55rem; color: #16845b; font-size: .84rem; font-weight: 700; }
.schedule-editor-status.error { color: #b51d3b; }
[data-schedule-editor] [data-schedule-cell] { cursor: pointer; transition: background-color .15s, box-shadow .15s; }
[data-schedule-editor] [data-schedule-cell]:hover,
[data-schedule-editor] [data-schedule-cell]:focus-visible { background: #fff7f5; box-shadow: inset 0 0 0 2px #ef312466; outline: 0; }
[data-schedule-editor] [data-schedule-cell].is-selected { background: #fff0ed; box-shadow: inset 0 0 0 3px var(--primary); }
[data-schedule-editor] .schedule-topic { cursor: grab; }
[data-schedule-editor] .schedule-topic:active { cursor: grabbing; }
.screen-layout {
  display: grid; grid-template-columns: minmax(240px,1fr) minmax(0,2fr); gap: 1rem;
  width: min(980px, calc(100vw - 24px));
  margin-left: calc((100% - min(980px, calc(100vw - 24px))) / 2);
}
.screen-page .shell { width: calc(100% - 32px); max-width: none; }
.screen-page .screen-layout {
  width: 100%; margin-left: 0;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}
.qr-card { margin-bottom: .7rem; }
.qr-card > img { display: block; width: min(100%,260px); margin: 0 auto .7rem; image-rendering: crisp-edges; }
.qr-card .media-caption { margin: .35rem 0 0; text-align: center; font-weight: 700; }
.upload-preview { width: min(100%,280px); max-height: 280px; object-fit: contain; border-radius: 10px; }
.file-field { position: relative; width: 100%; }
.file-input { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; opacity: 0; overflow: hidden; }
.file-picker { display: flex; align-items: center; gap: .65rem; width: 100%; cursor: pointer; }
.file-picker .button { flex: 0 0 auto; background: var(--action); color: #fff; }
.file-picker [data-file-name] { min-width: 0; color: var(--subtle); font-size: .86rem; overflow-wrap: anywhere; }
.gift-photo { max-width: 680px; margin: 0 auto 1rem; }
.gift-photo img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; }
.gift-text { width: fit-content; max-width: min(100%,680px); margin: .75rem auto 1rem; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.holiday-tabs { margin-top: .35rem; }
.holiday-snow, .holiday-garland, .holiday-cat { position: absolute; pointer-events: none; user-select: none; }
.holiday-snow {
  z-index: 2; left: 2.5%; right: 2.5%; top: -4px; height: 12px;
  border-radius: 999px 999px 45% 55%;
  background:
    radial-gradient(circle at 8% 86%, #fff 0 7px, transparent 7.5px),
    radial-gradient(circle at 22% 72%, #fff 0 8px, transparent 8.5px),
    radial-gradient(circle at 38% 88%, #fff 0 7px, transparent 7.5px),
    radial-gradient(circle at 58% 70%, #fff 0 8px, transparent 8.5px),
    radial-gradient(circle at 77% 85%, #fff 0 7px, transparent 7.5px),
    radial-gradient(circle at 93% 74%, #fff 0 8px, transparent 8.5px),
    linear-gradient(#fff, #f7fbff);
  filter: drop-shadow(0 2px 1px #9cb7c733);
}
.holiday-garland {
  z-index: 3; left: 6%; right: 23%; top: -8px; height: 31px;
  filter: drop-shadow(0 0 4px #ffba38aa);
}
.holiday-garland svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.holiday-garland path { fill: none; stroke: #304b3d; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.holiday-garland i {
  position: absolute; top: 19px; width: 9px; height: 10px; margin-left: -4px;
  border-radius: 45% 45% 55% 55%; background: #ffc62e; border: 1px solid #e5a600;
  box-shadow: 0 0 6px 2px #ffd65a99;
}
.holiday-garland i::before {
  content: ""; position: absolute; left: 3px; top: -4px; width: 3px; height: 5px;
  border-radius: 2px; background: #304b3d;
}
.holiday-garland i:nth-of-type(1) { left: 8.33%; background: #ef3124; border-color: #c8241a; box-shadow: 0 0 6px 2px #ff766c99; }
.holiday-garland i:nth-of-type(2) { left: 25%; background: #ffc62e; }
.holiday-garland i:nth-of-type(3) { left: 41.66%; background: #29a76f; border-color: #187e50; box-shadow: 0 0 6px 2px #72daa899; }
.holiday-garland i:nth-of-type(4) { left: 58.33%; background: #ef3124; border-color: #c8241a; box-shadow: 0 0 6px 2px #ff766c99; }
.holiday-garland i:nth-of-type(5) { left: 75%; background: #ffc62e; }
.holiday-garland i:nth-of-type(6) { left: 91.66%; background: #29a76f; border-color: #187e50; box-shadow: 0 0 6px 2px #72daa899; }
.holiday-cat {
  z-index: 4; right: 11%; bottom: calc(100% - 8px); width: 104px; height: auto;
  filter: drop-shadow(0 3px 2px #45201e2b); transform: rotate(2deg);
}
@media(max-width: 640px) {
  .shell { width: calc(100% - 24px); }
  .columns, .columns.even { grid-template-columns: 1fr; }
  .tabs a { font-size: clamp(.75rem, 3.4vw, .95rem); }
  .hero { min-height: 70px; }
  .hero h1::before { inset-inline: 9%; }
  .topic-caption { gap: .35rem; }
  .topic-caption .speaker { font-size: .76rem; max-width: 9ch; }
  .schedule-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .schedule-grid { min-width: 680px; }
  .schedule-grid .time-col { width: 24%; }
  .schedule-grid thead th, .schedule-grid tbody th, .schedule-grid tbody td {
    padding: .5rem .4rem; font-size: clamp(.67rem, 2.8vw, .86rem);
  }
  .schedule-grid tbody td { padding-left: .3rem; }
  .schedule-grid .schedule-topic, .schedule-grid .schedule-booking {
    min-height: 50px; padding: .45rem .3rem .45rem .9rem;
  }
  .schedule-grid .schedule-topic::before, .schedule-grid .schedule-booking::before {
    left: .35rem; top: .5rem; bottom: .5rem;
  }
  .schedule-grid tr.is-current > th:first-child { padding-left: calc(.4rem - 6px); }
  .schedule-grid td small { font-size: .71rem; }
  .screen-layout { grid-template-columns: 1fr; width: 100%; margin-left: 0; }
  .screen-page .shell { width: calc(100% - 24px); }
  .screen-page .screen-layout { grid-template-columns: 1fr; }
  .holiday-tabs { margin-top: .55rem; }
  .holiday-cat { right: 9%; bottom: calc(100% - 7px); width: 88px; }
  .holiday-garland { left: 5%; right: 26%; }
}
