:root {
  color: #1c1c1c;
  background: #f3f4f6;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
}

button, input, select, textarea, a {
  font: inherit;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }

button, .button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #e5e7eb;
  color: #1c1c1c;
  cursor: pointer;
}

a.button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

button.primary, .button.primary { background: #0b57d0; color: white; font-weight: 700; }
button.danger, a.button.danger { background: white; color: #b42318; border: 1px solid #fecdca; }
button.good, a.button.good { background: #067647; color: white; }
button:disabled { opacity: 0.45; cursor: default; }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: #1c1c1c;
  font-size: 16px;
  font-weight: 400;
}

input::placeholder, textarea::placeholder { color: #98a2b3; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

button:focus-visible, .button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #0b57d0;
  outline-offset: 2px;
}

textarea { min-height: 96px; resize: vertical; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, calc((100% - 720px) / 2)) 12px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.top a { color: inherit; font-weight: 700; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions a {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f2f4f7;
  font-weight: 600;
}
.top button { min-height: 36px; padding: 6px 12px; background: #f2f4f7; }

#app {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px 16px 140px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

section.stack > h2 { margin-top: 8px; color: #344054; font-size: 14px; }
section.stack > p.muted {
  padding: 14px;
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  background: white;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.card .card, p.card { background: #f8fafc; }
a.card, button.card { color: inherit; text-decoration: none; text-align: left; }

a.project-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
a.project-link strong { font-size: 18px; letter-spacing: -0.02em; }

.muted { color: #667085; margin: 0; }

.todo { color: #b42318; font-weight: 600; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: #667085; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

button.task-jump { font: inherit; color: inherit; width: 100%; background: white; }

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choices button { min-width: 0; white-space: normal; }
.choices button[aria-pressed="true"] { outline: 3px solid #0b57d0; }

.alert { margin: 0; color: #b42318; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.bottom-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 720px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: white;
  border-top: 1px solid #e5e7eb;
}

.shots { display: flex; flex-direction: column; gap: 8px; }
.shots img, .shot img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 8px; background: #f2f4f7; }
.shot { display: flex; flex-direction: column; gap: 6px; }
.shot input { min-height: 44px; }
.finding {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: white;
}
.finding label { flex: 1; margin: 0; }
.finding button { flex: 0 0 auto; min-height: 40px; background: transparent; color: #b42318; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair figure { margin: 0; }
.pair figcaption { margin-bottom: 4px; color: #475467; font-size: 13px; }
.pair .shots img { max-height: 160px; }

.file-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.meta h1 { flex: 1; min-width: 0; }
.meta span {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.back {
  color: #0b57d0;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.outbox {
  margin: 0;
  padding: 10px 16px;
  background: #fffaeb;
  color: #93370d;
}

.callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
}

details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
details.card[open] > summary { padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; }
button.pick { text-align: left; white-space: normal; }
button.pick strong, button.pick span { display: block; }

button.back { width: fit-content; background: transparent; color: #0b57d0; padding: 0; }

.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist h2 { margin: 4px 0 0; font-size: 15px; }
button.check-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: white;
  border: 1px solid #e5e7eb;
}
button.check-row strong { font-weight: 600; flex: 1; min-width: 0; }
button.check-row span { color: #667085; flex: 0 0 auto; white-space: nowrap; }
button.check-row.done span { color: #067647; }
button.check-row.fail span { color: #b42318; }

.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.steps button { flex: 1; min-width: 44px; }
.steps button[aria-current="step"] { outline: 3px solid #0b57d0; }
.steps button.done { background: #dbe7ff; }

@media (max-width: 360px) {
  .choices { grid-template-columns: 1fr; }
}

body[data-screen="login"] .top,
body[data-screen="login"] #outbox { display: none; }

body[data-screen="login"] #app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #e7e9ee;
}

.gate {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
}

.gate-head {
  padding: 28px 24px 20px;
  background: #f7f9fc;
  text-align: center;
}

.gate-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.gate-head p { margin: 8px 0 0; color: #475467; }

.gate-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }

.entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: #f2f4f7;
  border-radius: 14px;
}

.entry a, .entry .current {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  color: #344054;
  font-weight: 700;
}

.entry .current { background: #0b57d0; color: white; }

.password-line { position: relative; display: block; }
.password-line input { padding-right: 76px; }
.password-line button {
  position: absolute;
  right: 6px;
  top: 6px;
  min-height: 36px;
  padding: 0 10px;
  background: transparent;
}

.remember, .check { flex-direction: row; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; }
.remember input, .check input { width: 20px; min-height: 20px; }
