* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: #f4f6fb; color: #1f2937; }
header { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: #111827; text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
header { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 520px) { .brand span { display: none; } }
nav { display: flex; gap: 16px; align-items: center; }
nav a { color: #374151; text-decoration: none; }
nav a:hover { color: #4f46e5; }
main { margin: 32px auto; padding: 0 16px; }
main.narrow { max-width: 440px; }
main.wide { max-width: 1100px; }
.card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
h1 { margin-top: 0; font-size: 24px; }
h2 { font-size: 18px; margin-top: 0; }
h3 { margin: 0 0 12px; font-size: 16px; }
label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #374151; }
label small { font-weight: 400; color: #6b7280; }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; font-weight: 400; }
input:focus, textarea:focus { outline: 2px solid #c7d2fe; border-color: #6366f1; }
input:disabled { background: #f3f4f6; color: #6b7280; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
button { padding: 9px 16px; border: 1px solid #d1d5db; background: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
button:hover { background: #f9fafb; }
button.primary { background: #4f46e5; color: #fff; border-color: #4f46e5; width: 100%; padding: 12px; font-weight: 600; }
button.primary:hover { background: #4338ca; }
button.small { padding: 5px 10px; font-size: 13px; }
button.danger { color: #dc2626; border-color: #fecaca; }
button.link { border: 0; background: none; color: #374151; padding: 0; }
button.link:hover { color: #4f46e5; }
form.inline { display: inline; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: end; }
.grid .full { grid-column: 1 / -1; }
.grid button { grid-column: 1 / -1; justify-self: start; width: auto; padding: 9px 24px; }
.row { display: flex; align-items: center; justify-content: space-between; }
.row.gap { justify-content: flex-start; gap: 8px; margin-top: 12px; }
.center { text-align: center; }
.muted { color: #6b7280; font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fef2f2; color: #b91c1c; }
.alert.success { background: #ecfdf5; color: #047857; }
.alert.info { background: #eef2ff; color: #4338ca; }
.alert.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
code.big { display: inline-block; margin-top: 8px; font-size: 15px; user-select: all; }
pre { background: #111827; color: #e5e7eb; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; user-select: all; }
details summary { cursor: pointer; color: #4f46e5; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #f3f4f6; }
th { color: #6b7280; font-weight: 600; }
td.actions { white-space: nowrap; }
.tag { display: inline-block; background: #eef2ff; color: #4338ca; padding: 1px 8px; border-radius: 99px; font-size: 12px; margin-right: 4px; }
.tag.red { background: #fef2f2; color: #b91c1c; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } table { font-size: 12px; } }

.tag.green { background: #ecfdf5; color: #047857; }
.tag.gray { background: #f3f4f6; color: #6b7280; }
input.otp { font-size: 22px; letter-spacing: 6px; text-align: center; font-family: Consolas, monospace; }
.qr { margin: 12px 0; } .qr svg { width: 200px; height: 200px; border: 1px solid #e5e7eb; border-radius: 8px; }
ol.steps { padding-left: 20px; line-height: 1.7; } ol.steps li { margin-bottom: 10px; }
pre.codes { font-size: 16px; line-height: 1.8; columns: 2; }
label.check.full { grid-column: 1 / -1; }

/* ---------- 포털 (로그인 후 첫 화면) ---------- */
.portal { padding-bottom: 24px; }
.phero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-top: 8px; }
.phero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.phero p { margin: 0; color: #475569; font-size: 15px; }
.psearch { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; padding: 0 14px; height: 44px; width: 300px; max-width: 100%; margin: 0; }
.psearch:focus-within { border-color: #6366f1; outline: 2px solid #c7d2fe; }
.psearch input { border: 0; outline: none; margin: 0; padding: 0; flex: 1; min-width: 0; background: transparent; font-size: 14px; }
.pbanner { margin-top: 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 12px; padding: 14px 18px; }
.pbanner p { margin: 0; flex: 1; min-width: 220px; font-size: 14px; color: #3730a3; }
.pbtn { background: #4f46e5; color: #fff; font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.pbtn:hover { background: #4338ca; }
.psec { display: flex; align-items: center; gap: 8px; margin: 36px 0 14px; font-size: 18px; }
.psec span { color: #64748b; font-weight: 500; font-size: 15px; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pfav { display: flex; align-items: center; background: #fff; border: 1px solid #fde68a; border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.pfav:hover { border-color: #fcd34d; box-shadow: 0 6px 18px rgba(180,83,9,.10); }
.pfav > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 8px 14px 16px; color: #0f172a; text-decoration: none; }
.pname { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parrow { color: #4f46e5; display: flex; }
.fav-empty { border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 18px; text-align: center; font-size: 14px; color: #475569; background: #fff; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pcard:hover { border-color: #a5b4fc; box-shadow: 0 8px 24px rgba(79,70,229,.12); transform: translateY(-2px); }
.pcard > a { display: flex; flex-direction: column; gap: 14px; padding: 22px; min-height: 168px; box-sizing: border-box; height: 100%; color: #0f172a; text-decoration: none; }
.ptop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 44px; }
.pico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.pico.sm { width: 40px; height: 40px; border-radius: 10px; }
.pbadge { font-size: 12px; font-weight: 700; color: #92400e; background: #fef3c7; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.pbody { flex: 1; }
.ptitle { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.pdesc { font-size: 14px; color: #475569; }
.pgo { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #4f46e5; }
.pcard:hover .pgo { color: #3730a3; }
.pstar { position: absolute; top: 14px; right: 14px; }
.fav-form { margin: 0; }
.star { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.star:hover { background: #fef3c7; }
.pfav .star { margin-right: 6px; }
.pnone { text-align: center; color: #64748b; margin: 20px 0; }
.pfoot { margin: 36px 0 0; font-size: 13px; color: #64748b; text-align: center; }
fieldset.portal-fields { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 16px 0; margin: 0 0 14px; }
fieldset.portal-fields legend { font-size: 14px; font-weight: 700; color: #374151; padding: 0 6px; }
select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; font-weight: 400; background: #fff; }
.pcard[hidden], .pfav[hidden], .pnone[hidden] { display: none; }
.pemoji { line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
input.emoji-input { font-size: 20px; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", inherit; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid #d1d5db; border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
