:root {
  --bg: #e8f3f1;
  --card: #ffffff;
  --ink: #143132;
  --muted: #5d7475;
  --teal: #1b7a78;
  --teal-dark: #0f3d3e;
  --sand: #f4efe6;
  --danger: #b42318;
  --ok: #067647;
  --line: #d7e4e2;
  --shadow: 0 10px 30px rgba(15, 61, 62, 0.12);
  --phone-w: 390px;
  --phone-h: 844px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, #d7ece9 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #c5d8d4 0%, transparent 45%),
    #9fb4b1;
  color: var(--ink);
}

.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.hint {
  margin: 14px 0 0;
  color: #335050;
  font-size: 13px;
}

.device {
  width: calc(var(--phone-w) + 18px);
  height: calc(var(--phone-h) + 18px);
  padding: 9px;
  border-radius: 44px;
  background: #1a1c1c;
  box-shadow:
    0 0 0 2px #2c3030,
    0 22px 50px rgba(0, 0, 0, 0.28);
  position: relative;
}

.device-speaker {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 22px;
  background: #111;
  border-radius: 16px;
  z-index: 3;
}

.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.status-bar {
  flex: 0 0 34px;
  padding: 10px 22px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  background: var(--teal-dark);
}

.topbar {
  background: var(--teal-dark);
  color: #fff;
  padding: 8px 14px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 650;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  flex-shrink: 0;
}

#app {
  flex: 1;
  padding: 16px 16px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.home-indicator {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.home-indicator::after {
  content: "";
  width: 120px;
  height: 5px;
  border-radius: 99px;
  background: #1a1c1c;
  opacity: 0.22;
}

.brand {
  text-align: center;
  padding: 36px 8px 18px;
}
.mark {
  width: 72px; height: 72px; margin: 0 auto 12px;
  border-radius: 22px;
  background: linear-gradient(160deg, #2aa8a4, #0f3d3e);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 26px;
  letter-spacing: -1px;
}
.brand h2 { margin: 0; font-size: 26px; }
.brand p { margin: 6px 0 0; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: block; width: 100%;
  border: 0; border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px; font-weight: 650;
  cursor: pointer;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-ghost { background: var(--card); color: var(--teal-dark); border: 1px solid var(--line); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f2c2c0; }
.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-row .btn {
  width: auto;
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-top: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.assessment-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.assessment-item:first-child { padding-top: 0; }
.assessment-item:last-child { border-bottom: 0; padding-bottom: 0; }
.assessment-item h4 { margin: 0 0 6px; font-size: 15px; }
.assessment-item p { margin: 8px 0; line-height: 1.45; }
.muted { color: var(--muted); font-size: 13px; }
.row-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }

label { display: block; font-size: 13px; font-weight: 650; margin: 10px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  background: #fff;
  font-family: inherit;
}
textarea { min-height: 88px; resize: vertical; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: left;
  border: 0;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.tile strong { display: block; font-size: 14px; }
.tile span { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--teal-dark);
  text-transform: capitalize;
}
.err { color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.ok { color: var(--ok); font-size: 13px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.hidden { display: none; }

/* Real phone: drop the fake device and fill the screen */
@media (max-width: 480px) {
  body { background: var(--bg); }
  .stage { padding: 0; display: block; }
  .hint { display: none; }
  .device {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .device-speaker { display: none; }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .status-bar { padding-top: max(10px, env(safe-area-inset-top)); }
  .home-indicator { padding-bottom: env(safe-area-inset-bottom); }
}
