:root {
  --green:       #2d7a2d;
  --green-light: #4caf50;
  --green-pale:  #e8f5e9;
  --yellow:      #f5c800;
  --text:        #1a1a1a;
  --text-muted:  #666;
  --bg:          #f4f7f4;
  --radius:      12px;
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --tab-h:       48px;
  --header-h:    64px;
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: #fdd043;
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.progress-label {
  color: rgba(26,26,26,.85);
  font-size: 0.82rem;
  font-weight: 600;
}

.progress-bar-wrap {
  background: #bfe3bf;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 5px;
  background: var(--green);
  width: 0%;
  transition: width .4s ease;
  border-radius: 3px;
}

/* ── TABS ── */
.tabs {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 19;
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e0e0e0;
  height: var(--tab-h);
}

.tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ── VIEWS ── */
.view {
  display: none;
  margin-top: calc(var(--header-h) + var(--tab-h));
  padding-bottom: 80px;
}

.view.active { display: block; }

/* ── HOUSE VIEW ── */
.house-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 8px 0;
}

#houseSvg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* SVG hotspot circles */
.hotspot {
  cursor: pointer;
}

.hotspot circle {
  transition: r .15s;
}

.hotspot:active circle {
  r: 16;
}

.house-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 10px 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.todo { background: var(--yellow); border: 2px solid #e6b800; }
.legend-dot.done { background: var(--green-light); border: 2px solid var(--green); }

/* ── LIST VIEW ── */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 12px 6px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-muted);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 4px 12px 0;
}

/* TIP CARD */
.tip-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  border: 2px solid transparent;
  user-select: none;
  transition: background .2s, border-color .2s, transform .1s;
}

.tip-card:active { transform: scale(0.98); }

.tip-card.done {
  background: var(--green-pale);
  border-color: var(--green-light);
}

.tip-card.hidden { display: none; }

.tip-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.tip-card.done .tip-number { background: var(--green-light); }

.tip-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }

.tip-body { flex: 1; }

.tip-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
}

.tip-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.tip-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.tip-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--green-pale);
  color: var(--green);
  border-radius: 8px;
  padding: 2px 7px;
}

.tip-card.done .tip-tag { background: #c8e6c9; }

.tip-saving {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--yellow);
  color: #333;
  border-radius: 8px;
  padding: 2px 7px;
}

.tip-saving--tip {
  background: #e0e0e0;
  color: #666;
  font-weight: 600;
}

.tip-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: transparent;
  transition: all .2s;
  margin-top: 2px;
}

.tip-card.done .tip-check {
  background: var(--green-light);
  border-color: var(--green-light);
  color: #fff;
}

/* ── BOTTOM SHEET ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 31;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,1,.32,1);
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-content {
  padding: 16px 20px 24px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.sheet-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-icon { font-size: 2rem; }

.sheet-title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  flex: 1;
  padding-top: 4px;
}

.sheet-detail {
  font-size: 0.92rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 14px;
}

.sheet-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sheet-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--green-pale);
  color: var(--green);
  border-radius: 10px;
  padding: 3px 10px;
}

.sheet-saving {
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--yellow);
  color: #333;
  border-radius: 10px;
  padding: 3px 10px;
}

.sheet-info-block {
  background: var(--green-pale);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
}

.sheet-tip-block {
  background: #fff8e1;
  border-left: 4px solid var(--yellow);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #444;
}

.sheet-tip-label {
  font-weight: 800;
  color: #8a6800;
}

.sheet-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-align: center;
}

.sheet-btn:active { transform: scale(0.97); }

.sheet-btn.btn-todo {
  background: var(--green);
  color: #fff;
}

.sheet-btn.btn-done {
  background: var(--green-pale);
  color: var(--green);
  border: 2px solid var(--green-light);
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 18px;
  z-index: 18;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
}

.fab:hover { background: var(--green-light); }
.fab:active { transform: scale(0.92); }

/* ── CONGRATS ── */
.congrats {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn .3s ease;
}

.congrats-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  max-width: 290px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.congrats-box h2 { font-size: 1.4rem; color: var(--green); }
.congrats-box p  { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }

.congrats-box button {
  margin-top: 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── INSTALL BANNER ── */
.install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: var(--yellow);
  color: #222;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}

.install-banner button {
  flex-shrink: 0;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
}

.install-banner .close-banner {
  background: none;
  color: #555;
  padding: 4px 6px;
  font-size: 1rem;
  margin-left: auto;
}

/* ── RESPONSIVE ── */
@media (min-width: 580px) {
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .house-wrap { padding: 12px 16px 0; }
}
