/**
 * @file        sg-bucket.css
 * @description Styles of the bucket module: list rows, item page, forms, goals, save action and the four scratch map statuses (L4-01 to L4-10)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         7f2c4e81-93ab-4d06-b5e1-2a8d6c0f9e37
 * @version     0.2.0.2
 * @created     2026-12-01
 * @updated     2026-12-03
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* L4-01 header and list rows: 360 px first, everything wraps, nothing scrolls sideways. */
.sg-bucket-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sg-bucket-head .sg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sg-bucket-members { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.85rem; }
.sg-bucket-add .sg-menu__body a { display: block; padding: 8px 12px; min-height: 44px; }
.sg-bucket-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; }
.sg-bucket-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-bucket-row:not(:has(.sg-bucket-row__cover)) { grid-template-columns: minmax(0, 1fr); }
.sg-bucket-row__cover { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; }
.sg-bucket-row__cover--empty { display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--ink-muted); }
.sg-bucket-row__body { min-width: 0; }
.sg-bucket-row__body h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.sg-bucket-row__body p { margin: 4px 0 0; overflow-wrap: anywhere; }
.sg-bucket-row--done h3 a { color: var(--ink-muted); }
.sg-bucket-row__done { font-size: 0.85rem; color: var(--ink-muted); }
.sg-bucket-row__done .sg-icon { width: 14px; height: 14px; vertical-align: -2px; }
.sg-bucket-prio { vertical-align: 2px; }
.sg-bucket-prio--high { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.sg-bucket-prio--low { border-style: dashed; }
.sg-bucket-money, .sg-bucket-mono, .sg-bucket-code { font-family: var(--font-mono); white-space: nowrap; }
.sg-bucket-code { font-size: 0.8em; }

/* Filters: one column at 360 px, several when there is room. */
.sg-bucket-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 12px; align-items: end; }
.sg-bucket-filters .sg-field { margin: 0; min-width: 0; }
.sg-bucket-filters select { width: 100%; }

/* L4-02 editor. */
.sg-bucket-months { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-bucket-month { min-height: 44px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.sg-bucket-pair, .sg-bucket-latlng { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 12px; }
.sg-bucket-pair .sg-field, .sg-bucket-latlng .sg-field { min-width: 0; }
.sg-bucket-pair input, .sg-bucket-latlng input { width: 100%; }
[data-bucket-place][hidden], [data-bucket-experience-hint][hidden] { display: none; }

/* L4-03 item page. */
.sg-bucket-item__cover { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.sg-bucket-state p { margin: 0 0 8px; }
.sg-bucket-minimap { margin: 16px 0; }
.sg-bucket-note { white-space: normal; overflow-wrap: anywhere; margin: 12px 0; }
.sg-bucket-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sg-bucket-delete { margin-top: 24px; }
.sg-bucket-link-step select { max-width: 100%; }
.sg-bucket-tablewrap { overflow-x: auto; max-width: 100%; }

/* L4-07 goals: the reached badge is the one orange focal point of the view. */
.sg-bucket-goals { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.sg-bucket-bar { width: 100%; height: 10px; accent-color: var(--navy); }
.sg-bucket-reached { color: var(--accent); font-weight: 600; }
.sg-bucket-picker { display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }

/* L4-08 save action on step cards. */
.sg-bucket-save { margin: 8px 0 0; }
.sg-bucket-save .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }
.sg-bucket-save--saved a { color: var(--accent); font-weight: 600; }
.sg-bucket-tab { margin: 12px 0; }
.sg-bucket-tipform textarea { width: 100%; }

/* Phase 4 mockup pass (2026-12-03): L4-01 to L4-07 follow their Stitch mockups. Mobile first, 44 px touch targets. */
.sg-bucket-head__text { min-width: 0; }
.sg-bucket-counts { font-family: var(--font-mono); }
.sg-bucket-team { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.sg-bucket-team .sg-bucket-members { margin: 0; gap: 0; }
.sg-bucket-team .sg-bucket-members li + li { margin-left: -6px; }
.sg-bucket-team p { margin: 0; font-size: 0.85rem; }
.sg-bucket-initials { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--beige); color: var(--warm-ink); border: 2px solid var(--surface); display: inline-grid; place-items: center; font-weight: 600; font-size: 0.75rem; }
.sg-bucket-toggle, .sg-bucket-states { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.sg-bucket-toggle a, .sg-bucket-states a { min-height: 44px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--ink-muted); text-decoration: none; }
.sg-bucket-toggle a + a, .sg-bucket-states a + a { border-left: 1px solid var(--border-strong); }
.sg-bucket-toggle a[aria-current], .sg-bucket-states a[aria-current] { background: var(--ink); color: var(--surface); font-weight: 600; }
.sg-bucket-toggle .sg-icon { width: 16px; height: 16px; }
.sg-bucket-filters .sg-bucket-states { grid-column: 1 / -1; justify-self: start; }
.sg-bucket-limit p { margin: 0; }
.sg-bucket-limit .sg-bucket-mono { font-size: 0.8rem; margin-top: 4px; }
.sg-bucket-empty h2 { margin: 12px 0 4px; font-size: 1.15rem; }
.sg-bucket-empty .sg-actions { justify-content: center; }
.sg-bucket-maphead { margin: 0 0 8px; font-size: 0.8rem; color: var(--ink-muted); }
.sg-bucket-row__place { font-size: 0.85rem; color: var(--ink-muted); }
.sg-bucket-row__badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.sg-bucket-row__facts { font-size: 0.85rem; }
.sg-bucket-row__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sg-bucket-row__actions form { margin: 0; }
.sg-bucket-row__actions .sg-button { min-height: 44px; }
.sg-bucket-donebadge { border-color: var(--ink-muted); }
.sg-bucket-voted { border-color: var(--ink); color: var(--ink); font-weight: 600; }
@media (min-width: 640px) {
  .sg-bucket-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .sg-bucket-row:not(:has(.sg-bucket-row__cover)) { grid-template-columns: minmax(0, 1fr) auto; }
  .sg-bucket-row__actions { grid-column: auto; flex-direction: column; align-items: flex-end; }
}

/* Shared page parts: top bar with back link and actions, section heads, form footers. */
.sg-bucket-topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.sg-bucket-topbar > a { min-height: 44px; display: inline-flex; align-items: center; }
.sg-bucket-topbar .sg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.sg-bucket-sechead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sg-bucket-sechead h2 { margin: 0; }
.sg-bucket-formfoot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sg-bucket-h1 .sg-icon { width: 24px; height: 24px; vertical-align: -3px; }
.sg-bucket-banner p { margin: 0; }
.sg-bucket-topbar .sg-button, .sg-bucket-state .sg-button, .sg-bucket-formfoot .sg-button { min-height: 44px; }
[data-bucket-paste-button][hidden], [data-bucket-resolving][hidden] { display: none; }
.sg-bucket-banner p + p { margin-top: 4px; }
.sg-bucket-banner .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }

/* L4-03 hero: badges, title, source and the state block; two columns from 900 px. */
.sg-bucket-hero { display: grid; gap: 12px; margin-bottom: 16px; }
.sg-bucket-hero h1 { margin: 6px 0; overflow-wrap: anywhere; }
.sg-bucket-source { margin: 0; font-size: 0.9rem; }
.sg-bucket-source .sg-icon { width: 14px; height: 14px; vertical-align: -2px; }
.sg-bucket-state { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-bucket-state--done { border-color: var(--ink-muted); }
.sg-bucket-state__label { margin: 0 0 4px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.sg-bucket-state .sg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 8px 0 0; }
.sg-bucket-state .sg-actions form { margin: 0; }
.sg-bucket-pill { font-weight: 600; color: var(--ink); }
.sg-bucket-pill--done { border-color: var(--ink); }
.sg-bucket-detail { display: grid; gap: 16px; }
.sg-bucket-detail__main, .sg-bucket-detail__side { min-width: 0; display: grid; gap: 16px; align-content: start; }
.sg-bucket-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.sg-bucket-facts div { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sg-bucket-facts dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.sg-bucket-facts dd { margin: 2px 0 0; }
.sg-bucket-links a { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.sg-bucket-links .sg-icon { width: 16px; height: 16px; }
.sg-bucket-minimap p { margin: 0 0 8px; font-size: 0.8rem; }
@media (min-width: 900px) {
  .sg-bucket-hero { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); align-items: end; }
  .sg-bucket-hero .sg-bucket-item__cover { grid-column: 1 / -1; }
  .sg-bucket-detail { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

/* L4-02 and L4-04 editor parts: type and priority chips, note counter beside the label, budget pair. */
.sg-bucket-picks .sg-bucket-pick { min-height: 44px; border-radius: 999px; border-color: var(--border-strong); cursor: pointer; }
.sg-bucket-pick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.sg-bucket-pick:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.sg-bucket-xp .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }
.sg-bucket-pinbox { min-width: 0; }
.sg-bucket-labelrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.sg-bucket-labelrow p { margin: 0; font-size: 0.8rem; }
.sg-bucket-budget { display: grid; grid-template-columns: minmax(72px, 0.5fr) minmax(0, 1fr); gap: 0 8px; min-width: 0; }
.sg-bucket-budget .sg-field { min-width: 0; }
.sg-bucket-budget input { width: 100%; }
.sg-bucket-card .sg-trip-map { margin-bottom: 8px; }

/* L4-05 import: file panel and column grid. */
.sg-bucket-file__icon .sg-icon { width: 32px; height: 32px; color: var(--ink-muted); }
.sg-bucket-file input[type="file"] { max-width: 100%; min-height: 44px; }
.sg-bucket-mapping summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.sg-bucket-mapgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.sg-bucket-mapgrid .sg-field { min-width: 0; }
.sg-bucket-preview .sg-table td { overflow-wrap: anywhere; }

/* L4-06 sharing: audience cards, invite row, member rows. */
.sg-bucket-audience .sg-icon { width: 16px; height: 16px; vertical-align: -3px; }
@media (min-width: 720px) { .sg-bucket-audience { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sg-bucket-switch .sg-check { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.sg-bucket-invite { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 8px; }
.sg-bucket-invite .sg-field { flex: 1 1 200px; min-width: 0; }
.sg-bucket-invite .sg-button { margin-top: 28px; }
.sg-bucket-member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; }
.sg-bucket-member__name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.sg-bucket-member .sg-link-button { min-height: 44px; }
.sg-bucket-state-invited { border-style: dashed; }
.sg-bucket-state-left, .sg-bucket-state-removed { opacity: 0.75; }

/* L4-07 goals: list and detail side by side from 900 px; the reached badge stays the orange focal point. */
.sg-bucket-goalspace { display: grid; gap: 16px; }
.sg-bucket-goalspace > section { min-width: 0; }
.sg-bucket-goal h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.sg-bucket-goal h3 a { min-height: 44px; display: inline-flex; align-items: center; }
.sg-bucket-goal--current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sg-bucket-reached .sg-icon { width: 18px; height: 18px; vertical-align: -4px; }
.sg-bucket-newgoal summary { min-height: 44px; }
.sg-bucket-pickrow { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.sg-bucket-pickrow > span { min-width: 0; overflow-wrap: anywhere; }
[data-bucket-goal-panel][hidden] { display: none; }
@media (min-width: 900px) { .sg-bucket-goalspace--detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }

/* L4-09 four statuses: lived is solid, transit only light, want to go outlined; each also differs
   from "visited" (hatched) by more than colour. */
.sg-world .sg-c--lived { fill: #6B2D19; stroke: #3F1A0E; }
.sg-world .sg-c--transit { fill: #C3C7CB; stroke: #50606D; stroke-dasharray: 2 1; }
.sg-world .sg-c--want { fill: #FFE2D1; stroke: #A83900; stroke-width: 0.8; }
.sg-swatch-mini--lived { background: #6B2D19; border-color: #3F1A0E; }
.sg-swatch-mini--transit { background: #C3C7CB; border: 1px dashed #50606D; }
.sg-swatch-mini--want { background: #FFE2D1; border-color: #A83900; }
.sg-bucket-legend-note { flex-basis: 100%; font-size: 0.8rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sg-world .sg-c--transit, :root:not([data-theme="light"]) .sg-swatch-mini--transit { fill: #5B6B78; background: #5B6B78; stroke: #AEB8C1; border-color: #AEB8C1; }
  :root:not([data-theme="light"]) .sg-world .sg-c--want, :root:not([data-theme="light"]) .sg-swatch-mini--want { fill: #4A3A31; background: #4A3A31; stroke: #FF8C5F; border-color: #FF8C5F; }
  :root:not([data-theme="light"]) .sg-world .sg-c--lived, :root:not([data-theme="light"]) .sg-swatch-mini--lived { fill: #8A4A33; background: #8A4A33; stroke: #EADDD3; border-color: #EADDD3; }
}
:root[data-theme="dark"] .sg-world .sg-c--transit, :root[data-theme="dark"] .sg-swatch-mini--transit { fill: #5B6B78; background: #5B6B78; stroke: #AEB8C1; border-color: #AEB8C1; }
:root[data-theme="dark"] .sg-world .sg-c--want, :root[data-theme="dark"] .sg-swatch-mini--want { fill: #4A3A31; background: #4A3A31; stroke: #FF8C5F; border-color: #FF8C5F; }
:root[data-theme="dark"] .sg-world .sg-c--lived, :root[data-theme="dark"] .sg-swatch-mini--lived { fill: #8A4A33; background: #8A4A33; stroke: #EADDD3; border-color: #EADDD3; }
.sg-bucket-status { margin: 12px 0; }
