:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --ink: #17201b;
  --muted: #627067;
  --line: #d9e0da;
  --brand: #245c4f;
  --brand-dark: #183f37;
  --accent: #b86b3d;
  --ok: #2f7a4f;
  --warn: #a45d1f;
  --shadow: 0 18px 45px rgba(31, 54, 43, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(36, 92, 79, 0.08), transparent 280px),
    var(--bg);
  color: var(--ink);
}

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

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 8px 0 22px;
}

.section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.12;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  font-size: 17px;
}

.date-chip,
.status-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

main {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 18px;
  align-items: start;
}

.entry-selector,
.work-surface {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.entry-selector {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  position: sticky;
  top: 16px;
}

.entry-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 13px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 72px;
}

.entry-button:hover {
  border-color: rgba(36, 92, 79, 0.45);
}

.entry-button.active {
  border-color: var(--brand);
  background: #edf5f1;
}

.entry-index {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  font-size: 13px;
}

.entry-button strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.entry-button small {
  color: var(--muted);
  font-size: 13px;
}

.work-surface {
  border-radius: 8px;
  overflow: hidden;
}

.surface-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.scope-copy {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.log-form {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 92, 79, 0.14);
}

.confirm-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  padding: 13px 14px;
  margin-bottom: 18px;
}

.confirm-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.confirm-row span {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.confirm-row small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.task-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.temperature-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.hidden {
  display: none;
}

.task-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.limit-chip {
  color: var(--brand-dark);
  border: 1px solid rgba(36, 92, 79, 0.22);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.temperature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.task-list {
  display: grid;
}

.task-row {
  display: grid;
  grid-template-columns: 1fr 148px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.task-row:last-child {
  border-bottom: 0;
}

.task-title {
  font-weight: 700;
  line-height: 1.35;
}

.task-title small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 38px;
}

.segmented button {
  border: 0;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  background: var(--brand);
  color: #fff;
}

.ghost-button,
.secondary-button,
.primary-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  background: transparent;
  color: var(--brand);
  border-color: rgba(36, 92, 79, 0.22);
}

.submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.secondary-button {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--line);
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 14px;
  }

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

  h1 {
    font-size: 27px;
  }

  main {
    grid-template-columns: 1fr;
  }

  .entry-selector {
    position: static;
    grid-template-columns: 1fr;
  }

  .surface-heading,
  .form-grid,
  .temperature-grid,
  .task-row {
    grid-template-columns: 1fr;
  }

  .surface-heading {
    display: grid;
  }

  .submit-row {
    display: grid;
  }

  .ghost-button {
    width: 100%;
  }
}
