/* Gamma (the owner, 2026-10-25: "create this as a Gamma version ... the user can enable Beta or Gamma").
 *
 * The beta with the suggestions for easier screens (docs/design/ui-suggestions.html): the menu grouped by job, the
 * tasks first, the map first, status in words with a sign, one main button, steps for each well, lists as cards,
 * empty pages that lead on, field messages, the page's own questions, larger targets, pictures beside words, the
 * dashboards' four numbers, one search box, help where you are. Everything here applies only under
 * :root[data-gamma="1"], which is set only with the new look on (app.js applyLook): today's look and the beta are
 * untouched. Colours come from the beta's tokens (beta.css), so the themes, the palettes and the outdoor look hold.
 */

/* ── larger text, more space, bigger targets (suggestion 9) ───────────────────────────────────────────────────── */
:root[data-gamma="1"] { --base: 16px; --gamma-target: 40px; }
:root[data-gamma="1"][data-text="large"] { --base: 18px; }
:root[data-gamma="1"][data-theme="outdoor"] { --base: 18px; --gamma-target: 46px; }
:root[data-gamma="1"] body { line-height: 1.6; }
:root[data-gamma="1"] .main { gap: 20px; }
:root[data-gamma="1"] button.primary, :root[data-gamma="1"] button.chip, :root[data-gamma="1"] button.danger,
:root[data-gamma="1"] .main input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
:root[data-gamma="1"] .main select { min-height: var(--gamma-target); }
:root[data-gamma="1"] button.primary { font-weight: 650; padding: 9px 18px; }
:root[data-gamma="1"] .main input[type=checkbox], :root[data-gamma="1"] .main input[type=radio] { width: 20px; height: 20px; }

/* ── the menu grouped by job, at the side (suggestion 1, Direction B) ─────────────────────────────────────────── */
:root[data-gamma="1"] .tabs .nav-group {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 14px 12px 4px; white-space: nowrap;
}
:root[data-gamma="1"] .tabs .nav-group:first-child { padding-top: 4px; }
:root[data-gamma="1"][lang="ar"] .tabs .nav-group, :root[data-gamma="1"][dir="rtl"] .tabs .nav-group {
  letter-spacing: 0; text-transform: none; font-size: 12px;
}
:root[data-gamma="1"][data-nav-collapsed="1"] .tabs .nav-group { font-size: 0; padding: 6px 0 2px; border-top: 1px solid var(--line); }
:root[data-gamma="1"][data-nav-collapsed="1"] .tabs .nav-group:first-child { border-top: 0; }
@media (max-width: 760px) {
  /* on a phone the beta's menu is a row that scrolls: the headings would only push the tabs away */
  :root[data-gamma="1"] .tabs .nav-group { display: none; }
}

/* ── your tasks first (Direction B) ───────────────────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .gamma-tasks h2 { font-size: 1.45em; margin-bottom: 14px; }
:root[data-gamma="1"] .task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
:root[data-gamma="1"] .task {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface);
}
:root[data-gamma="1"] .task-number {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent); color: var(--accent-ink, #fff);
}
:root[data-gamma="1"] .task-words strong { display: block; font-size: 1.05em; }
:root[data-gamma="1"] .task-words p { margin: 2px 0 0; }
@media (max-width: 600px) {
  :root[data-gamma="1"] .task { grid-template-columns: 30px minmax(0, 1fr); }
  :root[data-gamma="1"] .task > button { grid-column: 1 / -1; justify-self: stretch; }
}

/* ── a status you can read without colour: a sign beside the word (suggestion 2) ──────────────────────────────── */
:root[data-gamma="1"] .badge.status-accepted::before, :root[data-gamma="1"] .badge.pkg-sealed::before,
:root[data-gamma="1"] .survey-chip.survey-reviewed::before { content: "✓\00a0"; }
:root[data-gamma="1"] .survey-chip.survey-approved::before { content: "✓✓\00a0"; }
:root[data-gamma="1"] .badge.status-partial::before { content: "!\00a0"; }
:root[data-gamma="1"] .badge.status-checking::before, :root[data-gamma="1"] .badge.status-quarantined::before,
:root[data-gamma="1"] .badge.pkg-in_review::before, :root[data-gamma="1"] .survey-chip.survey-in_progress::before { content: "◔\00a0"; }
:root[data-gamma="1"] .badge.status-rejected::before { content: "✕\00a0"; }
:root[data-gamma="1"] .survey-chip.survey-pending::before { content: "○\00a0"; }
:root[data-gamma="1"] .survey-chip.survey-submitted::before { content: "↑\00a0"; }
/* the five statuses in five hues, not five blues: told apart on the map, the bar and the chips alike (the panel) */
:root[data-gamma="1"] .survey-pending { background: #dfe4e9; color: #2b3a47; }
:root[data-gamma="1"] .survey-in_progress { background: #9cc8f2; color: #0d2a47; }
:root[data-gamma="1"] .survey-submitted { background: #4fc1bb; color: #052b29; }
:root[data-gamma="1"] .survey-reviewed { background: #f2b94f; color: #3a2405; }
:root[data-gamma="1"] .survey-approved { background: #237a4b; color: #ffffff; }
:root[data-gamma="1"] .survey-chip { font-weight: 600; padding: 2px 10px; }

/* ── one main button per page: the other buttons quieter (suggestion 3) ───────────────────────────────────────── */
/* a plain button beside others (not a choice that stays pressed, not a colour swatch) reads as a link: the filled one
   is the page's next step */
:root[data-gamma="1"] .main .row:has(> button.primary, > button.danger) > button.chip:not([aria-pressed]):not([role="tab"]):not(.swatch-choice) {
  background: transparent; border-color: transparent; color: var(--accent); font-weight: 600; padding-inline: 8px;
}
:root[data-gamma="1"] .main .row:has(> button.primary, > button.danger) > button.chip:not([aria-pressed]):not([role="tab"]):not(.swatch-choice):hover {
  background: var(--accent-soft);
}
:root[data-gamma="1"] .main .row:has(> button.primary, > button.danger) > button.chip:disabled { color: var(--muted); background: transparent; }

/* ── each well's way as steps (suggestion 4) ──────────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .well-steps-wrap { margin: 6px 0 12px; }
:root[data-gamma="1"] .well-steps { list-style: none; margin: 0; padding: 0; display: flex; }
:root[data-gamma="1"] .well-steps li {
  flex: 1; display: grid; justify-items: center; gap: 4px; position: relative; color: var(--muted); font-size: .9em;
  text-align: center; min-width: 0;
}
:root[data-gamma="1"] .well-steps li::before {
  content: ""; position: absolute; top: 14px; inset-inline-end: 50%; width: 100%; height: 3px; background: var(--line);
}
:root[data-gamma="1"] .well-steps li:first-child::before { display: none; }
:root[data-gamma="1"] .well-steps li.done::before, :root[data-gamma="1"] .well-steps li.now::before { background: var(--accent); }
:root[data-gamma="1"] .well-steps .step-dot {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; background: var(--surface); border: 3px solid var(--line); color: var(--muted);
}
:root[data-gamma="1"] .well-steps li.done .step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
:root[data-gamma="1"] .well-steps li.now .step-dot { border-color: var(--accent); color: var(--accent); }
:root[data-gamma="1"] .well-steps li.now { color: var(--ink); font-weight: 650; }
:root[data-gamma="1"] .well-steps-wrap > p { text-align: center; margin: 8px 0 0; }

/* ── lists that show what matters: a card a row at every width (suggestion 5) ─────────────────────────────────── */
:root[data-gamma="1"] .table-flip { margin: 0 0 6px; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards { overflow: visible; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards table { display: block; width: 100%; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead { display: none; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards tbody {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards tr {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; background: var(--surface); box-shadow: var(--shadow);
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards tr.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td {
  display: inline; padding: 0; border: 0; white-space: normal; min-height: 0;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td::before {
  content: attr(data-label) "\00a0"; color: var(--muted); font-size: .82em;
  position: static; width: auto; display: inline;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td { position: static; padding-inline-start: 0; }
/* the row's name the title wherever its cell is (Review's well, after the time it was raised) */
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td.card-title { order: -1; flex-basis: 100%; font-size: 1.1em; font-weight: 650; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td.card-title::before { content: none; }
/* one plain status a well: the survey's on the card, the stage and an active well's status left to its page */
@media screen {
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards td.cell-stage,
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards td.cell-status.status-is-active { display: none; }
}
/* Review's cards: what failed and what to do read best a line each */
:root[data-gamma="1"] .table-wrap.review-list.gamma-cards td { flex-basis: 100%; }
@media (max-width: 600px) {
  /* on a phone a pair a line: side by side they ran into each other (the panel's round 2) */
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards td { flex-basis: 100%; }
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td:empty { display: none; }
/* the first cell, the row's name, is the card's title, on a line of its own */
:root[data-gamma="1"] .table-wrap.cards.gamma-cards tr:not(:has(.card-title)) td:first-child {
  flex-basis: 100%; font-size: 1.1em; font-weight: 650;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards tr:not(:has(.card-title)) td:first-child::before { content: none; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td[data-label=""] { padding-inline-start: 0; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td[data-label=""]::before { content: none; }
/* a list whose first cell is a box to tick: the box beside the title */
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td:first-child:has(input[type=checkbox]) { flex-basis: auto; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td:first-child:has(input[type=checkbox]) + td {
  flex-basis: calc(100% - 40px); font-size: 1.1em; font-weight: 650;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards td:first-child:has(input[type=checkbox]) + td::before { content: none; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) { display: block; margin-bottom: 8px; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) tr {
  display: block; border: 0; padding: 0; margin: 0; background: none; box-shadow: none;
}
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th:not(:has(input)) { display: none; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th { display: flex; gap: 8px; align-items: center; border: 0; padding: 0; }
:root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th::after { content: attr(data-words); font-weight: normal; font-size: 13px; }
@media print {
  /* on paper the list is a table again: rows compared across, as the sheet expects */
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards table { display: table; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead { display: table-header-group; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards tbody { display: table-row-group; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards tr { display: table-row; box-shadow: none; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards td { display: table-cell; padding-inline-start: 6px; font-size: inherit; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards td::before { content: none; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) { display: table-header-group; margin: 0; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) tr { display: table-row; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th,
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th:not(:has(input)) { display: table-cell; }
  :root[data-gamma="1"] .table-wrap.cards.gamma-cards thead:has(input) th::after { content: none; }
}

/* ── empty pages that say what to do (suggestion 6) ───────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .gamma-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 16px; }
:root[data-gamma="1"] .gamma-empty .tab-icon { width: 34px; height: 34px; color: var(--muted); }
:root[data-gamma="1"] .gamma-empty strong { font-size: 1.1em; }
:root[data-gamma="1"] .gamma-empty p { margin: 0; max-width: 46ch; }

/* ── forms that help as you type (suggestion 7) ───────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .field-note { display: block; margin-top: 3px; font-weight: 600; color: var(--danger) !important; }
:root[data-gamma="1"] .row > .field-note { flex-basis: 100%; order: 99; margin-top: 0; }
:root[data-gamma="1"] [aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 2px var(--st-blocked-soft); }

/* ── the page's own question before anything hard to undo (suggestion 8) ──────────────────────────────────────── */
.ask-dialog {
  border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.ask-dialog::backdrop { background: rgba(15, 22, 28, .45); }
.ask-dialog .ask-text { margin: 0 0 18px; font-size: 1.05em; white-space: pre-line; overflow-wrap: anywhere; }
.ask-dialog .row { gap: 10px; flex-wrap: wrap; }

/* ── pictures beside the words (suggestion 10) ────────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .print-button .tab-icon { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 6px; }

/* ── the dashboards: four numbers first (suggestion 11) ───────────────────────────────────────────────────────── */
:root[data-gamma="1"] .kpis > .kpi:nth-child(-n+4) .kpi-value { font-size: 1.75em; }
:root[data-gamma="1"] .kpis > .kpi:nth-child(-n+4) { padding: 14px 16px; }
:root[data-gamma="1"] .kpis > .kpi:nth-child(n+5) { background: transparent; }

/* ── one search box (suggestion 13) ───────────────────────────────────────────────────────────────────────────── */
.search-results {
  position: fixed; z-index: 1000; max-width: calc(100vw - 16px);
  max-height: 60vh; overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 6px;
}
.search-results .search-group {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 2px;
}
[dir="rtl"] .search-results .search-group { letter-spacing: 0; text-transform: none; font-size: 12px; }
.search-results .search-item {
  display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: start; border: 0; background: none;
  padding: 8px; border-radius: 6px; color: inherit; font: inherit; cursor: pointer;
}
.search-results .search-item:hover, .search-results .search-item:focus-visible { background: var(--accent-soft); }
.search-results > p { margin: 8px; }
/* the box says what it finds (wells, teams, deliveries): room for its words on a wide screen */
@media (min-width: 900px) { :root[data-gamma="1"] #search { width: 300px; } }

/* ── help where you are (suggestion 14) ───────────────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .hint-wrap { position: relative; display: inline-flex; align-items: center; }
:root[data-gamma="1"] .hint {
  border: 0; background: none; padding: 2px; color: var(--accent); cursor: pointer; display: inline-grid; place-items: center;
  min-height: 0 !important;
}
:root[data-gamma="1"] .hint .tab-icon { width: 18px; height: 18px; }
:root[data-gamma="1"] .hint-note {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 20; width: min(340px, 78vw);
  background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: .92em; font-weight: normal; line-height: 1.5; box-shadow: var(--shadow);
}
@media print { :root[data-gamma="1"] .hint-wrap { display: none; } }

/* ── the map first (Direction C) ──────────────────────────────────────────────────────────────────────────────── */
:root[data-gamma="1"] .map-first .map-stage { position: relative; }
:root[data-gamma="1"] .main:has(> .map-first) { padding: 12px 16px; }
:root[data-gamma="1"] .card.map-first { padding: 12px; }
:root[data-gamma="1"] .map-first .map-tab { height: calc(100vh - 170px); min-height: 420px; border-radius: var(--radius); }
:root[data-gamma="1"] .map-first .map-statuses, :root[data-gamma="1"] .map-first .map-wells {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2px;
}
:root[data-gamma="1"] .map-first .map-status {
  display: flex; align-items: center; width: 100%; gap: 8px; border: 0; background: none; color: inherit; font: inherit;
  padding: 6px 4px; border-radius: 6px; cursor: pointer; min-height: 36px;
}
:root[data-gamma="1"] .map-first .map-status:hover:not(:disabled) { background: var(--accent-soft); }
:root[data-gamma="1"] .map-first .map-status:disabled { cursor: default; opacity: .55; }
:root[data-gamma="1"] .map-first .map-wells { max-height: 46vh; overflow-y: auto; }
:root[data-gamma="1"] .map-first .map-wells li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0;
  border-bottom: 1px solid var(--line); }
:root[data-gamma="1"] .map-first .map-float {
  /* on the map's left in either language: the map is drawn left to right, its zoom at the left, its layers at the right */
  position: absolute; z-index: 500; top: 12px; left: 56px; width: min(280px, calc(100% - 120px));
  max-height: calc(100% - 24px); overflow-y: auto; display: grid; gap: 8px; background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
:root[data-gamma="1"] .map-first .map-float .legend { display: grid; gap: 4px; margin: 0; }
:root[data-gamma="1"] .map-first .map-float > button { justify-self: start; }
@media (max-width: 600px) {
  :root[data-gamma="1"] .map-first .map-tab { height: 60vh; min-height: 320px; }
  /* on a phone the panel sits under the map, not over it */
  :root[data-gamma="1"] .map-first .map-float { position: static; width: auto; max-height: none; margin-top: 10px; box-shadow: none;
    border: 1px solid var(--line); }
}
