:root {
  --bg: #f3f1ec;
  --bg-deep: #e8e4db;
  --surface: #fffcf7;
  --surface-2: #f7f4ee;
  --ink: #1c2430;
  --muted: #5f6b7a;
  --line: #d9d2c5;
  --accent: #0f6e56;
  --accent-soft: #d8efe6;
  --accent-ink: #085041;
  --success: #0f7a4c;
  --success-bg: #e4f6ec;
  --failed: #b42318;
  --failed-bg: #fdecea;
  --running: #9a6700;
  --running-bg: #fff4d6;
  --idle: #5f6b7a;
  --idle-bg: #eef1f4;
  --shadow: 0 18px 50px rgba(28, 36, 48, 0.08);
  --radius: 16px;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 0% 0%, #dde8e2 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #ebe4d4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body {
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

.brand-mark {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Login */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-backdrop {
  position: absolute;
  inset: 12% 18% auto;
  height: 280px;
  background:
    linear-gradient(135deg, rgba(15, 110, 86, 0.18), transparent 60%),
    linear-gradient(320deg, rgba(154, 103, 0, 0.12), transparent 55%);
  filter: blur(8px);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: grid;
  gap: 12px;
  animation: rise 0.45s ease both;
}

.login-card h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.login-copy {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-card label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
}

.login-card input:focus,
.sidebar-head input:focus {
  outline: 2px solid rgba(15, 110, 86, 0.28);
  border-color: var(--accent);
}

/* Shell */
.shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  animation: rise 0.35s ease both;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-select-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.view-select {
  min-width: min(320px, 70vw);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.view-select:focus {
  outline: 2px solid rgba(15, 110, 86, 0.28);
  border-color: var(--accent);
}

.sidebar-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.empty-panel {
  margin: 10px 14px;
  padding: 16px 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.id-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 14px 14px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.id-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  min-height: 0;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.id-panel.encrypted {
  background: var(--failed-bg);
  border-color: rgba(180, 35, 24, 0.2);
}

.id-panel.normal {
  background: var(--success-bg);
  border-color: rgba(15, 122, 76, 0.2);
}

.id-panel h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.id-panel.encrypted h4 {
  color: var(--failed);
}

.id-panel.normal h4 {
  color: var(--success);
}

.id-panel ul {
  margin: 0;
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 2px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.id-panel li {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.id-panel a.catalog-id-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.id-panel a.catalog-id-link:hover {
  opacity: 0.85;
}

.id-panel.normal a.catalog-id-link {
  color: var(--success);
}

.id-panel.encrypted a.catalog-id-link {
  color: var(--failed);
}

.id-panel .none {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.weekly-emails {
  margin: 0 16px 20px;
}

@media (max-width: 860px) {
  .id-panels {
    grid-template-columns: 1fr;
  }
}

.failed-panel {
  margin: 0;
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--failed-bg);
}

.nightly-scripts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}

/* Daily exports: 3 meta cards when summary present */
#nightlyView .meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nightly-script-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.nightly-dd {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 480px;
}

.nightly-dd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.nightly-dd-btn:hover,
.nightly-dd.open .nightly-dd-btn {
  border-color: rgba(0, 0, 0, 0.22);
}

.nightly-dd-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #9aa3ad;
}

.nightly-dd-status.ok {
  background: var(--success);
}

.nightly-dd-status.failed {
  background: var(--failed);
}

.nightly-dd-status.idle {
  background: #9aa3ad;
}

.nightly-dd-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nightly-dd-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  flex-shrink: 0;
}

.nightly-dd-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 28, 36, 0.12);
}

.nightly-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.nightly-dd-item:hover,
.nightly-dd-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.nightly-dd-item.active {
  background: var(--success-bg);
}

.nightly-dd-item.active.failed {
  background: var(--failed-bg);
}

.nightly-dd-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-detail .detail-head {
  border-bottom: 1px solid var(--line);
}

.failed-panel h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--failed);
  letter-spacing: -0.01em;
}

.failed-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--failed);
  font-family: var(--mono);
  font-size: 0.8rem;
  display: grid;
  gap: 4px;
}

.meta-card.success .value {
  color: var(--success);
}

.meta-card.failed .value {
  color: var(--failed);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
}

.sidebar,
.detail {
  background: var(--surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  min-height: 0;
  max-height: none;
  height: 100%;
  align-self: stretch;
}

.sidebar {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow-x: hidden;
}

.detail {
  min-width: 0;
}

/* All views: both columns fill the shell under the topbar */
#ondemandView .sidebar,
#ondemandView .detail,
#pdfView .sidebar,
#pdfView .detail,
#weeklyFView .sidebar,
#weeklyFView .detail,
#weeklyMView .sidebar,
#weeklyMView .detail,
#nightlyView .sidebar,
#nightlyView .detail {
  min-height: 0;
  max-height: none;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
}

#ondemandView .sidebar,
#pdfView .sidebar,
#weeklyFView .sidebar,
#weeklyMView .sidebar,
#nightlyView .sidebar {
  overflow-y: auto;
}

/* On-demand: VS Code–style viewlets — open section fills space, others pin to bottom */
#ondemandView .sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ondemandView .sidebar-head {
  flex: 0 0 auto;
}

#ondemandView .script-list {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ondemandView .script-accordion {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-bottom: 1px solid rgba(217, 210, 197, 0.65);
}

#ondemandView .script-accordion.is-open {
  flex: 1 1 auto;
  min-height: 80px;
}

#ondemandView .script-accordion-head {
  flex: 0 0 auto;
}

#ondemandView .script-accordion-body {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid rgba(217, 210, 197, 0.45);
}

#ondemandView .script-accordion.is-open .script-accordion-body {
  display: block;
  /* allow flex grow + internal scroll */
  height: 100%;
}

#pdfView .detail,
#weeklyFView .detail,
#weeklyMView .detail,
#nightlyView .detail {
  overflow-y: auto;
}

.sidebar-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
}

.sidebar-head > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-head h2,
.detail-head h2,
.log-head h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.sidebar-head h2 {
  font-size: 1.05rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-head input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.script-list {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  max-height: none;
  height: 100%;
}

.group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 16px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(247, 244, 238, 0.96);
  border-bottom: 1px solid rgba(217, 210, 197, 0.7);
}

.script-accordion {
  border-bottom: 1px solid rgba(217, 210, 197, 0.65);
}

.script-accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  background: #efebe3;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.script-accordion-head:hover {
  background: rgba(15, 110, 86, 0.08);
}

.script-accordion-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.script-accordion-meta {
  flex-shrink: 0;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.script-accordion-caret {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.script-accordion.is-open .script-accordion-caret {
  transform: rotate(90deg);
}

.script-accordion-body {
  display: none;
  border-top: 1px solid rgba(217, 210, 197, 0.45);
}

.script-accordion.is-open .script-accordion-body {
  display: block;
}

.script-item {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(217, 210, 197, 0.65);
  background: transparent;
  color: inherit;
  padding: 12px 16px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: background 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.script-item:hover {
  background: rgba(15, 110, 86, 0.05);
}

.script-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.script-item .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.script-item .name {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-item .file {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--mono);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-item .when {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.script-item .badge {
  flex-shrink: 0;
}

/* Detail */
.detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.detail > * {
  flex-shrink: 0;
}

.detail .log-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.pdf-detail .id-panels {
  flex: 1 1 auto;
  min-height: 0;
}

.pdf-detail .empty-panel {
  flex: 0 0 auto;
}

.pdf-detail .weekly-emails {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0 16px 16px;
  max-height: none;
  height: auto;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
}

.detail-titles {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-head h2 {
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.detail-path {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.status-slot {
  min-height: 0;
}

.status-slot .badge {
  font-size: 0.68rem;
  padding: 2px 7px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.meta-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  display: grid;
  gap: 2px;
}

button.meta-card {
  font: inherit;
  text-align: left;
  color: inherit;
  width: 100%;
  cursor: default;
}

button.meta-card.clickable {
  cursor: pointer;
}

button.meta-card.clickable:hover {
  border-color: rgba(180, 35, 24, 0.35);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.12);
}

button.meta-card:disabled {
  opacity: 0.85;
  cursor: default;
}

.meta-card .label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-card .value {
  font-size: 0.82rem;
  font-weight: 600;
  word-break: break-word;
}

.detail .btn.run,
.detail .btn.stop {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.meta-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 4px 2px;
}

.log-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  background: #182029;
  color: #d7e0ea;
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #121920;
  flex-wrap: wrap;
}

.log-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.log-head h3 {
  font-size: 0.92rem;
  color: #f4f7fa;
}

.log-hint {
  font-size: 0.78rem;
  color: #8fa0b2;
  font-family: var(--mono);
}

.log-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.log-btn {
  color: #d7e0ea !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: transparent !important;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.log-btn:hover:not(:disabled):not(.disabled) {
  background: rgba(255, 255, 255, 0.06) !important;
}

.log-btn.disabled,
.log-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.log-view {
  margin: 0;
  padding: 14px 16px 20px;
  overflow: auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #c7d3df;
}

/* Buttons & badges */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover:not(:disabled) {
  border-color: #c4bbaa;
  background: var(--surface-2);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.btn.primary:hover:not(:disabled) {
  background: #0c5d48;
}

.btn.wide {
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn.run {
  min-width: 120px;
  padding: 12px 18px;
}

.btn.stop {
  min-width: 100px;
  padding: 12px 18px;
}

.btn.danger {
  background: var(--failed);
  color: #fff;
  border: none;
}

.btn.danger:hover:not(:disabled) {
  background: #912018;
}

.btn.danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.badge.stopped {
  color: #b54708;
  background: #fffaeb;
}

.btn.ghost {
  background: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge.idle {
  color: var(--idle);
  background: var(--idle-bg);
}

.badge.running {
  color: var(--running);
  background: var(--running-bg);
}

.badge.running::before {
  animation: pulse 1.2s ease infinite;
}

.badge.success {
  color: var(--success);
  background: var(--success-bg);
}

.badge.failed {
  color: var(--failed);
  background: var(--failed-bg);
}

.error {
  margin: 0;
  color: var(--failed);
  background: var(--failed-bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

@media (max-width: 960px) {
  .shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar,
  .detail,
  #ondemandView .sidebar,
  #ondemandView .detail,
  #pdfView .sidebar,
  #pdfView .detail,
  #weeklyFView .sidebar,
  #weeklyFView .detail,
  #weeklyMView .sidebar,
  #weeklyMView .detail,
  #nightlyView .sidebar,
  #nightlyView .detail {
    min-height: auto;
    max-height: none;
    height: auto;
  }

  .script-list,
  .log-view {
    max-height: 360px;
    height: auto;
  }

  .id-panels {
    height: auto;
  }

  .id-panel {
    height: auto;
    max-height: 360px;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-head {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }

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