/* Discover Darjeeling content manager — portal tools (October 2026).
   Styles for portal-tools.js. Loaded after styles.css and uses its colours. */

/* Ten tabs no longer fit on one line on smaller screens: let them wrap. */
.tabs { flex-wrap: wrap; border-radius: 18px; }

.pt-note { background: var(--accent-soft); border: 1px solid rgba(212, 112, 58, 0.35); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 0 14px; }
.pt-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pt-group-title { margin: 18px 0 6px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.pt-file-btn { display: inline-flex; align-items: center; margin-top: 8px; cursor: pointer; }

/* ---------- Dashboard ---------- */
.pt-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 6px; }
.pt-seg { display: flex; gap: 0; }
.pt-seg .btn { border-radius: 0; margin-left: -1px; }
.pt-seg .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.pt-seg .btn:last-child { border-radius: 0 8px 8px 0; }
.pt-seg .btn.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.pt-range, .pt-report { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.pt-range input, .pt-report select { width: auto; margin: 0; padding: 6px 8px; font-size: 13px; }
.pt-report { margin-left: auto; }
.pt-span { margin: 0 0 14px; }

.pt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pt-kpi { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.pt-kpi.accent { border-color: rgba(212, 112, 58, 0.45); box-shadow: inset 0 3px 0 var(--accent); }
.pt-kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.pt-kpi-value { font-size: 28px; font-weight: 750; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.pt-kpi-sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

.pt-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.pt-card h3 { margin: 0 0 10px; font-size: 15px; }
.pt-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pt-card-head h3 { margin: 0; }
.pt-card-head select { width: auto; margin: 0; }
.pt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pt-two .pt-card { margin-bottom: 14px; }
@media (max-width: 820px) { .pt-two { grid-template-columns: 1fr; } .pt-report { margin-left: 0; } }

.pt-chart { width: 100%; height: auto; display: block; }
.pt-chart .grid { stroke: var(--border); stroke-width: 1; }
.pt-chart .tick { fill: var(--muted); font-size: 12px; }
.pt-chart .bar { fill: var(--accent); opacity: 0.85; }
.pt-chart .bar:hover { opacity: 1; }
.pt-chart .line { fill: none; stroke-width: 2.5; }
.pt-chart .line.ink { stroke: var(--ink); }
.pt-chart .line.green { stroke: #2E7D52; }
.pt-chart .dot.ink { fill: var(--ink); }
.pt-chart .dot.green { fill: #2E7D52; }
.pt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pt-key::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.pt-key.bar::before { background: var(--accent); }
.pt-key.ink::before { background: var(--ink); height: 3px; vertical-align: 3px; }
.pt-key.green::before { background: #2E7D52; height: 3px; vertical-align: 3px; }

.pt-bars { list-style: none; margin: 0; padding: 0; }
.pt-bars li { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.pt-bars li:last-child { border-bottom: none; }
.pt-bar-text { min-width: 0; }
.pt-bar-name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-bar-circuit { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-bar-track { height: 10px; background: var(--background); border-radius: 6px; overflow: hidden; }
.pt-bar { height: 100%; background: var(--accent); border-radius: 6px; }
.pt-bar.quiet { background: #9CA3AF; }
.pt-bar-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }

.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pt-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pt-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.pt-table td:not(:first-child), .pt-table th:not(:first-child) { text-align: right; }

.pt-heat { display: grid; gap: 3px; font-size: 11px; overflow-x: auto; }
.pt-heat-h { color: var(--muted); text-align: left; white-space: nowrap; font-size: 10.5px; }
.pt-heat-d { color: var(--muted); font-weight: 600; align-self: center; }
.pt-heat-c { height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: 10.5px; font-variant-numeric: tabular-nums; min-width: 18px; }

.pt-mini { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; }

/* ---------- Overlays (above the stop editor) ---------- */
.pt-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 60; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 32px 16px; }
.pt-sheet { background: var(--white); border-radius: 16px; padding: 20px 22px; width: 100%; max-width: 720px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.pt-sheet.wide { max-width: 980px; }
.pt-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pt-sheet-head h2 { margin: 0; font-size: 18px; }

/* Photo cropping */
.pt-crop-wrap { margin: 10px 0; background: #111; border-radius: 10px; overflow: hidden; }
.pt-crop { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; }
.pt-crop:active { cursor: grabbing; }

/* QR poster preview: the A4 page, scaled down */
.pt-poster-preview { background: #E5E7EB; border-radius: 10px; padding: 16px; display: flex; justify-content: center; overflow: hidden; height: 620px; }
.pt-poster-frame { width: 794px; height: 1123px; border: 0; background: #fff; transform: scale(0.52); transform-origin: top center; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); flex: none; }

/* Map pin picker */
.pt-map-tools { display: flex; gap: 6px; margin-top: 8px; }
.pt-map-tools input { margin: 0; flex: 1; }
.pt-map-picker { height: 280px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin-top: 8px; }
#pt-map-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pt-result { text-align: left; background: var(--background); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.pt-result:hover { border-color: var(--accent); }

/* Gallery */
.pt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 6px; }
.pt-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--background) center / cover no-repeat; border: 1px solid var(--border); }
.pt-thumb-tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; gap: 4px; justify-content: flex-end; }
.pt-thumb-tools .btn { padding: 2px 7px; font-size: 12px; background: rgba(255, 255, 255, 0.92); }
.pt-thumb-tools .btn-danger { color: var(--danger); }

/* Places: drag to reorder, extra fields */
.pt-grip { cursor: grab; color: var(--muted); font-size: 14px; letter-spacing: -2px; padding: 0 6px 0 0; user-select: none; }
.pt-draggable { cursor: grab; }
.pt-dragging { opacity: 0.45; }
.place-form .pf-maps { flex-basis: 100%; }
.place-form .pf-inline input { flex: none; }
.place-form .pf-inline { flex: 0 1 auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 4px 0; font-weight: 500; }
.place-form .pf-inline input[type="checkbox"] { width: auto; margin: 0; }
.place-form .pf-inline input[type="date"] { width: auto; margin: 0; }

/* ---------- Phone preview ---------- */
.pt-preview-row { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.pt-preview-notes { flex: 1; min-width: 240px; font-size: 13.5px; }
.pt-preview-notes ul { padding-left: 18px; line-height: 1.55; }
.ph-frame { width: 340px; height: 690px; border-radius: 40px; background: #0B1220; padding: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); flex: none; }
.ph-screen { width: 100%; height: 100%; border-radius: 30px; background: #111A2E; overflow-y: auto; color: #E7EAF0; font-family: -apple-system, "Segoe UI", sans-serif; text-align: center; padding-bottom: 24px; }
.ph-hero { height: 220px; background: #1F2A44 center / cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; color: #8B95A8; font-size: 13px; }
.ph-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.ph-medal { width: 84px; height: 84px; border-radius: 50%; background: #23304F; border: 6px solid #1A2440; margin: -42px auto 0; position: relative; }
.ph-eyebrow { color: #F2A65A; letter-spacing: 3px; font-size: 11px; margin-top: 12px; font-weight: 600; }
.ph-title { font-family: Georgia, serif; font-weight: 800; font-size: 24px; margin: 8px 16px 0; line-height: 1.2; color: #fff; }
.ph-tags { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.ph-tag { background: #1C2742; border-radius: 12px; padding: 4px 12px; font-size: 12px; }
.ph-tag.accent { background: #F2A65A; color: #1B2A4A; }
.ph-btn { margin: 14px 16px 0; border: 1.5px solid #E7EAF0; border-radius: 12px; padding: 10px; font-size: 13px; }
.ph-text { margin: 14px 18px 0; color: #A9B1C2; font-size: 13px; line-height: 1.55; white-space: pre-line; }
.ph-heading { text-align: left; margin: 18px 18px 8px; color: #8B95A8; letter-spacing: 2px; font-size: 11px; }
.ph-card { margin: 0 16px; background: #18223A; border-radius: 14px; text-align: left; }
.ph-fact { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #222D48; font-size: 12.5px; }
.ph-fact:last-child { border-bottom: none; }
.ph-fact-v { color: #A9B1C2; text-align: right; max-width: 55%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-place { margin: 0 16px 8px; background: #18223A; border-radius: 12px; padding: 10px 12px; text-align: left; font-size: 12.5px; }
.ph-place-name { font-weight: 600; color: #fff; }
.ph-muted { color: #A9B1C2; margin-top: 2px; }
.ph-accent { color: #F2A65A; margin-top: 4px; }
.ph-gov { background: #2E7D52; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

/* Keep the ten tabs on one line on a laptop screen. */
.tab-btn { padding: 8px 13px; }

/* The map pin (drawn in CSS, so it needs no image files). */
.pt-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--accent); border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }

/* Chart: numbers for a day or week on hover or tap */
#dash-chart { position: relative; }
.pt-chart .pt-hit { fill: transparent; cursor: pointer; }
.pt-chart .pt-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pt-tip { position: absolute; z-index: 2; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); padding: 8px 12px; font-size: 12.5px; min-width: 210px; pointer-events: none; }
.pt-tip-title { font-weight: 700; margin-bottom: 4px; }
.pt-tip-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; color: var(--muted); }
.pt-tip-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
