/* 더치페이 정산기 */
.dp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dp > * { min-width: 0; }
.dp-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--text) 5%, var(--surface)); border: 1px solid var(--line); }
.dp-tab { min-height: 46px; border: 0; border-radius: calc(var(--r-lg) - 5px); background: none; color: var(--muted); font-size: 15.5px; font-weight: 800; cursor: pointer; }
.dp-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.dp-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dp-pane[hidden] { display: none; }
.dp-h { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.dp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.dp-head .hint { margin: 0; }

/* 금액 입력 */
.dp-grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.dp-money { position: relative; display: flex; align-items: center; }
.dp-money input { width: 100%; min-height: 54px; padding: 0 44px 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right; outline: none; transition: border-color .15s, box-shadow .15s; }
.dp-money input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.dp-money > span { position: absolute; right: 16px; color: var(--muted); font-weight: 700; pointer-events: none; }
.dp-money.small input { min-height: 44px; padding: 0 34px 0 12px; font-size: 17px; }
.dp-money.small > span { right: 12px; font-size: 14px; }
.dp-stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; min-height: 54px; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.dp-stepper button { border: 0; background: color-mix(in srgb, var(--text) 4%, var(--surface)); color: var(--text); font-size: 22px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.dp-stepper button:active { background: var(--soft-2); }
.dp-stepper input { width: 100%; min-width: 0; border: 0; text-align: center; font-size: 22px; font-weight: 800; background: none; outline: none; -moz-appearance: textfield; }
.dp-stepper input::-webkit-outer-spin-button, .dp-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dp-seg { display: flex; }
.dp-seg label { flex: 1; text-align: center; }
.dp-seg span { padding: 8px 4px; white-space: nowrap; }
.dp .segmented input { inset: 0; width: 100%; height: 100%; margin: 0; }

/* 간단 결과 */
.dp-simple-out { margin-top: 4px; display: grid; gap: 16px; }
.dp-hero { display: grid; justify-items: center; gap: 2px; padding: 10px 0 4px; text-align: center; }
.dp-hero span { color: var(--muted); font-weight: 700; font-size: 14.5px; }
.dp-hero strong { font-size: clamp(38px, 9vw, 54px); font-weight: 800; letter-spacing: -.045em; line-height: 1.15; font-variant-numeric: tabular-nums; background: linear-gradient(120deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dp-hero small { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 420px; }
.dp .stat strong { font-size: 19px; }
.dp .tool-actions { margin-top: 2px; }

/* 사람 */
.dp-people { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-person { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px 0 10px; border-radius: 99px; background: hsl(var(--h) 70% 96%); border: 1px solid hsl(var(--h) 45% 84%); }
.dp-person i { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 60% 55%); flex: none; }
.dp-person input { min-width: 1.6em; max-width: 9em; border: 0; background: none; color: #1f2a37; font-size: 15px; font-weight: 700; outline: none; padding: 4px 0; }
.dp-person input:focus { text-decoration: underline dashed hsl(var(--h) 50% 60%); text-underline-offset: 4px; }
.dp-person button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: #64748b; font-size: 17px; cursor: pointer; }
.dp-person button:hover { background: rgba(0, 0, 0, .06); color: #1f2a37; }
.dp-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.dp-add input, .dp-opts input[type=text] { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-size: 15.5px; outline: none; }
.dp-add input:focus, .dp-opts input[type=text]:focus { border-color: var(--primary); box-shadow: var(--ring); }
.dp-add .btn { min-height: 44px; }
:root[data-theme="dark"] .dp-person { background: hsl(var(--h) 25% 22%); border-color: hsl(var(--h) 25% 32%); }
:root[data-theme="dark"] .dp-person input { color: var(--text); }

/* 항목 */
.dp-items { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dp-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 2%, var(--surface)); }
.dp-item-top { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 150px) 36px; align-items: center; gap: 8px; }
.dp-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--link); font-size: 13px; font-weight: 800; }
.dp-iname { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15.5px; font-weight: 700; outline: none; }
.dp-iname:focus { border-color: var(--primary); box-shadow: var(--ring); }
.dp-del { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 16px; opacity: .55; }
.dp-del:hover { opacity: 1; background: color-mix(in srgb, #e5484d 10%, transparent); }
.dp-item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dp-payer { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.dp-payer select { min-height: 40px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; max-width: 12em; }
.dp-mem-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.dp-members { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-mem { min-height: 34px; padding: 0 12px; border: 1.5px dashed var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--subtle); font-size: 14px; font-weight: 700; cursor: pointer; touch-action: manipulation; text-decoration: line-through; transition: background .15s, border-color .15s, color .15s; }
.dp-mem[aria-pressed="true"] { border-style: solid; border-color: hsl(var(--h) 45% 72%); background: hsl(var(--h) 70% 95%); color: #1f2a37; text-decoration: none; }
:root[data-theme="dark"] .dp-mem[aria-pressed="true"] { background: hsl(var(--h) 25% 24%); border-color: hsl(var(--h) 25% 40%); color: var(--text); }
.dp-all { min-height: 34px; padding: 0 10px; border: 0; border-radius: 99px; background: none; color: var(--link); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.dp-each-line { margin: -2px 0 0; color: var(--muted); font-size: 13.5px; }
.dp-each-line:empty { display: none; }
.dp-each-line.warn { color: #d9480f; font-weight: 700; }
.dp-item-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dp-total-line { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.dp-opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.dp-opts .field { margin: 0; }
.dp-opts small { color: var(--subtle); font-weight: 500; }

/* 송금 목록 */
.dp-transfers { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.dp-tx { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), color-mix(in srgb, var(--sky) 6%, var(--surface))); border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line)); }
.dp-tx b { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.dp-arrow { color: var(--link); font-weight: 800; }
.dp-tx strong { font-size: 19px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--link); white-space: nowrap; }
.dp-empty, .dp-note { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.dp-empty { padding: 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 3%, var(--surface)); text-align: center; }
.dp-note { font-size: 13px; padding: 2px 4px; }
.dp-detail { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.dp-detail summary { padding: 13px 16px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.dp-table-wrap { overflow-x: auto; padding: 0 12px 12px; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.dp-table th, .dp-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.dp-table th:first-child, .dp-table td:first-child { text-align: left; font-weight: 700; }
.dp-table th { color: var(--muted); font-size: 13px; }
.dp-table em { font-style: normal; font-weight: 700; }
.dp-table em.plus { color: #0c8a6c; }
.dp-table em.minus { color: #d9480f; }
.dp .btn.confirm { background: #e5484d; border-color: #e5484d; color: #fff; }

@media (max-width: 560px) {
  .dp-grid2, .dp-opts { grid-template-columns: minmax(0, 1fr); }
  .dp-item { padding: 12px; }
  .dp-item-top { grid-template-columns: 26px minmax(0, 1fr) 34px; }
  .dp-item-top .dp-money { grid-column: 2 / 4; grid-row: 2; }
  .dp-tx { grid-template-columns: auto auto minmax(0, 1fr); padding: 12px 14px; gap: 6px 8px; }
  .dp-tx strong { grid-column: 1 / -1; font-size: 20px; }
  .dp-table { font-size: 13px; }
  .dp-table th, .dp-table td { padding: 8px 5px; }
  .dp-table-wrap { padding: 0 8px 10px; }
  .dp .tool-actions .btn { flex: 1 1 100%; }
}
