/* Mobile first: designed for 360px, centered 480px column on desktop. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #e9ebee; color: #111;
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: #0a4fb0; }
h1 { font-size: 22px; }
.list-title { font-size: 19px; margin: 10px 12px 0; }
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f4f5f7; }
main { padding: 0 12px 24px; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 2px solid #111; }
.brand { display: flex; align-items: center; min-height: 52px; color: #111; text-decoration: none; font-size: 18px; }
.brand b { margin-left: 4px; }
.top nav { display: flex; gap: 6px; margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 14px; border: 2px solid #111; border-radius: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-primary { background: #0a4fb0; border-color: #0a4fb0; color: #fff; }
.btn-plain { background: #fff; color: #111; }

.filters { padding: 8px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 64px; padding: 0 14px; background: #fff; border: 2px solid #777; border-radius: 26px; color: #111; text-decoration: none; font-weight: 600; }
.chip.on { background: #111; border-color: #111; color: #fff; }
.chip.on::before { content: "✓ "; white-space: pre; }
.chip.reset { border-style: dashed; }
.region summary { display: flex; align-items: center; min-height: 52px; padding: 0 14px; background: #fff; border: 2px solid #777; border-radius: 10px; cursor: pointer; }
.region summary b { margin-left: 6px; }
.region summary::after { content: "▼"; margin-left: auto; }
.region[open] summary::after { content: "▲"; }
.sub-chips { padding-top: 8px; border-top: 2px solid #ccc; }

.cards { list-style: none; margin: 8px 0 0; padding: 0; }
.card { margin-bottom: 12px; background: #fff; border: 1px solid #bbb; border-radius: 12px; overflow: hidden; }
.card-body { display: block; padding: 14px 14px 8px; color: #111; text-decoration: none; }
.card-body > span { display: block; }
.card-region { font-size: 20px; font-weight: 700; }
.card-pay { font-size: 24px; font-weight: 700; color: #b3121b; margin: 2px 0; }
.card-date { font-weight: 600; }
.tags { margin-top: 6px; }
.tag { display: inline-block; margin: 0 6px 4px 0; padding: 1px 8px; background: #eef0f3; border-radius: 6px; font-size: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px 14px; border-top: 1px solid #ddd; }
.card-meta { font-size: 16px; color: #444; min-width: 0; }
.call { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 96px; border-radius: 10px; background: #087a34; color: #fff; font-weight: 700; text-decoration: none; }

.empty { text-align: center; padding: 40px 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 0; }
.pager-now { font-weight: 700; white-space: nowrap; }
.pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding-bottom: 16px; }
.pages .chip { min-width: 52px; padding: 0 10px; }
.pages .chip.on::before { content: none; }
.search { display: flex; gap: 8px; margin-top: 8px; }
.search input { flex: 1; min-width: 0; }
.search button { flex: none; min-height: 52px; padding: 0 16px; font: inherit; font-weight: 700; color: #fff; background: #111; border: 2px solid #111; border-radius: 10px; cursor: pointer; }
.count { margin: 12px 0 0; font-weight: 700; }

.foot { padding: 16px 12px 32px; font-size: 15px; color: #444; border-top: 1px solid #ccc; }
.foot-links a { display: inline-flex; align-items: center; min-height: 52px; margin-right: 16px; color: #111; }

/* Forms */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; }
.tab { display: flex; align-items: center; justify-content: center; min-height: 52px; background: #fff; border: 2px solid #111; border-radius: 10px; color: #111; font-weight: 700; text-decoration: none; text-align: center; }
.tab.on { background: #111; color: #fff; }
label { display: block; margin: 12px 0 4px; font-weight: 700; }
input[type="text"], input[type="tel"], input[type="date"], input:not([type]), select, textarea {
  display: block; width: 100%; min-height: 52px; padding: 10px 12px; font: inherit; color: #111;
  background: #fff; border: 2px solid #777; border-radius: 10px;
}
textarea { line-height: 1.5; }
input.code { font-size: 28px; letter-spacing: 8px; text-align: center; }
.otp { font-size: 36px; font-weight: 700; letter-spacing: 8px; text-align: center; border: 2px solid currentColor; border-radius: 8px; padding: 8px 0; user-select: all; }
.btn-wide { display: flex; width: 100%; margin-top: 16px; font: inherit; font-weight: 700; cursor: pointer; }
button.btn-wide.btn-primary { border: 2px solid #0a4fb0; }
button.btn-wide.btn-plain { border: 2px solid #111; }
.hint { color: #444; font-size: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 14px; background: #fff1f0; border: 2px solid #b3121b; border-radius: 10px; font-weight: 700; }
.alert.ok { background: #eefaf0; border-color: #087a34; }

.draft { margin: 14px 0; padding: 12px; background: #fff; border: 1px solid #999; border-radius: 12px; }
.preview p { margin: 2px 0; }
.include { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; }
.include input, .pick input { width: 24px; height: 24px; }
.edit > summary, .patient > summary { display: flex; align-items: center; min-height: 52px; font-weight: 700; color: #0a4fb0; cursor: pointer; }
.field { margin: 12px 0 0; padding: 8px 0 0; border: 0; border-top: 1px solid #ccc; min-width: 0; }
.field legend { float: left; width: 100%; padding: 0; font-weight: 700; }
.field legend + * { clear: both; }
.field.check, .field.bad { padding: 8px; border: 3px solid #c77700; border-radius: 10px; background: #fff8e5; }
.field.bad { border-color: #b3121b; background: #fff1f0; }
.note { margin: 6px 0 0; font-weight: 700; color: #8a5200; }
.bad-note { color: #b3121b; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row .note { grid-column: 1 / -1; }

/* Radio buttons and checkboxes drawn as chips */
.pick { margin: 0; position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: flex; align-items: center; justify-content: center; min-height: 52px; min-width: 64px; padding: 0 14px; background: #fff; border: 2px solid #777; border-radius: 26px; font-weight: 600; cursor: pointer; }
.pick input:checked + span { background: #111; border-color: #111; color: #fff; }
.pick input:checked + span::before { content: "✓ "; white-space: pre; }
.pick input:focus-visible + span { outline: 3px solid #0a4fb0; outline-offset: 2px; }

/* Badges, detail page, my posts */
[hidden] { display: none !important; }
.badge { display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.badge-verified { background: #087a34; border: 2px solid #087a34; color: #fff; }
.badge-member { background: #fff; border: 2px solid #0a4fb0; color: #0a4fb0; }
.detail h1 { margin-bottom: 0; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; padding: 12px; background: #fff; border: 1px solid #bbb; border-radius: 12px; }
.detail dt { color: #555; }
.detail dd { margin: 0; font-weight: 700; }
.pre { white-space: pre-wrap; }
.poster { padding: 4px 12px; background: #fff; border: 1px solid #bbb; border-radius: 12px; }
.phone a { display: inline-flex; align-items: center; min-height: 52px; font-size: 24px; font-weight: 700; color: #111; }
.raw > summary { display: flex; align-items: center; min-height: 52px; font-weight: 700; cursor: pointer; }
.has-bar .foot { padding-bottom: 110px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; max-width: 480px; margin: 0 auto; padding: 8px; background: #fff; border-top: 2px solid #111; }
.bar a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60px; border-radius: 10px; color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; }
.bar-call { background: #087a34; }
.bar-sms { background: #0a4fb0; }
.mine .card-body { padding: 0 0 4px; }
.mine .state { margin: 0; font-weight: 700; color: #666; }
.mine .state.on { color: #087a34; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions .btn { flex: 1; }

/* Admin */
input[type="password"] { display: block; width: 100%; min-height: 52px; padding: 10px 12px; font: inherit; border: 2px solid #777; border-radius: 10px; }
.stats { width: 100%; border-collapse: collapse; background: #fff; }
.stats th, .stats td { padding: 6px 8px; border: 1px solid #bbb; text-align: right; }
.stats th:first-child, .stats td:first-child { text-align: left; }
button.btn { font: inherit; font-weight: 700; cursor: pointer; }
