* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Tahoma, 'Segoe UI', Arial, sans-serif; background: #f4e8d3; color: #3e2f22; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

#lock-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lock-box { background: #fffaf0; border: 2px solid #cbb489; border-radius: 16px; padding: 28px 22px; width: 100%; max-width: 340px; text-align: center; }
.lock-title { font-size: 30px; font-weight: bold; margin-bottom: 16px; }
.lock-msg { font-size: 15px; margin-bottom: 12px; color: #7a6a55; }
.lock-box input { width: 100%; font-size: 20px; padding: 12px; border: 2px solid #cbb489; border-radius: 10px; margin-bottom: 10px; text-align: center; background: #fff; }
.read-err-detail { font-size: 11px; color: #9a8a75; text-align: center; margin-top: 4px; direction: ltr; word-break: break-all; }
.lock-err { color: #a03030; font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.btn-main { background: #3e2f22; color: #f7ecd9; border: none; border-radius: 10px; font-size: 18px; font-weight: bold; padding: 12px 30px; width: 100%; }
.btn-ghost { background: none; border: 2px solid #3e2f22; color: #3e2f22; border-radius: 10px; font-size: 16px; font-weight: bold; padding: 12px 20px; width: 100%; }

.band { background: #3e2f22; color: #f7ecd9; padding: 18px 14px; text-align: center; position: sticky; top: 0; z-index: 5; }
.band .t { font-size: 30px; font-weight: bold; }
.clk { font-size: 13px; opacity: .85; margin-top: 6px; }
.editrow { display: flex; justify-content: space-between; padding: 12px 14px 4px; }
.editbtn { background: #3e2f22; color: #f7ecd9; border: none; border-radius: 10px; font-size: 17px; font-weight: bold; padding: 10px 26px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 14px 80px; }
.sq { position: relative; background: #fffaf0; border: 2px solid #cbb489; border-radius: 12px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 17px; font-weight: bold; padding: 6px; box-shadow: 0 2px 4px rgba(62,47,34,.15); word-break: break-word; }
.sq.add { border-style: dashed; color: #8a6d3f; background: #f9f1e0; }
.sq .rn { position: absolute; top: 4px; left: 4px; font-size: 10px; background: #3e2f22; color: #f7ecd9; border-radius: 4px; padding: 2px 6px; font-weight: bold; }

.top { display: flex; align-items: center; gap: 10px; padding: 14px; background: #3e2f22; color: #f7ecd9; position: sticky; top: 0; z-index: 5; }
.back { background: none; border: 1px solid #b98a2f; color: #f7ecd9; border-radius: 8px; font-size: 14px; padding: 6px 12px; }
.co { font-size: 24px; font-weight: bold; }
.top .clk2 { margin: 0 0 0 auto; font-size: 12px; opacity: .85; text-align: left; }
.bal { margin: 14px; background: #3e2f22; color: #f7ecd9; border-radius: 14px; padding: 18px; text-align: center; }
.bal .l { font-size: 16px; }
.bal .v { font-size: 36px; font-weight: bold; color: #e9c46a; }
.chips { display: flex; gap: 10px; margin: 0 14px; }
.chip { flex: 1; background: #fffaf0; border: 1px solid #cbb489; border-radius: 10px; text-align: center; padding: 10px 4px; font-size: 14px; font-weight: bold; }
.chip b { display: block; font-size: 20px; margin-top: 4px; }
.acts { display: flex; gap: 8px; margin: 14px; }
.act { flex: 1; background: #b98a2f; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: bold; padding: 11px 4px; }
.sec { font-size: 19px; font-weight: bold; margin: 16px 14px 8px; border-bottom: 2px solid #b98a2f; padding-bottom: 4px; }

.inv { margin: 0 14px 10px; background: #fffaf0; border: 1px solid #cbb489; border-radius: 10px; padding: 10px 12px; }
.inv .h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: bold; gap: 6px; }
.inv .h .ops button, .pay .ops button { background: none; border: 1px solid #b98a2f; color: #3e2f22; border-radius: 6px; font-size: 12px; padding: 3px 8px; margin-right: 4px; }
.paidbox { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: #f3e7cf; border: 1px dashed #cbb489; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.paidbox b { font-size: 16px; }
.paybtn { margin-right: auto; background: #b98a2f; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: bold; padding: 6px 12px; }
.lines { margin-top: 8px; border-top: 1px dashed #cbb489; padding-top: 8px; font-size: 14px; }
.lines .li { display: flex; justify-content: space-between; padding: 3px 0; }
.lines .tot { display: flex; justify-content: space-between; font-weight: bold; border-top: 1px solid #b98a2f; margin-top: 6px; padding-top: 6px; font-size: 16px; }
.pay { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; background: #f3e7cf; border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.inv-photo { margin-top: 8px; width: 100%; border-radius: 8px; border: 1px solid #cbb489; }
.empty { text-align: center; color: #7a6a55; font-size: 15px; padding: 20px; }

#pick-sheet { position: fixed; inset: 0; background: rgba(30,20,12,.55); display: flex; align-items: flex-end; z-index: 70; }
.pick-box { background: #fdf8ec; width: 100%; border-radius: 16px 16px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.pick-box .btn-main { width: 100%; padding: 13px; font-size: 17px; }
.pk-back { width: 100%; padding: 13px; font-size: 17px; background: none; border: 1.5px solid #a03030; color: #a03030; border-radius: 8px; font-family: inherit; }

#modal { position: fixed; inset: 0; background: rgba(30,20,12,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-box { background: #fffaf0; border: 2px solid #cbb489; border-radius: 14px; padding: 20px; width: 100%; max-width: 360px; max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 20px; font-weight: bold; margin-bottom: 12px; text-align: center; }
.modal-ops { display: flex; gap: 8px; margin-top: 14px; }
.modal-ops .btn-main { flex: 1; }
.modal-ops .btn-ghost { flex: 1; }
.f-row { margin-bottom: 10px; }
.f-row label { display: block; font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.f-row input, .f-row textarea { width: 100%; font-size: 18px; padding: 10px; border: 2px solid #cbb489; border-radius: 8px; background: #fff; }
.f-row input:disabled { background: #f3e7cf; }
.line-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.line-row input { font-size: 16px; padding: 8px; border: 1px solid #cbb489; border-radius: 6px; min-width: 0; }
.line-row textarea.ln { font: inherit; font-size: 16px; padding: 8px; border: 1px solid #cbb489; border-radius: 6px; min-width: 0; flex: 1; resize: none; overflow: hidden; line-height: 1.3; background: #fff; }
.lines .li span:first-child { white-space: normal; overflow-wrap: anywhere; }
.lines .li { align-items: flex-start; }
.line-row .lnum { width: 20px; flex: none; text-align: center; font-weight: bold; color: #3e2f22; font-size: 16px; }
.line-row .lq { width: 44px; flex: none; }
.line-row .lp { width: 52px; flex: none; }
.line-row .lt { width: 56px; flex: none; text-align: center; font-size: 15px; font-weight: bold; color: #3e2f22; }
.file-chip { display: block; font-size: 15px; color: #3e2f22; background: #f7ecd4; border: 1px dashed #cbb489; border-radius: 8px; padding: 10px; margin-top: 8px; text-decoration: none; word-break: break-all; }
.inv-note { font-size: 14px; color: #7a5b23; background: #f7ecd4; border: 1px dashed #cbb489; border-radius: 8px; padding: 6px 10px; margin-top: 8px; }
.line-row input.miss { border-color: #c0392b; background: #fdeceb; }
.line-row .ld { flex: none; background: none; border: 1px solid #a03030; color: #a03030; border-radius: 6px; font-size: 12px; padding: 4px 6px; }
.lines-head { display: flex; gap: 6px; padding-inline-start: 26px; margin-bottom: 4px; }
.lines-head span { font-size: 13px; font-weight: bold; color: #7a6a55; text-align: center; }
.lines-head .lh-n { flex: 1; }
.lines-head .lh-q { width: 48px; }
.lines-head .lh-p { width: 56px; }
.lines-head .lh-t { width: 62px; }
.f-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.f-top-new { justify-content: flex-start; }
.f-date-line { text-align: center; margin-bottom: 8px; }
.f-date-line input { font-size: 15px; padding: 6px; border: 1px solid #cbb489; border-radius: 6px; margin-inline-start: 6px; }
.btn-ghost { background: #fffaf0; border: 1px solid #3e2f22; color: #3e2f22; border-radius: 8px; padding: 10px 22px; font-size: 16px; font-weight: bold; }
.f-top .btn-main { width: auto; padding: 10px 30px; margin: 0; }
.f-date { font-size: 13px; color: #7a6a55; }
.form-trio { margin-top: 0; margin-bottom: 10px; }
.form-trio .tb .paid-in { width: 80%; }
.add-line { background: none; border: 1px dashed #b98a2f; color: #8a6d3f; border-radius: 8px; font-size: 14px; font-weight: bold; padding: 8px; width: 100%; margin-top: 4px; }
.photo-prev { width: 100%; border-radius: 8px; margin-top: 8px; border: 1px solid #cbb489; }
.pick-photo { background: none; border: 2px dashed #b98a2f; color: #8a6d3f; border-radius: 8px; font-size: 15px; font-weight: bold; padding: 12px; width: 100%; margin-top: 6px; }

.choice-row { display: flex; gap: 10px; margin-top: 4px; }
.choice-row .btn-main { flex: 1; font-size: 22px; padding: 18px 0; }

.done-tag { font-size: 12px; background: #e9c46a; color: #3e2f22; border-radius: 6px; padding: 3px 8px; margin-right: 4px; font-weight: bold; }
.tb .paid-in:disabled { background: #e9dfc9; color: #7a6a55; }

.searchrow { margin: 0 14px 10px; display: flex; gap: 8px; }
.searchrow input { flex: 1; min-width: 0; font-size: 16px; padding: 10px; border: 2px solid #cbb489; border-radius: 10px; background: #fff; }
.yr-wrap { position: relative; }
.yr-chip { height: 100%; background: #fffaf0; border: 2px solid #cbb489; border-radius: 10px; padding: 0 10px; font-family: inherit; font-size: 15px; color: #3e2f22; display: flex; align-items: center; gap: 5px; }
.yr-list { position: absolute; left: 0; top: calc(100% + 4px); min-width: 92px; background: #fffaf0; border: 2px solid #cbb489; border-radius: 10px; z-index: 60; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.yr-list button { display: block; width: 100%; padding: 8px 12px; background: none; border: none; font-family: inherit; font-size: 15px; color: #3e2f22; text-align: center; }
.yr-list button.sel { font-weight: bold; background: #f3e8d2; }

.f-sum-row { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid #b98a2f; margin-top: 10px; padding-top: 10px; font-size: 18px; font-weight: bold; }
.f-sum-row b { font-size: 24px; }

.f-note { font-size: 13px; color: #8a5a2a; background: #fdf3e0; border: 1px solid #ecd9b0; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }

.inv-sub { font-size: 13px; color: #7a6a55; margin-top: 3px; }

.sec { display: flex; align-items: center; justify-content: space-between; }
.sec-btn { font-family: inherit; font-size: 15px; background: #3e2f22; color: #f7ecd9; border: 0; border-radius: 8px; padding: 6px 14px; }
.att-list { max-height: 60vh; overflow-y: auto; }
.att-item { margin-bottom: 12px; }
.att-h { font-weight: bold; font-size: 15px; color: #3e2f22; }
.sec-count { font-size: 14px; color: #7a6a55; font-weight: normal; }

.backup-row { margin: 0 14px 10px; display: flex; gap: 8px; }
.bkbtn { flex: 1; background: #fffaf0; border: 2px solid #b98a2f; border-radius: 10px; padding: 8px; font-family: inherit; font-size: 15px; color: #3e2f22; }
.debtbox { background: #fffaf0; border: 2px solid #b98a2f; border-radius: 10px; padding: 8px 18px; font-size: 16px; color: #3e2f22; }
.debtbox span { font-size: 14px; margin-inline-end: 8px; }
.debtbox b { font-size: 19px; color: #8a5a2a; }
.debt-co { background: #fffaf0; border: 1px solid #cbb489; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.debt-co-name { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
.debt-co-nums { font-size: 16px; color: #5a4a38; }
#debt-list { margin-top: 12px; }

#ver { text-align: center; font-size: 12px; color: #8a6d3f; padding: 20px 0 30px; }
.trio { display: flex; gap: 8px; margin-top: 8px; }
.tb { flex: 1; background: #f3e7cf; border: 1px dashed #cbb489; border-radius: 8px; padding: 8px 4px; text-align: center; }
.tb span { display: block; font-size: 13px; margin-bottom: 4px; }
.tb b { font-size: 18px; }
.tb .paid-in { width: 90%; font-size: 18px; font-weight: bold; text-align: center; border: 1px solid #cbb489; border-radius: 6px; background: #fff; padding: 4px; }
.f-key-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.f-key-row input { flex: 1; min-width: 110px; font-size: 16px; padding: 8px; border: 1px solid #cbb489; border-radius: 6px; }
.f-key-msg { width: 100%; color: #c0392b; font-size: 13px; }
.read-status { text-align: center; padding: 6px; font-weight: bold; color: #8a5a2a; }
.line-row.flag { background: #fdf3e0; border: 1px solid #d35400; border-radius: 8px; padding: 4px; }
.line-flag { color: #c0392b; font-size: 13px; margin: 0 4px 8px; }
.f-key-note { font-size: 13px; color: #3e2f22; background: #fdf3e0; border: 1px solid #ecd9b0; border-radius: 10px; padding: 8px 10px; }
.f-key-btns { display: flex; gap: 6px; width: 100%; }
.f-key-btns .btn-main { flex: 1; font-size: 14px; padding: 8px 4px; }
.f-key-hint { width: 100%; font-size: 12px; color: #8a5a2a; text-align: center; }
.read-cancel { display: block; width: auto; margin: 0 auto 6px; padding: 4px 16px; font-size: 13px; }
body { padding-top: 26px; }

