:root {
  color-scheme: dark;
  --bg: #020806;
  --panel: #07110c;
  --panel-2: #0a1710;
  --line: #183524;
  --line-strong: #28533a;
  --text: #c6dccb;
  --muted: #6e9278;
  --green: #7bbf79;
  --green-dim: #4d8a55;
  --amber: #ceb36e;
  --red: #db756f;
  --shadow: rgba(19, 93, 45, 0.28);
  font-family: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(67, 115, 72, 0.12), transparent 32rem),
    linear-gradient(180deg, #020806 0%, #000302 100%);
  color: var(--text);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(199, 242, 204, 0.035) 0,
    rgba(199, 242, 204, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  opacity: 0.42;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: clamp(14px, 2vw, 28px);
  border: 1px solid rgba(79, 142, 85, 0.26);
  box-shadow: inset 0 0 60px rgba(26, 85, 37, 0.12);
}

.topline,
.footerline,
.panel-heading,
.brief-line,
.program-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topline {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.session,
.brief-line span,
.program-code,
.footerline,
.status-pill {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.session {
  margin: 0 0 6px;
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  min-height: 2.2rem;
  color: var(--green);
  font-size: clamp(1.4rem, 3vw, 2.35rem);
  font-weight: 700;
}

h1::after {
  content: "";
  display: inline-block;
  width: 0.62ch;
  height: 1em;
  margin-left: 4px;
  border-bottom: 2px solid var(--green);
  animation: blink 1s steps(2, jump-none) infinite;
}

h2 {
  color: var(--green);
  font-size: 1rem;
  text-transform: uppercase;
}

.status-pill {
  border: 1px solid var(--line);
  color: var(--amber);
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(6, 20, 11, 0.88);
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(360px, 1.8fr);
  gap: 14px;
  padding: 14px 0;
}

.brief,
.terminal-panel,
.today-panel,
.program-card {
  border: 1px solid var(--line);
  background: rgba(4, 15, 9, 0.88);
  border-radius: 5px;
}

.brief {
  min-height: 130px;
  padding: 14px;
}

.brief-line {
  border-bottom: 1px solid rgba(35, 75, 49, 0.58);
  padding: 10px 0;
}

.brief-line:last-child {
  border-bottom: 0;
}

.brief-line strong {
  color: var(--text);
  font-size: 0.92rem;
  text-align: right;
}

.terminal-panel {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 28px var(--shadow);
}

.terminal-log {
  flex: 1;
  padding: 16px;
  overflow: auto;
  color: var(--green);
  line-height: 1.55;
}

.terminal-line {
  min-height: 1.35rem;
  white-space: pre-wrap;
}

.terminal-line.muted {
  color: var(--muted);
}

.terminal-line.warn {
  color: var(--amber);
}

.terminal-line.error {
  color: var(--red);
}

.terminal-input-row {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  background: rgba(8, 22, 13, 0.94);
}

.prompt {
  color: var(--muted);
  white-space: nowrap;
}

#terminal-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.program-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.program-card {
  min-height: 88px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.program-card:hover,
.program-card:focus-visible {
  border-color: var(--line-strong);
  background: rgba(13, 31, 18, 0.96);
  transform: translateY(-1px);
  outline: 0;
}

.program-code {
  flex: 0 0 54px;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 800;
}

.program-copy {
  flex: 1;
  min-width: 0;
}

.program-name {
  display: block;
  color: var(--text);
  font-weight: 700;
}

.program-desc {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 5px;
}

.program-health {
  color: var(--muted);
  font-size: 0.78rem;
}

.program-health.ok {
  color: var(--green);
}

.program-health.down {
  color: var(--red);
}

.today-panel {
  grid-column: 1 / -1;
  padding: 14px;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

#refresh-tasks {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #07150c;
  color: var(--muted);
  padding: 6px 9px;
  cursor: pointer;
}

#refresh-tasks:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.today-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style-position: inside;
}

.today-list li {
  min-height: 46px;
  border: 1px solid rgba(35, 75, 49, 0.56);
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 22, 13, 0.64);
}

.footerline {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 0.8rem;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

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

@media (max-width: 640px) {
  .topline,
  .footerline {
    align-items: flex-start;
    flex-direction: column;
  }

  .program-grid,
  .today-list {
    grid-template-columns: 1fr;
  }

  .terminal-input-row {
    flex-direction: column;
  }
}
