:root {
  color-scheme: light;
  font: 17px/1.5 system-ui, "Malgun Gothic", sans-serif;
  color: #192b3b;
  background: #eff4f8;
  --blue: #19568a;
  --blue-dark: #113f68;
  --border: #b6c6d4;
  --paper: #fff;
  --soft: #eaf2f9;
  --muted: #40586c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(94%, 82rem); margin-inline: auto; }
.app-header { background: #fff; border-bottom: 1px solid var(--border); }
.app-bar { display: flex; align-items: center; gap: clamp(.3rem, 2vw, 1.4rem); min-height: 65px; }
.brand { color: var(--blue-dark); font-size: 1.08rem; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: .24rem; }
.main-nav a, .main-nav button, .admin-menu summary { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .72rem; color: var(--blue-dark); font-weight: 650; border: 0; border-radius: .4rem; text-decoration: none; white-space: nowrap; cursor: pointer; }
.main-nav [aria-current="page"] { color: #fff; background: var(--blue); }
.admin-menu { margin-left: auto; position: relative; z-index: 2; }
.admin-menu summary { background: var(--soft); }
.admin-menu summary::after { content: "▾"; margin-left: .3rem; }
.admin-menu div { position: absolute; right: 0; min-width: 9rem; padding: .35rem; border: 1px solid var(--border); background: white; border-radius: .5rem; box-shadow: 0 7px 18px #17375325; }
.admin-menu div button { width: 100%; text-align: left; border: 0; }
body > header:not(.app-header) { background: #173753; color: white; padding: .8rem 0; font-weight: 700; }
.app-shell { display: flex; flex-direction: column; height: 100dvh; }
.app-shell > .app-header { flex: none; }
.workspace { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-block: 1.35rem max(.35rem, env(safe-area-inset-bottom)); }
.workspace > section { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.workspace > section > :not(.list-panel) { flex: none; }
.list-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.list-panel > :not(.table) { flex: none; }
.list-panel > .table { flex: 1; min-height: 0; max-height: none; }
@media (max-height: 550px) {
  .workspace { padding-top: .4rem; }
  .workspace .page-title, .workspace .filter-panel { margin-bottom: .35rem; }
  .workspace .filter-panel, .workspace .list-toolbar { padding-block: .3rem; }
}
h1,h2,h3,h4,p { margin-block: 0 .55rem; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 0; }
h2 { font-size: 1.33rem; line-height: 1.25; margin: 0; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
.page-title, .list-toolbar, .section-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.page-title { margin-bottom: .9rem; }
.controls { display: flex; flex-wrap: wrap; gap: .38rem; align-items: center; }
.filter-panel, .list-panel { border: 1px solid var(--border); border-radius: .55rem; background: var(--paper); }
.filter-panel { display: grid; grid-template-columns: minmax(0,1.55fr) repeat(3,minmax(0,1fr)); gap: .65rem; padding: .85rem; margin-bottom: .85rem; }
.filter-panel:has(> .filter-reset) { grid-template-columns: minmax(0,1.55fr) repeat(3,minmax(0,1fr)) auto; }
.filter-reset { align-self: end; justify-self: end; }
.list-toolbar { padding: .6rem .8rem; }
.list-toolbar p { margin: 0; font-weight: 650; }
.compact-device .workspace { width: min(98%, 82rem); padding-top: .35rem; }
.compact-device .workspace .page-title,
.compact-device .workspace .filter-panel { margin-bottom: .35rem; }
.compact-device .workspace .filter-panel { padding: .3rem .45rem; gap: .35rem; }
.compact-device .workspace .list-toolbar { padding: .25rem .45rem; gap: .25rem .5rem; }
.compact-device :is(.member-list-actions, #score-export, #catalog-export, #receipts-export) { display: none; }
.receipts-table table { min-width: 32rem; }
.receipts-table button[aria-pressed="true"] { background: var(--blue); color: white; }
.app-bar .main-nav { flex-wrap: wrap; }
.finance-nav { margin-bottom: .45rem; }
.finance-nav a { color: var(--blue-dark); text-decoration: none; font-weight: 650; padding: .45rem .75rem; min-height: 42px; border-radius: .4rem; background: var(--soft); }
.finance-nav a[aria-current="page"] { background: var(--blue-dark); color: white; }
#finance-notice:empty, #receipts-notice:empty { display: none; }
#finance-notice, #receipts-notice { margin: .25rem .5rem; }
#finance-page {
  --finance-income: #156044;
  --finance-expense: #983b35;
  --finance-even: #f3f7fa;
}
#finance-page > :is(.finance-ledger,.finance-flow,.finance-pane) { flex: 1; min-height: 0; }
#finance-page > :is(.finance-ledger,.finance-flow) { display: flex; flex-direction: column; gap: .4rem; }
#finance-page > :is(.finance-ledger,.finance-flow) > :not(.list-panel) { flex: none; }
#finance-page .list-panel { flex: 1; }
#finance-page > .finance-pane { overflow: auto; }
#finance-page .finance-income { color: var(--finance-income); }
#finance-page .finance-expense { color: var(--finance-expense); }
#finance-page .finance-totals {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr);
  margin: 0; color: var(--blue-dark); background: var(--soft); border: 1px solid var(--border); border-radius: .55rem;
}
.finance-totals > div { min-width: 0; text-align: center; padding: .35rem .45rem; }
.finance-totals > div + div { border-inline-start: 1px solid var(--border); }
.finance-totals dt { font-size: 15px; font-weight: 650; }
.finance-totals dd { margin: 0; font-size: clamp(1.1rem,2.5vw,1.7rem); font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.finance-carry { background: #dfeaf5; }
#finance-page .finance-filters { grid-template-columns: .78fr .75fr 1.35fr 1fr minmax(17rem,2.4fr); align-items: end; margin: 0; padding: .4rem .55rem; gap: .45rem; }
.finance-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .4rem; align-items: end; }
#finance-page .list-toolbar { padding: .3rem .55rem; }
#finance-page .table table { table-layout: fixed; }
.finance-table table { min-width: 63rem; }
.finance-trash-table table { min-width: 56rem; }
.finance-report-table table { min-width: 28rem; }
#finance-page :is(.finance-table,.finance-trash-table) th:first-child { width: 3rem; }
.finance-table th:nth-child(2) { width: 7.7rem; }
.finance-table th:nth-child(3) { width: 8rem; }
.finance-table th:nth-child(4) { width: 9rem; }
.finance-table th:nth-child(n+6):nth-child(-n+8) { width: 7.2rem; }
#finance-page .table th { text-align: center; color: var(--blue-dark); background: var(--soft); }
#finance-page .table td { height: 42px; padding: .28rem .55rem; }
#finance-page .table :is(td,th) + :is(td,th) { border-inline-start: 1px solid #dce5ed; }
#finance-page .table tbody tr:nth-child(even) td { background: var(--finance-even); }
#finance-page .table tbody tr:has(input[type=checkbox]:checked) td { background: #dcebf8; }
#finance-page .table input[type=checkbox] { width: 1.16rem; min-height: 1.16rem; accent-color: var(--blue); }
#finance-page .finance-table td:nth-child(-n+4), #finance-page .finance-trash-table td:nth-child(-n+4),
#finance-page .finance-report-table td:is(:first-child,:last-child) { text-align: center; }
#finance-page .finance-table td:nth-child(2) { white-space: nowrap; }
#finance-page .finance-table td[data-column="credit"] { color: var(--finance-income); }
#finance-page .finance-table td[data-column="debit"] { color: var(--finance-expense); }
#finance-page .finance-table td[data-column="balance"] { color: var(--blue-dark); font-weight: 750; }
#finance-page :is(.finance-table,.finance-trash-table) td:nth-child(6), #finance-page .finance-table td:is(:nth-child(7),:nth-child(8)),
#finance-page .finance-report-table td:nth-child(3), #finance-opening input, #finance-transaction input[name="amount"] { text-align: right; font-variant-numeric: tabular-nums; }
#finance-page .finance-table td:nth-child(n+6):nth-child(-n+8) { white-space: nowrap; }
#finance-page .finance-table th { padding: 0; }
.finance-table th .finance-sort-button, .finance-table td .finance-text-button {
  position: relative; display: block; width: 100%; min-height: 40px; border: 0; border-radius: 0; background: transparent; color: inherit;
}
.finance-table th .finance-sort-button { padding-inline: .4rem 1rem; }
.finance-sort-button::after { position: absolute; inset-inline-end: .28rem; }
th[aria-sort="ascending"] .finance-sort-button::after { content: "▴"; }
th[aria-sort="descending"] .finance-sort-button::after { content: "▾"; }
.finance-table td .finance-text-button { text-align: left; padding: 0; font-weight: inherit; }
.compact-device .finance-table td .finance-text-button { color: var(--blue-dark); text-decoration: underline; text-underline-offset: .15em; }
#finance-ledger-rows td:not(:first-child) { cursor: pointer; }
@media (hover: hover) {
  #finance-page #finance-ledger-rows tr:hover td { background: var(--soft); }
  #finance-page #finance-ledger-rows tr:has(input:checked):hover td { background: #dcebf8; }
}
.finance-resize { position:absolute; right:0; top:0; width:.45rem; height:100%; cursor:col-resize; touch-action:none; }
.finance-report-form {
  display: grid; grid-template-columns: minmax(7rem,.65fr) minmax(8rem,.75fr) minmax(10rem,1fr) minmax(7rem,.65fr);
  gap: .4rem .55rem; padding: .45rem .55rem; background: var(--paper); border: 1px solid var(--border); border-radius: .55rem;
}
.finance-report-memo, .finance-report-actions, .finance-versions { grid-column: 1 / -1; }
.finance-report-memo, .finance-versions label { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .6rem; }
.finance-report-actions button[name="export"] { margin-inline-start: auto; }
.finance-versions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .45rem; }
#finance-report-reconciliation { margin: 0; padding: .28rem .55rem; color: var(--blue-dark); font-weight: 650; }
#finance-report-reconciliation[data-difference="true"] { color: var(--finance-expense); }
.finance-report-table th:first-child { width: 12%; }
.finance-report-table th:nth-child(3) { width: 23%; }
.finance-report-table th:last-child { width: 16%; }
.finance-settings-menu { display: grid; max-width: 44rem; gap: .45rem; }
.finance-settings-menu > :is(a,button) {
  display: grid; grid-template-columns: 1.5rem minmax(0,1fr) auto; align-items: center; gap: .6rem; min-height: 52px;
  padding: .55rem .75rem; text-align: left; color: var(--blue-dark); background: var(--paper); border: 1px solid var(--border); border-radius: .45rem; text-decoration: none;
}
.finance-settings-menu > :is(a,button):hover { background: var(--soft); }
.finance-settings-menu span { font-size: 1.2rem; text-align: center; }
#finance-category-rows { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.finance-category-panel { min-width: 0; border: 1px solid var(--border); border-radius: .55rem; background: var(--paper); }
.finance-category-panel h2 { margin: 0; padding: .5rem .65rem; background: var(--soft); }
.finance-category, .finance-category-labels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem; padding: .4rem .55rem; }
.finance-category { border-top: 1px solid #dce5ed; }
.finance-category-labels { font-weight: 650; }
.finance-category-actions { grid-column: 1 / -1; }
.finance-import-file { max-width: 36rem; }
#finance-import-preview { margin-block: .4rem; }
#finance-import-preview label { display:flex; align-items:center; padding:.25rem; gap:.5rem; }
@media (max-width: 850px) {
  #finance-page .finance-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .finance-search { grid-column: span 2; }
}
@media (max-width: 680px) {
  #finance-category-rows, .finance-report-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #finance-category-rows { grid-template-columns: minmax(0,1fr); }
  #finance-page .finance-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-search { grid-column: 1 / -1; }
  #finance-page #finance-report-totals { grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); }
  #finance-report-totals > div { border: 0; }
  #finance-report-totals > div:nth-child(even) { border-inline-start: 1px solid var(--border); }
  #finance-report-totals > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .finance-report-actions button[name="export"] { margin-inline-start: 0; }
}
@media (max-width: 500px) {
  body:not(.mobile-workspace):has(#finance-page:not([hidden])) .app-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; }
  body:not(.mobile-workspace):has(#finance-page:not([hidden])) .app-bar .brand { display: none; }
  #finance-page #finance-totals { grid-auto-flow: row; }
  #finance-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; text-align: left; padding: .22rem .55rem; }
  #finance-totals > div + div { border-inline-start: 0; border-top: 1px solid var(--border); }
  #finance-totals dd { text-align: right; }
}
@media (max-width: 680px), (max-height: 580px) {
  #finance-page > :is(.finance-ledger,.finance-flow) { overflow: auto; }
  #finance-page .list-panel { min-height: 10rem; }
}
@media (max-height: 550px) {
  body:has(#finance-page:not([hidden])) .app-bar .brand { display: none; }
}
@media (max-height: 550px) and (min-width: 740px) {
  #finance-page .finance-filters { grid-template-columns: .78fr .75fr 1.35fr 1fr minmax(17rem,2.4fr); }
  .finance-search { grid-column: auto; }
}
label { display: grid; gap: .23rem; min-width: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; min-width: 0; max-width: 100%; min-height: 42px; border-radius: .37rem; border: 1px solid #8ca3b7; background: white; padding: .36rem .58rem; }
label > input:not([type=checkbox]), label > select, label > textarea { width: 100%; }
textarea { resize: vertical; min-height: 4.8rem; }
button { cursor: pointer; font-weight: 630; }
button:hover, .main-nav a:hover { background: #edf4fa; }
button.primary, button.primary:hover, .main-nav [aria-current=page]:hover { background: var(--blue); border-color: var(--blue); color: white; }
button.primary:hover { background: var(--blue-dark); }
button.danger { color: #983b35; }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid #2582be; outline-offset: 2px; }
.file-icon { display: inline-grid; place-items: center; color: var(--blue); width: 1.15rem; height: 1.15rem; border: 1px solid currentColor; border-radius: .2rem; line-height: 1; }
.table { overflow: auto; max-width: 100%; max-height: min(66dvh, 40rem); border-top: 1px solid var(--border); }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th,td { padding: .38rem .56rem; border-bottom: 1px solid #d6e0e9; vertical-align: middle; overflow-wrap: anywhere; }
th { background: var(--soft); font-weight: 700; text-align: left; }
.table thead th { position: sticky; top: 0; z-index: 1; }
.member-table th,.member-table td { text-align: center; }
.member-table .member-address { text-align: left; }
.member-table tr:nth-child(even), .catalog-table tr:nth-child(even) { background: #f8fbfd; }
.member-table button { color: var(--blue-dark); background: transparent; border: 0; text-decoration: underline; text-underline-offset: .18em; }
.catalog-table table { min-width: 49rem; table-layout: fixed; }
.catalog-table td { height: 54px; padding: .18rem .35rem; }
.catalog-table th, .catalog-table td { text-align: center; vertical-align: middle; }
.catalog-table td:nth-child(6) { text-align: left; }
.catalog-name { font-size: 20px; }
.catalog-table td:nth-child(4) .catalog-name { font-weight: 550; }
.catalog-table td:nth-child(5) .catalog-name { font-weight: 750; }
.catalog-table .hanja { color: #405263; }
.catalog-actions { display: flex; justify-content: center; align-items: center; gap: .18rem; }
.catalog-actions button { min-width: 30px; padding: .18rem .25rem; font-size: 1rem; }
.catalog-table input { width: 6.5rem; min-height: 34px; text-align: center; }
.catalog-table td:first-child input { width: 4rem; }
.catalog-menu { position: fixed; inset: auto; margin: 0; padding: .25rem; border: 1px solid var(--border); border-radius: .45rem; background: white; }
.catalog-menu:popover-open { display: grid; }
.catalog-menu button { text-align: left; }
.catalog-menu .catalog-trash { color: #a22424; border-top: 1px solid var(--border); }
.catalog-counts { display: flex; gap: .6rem; flex-wrap: wrap; color: var(--muted); }
.catalog-counts span { white-space: nowrap; }
#catalog-number-status:not(:empty) { min-inline-size: 3em; }
#catalog-notice { margin-inline: .8rem; color: var(--muted); }
#catalog-notice:empty { display: none; }
dialog { padding: 0; width: min(46rem, calc(100% - 1.2rem)); max-height: min(90dvh, 51rem); border: 1px solid #8ca4b8; border-radius: .65rem; color: inherit; box-shadow: 0 18px 60px #17375340; }
dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
dialog::backdrop { background: #20354873; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 1rem; border-bottom: 1px solid var(--border); background: var(--soft); }
.dialog-heading button { font-size: 1.35rem; width: 43px; padding: 0; }
.dialog-body { min-height: 0; min-width: 0; overflow-y: auto; padding: .85rem 1rem 0; overflow-wrap: anywhere; }
.dialog-body > :last-child { margin-bottom: .8rem; }
.dialog-body :is(form,div,fieldset,label) { min-width: 0; }
.dialog-footer { position: sticky; bottom: 0; z-index: 1; padding: .6rem 0; border-top: 1px solid var(--border); background: white; justify-content: flex-end; }
.dialog-footer.split { justify-content: space-between; }
.form-grid, #fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.full-width { grid-column: 1 / -1; }
#history-form,.auth-form { display: grid; gap: .65rem; }
.auth-form { max-width: 26rem; }
.member-section { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.score-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin: .55rem 0; }
.score-card { min-width: 8.8rem; display: grid; padding: .52rem .8rem; background: var(--soft); border: 1px solid var(--border); border-radius: .45rem; }
.score-card strong { font-size: 2.12rem; color: var(--blue-dark); line-height: 1.15; }
.score-table { margin: .35rem 0 .7rem; }
.score-table th:nth-child(2),.score-table td:nth-child(2) { text-align: right; }
.score-table th:last-child,.score-table td:last-child { width: 6rem; }
.category-row { border-bottom: 1px solid #cbd5df; padding: .55rem 0; align-items: end; }
#category-add { margin-block: .55rem; }
input[type=checkbox] { min-height: 24px; width: 24px; }
.compare-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .62rem; }
.compare-card { padding: .55rem; background: var(--soft); border-radius: .4rem; min-width: 0; }
.merge-item { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: .5rem; border-bottom: 1px solid var(--border); padding-block: .4rem; }
.merge-item p { margin: 0; }
#work-form .section-title { margin-top: .55rem; }
#discard-dialog { width: min(28rem,calc(100% - 1.2rem)); }
@media (max-width: 740px) {
  .filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-panel:has(> .filter-reset) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-reset { grid-column: 2; }
  .wrap { width: min(96%,82rem); }
  .app-bar { gap: .25rem; }
  .main-nav a,.main-nav button,.admin-menu summary { padding-inline: .43rem; }
  th,td { padding-inline: .3rem; }
}
@media (max-width: 540px) {
  :root { font-size: 16px; }
  .app-bar .brand { display: none; }
  .form-grid,#fields,.compare-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-body,.dialog-heading { padding-inline: .65rem; }

}
#merge-manual { margin-block: .8rem; }
#merge-manual summary { color: var(--blue-dark); cursor: pointer; font-weight: 650; margin-bottom: .5rem; }
#merge-preview:empty { display: none; }
.member-table th.member-address { text-align: center; }
.member-table td:nth-child(3), .member-table td:nth-child(4) { text-align: center; }
.member-table td:nth-child(4) button { text-align: center; padding-inline: 0; }
.member-table .hanja { color: #405263; }
.table th[data-sort] { padding: .13rem .25rem; }
.table th .sort-heading { position: relative; display: block; width: 100%; padding: .26rem .72rem; border: 0; color: inherit; background: transparent; text-align: center; text-decoration: none; min-height: 40px; }
.table th .sort-heading:hover { background: #d8e7f4; }
.sort-arrow { position: absolute; inset-inline-end: .07rem; top: 50%; transform: translateY(-50%); color: var(--blue); }
.catalog-mobile-sort { display: none; }
.score-table th, .score-table td, .score-table th:nth-child(2), .score-table td:nth-child(2) { text-align: center; padding: .24rem .4rem; }
.score-table th:last-child,.score-table td:last-child { width: 4.7rem; }
.score-table td button { min-height: 35px; padding: .18rem .5rem; font-size: .9rem; }
#history-editor.award-dialog { width: min(432px, calc(100% - 1.2rem)); }
#history-editor.award-dialog .dialog-body { padding-top: .6rem; }
#history-editor.award-dialog #history-form { gap: .42rem; }
.award-line { display: grid; grid-template-columns: 4.55rem minmax(0,1fr); align-items: center; gap: .4rem; }
.award-controls { display: flex; align-items: center; gap: .24rem; }
.award-controls > select { flex: 1; min-width: 0; }
.award-controls > input[name="notes"] { width: 100%; }
.award-controls > input[name="points"] { width: 5.1rem; }
.award-controls button { min-width: 36px; }
#xlsx-export-dialog,#password-dialog { width: min(27rem,calc(100% - 1.2rem)); }
#detail:has(#history:empty), #work-editor { width: min(40rem,calc(100% - 1.2rem)); }
@media (max-width: 740px) {
  .catalog-mobile-sort { display: flex; align-items: end; padding: 0 .8rem .5rem; }
}
@media (max-width: 400px) {
  .table th .sort-heading { padding-inline: .55rem; }
  .award-controls > input[name="points"] { width: 4.3rem; }
}
.member-table td:nth-child(3), .member-table td:nth-child(4) { font-size: 20px; }
.member-table td:nth-child(3) { font-weight: 550; }
.member-table td:nth-child(4) button { font-weight: 750; font-size: inherit; line-height: 1.25; }
.member-table td .hanja { font-size: inherit; }
.member-picker { margin-block: .2rem .45rem; }
.member-picker-results { list-style: none; margin: .2rem 0 0; padding: .15rem; max-height: min(34dvh, 15rem); overflow-y: auto; border: 1px solid var(--border); border-radius: .35rem; }
.member-picker-results button { width: 100%; text-align: left; border: 0; padding: .35rem .55rem; border-bottom: 1px solid #d6e0e9; overflow-wrap: anywhere; }
.member-picker-results li:last-child button { border-bottom: 0; }
.member-picker-selected { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .42rem .55rem; background: var(--soft); border-radius: .35rem; }
.member-picker-identity, .member-picker-meta { display: block; }
.member-picker-meta, .member-picker .hanja { color: var(--muted); }
.member-picker p { margin: 0; }
#catalog-fixture-notice { margin-inline: .8rem; color: var(--muted); }
.fixture-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .32rem .6rem; }
.fixture-details dt { font-weight: 650; }
.fixture-details dd { margin: 0; }
#catalog-fixture[aria-pressed=true] { background: var(--soft); color: var(--blue-dark); }
@media (max-width: 900px) {
  .app-bar { flex-wrap: wrap; padding-block: .4rem; }
  .app-bar .brand { display: block; flex-basis: 100%; }
}


.member-table .member-score { width: 3.6rem; text-align: center; }
.member-table .member-score, .member-table th.member-score .sort-heading {
  color: var(--blue);
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.member-table th.member-score { padding-inline: .1rem; }
.member-table th.member-score .sort-heading { padding-inline: .18rem; white-space: nowrap; }
.member-score-pending { display: block; color: var(--muted); font-size: .69rem; font-weight: 650; }
@media (max-width: 740px) {
}

.choice-field { position: relative; display: block; width: 100%; min-width: 0; font-weight: 400; }
.choice-field > input { width: 100%; padding-inline-end: 2.55rem; }
.choice-toggle { position: absolute; inset: 1px 1px 1px auto; min-height: 0; width: 2.4rem; padding: 0; border: 0; background: transparent; color: var(--blue-dark); }
.choice-list { position: fixed; inset: auto; margin: 0; padding: .18rem; overflow: auto; overscroll-behavior: contain; border: 1px solid #8ca3b7; border-radius: .37rem; box-shadow: 0 5px 16px #17375325; background: var(--paper); color: #192b3b; }
.choice-option { display: flex; align-items: center; min-height: 42px; padding: .32rem .55rem; border-radius: .24rem; overflow-wrap: anywhere; text-align: left; cursor: pointer; }
.choice-option[aria-selected="true"] { background: var(--soft); color: var(--blue-dark); font-weight: 650; }
.choice-option:hover, .choice-option[data-active] { background: var(--blue); color: white; }
.score-sheet { --score-pen-width: 5.5rem; --score-name-width: 6.1rem; }
.score-sheet table { width: max-content; min-width: 100%; }
.score-sheet thead { position: sticky; top: 0; z-index: 3; }
.score-sheet thead th { position: static; text-align: center; }
.score-sheet :is(th,td):is(.score-pen,.score-name) {
  position: sticky; width: var(--identity-width); min-width: var(--identity-width); max-width: var(--identity-width); text-align: center;
}
.score-sheet .score-pen { --identity-width: var(--score-pen-width); left: 0; }
.score-sheet .score-name { --identity-width: var(--score-name-width); left: var(--score-pen-width); box-shadow: 2px 0 2px #17375320; }
.score-sheet tbody :is(.score-pen,.score-name) { z-index: 2; background: white; font-size: 20px; }
.score-sheet tbody tr:nth-child(even) > td { background: #f8fbfd; }
.score-sheet td.score-pen { font-weight: 550; }
.score-sheet td.score-name button { padding-inline: 0; border: 0; color: var(--blue-dark); background: transparent; text-align: center; text-decoration: underline; font-weight: 750; }
.score-sheet .hanja { color: #405263; }
.score-sheet .score-award { width: 3.75rem; min-width: 3.75rem; max-width: 3.75rem; text-align: center; }
.score-sheet .score-total { min-width: 4rem; text-align: center; }
.score-sheet td.score-total { color: var(--blue); font-size: 20px; font-weight: 750; }
.score-sheet .score-remarks { min-width: 9rem; max-width: 18rem; white-space: pre-line; }
@media (max-width: 600px) {
  .main-nav { flex-wrap: wrap; }
  .main-nav a, .main-nav button { padding-inline: .43rem; }
}

.page-title h1 { font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; font-size: 1.65rem; font-weight: 400; font-synthesis: none; line-height: 1.32; letter-spacing: normal; }
.bilingual-lines { line-height: 22px; word-break: keep-all; overflow-wrap: anywhere; }
.bilingual-lines > span { display: block; min-height: 22px; }
.bilingual-lines > .hanja { margin-top: 5px; }
.member-table .bilingual-lines, .score-sheet .bilingual-lines { line-height: 22px; }
.amount-input { text-align: right; }
.member-table table { min-width: 53rem; table-layout: fixed; }
.member-table th:nth-child(1) { width: 6.1rem; }
.member-table th:nth-child(2) { width: 6rem; }
.member-table th:nth-child(3) { width: 5.5rem; }
.member-table th:nth-child(4) { width: 6.1rem; }
.member-table th.member-phone { width: 8.5rem; }
.member-table th.member-zip { width: 5.5rem; }
.catalog-table th:nth-child(1) { width: 5rem; }
.catalog-table th:nth-child(2) { width: 3.75rem; }
.catalog-table th:nth-child(3) { width: 6rem; }
.catalog-table th:nth-child(4) { width: 5.5rem; }
.catalog-table th:nth-child(5) { width: 6.1rem; }
.catalog-table th:nth-child(7) { width: 4.3rem; }
.catalog-table th:nth-child(8) { width: 4rem; }
.catalog-table th:nth-child(9) { width: 6.75rem; }
:is(.member-table,.score-sheet,.catalog-table) th .sort-heading { white-space: nowrap; }
#category-settings { width: min(52rem, calc(100% - 1.2rem)); }
#category-settings .category-row { display: grid; grid-template-columns: minmax(0,1fr) repeat(4,auto); gap: .32rem; align-items: center; border: 0; padding: .19rem 0; }
#category-settings #category-rows .category-row { grid-template-columns: minmax(0,1fr) minmax(5rem,8rem) repeat(4,auto); }
#category-settings #catalog-settings form:has(input[type=number]) { grid-template-columns: minmax(0,1fr) minmax(4rem,5rem) repeat(4,auto); }
#category-settings .setting-icon { width: 42px; padding-inline: 0; }
#category-settings .setting-group { background: var(--soft); padding: .28rem .55rem; margin: .7rem 0 .2rem; border-radius: .3rem; }
#category-settings .settings-backup { margin-bottom: .7rem; }
#category-settings .settings-backup button { min-width: 7rem; }
#backup-status:empty { display: none; }
@media (max-width: 480px) {
  #category-settings .category-row button { padding-inline: .3rem; }
  #category-settings .setting-icon { width: 38px; }
  #category-settings #category-rows .category-row { grid-template-columns: minmax(0,1fr) minmax(3.7rem,5rem) repeat(4,auto); }
}

/* The initial workspace and subsequent viewport changes use the same layout. */
.mobile-only { display: none; }
.mobile-workspace .mobile-only { display: revert; }
.mobile-workspace .mobile-only:empty { display: none; }
.mobile-workspace .app-header .app-bar {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center;
  gap: .35rem; min-height: 52px; padding-block: .18rem;
}
.mobile-workspace .app-header .brand { display: none; }
.mobile-workspace #mobile-menu-open, .mobile-workspace .admin-menu summary { min-height: 44px; }
.mobile-workspace #mobile-menu-open { min-width: 44px; padding-inline: .4rem; }
.mobile-workspace #mobile-page-title { min-width: 0; text-align: center; color: var(--blue-dark); font-size: 1.12rem; }
.mobile-workspace .admin-menu { margin: 0; }
.mobile-main-menu { width: min(23rem,calc(100% - 1rem)); padding: .7rem; }
.mobile-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.mobile-main-menu .main-nav { display: grid; margin-top: .5rem; }
.mobile-main-menu .main-nav > :is(a,button) { width: 100%; min-height: 46px; }
.mobile-workspace :is(#member-page,#score-page,#catalog,#work-receipts) > .page-title > h1 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.mobile-workspace :is(#member-page,#score-page,#catalog) > .page-title { height: 0; margin: 0; padding: 0; }
.mobile-workspace .workspace { padding-top: .3rem; }
.mobile-workspace .mobile-period { color: var(--blue-dark); font-weight: 650; }
.mobile-workspace .workspace .mobile-filter {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .32rem;
  margin: 0 0 .3rem; padding: .24rem .3rem; align-items: end;
}
.mobile-workspace .mobile-filter:not(.mobile-expanded) .mobile-filter-detail,
.mobile-workspace #catalog-filter:not(.mobile-expanded) .catalog-mobile-sort { display: none; }
.mobile-workspace .mobile-filter .mobile-search-label { display: block; font-size: 0; grid-row: 1; grid-column: 1; }
.mobile-workspace .mobile-filter [name=q] { font-size: 1rem; }
.mobile-workspace .mobile-filter .mobile-disclosure { grid-row: 1; grid-column: 2; }
.mobile-workspace .mobile-filter .mobile-reset-control { grid-row: 1; grid-column: 3; padding-inline: .4rem; }
.mobile-workspace .mobile-filter .mobile-reset-label { display: none; }
.mobile-workspace .mobile-filter .mobile-reset-control > :first-child { font-size: 1.25rem; }
.mobile-workspace .mobile-filter .mobile-reset-control::after { content: " 초기화"; }
.mobile-workspace :is(.mobile-filter button,.mobile-filter input,.mobile-filter select,.list-toolbar button,.mobile-amount) { min-height: 44px; }
.mobile-workspace .mobile-reset-control { min-width: 44px; }
.mobile-workspace .mobile-filter.mobile-expanded { grid-template-columns: minmax(0,1fr) auto auto; }
.mobile-workspace .mobile-filter-detail { grid-column: 1 / -1; }
.mobile-workspace #catalog-filter .catalog-mobile-sort {
  grid-column: 1 / -1; display: flex; padding: 0; align-items: end;
}
.mobile-workspace #catalog-filter .catalog-mobile-sort label { flex: 1; }
.mobile-workspace #finance-page .finance-filters .finance-search { display: contents; }
.mobile-workspace #catalog .list-toolbar { justify-content: flex-start; gap: .2rem .45rem; }
.mobile-workspace #catalog .catalog-counts { gap: .35rem; }
.mobile-workspace #catalog .list-toolbar > .controls { gap: .28rem; }
.mobile-workspace #catalog #catalog-number-status:empty { display: none; }
.mobile-workspace #work-receipts > .page-title { margin-bottom: .2rem; }
.mobile-workspace #work-receipts > .page-title a { display: inline-flex; align-items: center; min-height: 44px; }
.mobile-workspace #receipts-filter { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); padding: .25rem .35rem; gap: .35rem; margin-bottom: .3rem; }
.mobile-workspace #finance-page > .finance-nav { flex-wrap: nowrap; gap: .25rem; margin-bottom: .25rem; }
.mobile-workspace .finance-nav a { min-height: 44px; padding: .45rem .55rem; white-space: nowrap; }
.mobile-workspace #finance-page .list-toolbar { padding-block: .22rem; }
.mobile-workspace #finance-page #finance-count { margin-inline-end: auto; }
.mobile-workspace #finance-trash-move:disabled { display: none; }
.mobile-workspace #finance-selected-count:empty { display: none; }
.mobile-workspace #finance-page > :is(.finance-ledger,.finance-flow) { overflow: visible; gap: .25rem; }
.mobile-workspace #finance-page .list-panel { min-height: 0; }
.mobile-workspace #finance-page .mobile-amount, .mobile-workspace #finance-report-form > .mobile-disclosure {
  color: var(--blue-dark); background: var(--soft);
}
.mobile-workspace #finance-page .mobile-amount {
  display: flex; align-items: center; text-align: left; gap: .35rem; width: 100%;
}
.mobile-amount strong { margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mobile-workspace .mobile-disclosure::after { content: "▾"; margin-inline-start: .25rem; }
.mobile-workspace .mobile-disclosure[aria-expanded="true"]::after { content: "▴"; }
.mobile-workspace #finance-page .finance-totals:not(.mobile-expanded) { display: none; }
.mobile-workspace #finance-page .finance-totals.mobile-expanded { grid-auto-flow: row; }
.mobile-workspace #finance-page #finance-report-totals.mobile-expanded { grid-template-columns: repeat(2,minmax(0,1fr)); }
.mobile-workspace #finance-report .finance-report-form:not(.mobile-expanded) > :is(label,.finance-versions) { display: none; }
.mobile-workspace #finance-report .finance-report-form:not(.mobile-expanded) { padding: .18rem .2rem; }
.mobile-workspace #finance-report .finance-report-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .25rem; }
.mobile-workspace #finance-report .finance-report-actions button { margin: 0; min-height: 44px; padding: .2rem .28rem; }
.mobile-workspace #finance-report-reconciliation:not([data-difference="true"]) { display: none; }
.mobile-workspace #finance-report-totals.mobile-expanded + #finance-report-reconciliation:not([hidden]) { display: block; }
.mobile-workspace.mobile-room-short { height: var(--mobile-available,100dvh); }
.mobile-workspace.mobile-room-short .workspace { scrollbar-gutter: stable; }
.mobile-workspace.mobile-room-short .workspace,
.mobile-workspace .workspace:has(#finance-report:not([hidden]) #finance-report-form.mobile-expanded) {
  overflow-y: auto; overflow-x: hidden;
}
.mobile-workspace.mobile-room-short .workspace > section,
.mobile-workspace .workspace:has(#finance-report:not([hidden]) #finance-report-form.mobile-expanded) > section {
  flex: none;
}
.mobile-workspace .workspace:has(#finance-report:not([hidden]) #finance-report-form.mobile-expanded) .list-panel,
.mobile-workspace.mobile-room-short .workspace .list-panel { flex: none; }
.mobile-workspace .workspace:has(#finance-report:not([hidden]) #finance-report-form.mobile-expanded) .list-panel > .table,
.mobile-workspace.mobile-room-short .workspace .list-panel > .table { flex: none; max-height: none; }
@media (max-height: 680px) {
  .mobile-workspace .workspace:has(.mobile-filter.mobile-expanded:not(:is([hidden] *))) { overflow-y: auto; overflow-x: hidden; }
  .mobile-workspace .workspace:has(.mobile-filter.mobile-expanded:not(:is([hidden] *))) > section,
  .mobile-workspace .workspace:has(.mobile-filter.mobile-expanded:not(:is([hidden] *))) .list-panel { flex: none; }
  .mobile-workspace .workspace:has(.mobile-filter.mobile-expanded:not(:is([hidden] *))) .list-panel > .table { flex: none; max-height: none; }
}
