:root {
  --bg: #f5f7ff;
  --ink: #15203a;
  --muted: #3f4a63;
  --card: #ffffff;
  --line: #d8def0;
  --accent: #2550e8;
  --accent-2: #e8edff;
  --coral: #e23a2b;
  --coral-2: #ffe8e3;
  --teal: #0e7a6b;
  --danger: #b42318;
  --focus: #2550e8;
  --radius: 18px;
  --shadow: 0 14px 36px rgba(37, 80, 232, 0.08);
  --sans: "Segoe UI", "Avenir Next", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(226, 58, 43, 0.12), transparent 55%),
    radial-gradient(800px 480px at -10% 0%, rgba(37, 80, 232, 0.16), transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header, main, footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 8px;
  gap: 16px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background:
    linear-gradient(135deg, #2550e8 52%, transparent 52%),
    linear-gradient(315deg, #e23a2b 50%, #ffd056 50%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45);
}
.brand-name { margin: 0; font-weight: 800; letter-spacing: -0.03em; }
.brand-tag { margin: 0; color: var(--muted); font-size: 0.85rem; }
.beta {
  margin: 0;
  background: var(--accent-2);
  color: #1636b3;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: center;
  padding: 36px 0 28px;
}
.intro h1 {
  font-size: clamp(2.15rem, 5.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 14px;
  max-width: 13ch;
  font-weight: 800;
}
.subline { margin: 0; max-width: 36ch; color: var(--muted); font-size: 1.08rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.intro-actions .btn {
  padding: 14px 22px;
  font-size: 1.02rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-visual { margin: 0; }
.hero-visual svg { width: 100%; height: auto; display: block; }

.hero-phone { transform-origin: 300px 300px; animation: phone-float 4.5s ease-in-out infinite; }
.hero-flash { animation: flash 4.5s ease-in-out infinite; }
.hero-event { animation: event-in 0.55s ease both; }
.hero-event:nth-child(2) { animation-delay: 0.15s; }
.hero-event:nth-child(3) { animation-delay: 0.3s; }
.hero-event:nth-child(4) { animation-delay: 0.45s; }
.hero-event:nth-child(5) { animation-delay: 0.6s; }
@keyframes phone-float {
  0%, 100% { transform: rotate(16deg) translateY(0); }
  50% { transform: rotate(16deg) translateY(-8px); }
}
@keyframes flash {
  0%, 18%, 28%, 100% { opacity: 0; }
  22% { opacity: 0.85; }
}
@keyframes event-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-phone, .hero-flash, .hero-event { animation: none; }
}

.how { margin: 8px 0 28px; }
.how h2, .faq h2, .tool-head h2 { font-size: 1.4rem; margin: 0 0 16px; letter-spacing: -0.03em; }
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.how-steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.how-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.how-steps li:nth-child(1) .how-icon { background: #e8edff; color: #1636b3; }
.how-steps li:nth-child(2) .how-icon { background: #ffe8e3; color: #b42318; }
.how-steps li:nth-child(3) .how-icon { background: #dff5f0; color: #0e7a6b; }
.how-icon svg { width: 23px; height: 23px; }
.how-steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.how-steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.works-with {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.faq { margin: 0 0 36px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
}
.faq details p { margin: 0 0 14px; color: var(--muted); }

.tool {
  margin: 8px 0 28px;
  padding: 22px 18px 10px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.tool-head { margin: 4px 8px 10px; }
.tool-head p { margin: 0; color: var(--muted); }
#upload-card, #events-card { scroll-margin-top: 16px; }

.sample-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
}
.card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.hint { margin: 0; color: var(--muted); font-size: 0.92rem; }

.btn, select, input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="color"] {
  font: inherit;
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-secondary {
  background: #fff;
  color: #1636b3;
  box-shadow: inset 0 0 0 2px #2550e8;
}
.btn-small { padding: 7px 12px; font-size: 0.9rem; }
.btn-link, .linkish {
  background: none;
  border: 0;
  color: #1636b3;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
}
.btn-danger {
  background: none;
  color: var(--danger);
  box-shadow: none;
  padding: 6px 8px;
}
.btn:focus-visible, .linkish:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #8fa2ff;
  outline-offset: 2px;
}

.calendar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.calendar-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.calendar-item input[type="color"] {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.calendar-item input[type="text"] {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  font-weight: 600;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  border: 2px dashed #9aa8e0;
  border-radius: 16px;
  background: #f5f7ff;
  cursor: pointer;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.dropzone strong { color: var(--ink); font-size: 1.05rem; }
.dropzone input { display: none; }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-2);
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}
.options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}
.options select, .options input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  min-width: 11rem;
}

.status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8edff;
  color: #1636b3;
}
.status.error { background: #fdecea; color: var(--danger); }
.status.ok { background: #dff5f0; color: #0e7a6b; }

.table-wrap { overflow-x: auto; }
.events {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.events th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line);
}
.events td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.events input, .events select {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 7px 6px;
  border-radius: 8px;
  color: var(--ink);
}
.events input:hover, .events select:hover,
.events input:focus, .events select:focus {
  border-color: var(--line);
  background: #fff;
}
.events .empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 8px;
}
.add-links { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.events th:nth-child(1), .events td:nth-child(1) { min-width: 12.5rem; }
.events th:nth-child(2), .events td:nth-child(2) { min-width: 10.5rem; }
.events th:nth-child(3), .events td:nth-child(3),
.events th:nth-child(4), .events td:nth-child(4) { min-width: 7.5rem; }
.events th:nth-child(5), .events td:nth-child(5) { min-width: 9.5rem; }
.events th:nth-child(6), .events td:nth-child(6) { min-width: 8.5rem; }
.events th:nth-child(7), .events td:nth-child(7) { min-width: 6.5rem; }
.events th:nth-child(8), .events td:nth-child(8) { min-width: 5.5rem; }
.events .btn-danger { white-space: nowrap; }

.export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.export-bar p { margin: 0; color: var(--muted); }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }

footer {
  padding: 10px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
footer p { margin: 0 0 6px; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; padding-top: 20px; }
  .intro h1 { max-width: none; }
}
@media (max-width: 720px) {
  .card-head, .site-header, .export-bar, .header-actions { flex-direction: column; align-items: stretch; }
  .header-actions { gap: 8px; }
  .intro h1 { max-width: none; }
  .how-steps { grid-template-columns: 1fr; }
  .intro-actions .btn, .sample-row .btn, .header-actions .btn { width: 100%; justify-content: center; }
  .beta { text-align: center; }
  .table-wrap { overflow: visible; }
  .events thead { display: none; }
  .events, .events tbody, .events tr, .events td { display: block; width: 100%; min-width: 0 !important; }
  .events tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px 8px 4px;
    background: #fff;
  }
  .events td {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 8px;
    align-items: center;
    border-bottom: 0;
    padding: 6px 4px;
  }
  .events td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }
  .events td:last-child { justify-items: end; }
  .events td:last-child::before { display: none; }
  .add-links { flex-direction: row; gap: 12px; }
  .tool { padding: 16px 10px 6px; }
}
