:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #242124;
  background: #fff;
  --red: #c52535;
  --red-dark: #a71c2a;
  --border: #eaeaea;
  --muted: #91878a;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #e88c95; outline-offset: 3px; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { width: min(660px, 100%); margin: auto; padding: 14px 20px 11px; }
.header-row, .event-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: #251e20; font-size: 14px; font-weight: 750; letter-spacing: -.03em; }
.budget { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.budget span, .small-label, .countdown-label { color: #a29598; font-size: 9px; font-weight: 700; letter-spacing: .07em; }
.budget strong { color: var(--red); font-size: 13px; }
.event-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.event-details { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: #998e90; font-size: 10px; line-height: 1.3; }
.event-details strong { color: #554b4d; font-weight: 600; }
.countdown-wrap { flex: 0 0 auto; text-align: right; }
.countdown { display: flex; justify-content: flex-end; align-items: baseline; gap: 4px; margin-top: 3px; color: var(--red); font-variant-numeric: tabular-nums; }
.countdown b { font-size: 13px; }
.countdown small { margin-left: 1px; color: #ac9b9e; font-size: 9px; }
.countdown i { color: #d3b5b9; font-size: 11px; font-style: normal; }

.board { width: min(660px, 100%); margin: auto; padding: 24px 20px 120px; }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.board-toolbar h1 { margin: 0; font-size: 19px; line-height: 1.1; letter-spacing: -.04em; }
.board-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.filter-toggle { min-height: 44px; padding: 0 12px; border: 1px solid #eee4e5; border-radius: 10px; background: #fff; color: #66595d; font-size: 12px; font-weight: 600; white-space: nowrap; }
.filter-toggle > span:first-child { margin-right: 4px; color: var(--red); font-size: 12px; }
#filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; }
.filter-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.filter-panel-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.filter-panel p { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.text-button, .back-button { padding: 0; border: 0; background: none; color: var(--red); font-size: 12px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip { min-height: 40px; padding: 7px 10px; border: 1px solid #eee3e5; border-radius: 8px; background: #fff; color: #706367; font-size: 12px; }
.chip.selected { border-color: var(--red); background: #fff; color: var(--red-dark); }
.privacy-note { margin: 19px 0 0; color: #a09597; font-size: 11px; line-height: 1.5; }
.feed-meta { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 16px; color: #b0a5a7; font-size: 9px; font-weight: 700; letter-spacing: .07em; }
.feed { display: flex; flex-direction: column; gap: 19px; }
.note { display: flex; align-items: flex-start; gap: 10px; }
.note-content { flex: 1; min-width: 0; }
.message-bubble { padding: 14px 15px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.message-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.message-heading strong { color: #a52735; font-size: 12px; font-weight: 700; }
.message-heading time { flex: 0 0 auto; color: #b1a3a6; font-size: 10px; }
.message-body { margin: 9px 0 0; color: #352d30; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-carousel { margin-top: 10px; }
.photo-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 8px; }
.photo-track::-webkit-scrollbar { display: none; }
.photo-slide { flex: 0 0 100%; min-width: 0; height: 280px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; }
.message-photo { display: block; max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.photo-navigation { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 11px; }
.photo-navigation button { width: 40px; height: 40px; border: 0; background: #fff; color: var(--red); font-size: 20px; }
.photo-navigation button:disabled { opacity: .3; cursor: default; }
.photo-error { color: var(--red); font-size: 12px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.note-tags span { padding: 4px 7px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #b43846; font-size: 10px; font-weight: 600; }
.message-actions { display: flex; gap: 19px; padding: 9px 2px 0; }
.message-actions button, .more-replies { min-height: 36px; padding: 3px 0; border: 0; background: transparent; color: #9c8b8f; font-size: 11px; font-weight: 600; }
.message-actions button:hover, .more-replies:hover { color: var(--red); }
.replies { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0 3px; padding-left: 13px; border-left: 2px solid var(--border); }
.reply { padding: 12px 13px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.reply .message-body { font-size: 12px; }
.thread-error { margin: 0; color: var(--red); font-size: 12px; }
.more-replies { margin: 8px 0 0 17px; color: var(--red); }
.empty-state { padding: 52px 15px; border: 1px dashed #eddddf; border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }
.error-state, .form-error { color: var(--red); }
.secondary-button { padding: 11px 16px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: #625658; font-size: 12px; font-weight: 600; }
.load-more { display: block; margin: 24px auto 0; }
.status-message { color: var(--red); font-size: 12px; text-align: center; }
.compose-button { position: fixed; z-index: 6; right: max(20px, calc((100vw - 620px) / 2)); bottom: max(24px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 19px; background: var(--red); color: #fff; box-shadow: 0 8px 24px #a71c2a40; }
.compose-button span { font-size: 32px; font-weight: 300; line-height: 1; }
.compose-button:hover { background: var(--red-dark); }

dialog { width: min(520px, calc(100% - 32px)); max-height: 90dvh; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: #fff; color: #282124; box-shadow: 0 24px 80px #42101530; }
dialog::backdrop { background: #2e171b99; }
.dialog-inner { padding: 25px; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; }
.dialog-top .small-label { color: var(--red); }
.close-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #8d7f82; font-size: 24px; }
.dialog-inner h2 { margin: 14px 0 7px; font-size: 21px; letter-spacing: -.04em; }
.dialog-inner p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.field-label { display: block; margin-top: 22px; color: #786b6e; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.field-hint { margin: 7px 0 0; }
textarea { width: 100%; height: 105px; resize: vertical; margin-top: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #282124; font-size: 13px; }
textarea::placeholder { color: #b6a9ac; }
.character-count { display: flex; justify-content: space-between; color: #aaa0a1; font-size: 10px; }
.photo-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.attach-button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--red); font-size: 12px; font-weight: 600; }
.photo-hint { color: var(--muted); font-size: 11px; }
.photo-preview { display: flex; overflow-x: auto; gap: 10px; margin-top: 12px; }
.preview-item { flex: 0 0 90px; display: flex; flex-direction: column; gap: 6px; }
.photo-preview img { display: block; width: 90px; height: 90px; border-radius: 8px; object-fit: cover; }
.preview-item button { min-height: 36px; text-align: left; }
.photo-status { margin: 8px 0 0; }
.photo-status:empty { display: none; }
.reply-context { margin-top: 16px; padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #a34450; font-size: 12px; line-height: 1.5; }
.form-error { min-height: 18px; margin: 12px 0 5px !important; color: var(--red) !important; }
.verification-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 15px; border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; color: #282124; text-align: left; font-size: 13px; }
.verification-button:hover { border-color: var(--red); }
.verification-box { flex: 0 0 auto; width: 24px; height: 24px; border: 2px solid #aaa; border-radius: 3px; }
.verification-label { margin-left: auto; color: #91878a; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.primary-button { min-height: 47px; padding: 0 17px; border: 1px solid var(--red); border-radius: 10px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; }
.primary-button:hover { background: var(--red-dark); }
.dialog-action { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.dialog-action span { font-size: 18px; }
.question-card { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.question-card .small-label, .question-card strong, .question-card .muted { display: block; }
.question-card .small-label { margin-bottom: 8px; color: #bd8188; }
.question-card strong { font-size: 14px; }
.question-card .muted { margin-top: 8px; color: var(--muted); font-size: 11px; }
.back-button { display: block; margin: 16px auto 0; }

@media (max-width: 480px) {
  dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 90dvh; margin: 0; border-radius: 18px 18px 0 0; }
  .dialog-inner { padding: 22px 20px max(24px, env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .topbar-inner, .board { padding-left: 15px; padding-right: 15px; }
  .event-details { max-width: 155px; }
}
