/* Travel hub — tabs, Keep-style notes, and the (scoped) Miles calculator. */
:root {
  --bg: #f4f5fb; --panel: #fff; --panel-2: #fff; --border: #dee2e6;
  --text: #2b2f3e; --muted: #6c757d; --accent: #766df4; --accent-2: #5750c9;
  --warn: #b98a00; --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; padding: 0 0 4rem; }
body.lang-en .zh { display: none; }
body.lang-zh .en { display: none; }
.d-none { display: none !important; }
.tv-wrap { max-width: 900px; margin: 0 auto; padding: 1.4rem 1rem 0; }
.tv-head { text-align: center; margin-bottom: 1.1rem; }
.tv-head h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
.tv-head p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Tabs */
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 1.3rem; }
.tab { padding: 8px 18px; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 50rem;
  box-shadow: 0 2px 6px -2px rgba(55,56,78,.08); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.tab:hover:not(.active) { color: var(--accent); border-color: var(--accent); }
.section { display: none; }
.section.active { display: block; }

/* Items list (travel checklist) */
.tv-primary { border: none; background: var(--accent); color: #fff; border-radius: 10px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tv-primary:hover { opacity: .9; }
.item-add { display: flex; gap: 8px; margin-bottom: 14px; }
.item-add input { flex: 1; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--text); outline: none; }
.item-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(118,109,244,.14); }
#items-list { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(30,30,80,.05); }
.item-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-check { width: 19px; height: 19px; cursor: pointer; flex-shrink: 0; accent-color: var(--accent); }
.item-text { flex: 1; font-size: 14px; word-break: break-word; }
.item-row.done .item-text { text-decoration: line-through; color: var(--muted); }
.item-del { border: none; background: none; color: #b8bcc9; cursor: pointer; font-size: 15px; padding: 2px 4px; line-height: 1; }
.item-del:hover { color: #f36d8a; }
.notes-empty, .notes-gate { color: var(--muted); background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-align: center; font-size: 13.5px; }
.notes-gate a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---- Miles calculator, scoped to its tab ---- */
#tab-miles .m-head { text-align: center; margin-bottom: 1.6rem; }
#tab-miles .m-head h2 { font-size: 1.35rem; margin: 0 0 .3rem; text-transform: none; letter-spacing: 0; color: var(--text); }
#tab-miles .m-head p { margin: 0; color: var(--muted); font-size: .93rem; }
#tab-miles .m-wrap { max-width: 620px; margin: 0 auto; }
#tab-miles .card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; margin-bottom: 1.3rem; box-shadow: 0 2px 12px rgba(30,30,80,.06); }
#tab-miles .card h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 1.1rem; }
#tab-miles .field { margin-bottom: 1.1rem; }
#tab-miles .field:last-child { margin-bottom: 0; }
#tab-miles label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
#tab-miles .input-group { position: relative; display: flex; align-items: center; }
#tab-miles .input-group .prefix { position: absolute; left: .9rem; color: var(--muted); font-size: .95rem; pointer-events: none; }
#tab-miles input[type="number"], #tab-miles select { width: 100%; background: #fff; border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: .72rem .85rem; font-size: 1rem; outline: none; appearance: none; -webkit-appearance: none; font-family: inherit; }
#tab-miles .input-group input[type="number"] { padding-left: 1.9rem; }
#tab-miles input:focus, #tab-miles select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(118,109,244,.14); }
#tab-miles select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239aa3af'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.3rem; }
#tab-miles .custom-rate-field { margin-top: .8rem; display: none; }
#tab-miles .custom-rate-field.visible { display: block; }
#tab-miles .hint { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
#tab-miles #calcBtn { width: 100%; padding: .9rem; font-size: 1rem; font-weight: 600; color: #fff;
  background: var(--accent); border: none; border-radius: 10px; cursor: pointer; }
#tab-miles #calcBtn:hover { opacity: .92; }
#tab-miles .results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#tab-miles .result-tile { background: #fbfbfe; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
#tab-miles .result-tile .label { font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }
#tab-miles .result-tile .value { font-size: 1.25rem; font-weight: 700; }
#tab-miles .result-tile.highlight { grid-column: 1 / -1; background: #f1effe; border-color: rgba(118,109,244,.35); text-align: center; padding: 1.3rem; }
#tab-miles .result-tile.highlight .value { font-size: 2.1rem; color: var(--accent); }
#tab-miles .summary { margin-top: 1.2rem; padding: 1rem 1.1rem; background: #fff8e6; border-left: 3px solid #f0b400; border-radius: 0 10px 10px 0; font-size: .9rem; line-height: 1.5; }
#tab-miles .m-foot { text-align: center; color: var(--muted); font-size: .76rem; margin-top: 1.4rem; }
@media (max-width: 500px) { #tab-miles .results-grid { grid-template-columns: 1fr; } #tab-miles .result-tile.highlight .value { font-size: 1.7rem; } }
