:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5b6475;
  --line: #d7dce5;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --primary: #1766e8;
  --primary-dark: #0f4fb8;
  --accent: #0f766e;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: end;
  padding: 46px 0 24px;
}

.hero h1,
.section-heading h2,
.schedule-head h2 {
  margin: 0;
}

.hero h1 {
  max-width: 780px;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel,
.status-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgb(23 32 51 / 8%);
}

.panel {
  padding: 24px;
}

.status-panel {
  display: grid;
  gap: 6px;
  padding: 22px;
}

.status-panel span,
.status-panel small,
.section-heading p,
.message {
  color: var(--muted);
}

.status-panel strong {
  font-size: 40px;
  line-height: 1;
}

.workspace,
.export-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.settings-grid,
.form-grid,
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

button,
.file-picker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

button:hover,
.file-picker:hover span {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

button.secondary,
.file-picker span {
  background: #eef4ff;
  border-color: #c9d9f6;
  color: var(--primary-dark);
}

button.secondary:hover,
.file-picker:hover span {
  background: #dfeaff;
}

button.danger {
  background: #fff1f1;
  border-color: #f0c4c0;
  color: var(--danger);
}

button.danger:hover {
  background: #ffe2e0;
}

.danger-text {
  color: var(--danger) !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.vertical-actions {
  display: grid;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.chip button {
  min-height: 24px;
  width: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.chip button:hover {
  background: #e9eef7;
  color: var(--danger);
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
}

.schedule-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.filter-grid {
  width: min(100%, 460px);
}

.schedule-board {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.period-section {
  display: grid;
  gap: 12px;
}

.period-section h3 {
  margin: 0;
  font-size: 19px;
}

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

.person-column {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.person-column h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.schedule-item {
  display: grid;
  gap: 8px;
  border: 1px solid #dfe5ef;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.schedule-item + .schedule-item {
  margin-top: 10px;
}

.schedule-item strong,
.schedule-item span {
  display: block;
}

.schedule-item span,
.schedule-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.schedule-item p {
  margin: 0;
}

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

.item-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.empty-state {
  border: 1px dashed #b8c3d4;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.code-output {
  min-height: 430px;
  margin-top: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.file-picker input {
  display: none;
}

.file-picker span {
  width: 100%;
}

.json-notes {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
}

.json-notes div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.json-notes dt {
  font-weight: 800;
}

.json-notes dd {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 880px) {
  .topbar,
  .schedule-head {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero,
  .workspace,
  .export-layout,
  .settings-grid,
  .form-grid,
  .filter-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 36px;
  }

  .filter-grid {
    width: 100%;
  }
}
