* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, 94vw); margin: 0 auto; }
.site-header {
  background: linear-gradient(135deg, var(--primary-color), #0b3b3d);
  color: #fff;
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.site-brand {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.8rem;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.site-brand:hover { text-decoration: none; }
.site-brand-text {
  min-width: 0;
  display: grid !important;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  justify-content: start;
  align-items: flex-start;
  gap: 1px;
}
.site-title {
  display: block !important;
  width: 100%;
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.02;
  transform: translateY(-8px);
  white-space: nowrap;
}
.site-subtitle {
  display: block !important;
  width: 100%;
  margin: 0;
  opacity: 0.92;
  font-size: 0.84rem;
  line-height: 1.2;
  transform: translateY(-7px);
  white-space: nowrap;
}
.site-logo { height: 58px; width: 58px; object-fit: contain; flex: 0 0 58px; border-radius: 8px; background: rgba(255,255,255,0.15); }
.top-nav { display: flex; gap: 0.85rem; flex: 0 0 auto; margin-left: 1rem; }
.top-nav a { color: #fff; font-weight: 600; }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.main-content { padding: 1.25rem 0 2rem; }
.section-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 1rem;
  margin-bottom: 1rem;
}
.day-menu-strip {
  margin: 0 0 1rem;
}
.day-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.day-form {
  margin: 0;
}
.day-button {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 0.52rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  min-height: 42px;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  text-align: center;
}
.day-button,
.day-button:hover {
  text-decoration: none;
}
.day-button.active { background: #0d5f5a; color: #fff; }
.day-button:hover {
  background: #0d6e68;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}
.day-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}
.day-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
.day-button.active:hover {
  background: #0b5551;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.38);
}
.feed-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.feed-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.09);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.embed-wrap,
.player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #0f172a;
}
.embed-wrap iframe,
.player-wrap iframe {
  border: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.card-body { padding: 0.9rem; }
.card-title { margin: 0 0 0.35rem; font-size: 1.04rem; }
.card-meta { margin: 0.2rem 0; font-size: 0.92rem; color: #374151; }
.feed-card .card-body .btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.55rem;
}
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-live { background: #dcfce7; color: #166534; }
.status-offline { background: #f3f4f6; color: #374151; }
.status-replay { background: #fef3c7; color: #92400e; }
.status-hidden { background: #fee2e2; color: #991b1b; }
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: 0.42rem;
  color: #b91c1c;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.live-indicator::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}
.inline-alert {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 0.7rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
}
.btn {
  display: inline-block;
  border: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 0.52rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  min-height: 42px;
  cursor: pointer;
  text-align: center;
}
.btn.secondary { background: #334155; }
.btn.warn { background: #b91c1c; }
.btn.small { padding: 0.35rem 0.66rem; font-size: 0.88rem; min-height: 0; }
.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feed-form-grid {
  grid-template-columns: minmax(0, 1fr);
}
.feed-form-grid > p {
  margin: 0;
}
label { font-weight: 600; display: block; margin-bottom: 0.35rem; }
input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.52rem 0.62rem;
  font: inherit;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.admin-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: 250px 1fr;
}
.admin-nav {
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}
.admin-nav a {
  display: block;
  color: #e2e8f0;
  padding: 0.4rem 0;
}
.admin-nav a.active,
.admin-nav a:hover { color: #fff; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
th { background: #f8fafc; }
.rich-content iframe,
.rich-content img { max-width: 100%; }
.map-wrap {
  width: 100%;
  height: 340px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d1d5db;
}
.site-footer {
  margin-top: 2rem;
  background: #111827;
  color: #d1d5db;
  padding: 1rem 0;
}
.site-footer a {
  color: #ffffff;
  text-decoration: underline;
}
.site-footer a:hover {
  color: #e2e8f0;
}
.site-footer .footer-text-link {
  text-decoration: none;
}
.site-footer .footer-text-link:hover {
  text-decoration: none;
}
.quill-wrapper {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}
.quill-wrapper .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid #e2e8f0;
}
.quill-wrapper .ql-container.ql-snow {
  border: 0;
}
.quill-wrapper .ql-editor {
  min-height: 220px;
}
.map-search-results {
  margin-top: 0.3rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  max-height: 200px;
  overflow: auto;
}
.map-result-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.45rem 0.6rem;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.map-result-item:last-child {
  border-bottom: 0;
}
.map-result-item:hover {
  background: #f1f5f9;
}
.map-inline-preview {
  margin-top: 0.35rem;
}
.assigned-feeds-list {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
  max-height: 170px;
  overflow: auto;
}
.assigned-feed-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.25rem;
  font-weight: 500;
}
.assigned-feed-item:last-child {
  margin-bottom: 0;
}
.assigned-feed-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.live-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.live-control-item {
  min-width: 0;
}
.live-control-row {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 0.5rem;
  align-items: center;
}
.live-control-row .btn.small {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
}
#live-controls-form .inline-alert {
  margin-bottom: 0.8rem;
}
.login-card {
  width: min(430px, 95vw);
  margin: 6vh auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 1rem;
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; }
  .live-controls-grid { grid-template-columns: 1fr; }
  .header-inner {
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
  }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .top-nav {
    display: none;
    width: 100%;
    margin: 0.6rem 0 0;
    background: rgba(10, 23, 42, 0.88);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    gap: 0.1rem;
    flex-direction: column;
  }
  .top-nav.open { display: flex; }
  .top-nav a {
    display: block;
    padding: 0.45rem 0.3rem;
  }
  .feed-grid { grid-template-columns: 1fr; }
}
