/* ProtoCare design system — tokens from the Figma style guide (Pretendard / Paperlogy, Orange · Green · Red scales). */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy/Paperlogy.css');

:root {
  --orange-light: #fff5ea; --orange-light-hover: #fff0e0; --orange-light-active: #ffdfbe;
  --orange: #ff982e; --orange-hover: #e68929; --orange-active: #cc7a25; --orange-dark: #bf7223; --orange-darker: #593510;
  --green-light: #edf9f7; --green-light-hover: #e3f7f3; --green-light-active: #c6eee5;
  --green: #47c7ac; --green-hover: #40b39b; --green-active: #399f8a; --green-dark: #359581; --green-darker: #19463c;
  --red-light: #fbeaea; --red: #d32f2f; --red-hover: #be2a2a;
  --blue-light: #eef5ff; --blue: #4f8fe6; --purple-light: #f3f1ff; --purple: #7a6ad8; --yellow-light: #fff8e3; --yellow: #e0a100;
  --black: #111; --gray-900: #222; --gray-700: #444; --gray-600: #666; --gray-500: #999; --gray-400: #bbb;
  --line: #e5e5e5; --line-light: #f0f0f0; --bg: #f5f5f5; --bg-soft: #fafafa; --white: #fff;
  /* brand colour of the current app: orange for customers, green for supporters and the admin console */
  --brand: var(--orange); --brand-hover: var(--orange-hover); --brand-active: var(--orange-active);
  --brand-light: var(--orange-light); --brand-light-hover: var(--orange-light-hover); --brand-light-active: var(--orange-light-active); --brand-dark: var(--orange-dark);
  --radius: 8px; --radius-lg: 12px; --shadow: 0 2px 8px rgba(0, 0, 0, .06); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .16);
  --content: 1030px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-display: 'Paperlogy', var(--font);
}
[data-app='supporter'], [data-app='admin'] {
  --brand: var(--green); --brand-hover: var(--green-hover); --brand-active: var(--green-active);
  --brand-light: var(--green-light); --brand-light-hover: var(--green-light-hover); --brand-light-active: var(--green-light-active); --brand-dark: var(--green-dark);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--black); background: var(--white); letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type */
.h-36 { font-size: 36px; font-weight: 700; line-height: 1.3; }
.h-28 { font-size: 28px; font-weight: 700; line-height: 1.35; }
.h-24 { font-size: 24px; font-weight: 700; line-height: 1.4; }
.h-20 { font-size: 20px; font-weight: 600; line-height: 1.4; }
.h-18 { font-size: 18px; font-weight: 600; }
.b-16 { font-size: 16px; } .b-14 { font-size: 14px; } .c-12 { font-size: 12px; }
.muted { color: var(--gray-600); } .faint { color: var(--gray-500); } .brand { color: var(--brand); } .danger { color: var(--red); }
.bold { font-weight: 600; } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.display { font-family: var(--font-display); }

/* layout helpers */
.container { width: 100%; max-width: calc(var(--content) + 40px); margin: 0 auto; padding: 0 20px; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grid { display: grid; gap: 12px; } .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-5 { grid-template-columns: repeat(5, 1fr); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; border: 1px solid transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; } .btn-primary:not(:disabled):hover { background: var(--brand-hover); } .btn-primary:not(:disabled):active { background: var(--brand-active); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; } .btn-outline:not(:disabled):hover { background: var(--brand-light); }
.btn-soft { background: var(--brand-light); color: var(--brand-dark); } .btn-soft:not(:disabled):hover { background: var(--brand-light-active); }
.btn-gray { background: var(--bg); color: var(--gray-700); } .btn-gray:not(:disabled):hover { background: #ebebeb; }
.btn-line { border-color: var(--line); background: #fff; color: var(--gray-700); } .btn-line:not(:disabled):hover { background: var(--bg-soft); }
.btn-danger { background: var(--red); color: #fff; } .btn-danger:not(:disabled):hover { background: var(--red-hover); }
.btn-green { background: var(--green); color: #fff; } .btn-green:not(:disabled):hover { background: var(--green-hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; } .btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 4px; }
.btn-lg { height: 48px; font-size: 16px; } .btn-block { width: 100%; }
.link { color: var(--gray-700); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; } .link:hover { color: var(--black); }
.link-brand { color: var(--brand); font-weight: 600; font-size: 13px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 20px; }
.label { font-size: 14px; font-weight: 600; } .label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 14px; outline: none; transition: border-color .15s; }
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--gray-500); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); }
.input:disabled, .input[readonly].locked { background: var(--bg); color: var(--gray-600); }
.input.error, .select.error, .textarea.error { border-color: var(--red); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-sm, .select-sm { height: 36px; font-size: 13px; }
.hint { font-size: 12px; color: var(--gray-600); } .hint.error { color: var(--red); } .hint.ok { color: var(--green-dark); }
.input-row { display: flex; gap: 8px; } .input-row .input { flex: 1; min-width: 0; } .input-row .btn { height: 44px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--gray-400); display: grid; place-items: center; flex: none; transition: .15s; color: transparent; }
.check input:checked + .box { border-color: var(--brand); color: var(--brand); }
.check input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #d6d6d6; transition: .2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::after { transform: translateX(20px); }

/* chips: single / multi select pills */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--gray-700); display: inline-flex; align-items: center; gap: 4px; transition: .15s; }
.chip:hover { border-color: var(--gray-400); }
.chip.on { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.chips.square .chip { border-radius: var(--radius); }
.chips.dark .chip.on { border-color: var(--black); background: #fff; color: var(--black); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg .chip { height: 44px; border-radius: var(--radius); justify-content: center; background: var(--bg); border-color: transparent; }
.seg .chip.on { background: var(--brand-light); border-color: transparent; color: var(--brand-dark); }

/* tags & badges */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--gray-700); white-space: nowrap; }
.tag.medical { background: var(--blue-light); color: #2f6fc4; } .tag.senior { background: var(--purple-light); color: #5b4bc0; } .tag.kids { background: var(--yellow-light); color: #a87800; } .tag.bath { background: #eaf7ee; color: #2f8a4c; }
.tag.urgent { background: var(--orange); color: #fff; font-weight: 600; } .tag.red { background: var(--red); color: #fff; }
.tag.green { background: var(--green-light); color: var(--green-dark); } .tag.orange { background: var(--orange-light); color: var(--orange-dark); } .tag.blue { background: var(--blue-light); color: #2f6fc4; }
.tag.gray { background: #ededed; color: var(--gray-600); } .tag.yellow { background: var(--yellow-light); color: #a87800; } .tag.solid-green { background: var(--green); color: #fff; }
.tag.sq { border-radius: 4px; }

/* cards */
.card { background: #fff; border: 1px solid var(--line-light); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border-color: var(--line); }
.card-pad { padding: 20px; }
.stat { background: #fff; border: 1px solid var(--line-light); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--brand); }
.stat .k { font-size: 13px; color: var(--gray-700); } .stat .v { font-size: 20px; font-weight: 700; color: var(--brand); margin-top: 4px; } .stat .v small { font-size: 12px; font-weight: 500; color: var(--black); margin-left: 2px; }
.stat.plain { border-top: 1px solid var(--line-light); }
.empty { padding: 56px 16px; text-align: center; color: var(--gray-500); font-size: 14px; }
.empty svg { margin: 0 auto 12px; color: var(--gray-400); }
.notice-box { background: var(--brand-light); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--gray-700); }
.notice-box.red { background: var(--red-light); color: #9c2323; } .notice-box.gray { background: var(--bg); }

/* stepper */
.stepper { display: flex; justify-content: center; margin: 20px 0 28px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 76px; position: relative; font-size: 12px; color: var(--gray-500); }
.step .dot { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--gray-500); position: relative; z-index: 1; }
.step + .step::before { content: ''; position: absolute; top: 18px; right: 50%; width: 100%; height: 1.5px; background: var(--line); }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; } .step.done, .step.now { color: var(--brand); font-weight: 600; }
.step.now .dot { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.step.done + .step::before, .step.now::before { background: var(--brand); }

/* tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; height: 44px; font-size: 14px; color: var(--gray-600); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.tabs.inline .tab { flex: none; padding: 0 16px; }

/* table */
.table-wrap { background: #fff; border: 1px solid var(--line-light); border-radius: var(--radius); overflow-x: auto; }
.table th { background: var(--bg-soft); font-size: 12px; font-weight: 500; color: var(--gray-600); text-align: left; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line-light); }
.table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--line-light); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; } .table tbody tr.click:hover { background: var(--brand-light); }
.table .center { text-align: center; } .table .right { text-align: right; }

/* pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 20px; }
.pager button { min-width: 30px; height: 30px; border-radius: 6px; font-size: 13px; color: var(--gray-700); display: grid; place-items: center; }
.pager button:hover:not(:disabled) { background: var(--bg); } .pager button:disabled { color: var(--gray-400); cursor: default; }
.pager button.on { border: 1px solid var(--brand); color: var(--brand); font-weight: 600; background: var(--brand-light); }

/* modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 24px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); overflow-y: auto; animation: pop .18s; }
.modal.wide { max-width: 580px; } .modal.xwide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; } .modal.centered .modal-head { justify-content: center; text-align: center; } .modal.centered .modal-text { text-align: center; }
.modal-text { font-size: 14px; color: var(--gray-700); line-height: 1.6; white-space: pre-line; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; } .modal-actions .btn { flex: 1; height: 44px; }
.modal-x { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--gray-700); flex: none; } .modal-x:hover { background: var(--bg); }
.toasts { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(34, 34, 34, .94); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: min(92vw, 480px); }
.toast.error { background: var(--red); } .toast.ok { background: var(--green-dark); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 64px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* key-value lists */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--gray-600); } .kv dd { font-weight: 500; min-width: 0; }
.kv.spread { grid-template-columns: auto 1fr; } .kv.spread dd { text-align: right; }
.divider { height: 1px; background: var(--line-light); margin: 20px 0; border: 0; }
.stars { color: #ffc93c; letter-spacing: 1px; white-space: nowrap; } .stars .off { color: #e3e3e3; }
.avatar { border-radius: 50%; background: #e9ebef; color: #8a90a0; display: grid; place-items: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.progress { height: 6px; border-radius: 3px; background: var(--line-light); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.accordion-item { border-bottom: 1px solid var(--line-light); }
.accordion-q { width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 4px; text-align: left; font-size: 15px; font-weight: 600; }
.accordion-q .chev { margin-left: auto; transition: transform .2s; color: var(--gray-600); flex: none; } .accordion-item.open .chev { transform: rotate(180deg); }
.accordion-a { display: none; padding: 0 4px 18px 34px; color: var(--gray-700); line-height: 1.7; white-space: pre-line; } .accordion-item.open .accordion-a { display: block; }
.q-mark { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--gray-500); }
.prose { font-size: 14px; line-height: 1.8; color: var(--gray-700); white-space: pre-line; }

@media (max-width: 768px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .h-36 { font-size: 26px; } .h-28 { font-size: 22px; } .h-24 { font-size: 20px; }
  .modal-back { place-items: end center; padding: 0; } .modal, .modal.wide, .modal.xwide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .hide-m { display: none !important; }
}
@media (min-width: 769px) { .only-m { display: none !important; } }
@media (max-width: 480px) { .grid-2.stack-m, .grid-3.stack-m, .grid-4.stack-m { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
