:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-2: #eef3f1;
  --text: #14211d;
  --muted: #60706a;
  --line: #d7e0dc;
  --accent: #0f766e;
  --accent-dark: #0b5954;
  --danger: #b42318;
  --success: #157347;
  --shadow: 0 18px 50px rgba(20, 33, 29, 0.10);
}

* {
  box-sizing: border-box;
}

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

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

.shell {
  min-height: 100vh;
}

.auth-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 8vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

.brand h1,
.topbar h1 {
  font-size: 24px;
  line-height: 1.15;
}

.brand p,
.section-title span,
.eyebrow,
.item-meta,
.metrics span {
  color: var(--muted);
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #263833;
  font-weight: 650;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 750;
  padding: 12px 16px;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e5ece9;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 8px 12px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.nav-tabs a,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-weight: 800;
  padding: 10px 14px;
}

.nav-tabs a.active,
.link-button:hover {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-dark);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 33, 29, 0.06);
}

.metrics article {
  padding: 18px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.workspace {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.wide {
  width: min(860px, 100%);
}

.section-title,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title h2,
.list-head h2 {
  font-size: 19px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-grid label {
  display: block;
}

.type-grid input {
  position: absolute;
  opacity: 0;
}

.type-grid span {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 800;
}

.type-grid input:checked + span {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-dark);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.button-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-actions {
  margin-top: 4px;
}

.card-actions button,
.card-actions .link-button {
  min-height: 38px;
  padding: 9px 12px;
}

.error,
.success {
  border-radius: 8px;
  padding: 10px 12px;
}

.error {
  background: #fff0ed;
  color: var(--danger);
}

.success {
  background: #ecfdf3;
  color: var(--success);
}

.next-actions,
.items {
  display: grid;
  gap: 10px;
}

.next-actions {
  margin-bottom: 24px;
}

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

.item-card.is-done {
  background: #f7faf8;
  border-color: #c9d8d1;
}

.item-card.is-done .item-title span:first-child {
  color: var(--muted);
  text-decoration: line-through;
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.score {
  flex: 0 0 auto;
  color: var(--accent-dark);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.pill {
  border-radius: 999px;
  background: var(--panel-2);
  padding: 4px 8px;
}

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

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

  .topbar,
  .section-title,
  .list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .two-col,
  .button-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .button-row button,
  .button-row .link-button,
  .card-actions button,
  .card-actions .link-button {
    width: 100%;
  }
}
