:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-strong: #101418;
  --text: #15191d;
  --muted: #697178;
  --line: #dfe4e8;
  --accent: #008a43;
  --accent-strong: #007237;
  --accent-soft: #e5f6ed;
  --warn: #b45b00;
  --radius: 8px;
  --shadow: 0 12px 32px rgba(25, 31, 36, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }

.app-shell {
  min-height: 100dvh;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  background: rgba(246, 247, 248, 0.92);
  border-bottom: 1px solid rgba(223, 228, 232, 0.85);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  text-decoration: none;
  font-weight: 800;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-updated {
  max-width: min(52vw, 240px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 19px;
}

.icon-button:active,
.text-button:active,
.search-box button:active,
.feedback-form button:active,
.tab:active {
  transform: translateY(1px);
}

.main {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 16px;
}

.channel-panel,
.today-card,
.schedule-item,
.info-item,
.feedback-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.channel-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.subcopy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-box input,
.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--text);
  outline: none;
}

.search-box input {
  height: 42px;
  padding: 0 12px;
}

.search-box button,
.feedback-form button,
.text-button {
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.search-box button {
  min-width: 64px;
  padding: 0 13px;
}

.search-results {
  display: grid;
  gap: 7px;
}

.result-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--text);
  text-align: left;
}

.result-button img,
.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
}

.status-strip { margin-top: 12px; }

.today-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface-strong);
  color: #ffffff;
}

.today-card .muted,
.today-card .meta { color: rgba(255, 255, 255, 0.72); }

.today-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.today-title strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.today-card .badge {
  background: rgba(0, 138, 67, 0.24);
  color: #96f0bd;
}

.tabs {
  position: sticky;
  top: 58px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 247, 248, 0.94);
  backdrop-filter: blur(16px);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(25, 31, 36, 0.08);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.schedule-list,
.info-list {
  display: grid;
  gap: 10px;
}

.timeline-list {
  position: relative;
  gap: 0;
  padding: 2px 0 4px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px 18px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 56px;
  width: 2px;
  background: var(--line);
}

.timeline-item:first-child::before { top: 13px; }
.timeline-item:last-child::before { bottom: calc(100% - 13px); }

.timeline-date {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 2px;
  padding-top: 5px;
  color: var(--muted);
}

.timeline-day {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.timeline-weekday {
  font-size: 12px;
  font-weight: 800;
}

.timeline-node {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 10px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: #b9c2c8;
  box-shadow: 0 0 0 1px var(--line);
}

.timeline-node.has-entry { background: var(--accent); }
.timeline-node.today { background: var(--accent); box-shadow: 0 0 0 4px rgba(0, 138, 67, 0.16); }
.timeline-node.off { background: var(--warn); }
.timeline-node.empty { background: #c9d0d5; }

.timeline-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.timeline-item.today .timeline-card { border-color: rgba(0, 138, 67, 0.48); }
.timeline-item.empty .timeline-card { background: #fbfcfd; }

.timeline-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}


.schedule-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  box-shadow: none;
}

.schedule-item.today { border-color: rgba(0, 138, 67, 0.48); }

.date-row,
.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.date-label { font-weight: 900; }

.meta,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-lines {
  display: grid;
  gap: 7px;
}

.part-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.part-tag {
  flex: 0 0 auto;
  max-width: 96px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-text {
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notes,
.vods {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.note {
  color: var(--warn);
  font-size: 13px;
  line-height: 1.45;
}

.vod-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.info-item {
  padding: 13px 14px;
  box-shadow: none;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feedback-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-form input,
.feedback-form select {
  height: 42px;
  padding: 0 11px;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 120px;
  padding: 10px 11px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-status {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status.error { color: #b3261e; }
.form-status.success { color: var(--accent-strong); }

.feedback-form button {
  min-height: 40px;
  padding: 0 16px;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
}

.empty-state strong { color: var(--text); }

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #e8edf0;
}

.today-card .skeleton { background: rgba(255, 255, 255, 0.16); }

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.2s infinite;
}

.line { width: 48%; height: 16px; }
.line.wide { width: 72%; }
.block { height: 54px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@media (min-width: 700px) {
  .main { padding: 24px; }
  .channel-panel { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Schedule-centered layout */
.schedule-first {
  padding-top: 10px;
}

.schedule-controls {
  gap: 11px;
  padding: 14px;
  box-shadow: none;
}

.channel-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.schedule-controls .eyebrow {
  margin-bottom: 3px;
}

.schedule-controls h1 {
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.05;
}

.schedule-controls .subcopy {
  flex: 0 1 150px;
  margin: 0;
  text-align: right;
  font-size: 12px;
  line-height: 1.35;
}

.schedule-controls .search-box input {
  height: 38px;
}

.schedule-controls .search-box button {
  min-width: 56px;
}

.schedule-first .tabs {
  top: 58px;
  margin: 10px 0 12px;
}

.schedule-head {
  align-items: flex-end;
  margin-bottom: 8px;
}

.section-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-strip {
  margin: 0 0 12px;
}

.today-card {
  gap: 8px;
  padding: 12px 13px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.today-card .muted,
.today-card .meta {
  color: var(--muted);
}

.today-card .badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.today-title strong {
  font-size: 16px;
}

.timeline-list {
  padding-top: 0;
}

.timeline-item {
  grid-template-columns: 42px 16px minmax(0, 1fr);
  gap: 9px;
  min-height: 82px;
}

.timeline-item::before {
  left: 49px;
}

.timeline-date {
  padding-top: 4px;
}

.timeline-day {
  font-size: 21px;
}

.timeline-card {
  gap: 8px;
  margin-bottom: 9px;
  padding: 8px;
}

.timeline-card-head .date-label {
  font-size: 15px;
}

.timeline-card-head .meta {
  margin-top: 1px;
}

.part-line {
  gap: 7px;
}

.notes,
.vods {
  padding-top: 7px;
}

@media (max-width: 380px) {
  .channel-headline {
    display: grid;
    align-items: start;
  }

  .schedule-controls .subcopy {
    text-align: left;
  }

  .timeline-item {
    grid-template-columns: 38px 16px minmax(0, 1fr);
    gap: 8px;
  }

  .timeline-item::before {
    left: 45px;
  }
}
.schedule-first .status-strip {
  display: none;
}

.schedule-controls .subcopy {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Schedule-only mode */
.schedule-only {
  padding-top: 12px;
}

.schedule-title {
  margin-bottom: 12px;
}

.schedule-title h1 {
  margin-top: 2px;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.05;
}

.schedule-title .subcopy {
  margin-top: 6px;
  font-size: 12px;
}

.schedule-only .timeline-item {
  min-height: 80px;
}

.schedule-only .timeline-card {
  margin-bottom: 8px;
}

.schedule-only .timeline-list {
  display: grid;
  gap: 10px;
  padding: 0;
}

.schedule-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.schedule-card:active {
  transform: translateY(1px);
}

.schedule-card.today {
  border-color: rgba(0, 138, 67, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.schedule-card.off {
  border-color: rgba(180, 91, 0, 0.26);
}

.schedule-card.empty {
  background: #fbfcfd;
}

.schedule-card-date {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-height: 58px;
  border-radius: 7px;
  background: #eef2f4;
  color: var(--muted);
}

.schedule-card.today .schedule-card-date {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.schedule-card.off .schedule-card-date {
  background: #fff3e6;
  color: var(--warn);
}

.schedule-card-day {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.schedule-card-weekday {
  font-size: 12px;
  font-weight: 900;
}

.schedule-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}
/* Week/month schedule views */
.schedule-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.schedule-view {
  display: none;
}

.schedule-view.active {
  display: block;
}

.month-head {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.month-head h2 {
  text-align: center;
  font-size: 18px;
}

.month-nav {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.month-weekday {
  padding: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.month-cell {
  min-height: 116px;
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.month-cell.today {
  border-color: rgba(0, 138, 67, 0.58);
  box-shadow: inset 0 0 0 1px rgba(0, 138, 67, 0.12);
}

.month-cell.has-entry .month-cell-title {
  color: var(--text);
  font-weight: 800;
}

.month-cell.off .month-cell-title {
  color: var(--warn);
}

.month-cell.empty {
  background: #fbfcfd;
}

.month-blank {
  border-color: transparent;
  background: transparent;
}

.month-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin-bottom: 8px;
}

.month-day {
  font-size: 13px;
  font-weight: 900;
}

.month-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.month-items {
  display: grid;
  gap: 3px;
  max-height: 74px;
  overflow: hidden;
}

.month-cell-title {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-error {
  grid-column: 1 / -1;
}

.month-cell[data-calendar-date] {
  cursor: pointer;
}

.month-cell[data-calendar-date]:focus-visible {
  outline: 2px solid rgba(47, 109, 246, 0.52);
  outline-offset: 2px;
}

/* Calendar-first mobile layout */
.schedule-only {
  padding-top: 10px;
}

.schedule-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.schedule-title h1 {
  font-size: 24px;
  line-height: 1.1;
}

.schedule-view.active + .schedule-view.active {
  margin-top: 18px;
}

.month-head {
  grid-template-columns: 36px 1fr 36px;
  margin-bottom: 16px;
}

.month-head h2 {
  font-size: 20px;
  font-weight: 900;
}

.month-nav {
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.month-grid {
  gap: 8px 6px;
  padding: 2px 4px 8px;
}

.month-weekday {
  padding-bottom: 8px;
  color: #4f5962;
  font-size: 12px;
}

.month-cell {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.month-cell.empty {
  background: transparent;
}

.month-cell.today {
  border-color: transparent;
  box-shadow: none;
}

.month-cell.selected {
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.month-cell.selected .month-day {
  position: relative;
  z-index: 0;
  color: #ffffff;
}

.month-cell.selected .month-day::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  z-index: -1;
  border-radius: 50%;
  background: #2f6df6;
  box-shadow: 0 8px 18px rgba(47, 109, 246, 0.28);
  transform: translate(-50%, -50%);
}

.month-cell.selected .month-dot {
  color: #ffffff;
}

.month-cell.off {
  color: var(--warn);
}

.month-blank {
  min-height: 40px;
  border: 0;
}

.month-day-row {
  display: grid;
  place-items: center;
  margin: 0;
}

.month-day {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.month-cell.today:not(.selected) .month-day {
  color: var(--accent-strong);
}

.month-dot {
  width: 6px;
  height: 6px;
  background: #2f6df6;
  opacity: 1;
  transition: none;
}

.month-cell.off .month-dot {
  background: var(--warn);
}

.month-cell.selected .month-dot {
  position: static;
  bottom: auto;
  opacity: 0;
  background: #2f6df6;
  transform: none;
}

.selected-schedule-view {
  padding: 16px;
  border: 1px solid rgba(223, 228, 232, 0.86);
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -8px 30px rgba(25, 31, 36, 0.08);
}

.selected-schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.selected-schedule-head h2 {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 900;
}

.calendar-list {
  display: grid;
  gap: 8px;
}

.schedule-card {
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #ffffff;
}

.schedule-card.today {
  background: #ffffff;
}

.schedule-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 46px;
  min-width: 0;
  padding-right: 11px;
  border-right: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.schedule-card.off .schedule-card-tag {
  color: var(--warn);
}

.schedule-card.empty .schedule-card-tag {
  color: var(--muted);
}

.schedule-card-main {
  gap: 6px;
  min-height: 46px;
  align-content: center;
}

.schedule-card .timeline-card-head {
  align-items: center;
  min-height: 46px;
}

.schedule-card .date-label {
  font-size: 15px;
  line-height: 1.35;
}

.schedule-card .badge {
  min-height: 28px;
  border-radius: 999px;
}

@media (max-width: 380px) {
  .schedule-title {
    display: grid;
    align-items: start;
  }

  .month-grid {
    gap: 4px;
  }

  .month-cell,
  .month-blank {
    min-height: 36px;
  }

  .month-day {
    font-size: 16px;
  }

  .selected-schedule-view {
    padding: 14px 12px;
  }

  .schedule-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }
}

/* Extension-aligned dark mobile theme */
:root {
  color-scheme: dark;
  --bg: #0f1012;
  --surface: #1b1c1f;
  --surface-strong: #232427;
  --surface-hover: #2b2d31;
  --text: #efeff1;
  --muted: #9d9ea3;
  --muted-weak: #6b6d73;
  --line: #2e3033;
  --line-strong: #3a3c40;
  --accent: #00c878;
  --accent-strong: #00ffa3;
  --accent-soft: rgba(0, 255, 163, 0.12);
  --warn: #e8c268;
  --purple: #c4b5fd;
  --purple-soft: rgba(167, 139, 250, 0.22);
  --radius: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 255, 163, 0.08), transparent 34%),
    var(--bg);
}

.app-shell {
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.topbar {
  height: 56px;
  background: rgba(15, 16, 18, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
}

.brand-icon {
  border-radius: 6px;
}

.topbar-actions {
  flex: 1 1 auto;
}

.topbar-updated {
  color: var(--muted-weak);
  font-size: 11px;
  font-weight: 700;
  max-width: min(60vw, 260px);
}

.icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 18px;
}

.main {
  width: min(100%, 560px);
  padding: 8px;
}

.schedule-title {
  margin-bottom: 10px;
  padding: 12px 14px 0;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.schedule-title h1 {
  margin-top: 2px;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.subcopy {
  color: var(--muted-weak);
  font-size: 12px;
}

#monthView {
  padding: 12px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.month-head {
  grid-template-columns: 32px 1fr 32px;
  margin-bottom: 12px;
}

.month-head h2 {
  color: #c9cacd;
  font-size: 18px;
  font-weight: 900;
}

.month-nav {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.month-nav-icon {
  display: grid;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.month-nav:active {
  transform: translateY(1px);
}

.month-grid {
  gap: 11px 8px;
  padding: 2px 2px 8px;
}

.month-weekday {
  padding: 0 0 6px;
  color: var(--muted-weak);
  font-size: 12px;
  font-weight: 800;
}

.month-cell,
.month-blank {
  min-height: 46px;
}

.month-cell {
  color: #c9cacd;
  border-radius: 6px;
}

.month-cell:hover {
  background: transparent;
}

.month-day {
  position: relative;
  z-index: 0;
  font-size: 16px;
  font-weight: 800;
}

.month-day::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  z-index: -1;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.month-cell.today:not(.selected) {
  background: transparent;
}

.month-cell.today:not(.selected) .month-day {
  color: var(--accent-strong);
}

.month-cell.selected {
  background: transparent;
  color: #c9cacd;
  box-shadow: none;
}

.month-cell.selected .month-day {
  color: #062b20;
}

.month-cell.selected .month-day::before {
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 255, 163, 0.36), 0 8px 18px rgba(0, 200, 120, 0.22);
}

.month-cell.off {
  color: var(--warn);
}

.month-cell.off.selected .month-day {
  color: #1b1c1f;
}

.month-cell.off.selected .month-day::before {
  background: var(--warn);
  box-shadow: 0 0 0 1px rgba(232, 194, 104, 0.28), 0 8px 18px rgba(232, 194, 104, 0.16);
}

.month-dot {
  width: 5px;
  height: 5px;
  background: var(--accent-strong);
  opacity: 1;
  transition: none;
}

.month-cell.off .month-dot {
  background: var(--warn);
}

.month-cell.selected .month-dot {
  position: static;
  bottom: auto;
  opacity: 0;
  background: #062b20;
  transform: none;
}

.month-cell,
.month-cell:active,
.month-cell.selected,
.month-cell.selected .month-dot,
.month-day {
  transform: none;
  transition: none;
}

.month-day::before {
  transition: none;
}

.schedule-view.active + .schedule-view.active {
  margin-top: 0;
}

.selected-schedule-view {
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(15, 16, 18, 0.45);
  box-shadow: none;
}

.selected-schedule-head {
  margin-bottom: 10px;
}

.selected-schedule-head h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.calendar-list {
  gap: 8px;
}

.schedule-card {
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: none;
}

.schedule-card.today {
  border-color: rgba(0, 255, 163, 0.28);
  background: rgba(0, 255, 163, 0.08);
}

.schedule-card.off {
  border-color: rgba(232, 194, 104, 0.22);
}

.schedule-card.empty {
  background: rgba(35, 36, 39, 0.72);
}

.schedule-card-tag {
  min-height: 34px;
  padding: 4px 9px 4px 0;
  border-right: 1px solid var(--line-strong);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.schedule-card-tag.special {
  color: var(--purple);
}

.schedule-card-tag.speculative {
  color: var(--warn);
}

.schedule-card.off .schedule-card-tag {
  color: var(--muted);
}

.schedule-card.empty .schedule-card-tag {
  color: var(--muted-weak);
}

.schedule-card-main,
.schedule-card .timeline-card-head {
  min-height: 34px;
}

.schedule-card .timeline-card-head {
  justify-content: flex-start;
}

.schedule-card .date-label {
  color: #c9cacd;
  font-size: 14px;
  font-weight: 700;
}

.schedule-card.today .date-label {
  color: var(--text);
}

.schedule-inline-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.16);
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-card-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.schedule-card-member {
  min-width: 0;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-card-notes {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(58, 60, 64, 0.72);
  border-radius: 6px;
  background: rgba(15, 16, 18, 0.34);
}

.schedule-card-notes-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-card-note {
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted-weak);
}

.empty-state {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.skeleton {
  background: #2b2d31;
}

.skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

@media (max-width: 380px) {
  .main {
    padding: 10px;
  }

  .schedule-title {
    padding-inline: 12px;
  }

  #monthView,
  .selected-schedule-view {
    padding-inline: 12px;
  }

  .month-grid {
    gap: 8px 5px;
  }

  .month-cell,
  .month-blank {
    min-height: 42px;
  }

  .schedule-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }
}



.mobile-info-section {
  margin-top: 12px;
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mobile-info-head {
  margin-bottom: 10px;
}

.mobile-info-head h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.mobile-info-list {
  display: grid;
  gap: 8px;
}

.mobile-info-card {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(58, 60, 64, 0.72);
  border-radius: 6px;
  background: var(--surface-strong);
  color: #c9cacd;
}

.mobile-info-card.loading {
  grid-template-columns: 1fr;
}

.mobile-info-marker {
  width: 3px;
  min-height: 100%;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.78;
}

.mobile-info-text {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.mobile-info-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
  padding: 6px 2px 2px;
}

.mobile-info-section-title::after,
.mobile-info-group-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 255, 163, 0.36), rgba(255, 255, 255, 0.05));
}

.mobile-info-group .mobile-info-text {
  display: grid;
  gap: 8px;
}

.mobile-info-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.3;
  white-space: normal;
}

.mobile-info-detail {
  display: grid;
  gap: 7px;
  padding: 8px 0;
}

.mobile-info-detail + .mobile-info-detail {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-info-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-info-detail-head[data-info-toggle] {
  margin: -4px -5px;
  padding: 4px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.mobile-info-detail-head[data-info-toggle]:active {
  background: rgba(0, 255, 163, 0.08);
}

.mobile-info-detail-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mobile-info-detail-toggle {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 255, 163, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.mobile-info-detail-body {
  padding: 0 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.mobile-info-detail-body[hidden] {
  display: none;
}

.mobile-info-detail.title-only {
  padding-bottom: 4px;
}

@media (max-width: 380px) {
  .mobile-info-section {
    padding-inline: 12px;
  }
}





/* Fixed selected schedule and info popup */
.schedule-only {
  padding-bottom: calc(230px + max(14px, env(safe-area-inset-bottom)));
}

#monthView {
  margin-bottom: 0;
}

.selected-schedule-view {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 40;
  width: min(calc(100% - 20px), 560px);
  max-height: min(38dvh, 270px);
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px 14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(15, 16, 18, 0.94);
  box-shadow: 0 -14px 46px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.selected-schedule-head {
  margin-bottom: 8px;
}

.selected-schedule-head h2 {
  font-size: 15px;
  font-weight: 900;
}

.calendar-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

#infoBtn.open {
  border-color: rgba(0, 255, 163, 0.38);
  background: rgba(0, 255, 163, 0.12);
  color: var(--accent-strong);
}

#infoBtn span {
  font-family: ui-serif, Georgia, serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}

.info-popup[hidden] {
  display: none;
}

.info-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: calc(64px + env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.54);
}

.info-popup-panel {
  width: min(100%, 560px);
  max-height: min(72dvh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.info-popup-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.info-popup-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-popup-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.info-popup-list {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

body.info-popup-open {
  overflow: hidden;
}

@media (max-width: 380px) {
  .schedule-only {
    padding-bottom: calc(220px + max(12px, env(safe-area-inset-bottom)));
  }

  .selected-schedule-view {
    width: min(calc(100% - 16px), 560px);
    max-height: min(40dvh, 250px);
    padding-inline: 12px;
  }
}

/* Content-sized schedule cells */
.calendar-list {
  align-items: stretch;
}

.schedule-card {
  grid-template-columns: minmax(58px, max-content) minmax(0, 1fr);
  align-items: stretch;
  min-height: max-content;
  height: auto;
  overflow: visible;
}

.schedule-card-tag {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: max-content;
  max-width: 104px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-card-main,
.schedule-card .timeline-card-head {
  min-height: max-content;
}

.schedule-card .timeline-card-head {
  align-items: center;
}

.schedule-card .date-label,
.part-text,
.schedule-card-member,
.schedule-card-note {
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-inline-tag {
  white-space: normal;
}

@media (max-width: 380px) {
  .schedule-card {
    grid-template-columns: minmax(54px, max-content) minmax(0, 1fr);
  }

  .schedule-card-tag {
    max-width: 92px;
  }
}

/* Dense schedule card layout */
.selected-schedule-view {
  max-height: min(46dvh, 340px);
}

.schedule-only {
  padding-bottom: calc(300px + max(14px, env(safe-area-inset-bottom)));
}

.schedule-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
}

.schedule-card-tag {
  justify-self: start;
  align-self: start;
  min-height: 0;
  max-width: 100%;
  padding: 3px 8px;
  border-right: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  line-height: 1.25;
}

.schedule-card.off .schedule-card-tag {
  background: rgba(232, 194, 104, 0.12);
}

.schedule-card.empty .schedule-card-tag {
  background: rgba(157, 158, 163, 0.12);
}

.schedule-card-main {
  width: 100%;
  gap: 8px;
}

.schedule-card .timeline-card-head {
  min-width: 0;
  width: 100%;
}

.schedule-card .date-label {
  min-width: 0;
  line-height: 1.45;
}

.part-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.part-tag {
  max-width: min(112px, 34vw);
}

@media (max-width: 380px) {
  .selected-schedule-view {
    max-height: min(48dvh, 320px);
  }

  .schedule-only {
    padding-bottom: calc(280px + max(12px, env(safe-area-inset-bottom)));
  }

  .schedule-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .part-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .part-tag {
    max-width: 100%;
    width: fit-content;
  }
}

/* Roomier schedule cards */
.selected-schedule-view {
  max-height: min(54dvh, 430px);
}

.schedule-only {
  padding-bottom: calc(370px + max(14px, env(safe-area-inset-bottom)));
}

.calendar-list {
  gap: 12px;
}

.schedule-card {
  min-height: 96px;
  padding: 16px 14px;
  gap: 12px;
}

.schedule-card-tag {
  min-height: 26px;
  padding: 5px 10px;
}

.schedule-card-main {
  gap: 10px;
}

.schedule-card .date-label {
  font-size: 15px;
  line-height: 1.55;
}

.content-lines {
  gap: 10px;
}

.part-line {
  gap: 9px;
}

.schedule-card-members {
  gap: 6px;
  margin-top: 4px;
}

.schedule-card-notes {
  margin-top: 8px;
  padding: 12px 14px;
}

@media (max-width: 380px) {
  .selected-schedule-view {
    max-height: min(54dvh, 390px);
  }

  .schedule-only {
    padding-bottom: calc(330px + max(12px, env(safe-area-inset-bottom)));
  }

  .schedule-card {
    min-height: 88px;
    padding: 14px 12px;
  }
}

/* Fluid schedule frame */
.selected-schedule-view {
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 86px - max(8px, env(safe-area-inset-bottom)));
  grid-template-rows: auto minmax(0, auto);
  overflow: visible;
}

.schedule-only {
  padding-bottom: calc(clamp(260px, 46dvh, 520px) + max(14px, env(safe-area-inset-bottom)));
}

.calendar-list {
  max-height: calc(100dvh - 150px - max(8px, env(safe-area-inset-bottom)));
  overflow-y: auto;
  align-content: start;
}

.schedule-card {
  min-height: 0;
  height: auto;
  align-items: start;
  contain: layout paint;
}

.schedule-card-tag {
  width: fit-content;
  max-width: 100%;
  align-self: start;
}

.schedule-card-main,
.schedule-card .timeline-card-head,
.schedule-card .timeline-card-head > div {
  width: 100%;
  min-width: 0;
}

.schedule-card .date-label,
.part-text,
.schedule-inline-tag,
.schedule-card-member,
.schedule-card-note {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.part-line {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  min-width: 0;
}

.part-tag {
  max-width: min(128px, 38vw);
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-card-notes {
  min-width: 0;
  overflow: visible;
}

@media (max-width: 380px) {
  .selected-schedule-view {
    max-height: calc(100dvh - 78px - max(8px, env(safe-area-inset-bottom)));
  }

  .schedule-only {
    padding-bottom: calc(clamp(240px, 48dvh, 500px) + max(12px, env(safe-area-inset-bottom)));
  }

  .calendar-list {
    max-height: calc(100dvh - 138px - max(8px, env(safe-area-inset-bottom)));
  }
}

/* Viewport-capped schedule view */
.selected-schedule-view {
  max-height: 40dvh;
  overflow: hidden;
}

.schedule-only {
  padding-bottom: calc(40dvh + max(22px, env(safe-area-inset-bottom)));
}

.calendar-list {
  max-height: calc(40dvh - 58px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 380px) {
  .selected-schedule-view {
    max-height: 40dvh;
  }

  .schedule-only {
    padding-bottom: calc(40dvh + max(18px, env(safe-area-inset-bottom)));
  }

  .calendar-list {
    max-height: calc(40dvh - 54px);
  }
}

/* Scroll frame, fluid cards */
.selected-schedule-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.calendar-list {
  display: grid;
  grid-auto-rows: max-content;
  align-items: start;
  overflow-x: hidden;
}

.schedule-card {
  min-height: max-content;
  height: auto;
  contain: none;
  overflow: visible;
}

.schedule-card-main,
.schedule-card .timeline-card-head,
.content-lines,
.part-line,
.schedule-card-members,
.schedule-card-notes {
  height: auto;
  max-height: none;
  overflow: visible;
}

.schedule-card .date-label,
.part-text,
.schedule-card-note {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.schedule-inline-tag,
.part-tag,
.schedule-card-member {
  height: auto;
  max-height: none;
}

/* Rounded standalone month view */
#monthView {
  border-radius: var(--radius);
}

/* Disabled month navigation */
.month-nav:disabled {
  opacity: 0.28;
  color: var(--muted-weak);
  border-color: var(--line);
  background: rgba(35, 36, 39, 0.45);
  box-shadow: none;
  transform: none;
}

.month-nav:disabled .month-nav-icon {
  color: inherit;
}

/* Non-interactive schedule cards */
.schedule-card {
  cursor: default;
  transition: border-color 160ms ease, background 160ms ease;
}

.schedule-card:active {
  transform: none;
}

.schedule-card a,
.schedule-card button {
  cursor: pointer;
}

/* Centered info popup */
.info-popup {
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
}

.info-popup-panel {
  max-height: min(82dvh, 620px);
}

/* Attached calendar and selected schedule */
.schedule-only {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

#monthView {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.schedule-view.active + .schedule-view.active {
  margin-top: 0;
}

.selected-schedule-view {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  max-height: none;
  transform: none;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.calendar-list {
  max-height: none;
  overflow-y: visible;
}

@media (max-width: 380px) {
  .schedule-only {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .selected-schedule-view {
    width: 100%;
    max-height: none;
  }

  .calendar-list {
    max-height: none;
  }
}

/* Center attached mobile schedule stack */
.schedule-only {
  min-height: calc(100dvh - 58px);
  justify-content: center;
}

@media (max-height: 720px) {
  .schedule-only {
    min-height: 0;
    justify-content: flex-start;
  }
}

/* Part memo chips */
.schedule-card-part-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.schedule-card-part-notes .schedule-card-note {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(180, 91, 0, 0.18);
  border-radius: 999px;
  background: rgba(180, 91, 0, 0.08);
}

/* Scrollable swipe surfaces */
html,
body,
.app-shell,
.main,
.schedule-only,
.schedule-view,
.month-grid,
.month-cell,
.selected-schedule-view,
.calendar-list,
.schedule-card,
.schedule-card-main,
.content-lines,
.part-line,
.part-text,
.schedule-card-members,
.schedule-card-part-notes,
.schedule-card-notes,
.mobile-info-card,
.mobile-info-text {
  touch-action: pan-y;
}

.calendar-list,
.info-popup-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.schedule-card a,
.month-nav,
.icon-button {
  touch-action: manipulation;
}

/* Force page scroll inside schedule views */
.schedule-view,
#monthView,
.selected-schedule-view,
.schedule-list,
.calendar-list,
.schedule-card,
.schedule-card-main {
  overflow: visible !important;
  overscroll-behavior: auto !important;
  touch-action: pan-y !important;
}

.month-grid,
.month-cell,
.schedule-card-tag,
.schedule-card .timeline-card-head,
.content-lines,
.part-line,
.part-text,
.schedule-card-member,
.schedule-card-note {
  touch-action: pan-y !important;
}

.month-cell {
  -webkit-user-drag: none;
}

/* Streamer directive badges */
.schedule-inline-streamer {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  margin: 1px 3px 1px 0;
  padding: 3px 8px;
  border: 1px solid rgba(82, 118, 255, 0.22);
  border-radius: 999px;
  background: rgba(82, 118, 255, 0.1);
  color: #8ea2ff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  vertical-align: baseline;
  white-space: normal;
  overflow-wrap: anywhere;
  touch-action: pan-y !important;
}

/* Collab member label badge */
.schedule-card-member-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(0, 255, 163, 0.22);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  touch-action: pan-y !important;
}

/* PC front parity polish */
body {
  background: #0f1012;
}

.app-shell {
  background: #0f1012;
}

.topbar {
  height: calc(56px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: #1b1c1f;
  border-bottom-color: #2e3033;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.app-update-banner[hidden] { display: none; }
.app-update-banner { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 9; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 38px; padding: 7px max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid rgba(0,255,163,0.3); background: #124233; color: #d7f7ea; font-size: 12px; font-weight: 800; }
.app-update-banner button { flex: 0 0 auto; min-height: 26px; padding: 4px 9px; border: 1px solid rgba(0,255,163,0.48); border-radius: 7px; background: rgba(0,255,163,0.16); color: #bfffe7; font-size: 12px; font-weight: 900; cursor: pointer; }
.app-update-banner button:disabled { opacity: 0.65; cursor: wait; }

.icon-button,
.month-nav {
  border-color: #3a3c40;
  background: #232427;
  color: #00ffa3;
  box-shadow: none;
}

.icon-button:active,
.month-nav:active {
  background: #2b2d31;
}

.main {
  padding: 10px 40px max(18px, env(safe-area-inset-bottom));
}

.schedule-only {
  gap: 0;
}

.schedule-title {
  margin: 0 0 -1px;
  padding: 10px 14px 9px;
  border: 1px solid #2e3033;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #1b1c1f;
}

.schedule-title h1 {
  color: #efeff1;
  font-size: 16px;
  font-weight: 700;
}

.eyebrow {
  color: #00ffa3;
  font-size: 12px;
  font-weight: 800;
}

.subcopy,
.topbar-updated {
  color: #9d9ea3;
}

#monthView {
  border-color: #2e3033;
  border-radius: 0;
  background: #1b1c1f;
  box-shadow: none;
}

.month-head h2 {
  color: #c9cacd;
}

.month-weekday {
  color: #6b6d73;
}

.month-cell {
  color: #c9cacd;
  border: 1px solid transparent;
  background: transparent;
}

.month-cell[data-calendar-date]:focus-visible {
  outline-color: #00ffa3;
}

.month-cell.today:not(.selected) .month-day {
  color: #00ffa3;
}

.month-cell.selected .month-day {
  color: #062b20;
}

.month-cell.selected .month-day::before {
  background: #00c878;
  box-shadow: 0 0 0 1px rgba(0, 255, 163, 0.36);
}

.month-dot {
  background: #00ffa3;
}

.month-cell.off {
  color: #e8c268;
}

.selected-schedule-view {
  border-color: #2e3033;
  background: #1b1c1f;
}

.selected-schedule-head h2 {
  color: #efeff1;
  font-size: 15px;
  font-weight: 700;
}

.schedule-card {
  border-color: transparent;
  border-radius: 8px;
  background: #232427;
  color: #c9cacd;
}

.schedule-card.today {
  border-color: rgba(0, 255, 163, 0.28);
  background: rgba(0, 255, 163, 0.1);
}

.schedule-card.off {
  border-color: rgba(232, 194, 104, 0.24);
  background: rgba(232, 194, 104, 0.08);
}

.schedule-card.empty {
  background: #232427;
}

.schedule-card-tag,
.part-tag {
  color: #00ffa3;
  background: rgba(0, 255, 163, 0.12);
  border-color: rgba(0, 255, 163, 0.2);
}

.schedule-card-tag {
  border-right-color: #3a3c40;
  background: transparent;
}

.schedule-card-tag.special,
.part-tag.special,
.schedule-inline-tag {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.35);
}

.schedule-card-tag.speculative,
.part-tag.speculative {
  color: #e8c268;
  background: rgba(232, 194, 104, 0.14);
  border-color: rgba(232, 194, 104, 0.28);
}

.schedule-card .date-label,
.part-text {
  color: #c9cacd;
}

.schedule-card.today .date-label {
  color: #efeff1;
}

.schedule-inline-streamer,
.schedule-card-member,
.schedule-card-member-label {
  min-height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.schedule-card-member-label {
  border-color: rgba(157, 158, 163, 0.24);
  background: rgba(157, 158, 163, 0.14);
  color: #c9cacd;
}

.schedule-card-member,
.schedule-inline-streamer {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.schedule-card-notes,
.schedule-card-part-notes .schedule-card-note {
  border-color: #3a3c40;
  background: #1f2023;
}

.schedule-card-note {
  color: #c9cacd;
}

.mobile-info-section,
.info-popup-panel {
  border: 1px solid #3a3c40;
  border-radius: 10px;
  background: #1b1c1f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.mobile-info-head h2,
.info-popup-head h2 {
  color: #efeff1;
}

.mobile-info-card {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: transparent;
}

.mobile-info-marker {
  background: rgba(0, 255, 163, 0.55);
}

.mobile-info-text {
  color: #c9cacd;
}

.info-popup-close {
  border-color: #3a3c40;
  background: #232427;
  color: #9d9ea3;
}

.info-popup-close:active {
  background: #2b2d31;
  color: #efeff1;
}

/* Schedule detail readability pass */
.selected-schedule-view {
  padding: 14px;
  background: #18191c;
}

.selected-schedule-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.selected-schedule-start-time {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: auto;
  padding: 4px 9px;
  border: 1px solid rgba(0, 255, 163, 0.28);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.12);
  color: #8fffd5;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.selected-schedule-start-time[hidden] {
  display: none !important;
}

.selected-schedule-head h2 {
  color: #f4fff9;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.selected-schedule-view .calendar-list {
  display: grid;
  gap: 10px;
  padding-top: 0;
}

.selected-schedule-view .schedule-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid rgba(157, 158, 163, 0.18);
  border-radius: 8px;
  background: #202124;
  color: #f2f3f5;
}

.selected-schedule-view .schedule-card.today {
  border-color: rgba(0, 255, 163, 0.42);
  background: #202823;
}

.selected-schedule-view .schedule-card.off {
  border-color: rgba(232, 194, 104, 0.36);
  background: #242119;
}

.selected-schedule-view .schedule-card.empty {
  border-color: rgba(157, 158, 163, 0.16);
  background: #202124;
}

.selected-schedule-view .schedule-card-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 255, 163, 0.28);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.12);
  color: #8fffd5;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.selected-schedule-view .schedule-card-tag.special {
  border-color: rgba(196, 181, 253, 0.42);
  background: rgba(167, 139, 250, 0.2);
  color: #d7c5ff;
}

.selected-schedule-view .schedule-card-tag.speculative {
  border-color: rgba(232, 194, 104, 0.34);
  background: rgba(232, 194, 104, 0.14);
  color: #f5d98e;
}

.selected-schedule-view .schedule-card-main {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.selected-schedule-view .schedule-card .timeline-card-head,
.selected-schedule-view .schedule-card .timeline-card-head > div {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.selected-schedule-view .schedule-card .date-label {
  display: block;
  width: 100%;
  min-width: 0;
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.selected-schedule-view .schedule-card.today .date-label,
.selected-schedule-view .schedule-card.off .date-label {
  color: #ffffff;
}

.selected-schedule-view .part-text {
  display: block;
  min-width: 0;
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.55;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.selected-schedule-view .part-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 2px 0;
}

.selected-schedule-view .part-tag,
.selected-schedule-view .schedule-inline-tag,
.selected-schedule-view .schedule-inline-streamer,
.selected-schedule-view .schedule-card-member,
.selected-schedule-view .schedule-card-member-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 23px;
  padding: 4px 8px;
  border-width: 1px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.selected-schedule-view .part-tag {
  flex: 0 0 auto;
  color: #8fffd5;
}

.selected-schedule-view .schedule-inline-tag {
  color: #decfff;
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(196, 181, 253, 0.48);
}

.selected-schedule-view .schedule-inline-streamer,
.selected-schedule-view .schedule-card-member {
  color: #decfff;
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(196, 181, 253, 0.42);
}

.selected-schedule-view .schedule-card-member-label {
  color: #e7e8eb;
  background: rgba(157, 158, 163, 0.2);
  border-color: rgba(201, 202, 205, 0.3);
  white-space: nowrap;
}

.selected-schedule-view .schedule-card-members,
.selected-schedule-view .schedule-card-part-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-top: 0;
}

.selected-schedule-view .schedule-card-notes {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding: 11px 12px;
  border: 1px solid rgba(232, 194, 104, 0.28);
  border-radius: 8px;
  background: rgba(232, 194, 104, 0.08);
}

.selected-schedule-view .schedule-card-notes-title {
  color: #f5d98e;
  font-size: 12px;
  font-weight: 900;
}

.selected-schedule-view .schedule-card-note,
.selected-schedule-view .schedule-card-part-notes .schedule-card-note {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(232, 194, 104, 0.32);
  border-radius: 999px;
  background: rgba(232, 194, 104, 0.1);
  color: #f1d997;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.selected-schedule-view .schedule-card .muted {
  color: #b6b8bd;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 380px) {
  .selected-schedule-view {
    padding: 12px;
  }

  .selected-schedule-view .schedule-card {
    gap: 8px;
    padding: 11px;
  }

  .selected-schedule-view .schedule-card .date-label,
  .selected-schedule-view .part-text {
    font-size: 14px;
  }
}

/* PC hover detail layout on mobile */
.selected-schedule-view .schedule-list {
  display: block;
}

.schedule-detail {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #3a3c40;
  border-radius: 10px;
  background: #26272b;
  color: #c9cacd;
  box-shadow: none;
}

.schedule-detail.today {
  border-color: rgba(0, 255, 163, 0.36);
}

.schedule-detail.off {
  border-color: rgba(232, 194, 104, 0.34);
}

.schedule-detail.empty {
  border-color: rgba(157, 158, 163, 0.2);
}

.schedule-detail-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.schedule-detail-date {
  color: #efeff1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.schedule-detail-title {
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border-left: 3px solid #00ffa3;
  border-radius: 7px;
  background: rgba(0, 255, 163, 0.1);
  color: #f4fff9;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.schedule-detail-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  min-height: 24px;
}

.schedule-detail-icon {
  flex: 0 0 auto;
  color: #9d9ea3;
  font-size: 12px;
  line-height: 1.5;
}

.schedule-detail-text {
  min-width: 0;
  color: #c9cacd;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-detail-parts {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-top: 1px;
}

.schedule-detail-part {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(157, 158, 163, 0.18);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.schedule-detail-part-main {
  align-items: flex-start;
}

.schedule-detail-part-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  max-width: 96px;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(0, 255, 163, 0.22);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.12);
  color: #7dffcf;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.schedule-detail-part-label.special {
  border-color: rgba(196, 181, 253, 0.38);
  background: rgba(167, 139, 250, 0.22);
  color: #c4b5fd;
}

.schedule-detail-part-label.speculative {
  border-color: rgba(232, 194, 104, 0.3);
  background: rgba(232, 194, 104, 0.14);
  color: #e8c268;
}

.schedule-detail-part-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #f2f3f5;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.schedule-detail-part-text .schedule-inline-tag,
.schedule-detail-part-text .schedule-inline-streamer {
  color: inherit;
}

.schedule-detail-members-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.schedule-detail-members-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(157, 158, 163, 0.14);
  color: #c9cacd;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.schedule-detail-members {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.schedule-detail-member {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(157, 158, 163, 0.14);
  color: #c9cacd;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-detail-part-notes {
  display: grid;
  gap: 6px;
  margin-top: 1px;
  padding-top: 7px;
  border-top: 1px solid rgba(0, 255, 163, 0.16);
}

.schedule-detail-note-text {
  color: #c9cacd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.schedule-detail .schedule-card-notes {
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #3a3c40;
  border-radius: 8px;
  background: #1f2023;
}

.schedule-detail .schedule-card-notes-title {
  color: #9d9ea3;
}

.schedule-detail .schedule-card-note {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c9cacd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.schedule-detail-empty-text {
  color: #c9cacd;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .schedule-detail {
    padding: 11px 12px;
  }

  .schedule-detail-part-label {
    max-width: 100%;
  }

  .schedule-detail-title,
  .schedule-detail-part-text {
    font-size: 14px;
  }
}

/* Plain collab member text in mobile detail */
.schedule-detail-members-plain {
  gap: 0;
  color: #c9cacd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.schedule-detail-member-text {
  display: inline;
  color: #c9cacd;
  font: inherit;
  line-height: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.schedule-detail-member-text + .schedule-detail-member-text::before {
  content: ", ";
  color: #8b8d92;
}

/* Move mobile detail frame color from outer article to detail parts */
.schedule-detail {
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.schedule-detail.today,
.schedule-detail.off,
.schedule-detail.empty {
  border-color: transparent;
}

.schedule-detail-part {
  padding: 12px 14px;
  border: 1px solid #3a3c40;
  border-radius: 10px;
  background: #26272b;
}

.schedule-detail.today .schedule-detail-part {
  border-color: rgba(0, 255, 163, 0.36);
}

.schedule-detail.off .schedule-detail-part {
  border-color: rgba(232, 194, 104, 0.34);
}

.schedule-detail.empty .schedule-detail-part {
  border-color: rgba(157, 158, 163, 0.2);
}

.schedule-detail > .schedule-card-notes {
  border-color: #3a3c40;
  background: #26272b;
}

.schedule-detail-empty-text {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #3a3c40;
  border-radius: 10px;
  background: #26272b;
}

@media (max-width: 380px) {
  .schedule-detail {
    padding: 0;
  }

  .schedule-detail-part,
  .schedule-detail-empty-text {
    padding: 11px 12px;
  }
}

/* Deployment width behavior */
html,
body {
  overflow-x: auto;
}

.app-shell {
  min-width: 375px;
}

.main.schedule-only {
  width: 100%;
  min-width: 375px;
  max-width: none;
  margin-inline: 0;
}

@media (max-width: 559px) {
  .topbar {
    min-width: 375px;
  }

  .main.schedule-only {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
}

/* iOS/Android standalone safe-area guardrails */
.app-shell {
  min-height: 100dvh;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.info-popup {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(10px, env(safe-area-inset-left));
}

/* Allow horizontal scroll below the deployment minimum width */
@media (max-width: 559px) {
  html,
  body,
  .app-shell,
  .main,
  .schedule-only,
  .schedule-view,
  #monthView,
  .selected-schedule-view,
  .month-grid,
  .month-cell,
  .calendar-list,
  .schedule-list,
  .schedule-detail,
  .schedule-detail-part {
    touch-action: pan-x pan-y !important;
  }

  body {
    overscroll-behavior-x: auto;
  }

  .app-shell {
    overflow-x: visible;
  }
}
/* Horizontal scroll for mobile schedule details */
.selected-schedule-view .calendar-list {
  overflow-x: hidden;
  overflow-y: visible;
}

.selected-schedule-view .schedule-detail,
.selected-schedule-view .schedule-detail-parts {
  width: 100%;
  min-width: 0;
}

.selected-schedule-view .schedule-detail-part {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  white-space: nowrap;
}

.selected-schedule-view .schedule-detail-part-scroll {
  display: inline-grid;
  width: max-content;
  min-width: 100%;
  max-width: none;
  gap: 7px;
  padding-right: 12px;
  box-sizing: border-box;
  vertical-align: top;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.selected-schedule-view .schedule-detail-empty-text,
.selected-schedule-view .schedule-detail > .schedule-card-notes {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.selected-schedule-view .schedule-detail-empty-text > *,
.selected-schedule-view .schedule-detail > .schedule-card-notes > * {
  min-width: 100%;
}

.selected-schedule-view .schedule-detail-row,
.selected-schedule-view .schedule-detail-members-row {
  display: flex;
  width: max-content;
  min-width: 0;
  max-width: none;
}

.selected-schedule-view .schedule-detail-members {
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
}

.selected-schedule-view .schedule-detail-part-label,
.selected-schedule-view .schedule-detail-part-text,
.selected-schedule-view .schedule-detail-members-chip,
.selected-schedule-view .schedule-detail-member-text,
.selected-schedule-view .schedule-detail-note-text,
.selected-schedule-view .schedule-detail .schedule-card-note {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.selected-schedule-view .schedule-detail-part-text,
.selected-schedule-view .schedule-detail-note-text,
.selected-schedule-view .schedule-detail-part-notes {
  width: max-content;
  max-width: none;
}

.selected-schedule-view .schedule-detail-note-text {
  display: inline-block;
}

.selected-schedule-view .schedule-detail-part-notes {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.selected-schedule-view .schedule-detail-part .schedule-inline-streamer {
  touch-action: pan-x pan-y !important;
  -webkit-user-select: none;
  user-select: none;
}

/* PC-matched tag badge tones */
.schedule-tag-tone,
.selected-schedule-view .schedule-inline-tag.schedule-tag-tone,
.selected-schedule-view .schedule-detail-part-label.schedule-tag-tone {
  color: var(--cs-tag-color);
  background: var(--cs-tag-bg);
  border-color: var(--cs-tag-border);
}

.schedule-detail-part-text .schedule-inline-tag.schedule-tag-tone,
.selected-schedule-view .schedule-detail-part-text .schedule-inline-tag.schedule-tag-tone {
  color: var(--cs-tag-color);
}

.mobile-media-trigger {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  padding: 2px 8px;
  border: 1px solid rgba(0, 255, 163, 0.3);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.1);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 850;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  vertical-align: baseline;
  cursor: pointer;
}

.mobile-media-trigger:active {
  transform: translateY(1px);
}

.mobile-media-popup[hidden] {
  display: none;
}

.mobile-media-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.64);
}

.mobile-media-panel {
  width: min(100%, 720px);
  max-height: min(84dvh, 640px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.mobile-media-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.mobile-media-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-media-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.mobile-media-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.mobile-media-body iframe {
  width: min(100%, 680px);
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.mobile-media-body img,
.mobile-media-body video {
  display: block;
  max-width: 100%;
  max-height: calc(84dvh - 116px);
  border-radius: 8px;
  object-fit: contain;
}

.mobile-media-empty {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.mobile-media-link,
.mobile-media-open {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.mobile-media-open {
  padding: 11px 14px 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}

body.media-popup-open {
  overflow: hidden;
}
