:root {
  --ink: #17211c;
  --muted: #5d6b64;
  --line: #d7e0da;
  --paper: #f4f7f5;
  --card: #fff;
  --green: #1d6b4f;
  --green-dark: #16352b;
  --warn: #9a3412;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-text-size-adjust: 100%; font-family: "Pretendard", "Malgun Gothic", sans-serif; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; min-height: 44px; color: var(--ink); touch-action: manipulation; }
header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px; background: var(--green-dark); color: #fff; }
header b { display: block; font-size: 18px; }
header small { color: #c9ddd4; }
header button, .ghost { border: 1px solid transparent; background: transparent; color: inherit; padding: 0 10px; white-space: nowrap; }
header > div:first-child { min-width: 0; }
header b, header small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header > div:last-child:not(:first-child) { display: flex; flex: 0 0 auto; }
.wrap { max-width: 880px; margin: 0 auto; padding: 16px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
h1, h2 { margin: 0 0 8px; }
.hint { color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
input:not([type="checkbox"]):not([type="file"]) { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); font-size: 16px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #7fc4a6; outline-offset: 1px; }
.primary, .secondary { border: 0; border-radius: 12px; padding: 12px 14px; white-space: nowrap; font-weight: 600; }
.primary { background: var(--green); color: #fff; }
.secondary { background: #e7f2ec; color: var(--green-dark); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; }
.site { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 8px; }
.site b { display: block; }
.site span { color: var(--muted); font-size: 13px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { border: 1px dashed #b7c7be; border-radius: 14px; padding: 10px; background: #fbfcfb; min-height: 148px; }
.slot strong { display: block; margin-bottom: 6px; }
.slot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #111; display: block; }
.actions { display: flex; gap: 6px; margin-top: 8px; }
.actions button, .mini { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--line); padding: 14px 0; }
.line .shot { display: block; align-self: start; }
.line .shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #111; display: block; }
.line .shot.empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed #b7c7be; border-radius: 8px; padding: 0; }
.line .body { display: grid; gap: 6px; align-content: start; }
.line .sub { font-size: 20px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.line .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.line .note, .line .actions { grid-column: 1 / -1; margin: 0; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10; max-width: 856px; margin: 0 auto; padding: 12px 14px; border-radius: 12px; background: #16352b; color: #fff; font-size: 14px; line-height: 1.4; word-break: break-all; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast:empty { display: none; }
.note { color: var(--warn); font-size: 13px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(420px, 100%); }
.empty { color: var(--muted); padding: 12px 0; }
@media (max-width: 720px) {
  .wrap { padding: 10px 10px calc(80px + env(safe-area-inset-bottom)); }
  .card { padding: 14px 12px; }
  .slot { padding: 8px; min-height: 0; }
  .slot .hint { display: none; }
  .file { flex-wrap: wrap; }
  .file a { flex: 1 1 100%; }
  .file small { flex: 1; }
}
.stampTap { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--ink); }
.stampTap input { width: 18px; height: 18px; }
.file { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.file a { flex: 1; word-break: break-all; }
.file small { color: var(--muted); white-space: nowrap; }
.file .mini { flex: 0 0 auto; padding: 8px 16px; }
.note.toast { color: #fff; }
.card > .row + .hint { margin-top: 10px; }
@media (max-width: 720px) {
  .file { flex-wrap: wrap; }
  .file a { flex: 1 1 100%; }
  .file small { flex: 1; }
}
.wide { display: block; width: 100%; min-height: 52px; font-size: 17px; }
