:root {
  --color-bg: #fff;
  --color-text: #1a1a1a;
  --color-accent: #2ecc71;
  --color-warning: #f39c12;
  --color-border: #e9e9e9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

body {
  min-height: 100vh;
}

.page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.hero {
  margin-bottom: 24px;
}

.app-brand {
  margin: 0 0 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: #6e8c5e;
  letter-spacing: 0.3px;
}

.hero-title {
  margin: 0 0 18px 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  color: #1a1a1a;
}

.actions {
  margin-bottom: 28px;
}

.actions-title {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mode-btn {
  background: #ffffff;
  border: 1.5px solid #d6d6d0;
  border-radius: 14px;
  padding: 14px 4px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  font-family: inherit;
}

.recent {
  margin-bottom: 16px;
}

.recent-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #1a1a1a;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.stat-card {
  background: #f5f5f2;
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
}

.stat-label {
  margin: 0 0 4px 0;
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.stat-number {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: #1a1a1a;
}

.stat-number.is-zero {
  color: #128744;
}

.record-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.record-item {
  display: grid;
  grid-template-columns: 76px 28px 1fr auto;
  align-items: center;
  padding: 12px 0;
  border-bottom: 0.5px solid #ececea;
  column-gap: 8px;
  position: relative;
}

.record-item:last-child {
  border-bottom: none;
}

.record-time {
  color: #999;
  font-size: 13px;
}

.record-mode {
  font-size: 16px;
  text-align: center;
}

.record-drink {
  font-size: 14px;
  color: #1a1a1a;
}

.record-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.record-warning .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5a623;
}

.record-warning .text {
  font-size: 12px;
  color: #c87c00;
  font-weight: 600;
}

.record-empty {
  padding: 20px 0;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.45);
}

.is-hidden {
  display: none;
}

.drink-dialog {
  width: 100%;
  max-width: 430px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--color-bg);
  padding: 16px;
}

.dialog-title {
  margin: 0 0 16px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
}

.dialog-section {
  margin-bottom: 18px;
}

.dialog-label {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.date-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-btn {
  min-height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.option-btn.is-selected {
  border-color: var(--color-accent);
  background: rgba(46, 204, 113, 0.12);
  color: #128744;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dialog-btn {
  min-height: 46px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid transparent;
}

.dialog-btn-cancel {
  border-color: var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}

.dialog-btn-save {
  background: var(--color-accent);
  color: #fff;
}

.dialog-btn-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .page {
    padding-top: 36px;
  }

  .hero-title {
    font-size: 40px;
  }

  .dialog-overlay {
    align-items: center;
  }
}
