:root {
  --bg: #f3f7f7;
  --card: #ffffff;
  --ink: #123333;
  --ink-soft: #466666;
  --line: #d4e3e3;
  --brand: #146c6c;
  --brand-2: #0f8c8c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

h1, h2 {
  margin: 0 0 0.4rem 0;
}

.topbar p,
.muted {
  margin: 0;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  border: 1px solid var(--line);
  background: #edf8f8;
  color: var(--brand);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.layout {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.9rem;
  color: #fff;
  background: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--brand-2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost {
  background: #e8f2f2;
  color: #184949;
}

.small {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.55rem 0.64rem;
  border: 1px solid #c1d7d7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.inline-form {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.grid-form label {
  font-size: 0.88rem;
  color: #325757;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
}

.span-2 {
  grid-column: span 2;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tank-item,
.reminder-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.56rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.tank-item.active {
  border-color: var(--brand);
  background: #eff9f9;
}

.history-item {
  border-bottom: 1px dashed var(--line);
  padding: 0.45rem 0;
  font-size: 0.9rem;
}

.history-item:last-child {
  border-bottom: 0;
}

.history {
  margin-top: 0.8rem;
}

#trendChart {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfefe;
  min-height: 220px;
}

.pro-tag {
  font-size: 0.75rem;
  border: 1px solid #f2bb4b;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  color: #8d5a00;
  background: #fff4dc;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.7rem 0;
}

.feature-list {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.2rem;
}

.footer-links {
  max-width: 1100px;
  margin: 0 auto 1.2rem;
  padding: 0 1rem;
}

.footer-links a {
  color: var(--brand);
}

textarea {
  resize: vertical;
}

@media (max-width: 700px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    flex-direction: column;
  }
}
