:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-soft: #eff4f1;
  --ink: #1c2421;
  --muted: #65726d;
  --line: #d9e0dc;
  --accent: #126a5a;
  --accent-strong: #0c4f43;
  --gold: #c4812a;
  --rose: #9e4058;
  --shadow: 0 18px 45px rgba(28, 36, 33, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.topbar-actions,
.form-actions,
.job-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button,
.primary-button,
.secondary-button,
.text-button,
.filter-pill {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.filter-pill:hover {
  transform: translateY(-1px);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.import-button {
  position: relative;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.primary-button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.text-button,
.filter-pill {
  padding: 0 14px;
  font-weight: 700;
}

.text-button {
  min-height: 34px;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-label {
  display: block;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 2.3rem;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 14px;
}

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

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading.compact {
  margin-bottom: 12px;
}

.job-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 106, 90, 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-pill.active {
  border-color: var(--accent);
  background: var(--panel-soft);
  color: var(--accent-strong);
}

.job-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.job-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.job-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: start;
}

.company {
  margin: 0 0 3px;
  color: var(--gold);
  font-weight: 900;
}

.next-action,
.notes {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.next-action {
  font-weight: 700;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.job-meta a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.job-card-actions {
  justify-content: flex-end;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.tag button,
.task-list button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  margin-top: 12px;
}

.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-list input {
  min-height: 20px;
  accent-color: var(--accent);
}

.task-list span {
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.task-list li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

#story-bank {
  min-height: 190px;
}

@media (max-width: 880px) {
  .metric-grid,
  .workspace-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    gap: 14px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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

  .panel,
  .metric {
    padding: 14px;
  }

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

  .job-card-top {
    grid-template-columns: 1fr;
  }

  .stage-select {
    max-width: 180px;
  }
}
