:root {
  --bg-a: #f2efe6;
  --bg-b: #e6f4f1;
  --card: #fffcf7;
  --ink: #182b2a;
  --muted: #5e7573;
  --line: #d8e6e2;
  --brand: #147a78;
  --brand-2: #3fb8b1;
  --brand-strong: #0f6462;
  --ok: #1f8f4c;
  --warn: #b15b1a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff7da 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dff5ef 0%, transparent 58%),
    linear-gradient(160deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
}

.app {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.35rem 1.1rem 1.6rem;
}

h1,
h2 {
  margin-top: 0;
  line-height: 1.15;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.6rem, 3.6vw, 2.25rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.18rem;
  margin-bottom: 0.85rem;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.card {
  background: linear-gradient(180deg, #fffdf9, #fffaf1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 1.05rem;
  margin-bottom: 0.95rem;
  box-shadow:
    0 8px 26px rgba(34, 61, 59, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
  color: #274544;
}

input,
button {
  font: inherit;
  border-radius: 10px;
}

input {
  border: 1px solid #b6d3cc;
  background: #fffefb;
  color: var(--ink);
  padding: 0.55rem 0.64rem;
  outline: none;
}

input:focus {
  border-color: #6db6ab;
  box-shadow: 0 0 0 3px rgba(80, 170, 158, 0.18);
}

button {
  border: none;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #f4fffd;
  padding: 0.56rem 0.88rem;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  filter: brightness(0.95);
}

button:active {
  transform: translateY(1px);
}

.secondary {
  margin-top: 0.8rem;
  background: linear-gradient(180deg, #e9f5f1, #d8ece7);
  color: #1d504d;
}

.secondary:hover {
  filter: brightness(0.97);
}

.log-card {
  position: relative;
}

.log-card h2 {
  margin-right: 5.7rem;
}

.view-mode-toggle {
  position: absolute;
  top: 0.72rem;
  right: 0.95rem;
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.18rem;
  border: 1px solid #bfd8d2;
  border-radius: 999px;
  background: #f2f9f7;
}

.toggle-icon-btn {
  width: 1.78rem;
  height: 1.78rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #577977;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon-btn:hover {
  background: #e0f0ec;
}

.toggle-icon-btn.active {
  background: #cce9e2;
  color: #1e605c;
  box-shadow: inset 0 0 0 1px #8ac7be;
}

.icon-h,
.icon-v {
  width: 12px;
  height: 12px;
  position: relative;
  display: block;
}

.icon-h::before,
.icon-h::after,
.icon-v::before,
.icon-v::after {
  content: "";
  position: absolute;
  border-radius: 2px;
  background: currentColor;
}

.icon-h::before {
  left: 1px;
  top: 2px;
  width: 10px;
  height: 3px;
}

.icon-h::after {
  left: 1px;
  top: 7px;
  width: 7px;
  height: 3px;
}

.icon-v::before {
  left: 2px;
  bottom: 1px;
  width: 3px;
  height: 10px;
}

.icon-v::after {
  left: 7px;
  bottom: 1px;
  width: 3px;
  height: 7px;
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.2rem 0.7rem;
  margin-top: 0.65rem;
}

.bars-container {
  margin-top: 0.22rem;
}

.bar-group + .bar-group {
  margin-top: 0.12rem;
}

.vertical-bar-area {
  position: relative;
}

.expected-vertical-markers {
  display: none;
  position: absolute;
  left: calc(100% + 0.45rem);
  bottom: 0;
  width: 4.4rem;
  height: 200px;
}

.progress-wrap {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #e4f0ed;
  border: 1px solid #d4e4e0;
  overflow: hidden;
  margin-top: 0.5rem;
}

.expected-wrap {
  margin-top: 0.36rem;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transition: width 240ms ease, height 240ms ease;
}

.expected-bar {
  background: linear-gradient(90deg, #7fa9a3, #b8d9d3);
}

.progress-caption {
  margin: 0.5rem 0 0;
  color: #4f6f6d;
  font-size: 0.92rem;
}

.vertical-detail {
  display: none;
  margin: 0.42rem 0 0;
  text-align: center;
  color: #4f6f6d;
  font-size: 0.84rem;
}

.time-markers {
  position: relative;
  height: 1.8rem;
  margin-top: 0.25rem;
}

.time-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: #5a7573;
  line-height: 1;
  text-align: center;
  min-width: 2.25rem;
}

.time-marker::before {
  content: "";
  display: block;
  width: 1px;
  height: 7px;
  margin: 0 auto 0.22rem;
  background: #93b9b2;
}

.time-marker-time {
  display: block;
  font-size: 0.77rem;
}

.time-marker-oz {
  display: block;
  font-size: 0.67rem;
  margin-top: 0.1rem;
  color: #6f8f8b;
}

.status {
  margin: 0.85rem 0 0;
  font-weight: 600;
}

body:not(.vertical-view) .status {
  margin-top: 1.2rem;
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.bars-container.vertical {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  align-items: flex-end;
  margin-top: 0.6rem;
}

.bars-container.vertical .bar-group {
  flex: 1;
  max-width: 180px;
}

.bars-container.vertical .bar-group + .bar-group {
  margin-top: 0;
}

.bars-container.vertical .progress-wrap {
  height: 200px;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
}

.bars-container.vertical .progress-bar {
  width: 100%;
  height: 0%;
}

.bars-container.vertical .vertical-detail {
  display: block;
}

.bars-container.vertical .vertical-bar-area .progress-wrap {
  width: 100%;
}

.bars-container.vertical .expected-vertical-markers {
  display: block;
}

.vertical-time-marker {
  position: absolute;
  left: 0;
  transform: translateY(50%);
  line-height: 1;
  color: #5b7875;
  font-size: 0.68rem;
  white-space: nowrap;
}

.vertical-time-marker::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1px;
  margin-right: 0.28rem;
  background: #93b9b2;
  vertical-align: middle;
}

body.vertical-view .current-sep,
body.vertical-view #current-text,
body.vertical-view .expected-sep,
body.vertical-view #expected-text {
  display: none;
}

body.vertical-view .time-markers {
  display: none;
}

.drink-list {
  margin: 0;
  padding-left: 1.1rem;
}

.drink-list li {
  margin-bottom: 0.38rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 700px) {
  .app {
    padding: 1rem 0.75rem 1.3rem;
  }

  .card {
    padding: 0.9rem 0.85rem 1rem;
  }

  .bars-container.vertical {
    gap: 0.6rem;
  }

  .bars-container.vertical .bar-group {
    max-width: 160px;
  }

  .bars-container.vertical .expected-vertical-markers {
    width: 3.95rem;
  }
}
