:root {
  color-scheme: light;
  --bg: #f4fbfb;
  --ink: #132629;
  --muted: #5d7378;
  --line: #d6e7e8;
  --panel: #ffffff;
  --aqua: #087f8c;
  --aqua-dark: #045c66;
  --coral: #e45d50;
  --amber: #d89216;
  --green: #2e8b57;
  --shadow: 0 18px 45px rgba(8, 59, 66, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(8, 127, 140, 0.14), rgba(244, 251, 251, 0) 360px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 32px) 48px;
}

.topbar,
.brand,
.panel-heading,
.action-row,
.history-toolbar,
.task-row,
.dose-item,
.task-meta {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 18px 58px;
}

.brand {
  gap: 12px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(4, 92, 102, 0.24);
}

.menu-button {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 14px;
  z-index: 40;
  width: 46px;
  height: 46px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px solid rgba(214, 231, 232, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(19, 38, 41, 0.16);
  backdrop-filter: blur(12px);
}

.menu-button span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(7, 31, 35, 0.34);
  backdrop-filter: blur(2px);
}

.eyebrow,
.status-label,
.metric-label,
.pill {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: 1.28rem;
}

.hero {
  margin-bottom: 20px;
  min-height: 285px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: end;
  gap: 28px;
  padding: clamp(22px, 5vw, 54px);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 53, 60, 0.72), rgba(5, 53, 60, 0.24)),
    url("assets/icon-512.png");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  color: white;
}

.hero .eyebrow,
.hero p {
  color: rgba(255, 255, 255, 0.82);
}

.hero h2 {
  max-width: 720px;
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
}

.status-board div {
  min-width: 0;
  padding: 16px;
}

.status-board strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.05rem, 2.5vw, 1.65rem);
  overflow-wrap: anywhere;
}

.tabs {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  width: min(330px, 86vw);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 18px 0 45px rgba(7, 31, 35, 0.18);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

body.menu-open .tabs {
  transform: translateX(0);
}

.menu-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 6px 4px 14px;
  border-bottom: 1px solid var(--line);
}

.menu-heading img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.menu-heading span,
.menu-heading small {
  display: block;
}

.menu-heading span {
  color: var(--ink);
  font-weight: 850;
}

.menu-heading small {
  color: var(--muted);
  font-weight: 750;
}

.tab,
.ghost-button,
.primary-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 750;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 14px;
  text-align: left;
}

.tab.is-active,
.primary-button {
  border-color: var(--aqua);
  background: var(--aqua);
  color: white;
}

.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.ghost-button.danger {
  color: #9d241b;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.metric-grid,
.content-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.content-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr);
}

.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(19, 38, 41, 0.07);
}

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.28rem;
}

.metric-card p,
.dose-item p,
.task-row p,
.history-item p,
.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.panel {
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.08rem;
}

.pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: #e6f5f6;
  color: var(--aqua-dark);
  white-space: nowrap;
}

.dose-list,
.task-list,
.history-list,
.startup-summary,
.startup-steps {
  display: grid;
  gap: 10px;
}

.dose-item,
.task-row,
.history-item,
.startup-amount,
.startup-step {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbffff;
}

.dose-item {
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.dose-item span {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0f7f8;
  color: var(--aqua-dark);
  font-weight: 850;
}

.task-row {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.task-row.is-due {
  border-color: rgba(228, 93, 80, 0.5);
  background: #fff8f6;
}

.task-row.is-ok {
  border-color: rgba(46, 139, 87, 0.35);
}

.task-main {
  min-width: 0;
}

.task-meta {
  gap: 8px;
  flex-wrap: wrap;
}

.task-meta span {
  color: var(--muted);
  font-size: 0.86rem;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.form-grid {
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
}

.startup-grid {
  margin-bottom: 14px;
}

.startup-form {
  grid-template-columns: repeat(2, 1fr);
}

.startup-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #eef8f8;
  color: var(--aqua-dark);
  font-size: 0.92rem;
  font-weight: 650;
}

.startup-summary {
  grid-template-columns: repeat(2, 1fr);
}

.startup-amount {
  padding: 14px;
}

.startup-amount span,
.startup-amount small {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.startup-amount strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--aqua-dark);
  font-size: 1.42rem;
}

.startup-steps-panel {
  margin-top: 14px;
}

.startup-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.startup-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--aqua);
  color: white;
  font-weight: 850;
}

.startup-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.startup-step-head span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: #f0f7f8;
  color: var(--aqua-dark);
  font-weight: 850;
}

.startup-step p {
  margin: 7px 0 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(8, 127, 140, 0.24);
  outline-offset: 2px;
}

.action-row,
.history-toolbar {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.history-item {
  padding: 14px;
}

.history-item strong {
  display: block;
  margin-bottom: 5px;
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 860px) {
  .hero,
  .content-grid,
  .metric-grid,
  .form-grid,
  .startup-summary {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 520px;
    align-items: end;
    background-position: center top;
  }

  .status-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 12px;
  }

  .topbar {
    align-items: flex-start;
    padding-left: 56px;
  }

  .brand-icon {
    width: 46px;
    height: 46px;
  }

  .hero {
    min-height: 500px;
    padding: 20px;
  }

  .task-row,
  .dose-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-actions {
    width: 100%;
  }

  .task-actions button {
    flex: 1;
  }
}
