.view-bill-record .main { padding: 20px 24px 24px; }
.view-bill-record .content { max-width: 1440px; }
.view-bill-record .topbar { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 18px; gap: 12px; }
.view-bill-record .topbar h2 { font: 700 24px/1.4 var(--body); letter-spacing: 0; }
.view-bill-record .topbar .eyebrow { display: none; }
.view-bill-record .topbar.has-back .topbar-back { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); }
.view-bill-record .topbar.has-back > div { flex: initial; text-align: left; }
.view-bill-record .topbar .back-glyph svg { width: 18px; height: 18px; }
.bill-entry { min-width: 0; font-size: 14px; letter-spacing: 0; }
.bill-entry .upload-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-bottom: 0; }
.bill-entry .upload-slot {
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 220px;
  padding: 12px; border: 1px solid var(--border); border-top: 3px solid var(--rose);
  background: var(--surface); border-radius: 8px; transition: border-color .15s, background .15s;
}
.bill-entry .upload-slot[data-upload-slot="purchase"] { border-top-color: var(--success); }
.bill-entry .upload-slot[data-upload-slot="invoice"] { border-top-color: var(--info); }
.bill-entry .slot-head { align-items: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
.bill-entry .slot-head strong { font-size: 14px; }
.bill-entry .slot-count { color: var(--muted); font: 12px var(--body); }
.bill-entry .slot-files { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; flex: 1; }
.bill-entry .slot-files.is-empty { display: none; }
.bill-entry .slot-file { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 8px; align-items: start; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bill-entry .file-icon { width: 30px; height: 32px; font-size: 10px; border-radius: 4px; grid-column: 1; }
.bill-entry .file-meta { grid-column: 2; min-width: 0; }
.bill-entry .file-meta strong { font-size: 12px; line-height: 1.5; }
.bill-entry .file-meta small { display: block; font-size: 11px; overflow-wrap: anywhere; }
.bill-entry .file-actions { grid-column: 2; gap: 12px; width: auto; }
.bill-entry .file-actions button { font-size: 12px; min-height: 24px; padding: 0; }
.bill-entry .slot-drop-target { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 48px; width: 100%; margin-top: 8px; padding: 6px 12px; border: 1px dashed #d2bec7; border-radius: 5px; color: var(--rose-dark); background: #fcf8fa; }
.bill-entry .slot-files.is-empty + .slot-drop-target { flex: 1; margin-top: 0; }
.bill-entry .slot-drop-target:hover { border-color: var(--rose); background: var(--rose-soft); }
.bill-entry .slot-drop-target strong { font-size: 13px; font-weight: 600; }
.bill-entry .slot-drop-target small { color: var(--muted); font-size: 11px; }
.bill-entry .slot-drag-overlay { display: none; position: absolute; inset: 4px; z-index: 1; align-items: center; justify-content: center; padding: 12px; border: 2px dashed var(--rose); border-radius: 5px; background: #fcf2f7f5; color: var(--rose-dark); font-weight: 600; pointer-events: none; }
.bill-entry .is-dragging .slot-drag-overlay { display: flex; }
.bill-entry .is-dragging { border-color: var(--rose); }
.bill-entry .slot-selection { visibility: hidden; margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--rose-dark); }
.bill-entry .upload-slot:focus-within { border-color: var(--rose); outline: 2px solid var(--rose); outline-offset: 2px; background: #fff3f8; box-shadow: 0 0 0 5px rgba(192, 47, 98, .1); }
.bill-entry .upload-slot:focus-within .slot-selection { visibility: visible; }
.bill-entry .upload-slot:focus-within .slot-drop-target { border-color: var(--rose); background: var(--surface); }
.bill-entry .slot-import-error { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--danger); overflow-wrap: anywhere; max-height: 82px; overflow-y: auto; }
.bill-information { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.bill-information .section-head { margin-bottom: 12px; }
.bill-information h3 { margin: 0; font: 600 15px/1.5 var(--body); }
.bill-entry .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; gap: 12px 16px; }
#bill-form .form-grid > .field { grid-area: auto; order: initial; }
#bill-form .form-grid > .full { grid-column: 1 / -1; }
#bill-form .form-grid > .field-note { grid-column: span 2; }
.bill-entry .inline-control > .bill-select { flex: 1; }
.bill-entry .field-add svg { width: 18px; height: 18px; }
.bill-entry .field label { margin-bottom: 5px; font-size: 13px; }
.bill-entry .field input, .bill-entry .field select { width: 100%; height: 40px; min-height: 40px; padding: 8px 10px; font-size: 14px; line-height: 22px; border-radius: 6px; }
.bill-entry .field input[type="hidden"] { display: none; }
.bill-entry .field select { padding-right: 30px; background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; }
.bill-entry #bill-date { height: 40px; min-height: 40px; font-size: 14px; padding: 8px 10px; border-radius: 6px; }
.bill-entry #bill-amount { font-family: var(--mono); font-size: 20px; color: var(--rose-dark); }
.bill-entry .field-add { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 6px; font-size: 20px; }
.bill-entry #bill-note { min-height: 54px; height: 54px; padding: 8px 10px; border-radius: 6px; resize: vertical; font-size: 14px; line-height: 20px; }
.view-bill-record .sticky-save { position: sticky; bottom: 0; z-index: 2; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 16px; margin: 14px 0 0; padding: 10px 0; background: var(--canvas); border-top: 1px solid var(--border); }
.bill-entry .sticky-save .btn { min-width: 140px; min-height: 40px; padding: 8px 24px; border-radius: 6px; }
.bill-upload-status { margin-right: auto; }
.bill-select { position: relative; min-width: 0; }
.bill-options { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 4; max-height: 224px; padding: 4px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 20px #241a2120; }
.bill-options.opens-up { top: auto; bottom: calc(100% + 4px); }
.bill-options[hidden], .bill-options [hidden] { display: none; }
.bill-options [role="option"] { padding: 8px 10px; min-height: 36px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.bill-options [role="option"]:hover, .bill-options .is-active { background: var(--rose-soft); color: var(--rose-dark); }
.bill-options [aria-selected="true"] { font-weight: 600; }
.bill-options-empty { padding: 12px 10px; color: var(--muted); }
@media (min-width: 768px) and (max-height: 760px) {
  .view-bill-record .main { padding-top: 14px; padding-bottom: 14px; }
  .view-bill-record .topbar { margin-bottom: 12px; }
  .bill-entry .upload-slot { height: 192px; }
  .bill-information { margin-top: 14px; padding-top: 12px; }
  .bill-information .section-head { margin-bottom: 8px; }
  .bill-entry .form-grid { gap: 10px 16px; }
  .view-bill-record .sticky-save { margin-top: 10px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .view-bill-record .main { padding-inline: 18px; }
  .bill-entry .upload-grid { gap: 10px; }
  .bill-entry .upload-slot { padding: 10px; }
}
@media (max-width: 767px) {
  .view-bill-record .main { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  .bill-entry .upload-grid { grid-template-columns: 1fr; gap: 10px; }
  .bill-entry .upload-slot { height: 196px; }
  .bill-entry .form-grid { grid-template-columns: 1fr; }
  #bill-form .form-grid > .field-note { grid-column: auto; }
  .bill-entry .field input, .bill-entry .field select, .bill-entry #bill-date { height: 44px; min-height: 44px; font-size: 16px; }
  .bill-entry .field-add { height: 44px; width: 44px; }
  .bill-entry .field select { background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; }
  .bill-entry #bill-note { height: 70px; font-size: 16px; }
  .view-bill-record .sticky-save { position: static; flex-wrap: wrap; gap: 6px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .bill-entry .sticky-save .btn { width: 100%; }
  .bill-entry .slot-files { touch-action: pan-y; }
}
