:root {
  /* Matches onlyphucnguyensiavn.com — dark navy + cyan-blue accent. */
  color-scheme: dark;
  --bg: #0c121d;
  --card: #131c2b;
  --ink: #f9fafb;
  --muted: #8b97ad;
  --line: #242e42;
  --accent: #00aaff;
  --accent-ink: #04121f;
  --code-bg: #0d1524;
  --ok: #22c55e;
  --grad: linear-gradient(135deg, #00aaff, #00ccff, #24248f);
  --status-ongoing-bg: #0d2a1c;
  --status-ongoing-ink: #4ade80;
  --status-soon-bg: #0e2740;
  --status-soon-ink: #4cc4ff;
  --status-done-bg: #1a2233;
  --status-done-ink: #8b97ad;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .40);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Deep navy with a soft blue glow up top, echoing the main site's hero. */
  background:
    radial-gradient(1100px 480px at 50% -120px, rgba(0, 170, 255, .18), transparent 62%),
    var(--bg);
}

/* Faint tiled starfield, like the main site's particle background. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 28px 34px, rgba(255, 255, 255, .35), transparent),
    radial-gradient(1.5px 1.5px at 128px 88px, rgba(120, 200, 255, .30), transparent),
    radial-gradient(1px 1px at 76px 156px, rgba(255, 255, 255, .22), transparent),
    radial-gradient(1px 1px at 186px 42px, rgba(255, 255, 255, .18), transparent);
  background-size: 230px 230px;
  background-repeat: repeat;
  opacity: .6;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top spacing that the header used to provide (safe-area for notched phones). */
main.wrap { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }

/* The "tap an item to copy" note, now sitting under the search bar. */
.tagline {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: .92rem;
}
.tagline strong { color: var(--ink); font-weight: 700; }

/* Controls */
.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 16px 0 10px;
  margin-bottom: 4px;
}
.search {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  outline: none;
}
.search:focus { border-color: var(--accent); }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chip {
  padding: 7px 14px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Feedback line */
.feedback {
  padding: 24px 4px;
  color: var(--muted);
  text-align: center;
  font-size: .95rem;
}
.feedback[hidden] { display: none; }
.feedback.error { color: #d33; }

/* Cards */
.events {
  display: grid;
  gap: 14px;
  padding: 4px 0 40px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.ongoing { background: var(--status-ongoing-bg); color: var(--status-ongoing-ink); }
.badge.soon    { background: var(--status-soon-bg);    color: var(--status-soon-ink); }
.badge.done    { background: var(--status-done-bg);    color: var(--status-done-ink); }
.badge.neutral { background: var(--status-done-bg);    color: var(--status-done-ink); }

.notes {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.tags {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--code-bg);
  border-radius: 12px;
  font-size: .96rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.copy {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  font-size: .98rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .05s, filter .15s;
}
.copy:hover { filter: brightness(1.08); }
.copy:active { transform: scale(.99); }
.copy.copied { background: var(--ok); }

/* Schedule page — poster */
.poster {
  margin: 18px 0 4px;
}
.poster[hidden] { display: none; }
.poster img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Schedule page — category sections */
.schedule {
  display: grid;
  gap: 24px;
  padding: 12px 0 40px;
}
.sched-section { display: block; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-count {
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--code-bg);
  padding: 2px 9px;
  border-radius: 999px;
}
.section-toggle {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 700;
}
.section-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform .2s;
}
.sched-section.open .section-chevron { transform: rotate(180deg); }
.section-body {
  display: grid;
  gap: 12px;
}
.section-body[hidden] { display: none; }

/* Schedule page — timeline cards */
.sched {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sched-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.sched-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--code-bg);
}
.sched-thumb.placeholder {
  display: inline-block;
  background: linear-gradient(135deg, var(--code-bg), var(--line));
}
.sched-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sched-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sched-when {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.sched-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sched-loc {
  font-size: .85rem;
  color: var(--muted);
}
.sched-chevron {
  flex: none;
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform .2s;
}
.sched.open .sched-chevron { transform: rotate(180deg); }

.sched-panel {
  padding: 0 12px 14px;
  border-top: 1px solid var(--line);
}
.sched-panel[hidden] { display: none; }
.sched-panel .notes { margin-top: 12px; }
.sched-event {
  margin: 12px 0 0;
  font-size: .9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sched-event strong { color: var(--ink); }

/* Hashtag blocks inside an expanded schedule item */
.tag-group { margin-top: 14px; }
.tag-group .tags { margin-top: 6px; }
.tag-label {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 22px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: .84rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

