
:root {
  --bg: #f5f7f3;
  --panel: #ffffff;
  --text: #1f2a24;
  --muted: #647067;
  --line: #dfe6dc;
  --accent: #2f6f4e;
  --accent-soft: #e5f1e8;
  --warning: #a15c1b;
  --shadow: 0 14px 30px rgba(31, 42, 36, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 40px clamp(16px, 5vw, 72px);
  background: linear-gradient(135deg, #1f4d37, #3d875f);
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  opacity: .85;
}

h1, h2, h3, p { margin-top: 0; }

h1 { font-size: clamp(34px, 6vw, 64px); margin-bottom: 10px; }

.lead { max-width: 720px; font-size: 18px; opacity: .9; }

main {
  padding: 28px clamp(16px, 5vw, 72px) 60px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
  font-size: 14px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: white;
}

.score-card {
  min-width: 210px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  text-align: right;
}

.score-card span, .score-card small {
  display: block;
  opacity: .85;
}

.score-card strong {
  display: block;
  font-size: 48px;
  line-height: 1;
  margin: 8px 0;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  margin: 18px 0;
}

.dashboard .panel, .actions { padding: 22px; }

.actions button {
  width: 100%;
  margin-bottom: 10px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin: 18px 0;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 170px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.bar-bg {
  height: 14px;
  background: #edf1ec;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .2s ease;
}

#criteria {
  display: grid;
  gap: 16px;
}

.criterion {
  padding: 20px;
}

.criterion-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 750;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 10px;
}

.meta, .indicator, .question, footer {
  color: var(--muted);
}

.points {
  min-width: 76px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 20px;
}

details {
  margin: 12px 0 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}

.options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.option {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  min-height: 138px;
}

.option:hover {
  border-color: var(--accent);
}

.option input {
  width: auto;
  margin-right: 8px;
}

.option strong {
  display: block;
  margin-bottom: 8px;
}

.option span {
  color: var(--muted);
  font-size: 14px;
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

footer {
  padding: 0 clamp(16px, 5vw, 72px) 28px;
}

@media (max-width: 900px) {
  .hero, .intro, .dashboard, .toolbar {
    grid-template-columns: 1fr;
  }
  .score-card { text-align: left; }
  .form-grid, .options {
    grid-template-columns: 1fr;
  }
}

@media print {
  body { background: white; }
  .hero, main, footer { padding: 16px; }
  .actions, .toolbar, details, button { display: none !important; }
  .panel { box-shadow: none; break-inside: avoid; }
  .options { display: none; }
}

.project-ref {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fff;
  display: inline-block;
}

.project-ref strong {
  color: var(--text);
}

.sync-status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.sync-status strong::before {
  content: "✓ ";
}

.sync-status span {
  color: var(--muted);
  font-size: 14px;
}

.sync-status[data-status="syncing"] strong::before {
  content: "↻ ";
}

.sync-status[data-status="offline"] strong::before,
.sync-status[data-status="error"] strong::before {
  content: "⚠ ";
}

@media print {
  .sync-status { display: none !important; }
}

.project-share {
  display: grid;
  gap: 12px;
}

.share-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.share-row input {
  font-size: 14px;
  background: #fbfcfb;
}

.share-row button {
  white-space: nowrap;
}

.qr-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

#qrcode {
  min-width: 164px;
  min-height: 164px;
  display: grid;
  place-items: center;
}

#qrcode img,
#qrcode canvas {
  display: block;
}

@media (max-width: 900px) {
  .share-row {
    grid-template-columns: 1fr;
  }
}


.new-project-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.new-project-box small {
  color: var(--muted);
  line-height: 1.4;
}

.recent-projects {
  padding: 22px;
  margin: 18px 0;
}

.recent-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.recent-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfb;
}

.recent-item.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.recent-title {
  display: block;
  font-weight: 750;
}

.recent-meta,
.recent-place {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.recent-place {
  color: var(--text);
  opacity: .78;
}

.recent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.recent-actions button,
.recent-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 13px;
  font-weight: 750;
  font-size: 14px;
}

.recent-actions a {
  background: var(--accent);
  color: white;
}

.empty-recent {
  color: var(--muted);
  padding: 12px 0;
}

@media (max-width: 900px) {
  .recent-head,
  .recent-item {
    grid-template-columns: 1fr;
  }
  .recent-actions {
    justify-content: stretch;
  }
  .recent-actions a,
  .recent-actions button {
    flex: 1;
  }
}

@media print {
  .recent-projects,
  .new-project-box {
    display: none !important;
  }
}

@media print {
  .project-share {
    break-inside: avoid;
  }
  .share-row button {
    display: none !important;
  }
  .qr-wrap {
    padding: 8px;
  }
}
