/* Extracted legacy record rules. Keep source order; existing screen overrides load later. */
@layer legacy {
.view-record .sub-title strong {
  font-size: var(--fs-display-s);
  letter-spacing: 0;
  white-space: nowrap;
}
.entry-actions .secondary-btn svg { display: block; }
.entry-actions .secondary-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  border-style: solid;
}
.entry-card { overflow: hidden; }
/* 2026-11-05 점검: 배송노트로 센 날은 손으로 적은 줄이 없어 머리줄만 남은 빈 표와 개수 안내가 보였다.
   구역 추가로 줄이 생기면 표와 안내가 다시 보인다. */
.entry-card:has(> #entryRows:empty), .entry-card:has(> #entryRows:empty) + .hint { display: none; }
.entry-head, .entry-row {
  display: grid;
  grid-template-columns: 1.1fr .9fr .9fr 1fr 32px;
  gap: 8px;
  align-items: center;
}
.entry-head { padding: 10px 12px; color: var(--muted); font-size: var(--fs-caption); font-weight: 700; border-bottom: 1px solid var(--line); background: var(--panel2); }
.entry-row { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-row input, .entry-row select, .calc-row input { min-height: 44px; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-body); font-weight: 600; }
.entry-row select:disabled { opacity: 1; }
.entry-row input[readonly] { color: var(--muted); border-style: dashed; }
.entry-row input[type="number"][readonly] { appearance: textfield; }
.entry-row input[type="number"][readonly]::-webkit-inner-spin-button,
.entry-row input[type="number"][readonly]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.entry-row output, .calc-row output {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--panel2);
  color: var(--text);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: 0;
  white-space: nowrap;
}
.del-btn { position: relative; font-size: var(--fs-display-s); }
.del-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.calc-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
.calc-row > span:first-child { color: var(--text); font-weight: 700; white-space: nowrap; }
.multiply { color: var(--muted); }
html:not([data-theme="dark"]) .view-record .date-nav-btn,
body:not([data-theme="dark"]) .view-record .date-nav-btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

@media (max-width: 380px) {
  .entry-head, .entry-row { grid-template-columns: 1fr .75fr .78fr .9fr 28px; gap: 6px; }
  .entry-row input, .entry-row select { font-size: var(--fs-body); padding: 8px 6px; }
  .calc-row { grid-template-columns: auto .8fr auto .8fr 1fr; gap: 8px; }
}
.entry-actions .secondary-btn::after { content: ""; position: absolute; inset: -4px 0; }
/* 배송노트 total of the day in 기록 수정 (2026-11-04): read-only line, owner's 고치기 below it. */
.group-finance-group { border-bottom: 1px solid var(--line); }
.group-finance > :last-child { border-bottom: 0; }
.group-finance-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 12px;
}
.group-finance > .group-finance-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.group-finance-row > span { color: var(--text); font-weight: 700; white-space: nowrap; }
.group-finance-row > strong {
  margin-left: auto;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.group-finance-row > .secondary-btn { flex: none; }
.group-finance-note { margin: -4px 12px 8px; }
/* Per-route edit (2026-11-04): plain lines inside the entry card, no second card frame. */
.group-finance-edit { display: grid; padding: 0 12px 12px; }
.group-finance-line {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 2026-11-28: the page's label margin (8px above, 4px below) left 16px over each divider and 4px under
     it. Without it a 44px field sits 8px from the divider on both sides. */
  min-height: 60px;
  margin: 0;
}
.group-finance-line + .group-finance-line { border-top: 1px solid var(--line); }
.group-finance-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-right: auto;
  color: var(--text);
  font-family: var(--font-code);
  font-weight: 700;
  white-space: nowrap;
}
.group-finance-line input { width: 96px; flex: none; text-align: right; font-family: var(--font-numeric); font-variant-numeric: tabular-nums; }
.group-finance-unit { flex: none; color: var(--muted); font-size: var(--fs-label); }
/* 2026-11-28: the one line under the 반품·취소 fields, close to the lines it is about. */
.group-finance-hint { margin: 0; }
.group-finance-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 12px; }
/* 기록 수정 and the day detail mark a count the owner edited. */
.edited-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--primary-bg);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
}
.group-finance-name .edited-tag { margin-left: 0; }
}
