/* "Thửa của tôi" (public/ui/thua-cua-toi.js). Phone: pill under the top buttons, list at 40 % of the screen (tap the grip
   for more). Computer: pill under the top bar, list as a left panel. */
.thua-pill { pointer-events: auto; position: absolute; z-index: 1100; top: 78px; left: 16px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--v2-line); border-radius: 999px; background: #fff; color: var(--v2-ink);
  box-shadow: var(--v2-shadow); font: 650 15px Inter, system-ui, sans-serif; cursor: pointer; zoom: var(--ui-zoom); }
.thua-pill[hidden] { display: none; }
.thua-pill[aria-expanded="true"] { border-color: var(--v2-green); background: var(--v2-green); color: #fff; }
.thua-pill-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #f3e6c4; color: #6b4e00; font-size: 13px; }
.thua-pill[aria-expanded="true"] .thua-pill-n { background: #fff; color: var(--v2-green); }

.thua-sheet { pointer-events: auto; position: absolute; z-index: 1160; display: none; flex-direction: column; overflow: hidden; box-sizing: border-box;
  border: 1px solid var(--v2-line); background: var(--v2-paper, #fff); color: var(--v2-ink); box-shadow: var(--v2-shadow);
  font: 15px/1.45 Inter, system-ui, sans-serif; }
.thua-sheet.open { display: flex; }
.thua-grip { flex: 0 0 auto; width: 44px; height: 5px; margin: 8px auto 2px; border-radius: 3px; background: #cfd5db; cursor: pointer; }
.thua-head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 14px 8px; border-bottom: 1px solid var(--v2-line); }
.thua-head h2 { flex: 1 1 auto; margin: 0; font: 750 18px Inter, system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thua-where { flex: 0 0 auto; color: #5b6670; font-size: 13px; }
.thua-back { min-width: 40px; min-height: 40px; border: 0; background: none; color: var(--v2-ink); font-size: 26px; line-height: 1; cursor: pointer; }
.thua-list { flex: 1 1 auto; margin: 0; padding: 8px 12px; overflow-y: auto; list-style: none; }
.thua-list li + li { margin-top: 8px; }
.thua-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border: 1px solid var(--v2-line); border-radius: 14px;
  background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.thua-item-top { display: flex; justify-content: space-between; gap: 8px; }
.thua-item-top span { color: #5b6670; font-size: 13px; white-space: nowrap; }
.thua-price { margin: 0; font-size: 19px; font-weight: 750; }
.thua-sub, .thua-change, .thua-fine { color: #5b6670; font-size: 13px; }
.thua-change { color: #31404b; }
.thua-flag { margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: #fff4d6; color: #6b4e00; font-size: 13px; font-weight: 600; }
.thua-empty { flex: 1 1 auto; margin: 0; padding: 16px; color: #31404b; }
.thua-undo { margin: 8px 12px 0; padding: 8px 10px; border-radius: 10px; background: #eef4f0; font-size: 14px; }
.thua-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px; }
.thua-body h3 { margin: 14px 0 6px; font-size: 16px; }
.thua-note { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff; }
.thua-note p, .thua-note ul { margin: 2px 0 0; font-size: 14px; }
.thua-note ul { padding-left: 18px; }
.thua-note-warn { border-color: #e8c66a; background: #fff8e5; }
.thua-history { margin: 0; padding-left: 18px; font-size: 14px; }
.thua-foot { flex: 0 0 auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--v2-line); background: var(--v2-paper, #fff); }
.thua-foot p { margin: 0 0 6px; color: #31404b; font-size: 13px; }
.thua-foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thua-foot-actions .v2-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.thua-foot-actions .v2-btn-primary { flex-basis: 100%; }
.thua-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--v2-line); cursor: pointer; }
.thua-check input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }
.thua-check small { display: block; color: #5b6670; font-size: 13px; }
.thua-status { min-height: 1.4em; font-size: 14px; color: #1f5c3b; }
.thua-save-status { grid-column: 1 / -1; margin: 0; font-size: 14px; }
.thua-save-status:empty { display: none; }
.v2-btn.thua-saved { border-color: #d9b75a; background: #fff8e5; }

/* Gold pins for watched parcels */
.thua-pin span { display: block; width: 20px; height: 20px; margin: 1px 0 0 3px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #c9971c;
  transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.45); }

@media (max-width: 767px) {
  .thua-pill { top: 70px; left: 8px; }
  .thua-sheet { left: 0; right: 0; bottom: 0; height: 40dvh; min-height: 260px; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .thua-sheet.tall { height: 86dvh; }
}
@media (min-width: 768px) {
  .thua-pill { top: 92px; }
  .thua-sheet { left: 16px; top: 148px; bottom: 16px; width: 400px; border-radius: 18px; }
  .thua-grip { display: none; }
}
.thua-more { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 4px; }
.thua-more .v2-link-btn { min-height: 40px; }
