/* Hallmark · macrostructure: workbench with ledger index · tone: restrained · anchor hue: pine green */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4 */
@font-face {
  font-family: Pretendard;
  src: url("./assets/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #eff2ed;
  --paper: #fcfdfa;
  --ink: #18261f;
  --muted: #52645b;
  --line: #d2dcd5;
  --accent: #174d3a;
  --accent-ink: #f1fbf5;
  --selection: #e0ece4;
  --hover: #e5ebe5;
  --danger: #a32829;
  --focus: #186b51;
  --font: Pretendard, "Apple SD Gothic Neo", sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--ground); color: var(--ink); font-family: var(--font); line-height: 1.45; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2 { margin: 0; line-height: 1.14; letter-spacing: -.055em; overflow-wrap: anywhere; min-width: 0; }
p { margin: 0; }
.skip { position: absolute; translate: 0 -120%; background: var(--paper); color: var(--ink); padding: .75rem; }
.skip:focus { translate: 0; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.mast { background: var(--paper); border-bottom: 1px solid var(--line); }
.mast-inner { min-height: 64px; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 760; letter-spacing: -.045em; font-size: 1.07rem; }
.ledger-icon {
  display: inline-block; width: 17px; height: 20px; border: 2px solid var(--accent); border-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent)) center / 8px 2px no-repeat;
}
.scope { color: var(--muted); font-size: .85rem; font-weight: 650; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1.25rem; padding-block: 37px 29px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3.65rem); font-weight: 790; }
.page-head p { color: var(--muted); margin-top: 9px; }
.period { font-size: .83rem; color: var(--muted); font-weight: 650; }
select {
  display: block; min-height: 46px; margin-top: 4px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.workspace { display: grid; grid-template-columns: minmax(260px, .88fr) minmax(0, 1.65fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.index { padding: 19px 16px; min-width: 0; border-right: 1px solid var(--line); }
.index-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: 3px 11px 16px; }
.index h2 { font-size: 1.17rem; white-space: nowrap; }
#status { font-size: .79rem; font-weight: 650; color: var(--accent); }
#contracts { list-style: none; padding: 0; margin: 0; }
#contracts li + li { margin-top: 4px; }
#contracts button {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 6px;
  padding: 12px 11px; min-height: 62px; border: 0; border-radius: 8px; text-align: left; background: transparent;
}
#contracts button:hover { background: var(--hover); }
#contracts button[aria-pressed="true"] { background: var(--selection); }
#contracts strong, .amount span, #total, #payout, dd { font-variant-numeric: tabular-nums; font-weight: 730; }
.amount { text-align: right; }
#contracts small { display: block; color: var(--muted); font-size: .78rem; }
.total {
  display: flex; align-items: center; justify-content: space-between; gap: 7px; margin: 16px 11px 0;
  border-top: 1px solid var(--line); padding-top: 15px; font-size: .94rem;
}
.detail { padding: 21px 26px 24px; min-width: 0; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.detail-head h2 { font-size: 1.8rem; }
.overline, .version { font-size: .78rem; color: var(--muted); margin-bottom: 3px; }
.version { background: var(--ground); border-radius: 5px; padding: 6px 8px; white-space: nowrap; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { margin-bottom: 10px; padding: 0; font-weight: 720; }
.inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 13px; }
.inputs label { color: var(--muted); font-size: .85rem; font-weight: 640; }
.input {
  display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px;
  margin-top: 4px; padding-right: .75rem;
}
.input:focus-within { border-color: var(--focus); }
input { background: transparent; width: 100%; min-width: 0; min-height: 46px; border: 0; padding: .4em .75em; font-size: 1rem; font-weight: 690; border-radius: 8px; }
fieldset:disabled .input { background: var(--ground); }
input:disabled { opacity: 1; color: var(--muted); }
.hint, .error { font-size: .82rem; margin-top: 12px; }
.hint { color: var(--muted); }
.error { color: var(--danger); font-weight: 670; }
.breakdown { margin-block: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: .45rem; }
.breakdown div { display: flex; gap: .7rem; justify-content: space-between; padding-block: .22rem; }
.breakdown dt { color: var(--muted); }
dd { margin: 0; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 8px; padding: 13px 15px; color: var(--accent-ink); background: var(--accent); }
.result span { display: block; font-size: .83rem; }
#payout { display: block; font-size: clamp(1.35rem, 3.2vw, 2.1rem); letter-spacing: -.042em; }
#reset {
  border: 1px solid var(--accent-ink); border-radius: 6px; min-height: 45px; padding-inline: 12px;
  color: var(--accent-ink); background: transparent; white-space: nowrap; font-size: .86rem;
}
#reset:hover, #reset:active { background: var(--accent-ink); color: var(--accent); }
#reset:focus-visible { outline-color: var(--accent-ink); }
footer { padding-block: 17px 32px; color: var(--muted); font-size: .83rem; }
@media (max-width: 735px) {
  .wrap { width: calc(100% - 34px); }
  .page-head { padding-block: 26px 19px; display: grid; }
  .workspace { display: block; }
  .index { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 12px 17px; }
  .detail { padding: 20px 16px 16px; }
}
@media (max-width: 390px) {
  .wrap { width: calc(100% - 24px); }
  .detail { padding-inline: 12px; }
  .inputs { gap: 10px 8px; }
  #reset { padding-inline: 8px; }
}
