:root {
  --bg: #f4f9fa;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #666666;
  --line: #e0e0e0;
  --brand: #009db7;
  --brand-dark: #007a8f;
  --accent: #e5635e;
  --accent-alt: #44a62e;
  --shadow: 0 14px 40px rgba(0, 157, 183, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Encode Sans Condensed", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(229, 99, 94, 0.15), transparent 30%),
    radial-gradient(circle at bottom right, rgba(68, 166, 46, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  background-attachment: fixed;
}

.page {
  max-width: 98%;
  margin: 0 auto;
  padding: 40px 1% 56px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 14px;
  color: var(--accent);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.95;
  max-width: 740px;
}

.intro {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  margin: 16px 0 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 18px;
  align-items: end;
  padding: 22px;
  margin-bottom: 24px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button.primary {
  background: var(--brand);
  color: white;
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.secondary {
  background: #f0f0f0;
  color: var(--ink);
}

.status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  min-height: 22px;
}

.output {
  padding: 22px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: 26px;
}

.sheet-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.schedule.empty {
  padding: 22px;
  border-radius: 18px;
  background: #f0f7f9;
  color: var(--muted);
  border: 1px dashed var(--brand);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}

.day-card summary {
  list-style: none; /* Removes default triangle */
  user-select: none;
}

@media (max-width: 760px) {
  .day-card summary {
    cursor: pointer;
  }
}

@media (min-width: 761px) {
  .day-card summary {
    pointer-events: none;
  }
}

.day-card summary::-webkit-details-marker {
  display: none;
}

.day-card h3 {
  margin: 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.program-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.program-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  transition: background-color 0.15s ease, padding-left 0.2s ease;
}

@media (hover: hover) {
  .program-item:hover {
    background-color: #f4f9fa;
    padding-left: 20px;
  }
}

.program-time {
  font-weight: 800;
  color: var(--brand-dark);
}

.program-title {
  line-height: 1.35;
}

@media (max-width: 760px) {
  .page {
    padding: 24px 14px 36px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.hidden {
  display: none !important;
}

.app-signature {
  margin-top: auto;
  padding: 10px 0 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--brand-dark);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background: var(--accent-alt);
}

.toast.error {
  background: var(--accent);
}
