/* ============================================================
   Nestiy — Smart Holiday Travel Bag (documents for each trip), light and dark.
   ============================================================ */
.tb{ margin-top:28px; padding:24px; border-radius:var(--radius-lg); background:var(--white); border:1px solid var(--line); box-shadow:var(--shadow-soft);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); scroll-margin-top:90px; }
.tb[hidden]{ display:none; }
.tb-ic{ width:18px; height:18px; flex:0 0 auto; }
.tb-head{ display:flex; align-items:center; gap:14px; }
.tb-nestiy{ flex:0 0 auto; margin:-10px -4px -10px -10px; }
.tb-titles{ flex:1; min-width:0; }
.tb-kicker{ display:inline-flex; align-items:center; gap:6px; font-size:0.78rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--primary); }
.tb-titles h2{ font-size:1.5rem; margin:2px 0 2px; overflow-wrap:anywhere; }
.tb-titles p{ margin:0; color:var(--muted); font-size:0.88rem; }
.tb-close{ align-self:flex-start; width:38px; height:38px; border-radius:50%; border:1px solid var(--line); background:var(--mint-50); color:var(--ink); cursor:pointer; font-size:1rem; }
.tb-close:hover{ border-color:var(--primary); color:var(--primary); }

.tb-storage{ margin:16px 0 4px; }
.tb-st-row{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; font-size:0.82rem; color:var(--muted); }
.tb-st-row b{ color:var(--ink); }
.tb-st-row a{ color:var(--primary); font-weight:700; }
.tb-st-bar{ height:7px; border-radius:99px; background:var(--mint-50); border:1px solid var(--line); overflow:hidden; margin-top:6px; }
.tb-st-bar i{ display:block; height:100%; border-radius:99px; background:linear-gradient(90deg, #4FB3C9, #9D8DE4); }
.tb-st-bar i.warn{ background:linear-gradient(90deg, #F0AE57, #EA7F74); }
.tb-st-bar i.full{ background:var(--red); }

.tb-bar{ display:flex; gap:10px; margin:16px 0 8px; align-items:center; }
.tb-search, .tb-g-filter{ position:relative; display:flex; align-items:center; flex:1; min-width:0; }
.tb-search svg, .tb-g-filter svg{ position:absolute; left:12px; width:17px; height:17px; color:var(--muted); pointer-events:none; }
.tb-search input, .tb-g-filter input{ width:100%; padding:11px 12px 11px 38px; border-radius:12px; border:1px solid var(--line); background:var(--mint-50); color:var(--ink); font:inherit; font-size:0.92rem; }
.tb-search input:focus, .tb-g-filter input:focus{ outline:none; border-color:var(--primary); }
.tb-g-filter{ margin:0 0 10px; }
.tb-g-filter input{ padding:8px 10px 8px 34px; font-size:0.84rem; border-radius:10px; }
.tb-g-filter svg{ left:11px; width:15px; height:15px; }
.tb-found{ font-size:0.84rem; color:var(--muted); margin:0 0 8px; }

.tb-groups{ display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:16px; margin-top:8px; }
.tb-group{ border:1px solid var(--line); border-radius:18px; padding:14px; background:var(--mint-50); display:flex; flex-direction:column; min-width:0; }
.tb-g-head{ display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.tb-g-head h3{ flex:1; min-width:0; font-size:1.05rem; margin:0; overflow-wrap:anywhere; }
.tb-g-head h3 small{ font-size:0.74rem; font-weight:700; color:var(--muted); background:var(--white); border:1px solid var(--line); border-radius:99px; padding:1px 8px; margin-left:4px; vertical-align:middle; }
.tb-g-tools button{ border:0; background:none; color:var(--muted); font:inherit; font-size:0.78rem; font-weight:700; cursor:pointer; padding:4px 6px; border-radius:8px; }
.tb-g-tools button:hover{ color:var(--primary); }
.tb-g-tools button.danger:hover{ color:var(--red); }
.tb-items{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; flex:1; }
.tb-item{ display:flex; align-items:center; gap:6px; border:1px solid var(--line); border-radius:12px; background:var(--white); padding:6px 6px 6px 8px; min-width:0; }
.tb-item:hover{ border-color:color-mix(in srgb, var(--primary) 45%, var(--line)); }
.tb-open{ flex:1; min-width:0; display:flex; align-items:center; gap:10px; border:0; background:none; text-align:left; font:inherit; color:inherit; cursor:pointer; padding:2px; }
.tb-thumb{ flex:0 0 42px; width:42px; height:42px; border-radius:10px; display:grid; place-items:center; overflow:hidden; background:color-mix(in srgb, var(--primary) 12%, transparent); color:var(--primary); }
.tb-thumb svg{ width:20px; height:20px; }
.tb-thumb img{ width:100%; height:100%; object-fit:cover; }
.k-pdf .tb-thumb{ background:color-mix(in srgb, #EA7F74 18%, transparent); color:#D9645A; }
.k-link .tb-thumb{ background:color-mix(in srgb, #4FB3C9 18%, transparent); color:#2F8FA8; }
.k-text .tb-thumb{ background:color-mix(in srgb, #9D8DE4 18%, transparent); color:#7A63D6; }
.tb-meta{ min-width:0; display:flex; flex-direction:column; }
.tb-meta b{ font-size:0.9rem; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tb-meta small{ font-size:0.76rem; color:var(--muted); }
.tb-snip{ font-size:0.76rem; color:var(--muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:2px; }
.tb-item mark, .tb-g-head mark{ background:color-mix(in srgb, #F0AE57 45%, transparent); color:inherit; border-radius:3px; padding:0 1px; }
.tb-i-tools{ display:flex; gap:2px; flex:0 0 auto; }
.tb-i-tools a, .tb-i-tools button{ width:32px; height:32px; display:grid; place-items:center; border:0; border-radius:9px; background:none; color:var(--muted); cursor:pointer; }
.tb-i-tools svg{ width:16px; height:16px; }
.tb-i-tools a:hover, .tb-i-tools button:hover{ background:var(--mint-50); color:var(--primary); }
.tb-i-tools .danger:hover{ color:var(--red); }
.tb-none{ font-size:0.84rem; color:var(--muted); padding:10px 4px; }
.tb-uploading{ opacity:.85; }
.tb-prog{ display:block; height:4px; border-radius:99px; background:var(--mint-50); margin-top:5px; overflow:hidden; }
.tb-prog i{ display:block; height:100%; width:4%; background:var(--primary); transition:width .2s; }
.tb-add{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:12px; padding-top:10px; border-top:1px dashed var(--line); }
.tb-add span{ font-size:0.76rem; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-right:2px; }
.tb-add button{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--white); color:var(--forest); border-radius:999px; padding:6px 12px; font:inherit; font-size:0.8rem; font-weight:700; cursor:pointer; }
.tb-add button svg{ width:15px; height:15px; }
.tb-add button:hover{ border-color:var(--primary); color:var(--primary); }

.tb-start{ grid-column:1 / -1; display:flex; gap:16px; align-items:center; padding:18px; border:1px dashed var(--line); border-radius:18px; background:var(--mint-50); }
.tb-start img{ flex:0 0 auto; }
.tb-start strong{ font-size:1.05rem; color:var(--ink); }
.tb-start p{ margin:4px 0 10px; color:var(--muted); font-size:0.88rem; }
.tb-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.tb-chip{ border:1px solid var(--line); background:var(--white); color:var(--forest); border-radius:999px; padding:7px 14px; font:inherit; font-size:0.84rem; font-weight:700; cursor:pointer; }
.tb-chip:hover{ border-color:var(--primary); color:var(--primary); }
.tb-quick{ grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.tb-quick > span{ font-size:0.76rem; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-right:2px; }
.tb-chip.sm{ padding:5px 11px; font-size:0.78rem; }
.tb-empty{ grid-column:1 / -1; text-align:center; color:var(--muted); font-size:0.9rem; }
.tb-empty img{ display:block; margin:0 auto 4px; }
.tb-note{ margin:16px 0 0; font-size:0.78rem; color:var(--muted); }

.tb-modal .box{ max-height:calc(100vh - 32px); overflow:auto; }
.tb-modal textarea{ width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:var(--mint-50); color:var(--ink); font:inherit; font-size:0.9rem; resize:vertical; box-sizing:border-box; }
.tb-m-actions{ display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-top:12px; }
.tb-view{ border-radius:14px; overflow:hidden; background:var(--mint-50); border:1px solid var(--line); display:grid; place-items:center; }
.tb-view img{ max-width:100%; max-height:62vh; display:block; }
.tb-file-line{ font-size:0.8rem !important; margin:0 !important; }
.tb-toast{ position:fixed; left:50%; bottom:24px; transform:translate(-50%, 20px); max-width:min(560px, calc(100vw - 32px)); padding:12px 18px; border-radius:14px;
  background:#05281A; color:#fff; font-size:0.9rem; box-shadow:0 18px 50px -12px rgba(0,0,0,.5); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:3000; }
.tb-toast.show{ opacity:1; transform:translate(-50%, 0); }
.tb-toast.err{ background:#8E2F2A; }
html:not([data-theme="light"]) .tb-toast{ background:#FBE3D3; color:#05281A; }
html:not([data-theme="light"]) .tb-toast.err{ background:#F7B6AE; }

/* the Travel Bag button on each trip */
.sh-trips button.bag{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line); background:var(--white); color:var(--forest); border-radius:999px; padding:5px 10px; font:inherit; font-size:0.78rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.sh-trips button.bag .tb-ic{ width:15px; height:15px; }
.sh-trips button.bag:hover{ border-color:var(--primary); color:var(--primary); }
.sh-trips button.bag em{ font-style:normal; font-size:0.72rem; color:var(--muted); }
.sh-trips-hint{ font-size:0.84rem; color:var(--primary); font-weight:700; margin:0 0 8px; display:flex; align-items:center; gap:6px; }
.sh-trips-hint .tb-ic{ width:16px; height:16px; }
.sh-hl{ animation:tbPulse 1.6s ease 2; }
@keyframes tbPulse{ 50%{ box-shadow:0 0 0 4px color-mix(in srgb, var(--primary) 35%, transparent); } }

@media (max-width: 640px){
  .tb{ padding:16px; }
  .tb-nestiy{ width:64px; height:64px; }
  .tb-titles h2{ font-size:1.2rem; }
  .tb-groups{ grid-template-columns:1fr; }
  .tb-bar{ flex-wrap:wrap; }
  .tb-bar .btn{ width:100%; }
  .tb-start{ flex-direction:column; text-align:center; }
  .tb-chips{ justify-content:center; }
}
