* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Courier New', monospace;
  background: #e8e8e8;
  color: #333;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

header {
  border-bottom: 2px solid #333;
  padding-bottom: 12px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
}

.auth-area {
  font-size: 13px;
}

.auth-area a {
  color: #4a90d9;
  cursor: pointer;
  text-decoration: underline;
}

#login-prompt {
  text-align: center;
  padding: 60px 20px;
}

#login-prompt p {
  margin-bottom: 16px;
  font-size: 14px;
}

#login-prompt button {
  font-family: 'Courier New', monospace;
  background: #333;
  color: #e8e8e8;
  border: none;
  padding: 10px 24px;
  cursor: pointer;
  font-size: 14px;
}

#login-prompt button:hover {
  background: #4a90d9;
}

#app {
  display: none;
}

/* Range selector */
.range-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.range-selector button {
  font-family: 'Courier New', monospace;
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
}

.range-selector button.active {
  background: #333;
  color: #e8e8e8;
  border-color: #333;
}

/* Summary cards */
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.summary-card {
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 14px;
  text-align: center;
}

.summary-card .label {
  font-size: 11px;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 4px;
}

.summary-card .value {
  font-size: 22px;
  font-weight: bold;
}

.summary-card .value.kcal { color: #d9534f; }
.summary-card .value.protein { color: #4a90d9; }
.summary-card .value.fat { color: #f0ad4e; }
.summary-card .value.carbs { color: #5cb85c; }

.averages {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-bottom: 24px;
  padding: 6px;
  background: #f5f5f5;
  border: 1px solid #ddd;
}

/* Link section */
.link-section {
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 16px;
  margin-bottom: 24px;
}

.link-section h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.link-section .code {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 6px;
  color: #4a90d9;
  margin: 12px 0;
}

.link-section button {
  font-family: 'Courier New', monospace;
  background: #333;
  color: #e8e8e8;
  border: none;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
}

.link-section .linked {
  color: #5cb85c;
  font-weight: bold;
}

/* View selector */
.view-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.view-selector button {
  font-family: 'Courier New', monospace;
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
}

.view-selector button.active {
  background: #333;
  color: #e8e8e8;
  border-color: #333;
}

/* View containers */
.view-container {
  margin-bottom: 24px;
}

/* Charts */
.charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-box {
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 12px;
}

.chart-box h3 {
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-box canvas {
  width: 100% !important;
}

/* Food log table */
.section {
  margin-bottom: 24px;
}

.section h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
}

th {
  background: #333;
  color: #e8e8e8;
  font-weight: normal;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

tr:hover {
  background: #ddd;
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  text-transform: uppercase;
}

.badge.menu {
  background: #4a90d9;
  color: #fff;
}

.badge.estimated {
  background: #999;
  color: #fff;
}

.btn-delete {
  font-family: 'Courier New', monospace;
  background: none;
  border: 1px solid #d9534f;
  color: #d9534f;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.btn-delete:hover {
  background: #d9534f;
  color: #fff;
}

/* Menu items list */
.menu-items {
  list-style: none;
}

.menu-items li {
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
}

.menu-items li:last-child {
  border-bottom: none;
}

.empty {
  color: #999;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
}
