/* Az éles Personal Hub app static/style.css másolata (F-07), a végén a demó saját elemeinek (demósáv, magyarázó ablak, értesítés-kártya) stílusaival. */
:root {
  --border: #e1e4e8;
  --text: #1f2328;
  --text-muted: #656d76;
  --bg: #ffffff;
  --bg-muted: #f6f8fa;
  --accent: #3b82f6;
  --danger: #d1242f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.app-title { font-size: 1.1rem; margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

@media (max-width: 680px) {
  .tabs { width: 100%; gap: 4px; }
  .tab-btn { flex: 1 1 45%; text-align: center; padding: 8px 4px; }
}

.backup-controls { display: flex; align-items: center; gap: 8px; }
.backup-status { font-size: 0.8rem; color: var(--text-muted); }
.backup-status.success { color: #1a7f37; }
.backup-status.error { color: var(--danger); }

.page { max-width: 640px; margin: 0 auto; padding: 20px 16px; }

.add-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.add-form input, .add-form textarea {
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* 16px minimum — below this iOS Safari auto-zooms the viewport on focus */
  font-size: 16px;
  font-family: inherit;
}
.add-form input[type="text"] { flex: 1; min-width: 160px; }
.todo-add-form { align-items: flex-end; }
.todo-due-field {
  display: flex;
  flex: 0 1 220px;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.todo-due-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.2;
}
#todo-due-date {
  width: 100%;
  min-height: 44px;
  color: var(--text);
  background-color: var(--bg);
  color-scheme: light;
}

@media (max-width: 520px) {
  .todo-add-form { align-items: stretch; }
  .todo-add-form > input[type="text"],
  .todo-due-field,
  .todo-add-form > button {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .todo-add-form > button { min-height: 44px; }
}
.qty-input { width: 160px; }
#weight-value {
  background: #eaf4ff;
  border-color: #a9d3f5;
  font-weight: 600;
}
#weight-value:focus {
  background: #ffffff;
}
.reminder-add-form { flex-direction: column; align-items: stretch; }
.reminder-notes-input { width: 100%; resize: vertical; }

.goal-label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; color: var(--text-muted); }

.weight-summary { margin-bottom: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.summary-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; }
.summary-value { font-size: 1.3rem; font-weight: 600; }
.summary-value-small { font-size: 0.95rem; font-weight: 600; }
.summary-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.weight-chart-container { margin-bottom: 16px; }
.weight-chart { width: 100%; height: auto; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-point { fill: var(--accent); }
.chart-goal-line { stroke: #1a7f37; stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-axis-label { font-size: 9px; fill: var(--text-muted); }

button.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}
button.secondary {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 8px;
}
button.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2px 6px;
}
button.icon-btn:hover { color: var(--danger); }
button.icon-btn:disabled { opacity: 0.3; cursor: default; }
button.icon-btn:disabled:hover { color: var(--text-muted); }

.reorder-controls { display: flex; flex-direction: column; gap: 0; }
.reorder-btn { font-size: 0.65rem; padding: 0 4px; line-height: 1.4; }
.reorder-btn:hover { color: var(--accent); }

.card-list { display: flex; flex-direction: column; gap: 8px; }
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.card-title { font-weight: 600; margin: 0 0 4px; }
.card-body { color: var(--text-muted); font-size: 0.9rem; white-space: pre-wrap; margin: 0; }
.card-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 6px; }
.card-title-input {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
}
.card-title-input:focus { outline: none; border-bottom-color: var(--accent); }
.note-body-input { width: 100%; border: none; background: none; resize: vertical; }
.note-body-input:focus { outline: none; }
.note-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-height: 28px; }
.note-status { font-size: 0.78rem; color: var(--text-muted); }
.note-status.saved { color: #1a7f37; }
.note-status.error { color: var(--danger); }
.note-save-btn[hidden] { display: none; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card.sent { opacity: 0.6; }

.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.check-item.checked .check-label { text-decoration: line-through; color: var(--text-muted); }
.check-label { flex: 1; }
.check-qty, .check-due { color: var(--text-muted); font-size: 0.82rem; }
.check-shared {
  color: var(--accent);
  font-size: 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 12px 0; }

.shared-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.push-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.85rem;
}
.push-widget[hidden] { display: none; }
.push-label { color: var(--text-muted); }
.push-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
.push-btn[hidden] { display: none; }
.push-error { color: #d1242f; font-size: 0.8rem; }
.push-error[hidden] { display: none; }

/* Mértékegység-váltó (/converter, static/converter.js) */
.page-title { font-size: 1.1rem; margin: 0 0 4px; }
.page-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 16px; }
.conv-row { display: flex; align-items: center; gap: 8px; }
.conv-side { display: flex; flex: 1 1 0; gap: 6px; min-width: 0; }
.conv-input, .conv-select {
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* 16px minimum — below this iOS Safari auto-zooms the viewport on focus */
  font-size: 16px;
  font-family: inherit;
  min-height: 40px;
  background: var(--bg);
  color: var(--text);
}
.conv-input { flex: 1 1 0; min-width: 0; width: 100%; }
.conv-input.invalid { border-color: var(--danger); background: #fff5f5; }
.conv-select { flex: 0 1 auto; max-width: 55%; }
.conv-sign-btn, .conv-swap-btn {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
}
.conv-ref { margin-top: 8px; }

@media (max-width: 520px) {
  .conv-row { flex-direction: column; align-items: stretch; }
  .conv-swap-btn { align-self: center; transform: rotate(90deg); }
}

/* ---------------------------------------------------------------------- */
/* Demó-elemek (demósáv, nyelvválasztó, magyarázó ablak, értesítés-kártya)  */
/* ---------------------------------------------------------------------- */

.hidden { display: none !important; }

.demo-banner {
  background: #b42318;
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
}

.demo-banner-link { margin-left: 10px; color: white; font-weight: 700; white-space: nowrap; }
.demo-banner-link:hover { text-decoration: none; }

.backup-controls button.secondary { margin-top: 0; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.lang-switch a { padding: 6px 10px; color: var(--text-muted); text-decoration: none; font-size: 0.78rem; font-weight: 700; letter-spacing: .05em; }
.lang-switch a.active { background: var(--text); color: white; }

.feedback {
  position: fixed;
  z-index: 150;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 7px;
  background: #166534;
  color: white;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  font-size: 0.88rem;
}

.notifications {
  position: fixed;
  z-index: 160;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
}
.notification {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  font-size: 0.88rem;
}
.notification-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.notification-tag { font-size: 0.7rem; color: #b42318; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.notification-title { font-weight: 600; }
.notification-meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.notification-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-size: 0.82rem; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, 0.55); }
.dialog-backdrop[hidden] { display: none; }
.dialog { width: min(480px, 100%); padding: 22px 24px; border-radius: 12px; background: white; box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
.dialog .eyebrow { margin: 0 0 6px; color: #b42318; font-size: 0.72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.dialog p:not(.eyebrow) { color: var(--text-muted); line-height: 1.5; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.dialog-actions button { background: var(--accent); color: white; border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font: inherit; }
