/* Navigation toolkit — matte neumorphism, dark/light themes, smooth motion */

:root {
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --transition-slow: 0.5s cubic-bezier(0.33, 0.01, 0.22, 1);
  --transition-medium: 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  /* Смена темы: растворение старой / появление новой */
  --theme-dissolve-duration: 2s;
  /* Медленный старт, ускорение к концу (ease-in) */
  --theme-dissolve-ease: cubic-bezier(0.45, 0.06, 0.82, 1);
  --font-sans: system-ui, -apple-system, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --ink-blue: #0b4a8a;
}

/* ——— Dark theme (default) ——— */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-page-a: #121418;
  --bg-page-b: #1a1d24;
  --bg-page-c: #0e1014;

  --surface: #1e2229;
  --surface-raised: #252a33;
  --surface-inset: #171a20;

  --text-main: #e9ecf1;
  --text-soft: #8f97a8;
  --border-glow: rgba(0, 163, 255, 0.22);

  --accent: #00a3ff;
  --accent-mid: #0088d4;
  --accent-deep: #0066a3;
  --accent-glow: rgba(0, 163, 255, 0.45);

  /* Neon track — same colour as ship trail on the map */
  --neon-track: #00e5ff;

  /* Muted neon for icon actions (NOW / Compute) */
  --neon-soft: rgba(0, 150, 195, 0.22);
  --neon-soft-mid: rgba(0, 175, 215, 0.38);
  --neon-soft-glow: rgba(0, 185, 225, 0.28);
  --neon-border: rgba(0, 165, 210, 0.4);

  --shadow-light: rgba(255, 255, 255, 0.06);
  --shadow-dark: rgba(0, 0, 0, 0.55);

  --inset-a: rgba(0, 0, 0, 0.45);
  --inset-b: rgba(255, 255, 255, 0.04);

  --outset-top: rgba(255, 255, 255, 0.08);
  --outset-bot: rgba(0, 0, 0, 0.5);

  --status-green-a: #22c55e;
  --status-green-b: #15803d;

  --journal-group-bg: rgba(0, 163, 255, 0.065);
  --journal-group-border: rgba(0, 163, 255, 0.16);
  --journal-group-inset: rgba(0, 0, 0, 0.2);
}

/* ——— Light theme ——— */
[data-theme="light"] {
  color-scheme: light;

  --bg-page-a: #e8edf5;
  --bg-page-b: #f2f5fa;
  --bg-page-c: #dce3ee;

  --surface: #eef2f8;
  --surface-raised: #f7f9fc;
  --surface-inset: #e2e8f0;

  --text-main: #1c2430;
  --text-soft: #64748b;
  --border-glow: rgba(37, 99, 235, 0.2);

  --accent: #2563eb;
  --accent-mid: #1d4ed8;
  --accent-deep: #1e40af;
  --accent-glow: rgba(37, 99, 235, 0.35);

  --neon-track: #19b5fe;

  --neon-soft: rgba(37, 99, 235, 0.12);
  --neon-soft-mid: rgba(37, 99, 235, 0.22);
  --neon-soft-glow: rgba(37, 99, 235, 0.14);
  --neon-border: rgba(37, 99, 235, 0.28);

  --shadow-light: rgba(255, 255, 255, 0.95);
  --shadow-dark: rgba(163, 177, 198, 0.55);

  --inset-a: rgba(163, 177, 198, 0.45);
  --inset-b: rgba(255, 255, 255, 0.85);

  --outset-top: rgba(255, 255, 255, 0.98);
  --outset-bot: rgba(163, 177, 198, 0.65);

  --status-green-a: #16a34a;
  --status-green-b: #15803d;

  --journal-group-bg: rgba(37, 99, 235, 0.07);
  --journal-group-border: rgba(37, 99, 235, 0.18);
  --journal-group-inset: rgba(255, 255, 255, 0.35);
}

/* View Transitions: кроссфейд снимков страницы (старая тема «тает», новая проявляется) */
::view-transition-group(root) {
  animation-duration: var(--theme-dissolve-duration);
  animation-timing-function: var(--theme-dissolve-ease);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--theme-dissolve-duration);
  animation-timing-function: var(--theme-dissolve-ease);
}

/*
 * Без View Transitions: одна длительность/кривая на весь документ при смене темы.
 * transition-property: all — чтобы участвовали фон, тени, границы, поля, кнопки, SVG и т.д.
 * Базовый фон body — сплошной (интерполируется); градиенты на body::before.
 */
html.theme-dissolve,
html.theme-dissolve *,
html.theme-dissolve *::before,
html.theme-dissolve *::after {
  transition-property: all;
  transition-duration: var(--theme-dissolve-duration);
  transition-timing-function: var(--theme-dissolve-ease);
}

html {
  transition: background-color var(--transition-slow);
}

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
}

body {
  position: relative;
  color: var(--text-main);
  background-color: var(--bg-page-a);
  transition: color var(--transition-slow), background-color var(--transition-slow);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.88;
  background:
    radial-gradient(ellipse 120% 80% at 10% 0%, var(--bg-page-b) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 100% 20%, var(--surface) 0%, transparent 45%),
    linear-gradient(165deg, var(--bg-page-a) 0%, var(--bg-page-c) 100%);
}

/* ========================= HEADER ========================= */

/* Theme switch: горизонтальный (резерв) и вертикальный «день/ночь» */
.theme-switch {
  --dock-scale: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: linear-gradient(145deg, var(--surface), var(--surface-inset));
  box-shadow:
    inset 2px 2px 6px var(--inset-a),
    inset -2px -2px 6px var(--inset-b),
    -2px -2px 6px var(--outset-top),
    3px 4px 10px var(--outset-bot);
  color: var(--text-soft);
  transition:
    box-shadow var(--transition-medium),
    transform var(--transition-medium),
    color var(--transition-slow);
  transform: scale(var(--dock-scale));
}

.theme-switch:hover {
  color: var(--text-main);
  box-shadow:
    inset 1px 1px 4px var(--inset-a),
    inset -1px -1px 4px var(--inset-b),
    -3px -3px 10px var(--outset-top),
    5px 6px 14px var(--outset-bot);
}

.theme-switch:active {
  transform: scale(calc(var(--dock-scale) * 0.98));
}

.theme-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-switch-track {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--surface-inset);
  box-shadow:
    inset 3px 3px 8px var(--inset-a),
    inset -2px -2px 6px var(--inset-b);
  flex-shrink: 0;
}

.theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow:
    -2px -2px 6px var(--outset-top),
    3px 3px 8px var(--outset-bot);
  transition:
    transform var(--transition-slow),
    box-shadow var(--transition-medium),
    background var(--transition-slow);
}

[data-theme="dark"] .theme-switch:not(.theme-switch--vertical) .theme-switch-knob {
  transform: translateX(22px);
}

/* Вертикальный переключатель: капсула, небо с облаками / ночь со звёздами */
.theme-switch.theme-switch--vertical {
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: inherit;
  box-shadow: none;
  transform: scale(var(--dock-scale));
}

.theme-switch.theme-switch--vertical:hover {
  color: inherit;
  filter: brightness(1.06);
  box-shadow: none;
  transform: scale(var(--dock-scale));
}

.theme-switch.theme-switch--vertical:active {
  transform: scale(calc(var(--dock-scale) * 0.97));
}

.theme-switch--vertical .theme-switch-track {
  --sw-track-h: 92px;
  --sw-track-w: 42px;
  --sw-knob: 30px;
  --sw-inset: 5px;

  width: var(--sw-track-w);
  height: var(--sw-track-h);
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #141824;
  /* Неоморф: дорожка «утоплена» — тёмные inset сверху-слева, светлый кант снизу-справа внутри */
  box-shadow:
    inset 5px 6px 14px rgba(0, 0, 0, 0.58),
    inset 8px 10px 22px rgba(0, 0, 0, 0.35),
    inset -4px -5px 12px rgba(255, 255, 255, 0.12),
    inset -1px -1px 0 rgba(255, 255, 255, 0.06),
    5px 8px 18px rgba(0, 0, 0, 0.32),
    -4px -5px 14px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .theme-switch--vertical .theme-switch-track {
  box-shadow:
    inset 5px 6px 14px rgba(0, 0, 0, 0.45),
    inset 7px 9px 18px rgba(0, 0, 0, 0.22),
    inset -4px -5px 12px rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(255, 255, 255, 0.12),
    6px 9px 16px rgba(15, 23, 42, 0.18),
    -4px -6px 14px rgba(255, 255, 255, 0.65);
}

/* В строке с AUTO/MANUAL: высота дорожки = высоте блока переключателя */
.theme-switch.theme-switch--mode-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-height: 0;
}

.theme-switch--mode-card .theme-switch-track {
  flex: 1 1 auto;
  min-height: 78px;
  height: 100%;
  width: var(--sw-track-w);
}

/* Вертикальное небо (верх) — слои облаков; низ уходит в сумерки (под звёздами) */
.theme-switch--vertical .theme-switch-track::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 85% at 18% 6%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(ellipse 95% 70% at 78% 10%, rgba(248, 252, 255, 0.96) 0%, transparent 54%),
    radial-gradient(ellipse 120% 80% at 48% 20%, rgba(230, 242, 255, 0.92) 0%, transparent 58%),
    radial-gradient(ellipse 90% 65% at 8% 28%, rgba(255, 255, 255, 0.88) 0%, transparent 50%),
    radial-gradient(ellipse 100% 72% at 88% 30%, rgba(220, 235, 248, 0.85) 0%, transparent 52%),
    radial-gradient(ellipse 130% 90% at 50% -5%, rgba(255, 255, 255, 0.45) 0%, transparent 48%),
    linear-gradient(
      180deg,
      #a8dcff 0%,
      #7ecbf5 14%,
      #5ab3e8 28%,
      #4a94c8 40%,
      #355a78 48%,
      #1e2a3e 54%,
      #141a2c 68%,
      #0a0d16 100%
    );
}

/* Ночное небо снизу: «кольца» от зоны луны, звёзды */
.theme-switch--vertical .theme-switch-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 0 0 999px 999px;
  opacity: 1;
  background:
    radial-gradient(ellipse 140% 120% at 50% 118%, rgba(8, 12, 22, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 100% 95% at 62% 108%, rgba(25, 35, 55, 0.45) 0%, transparent 52%),
    radial-gradient(ellipse 72% 80% at 28% 102%, rgba(35, 48, 78, 0.32) 0%, transparent 48%),
    radial-gradient(circle at 50% 112%, rgba(20, 28, 48, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 22% 18%, #fff 0 1px, transparent 1.6px),
    radial-gradient(circle at 48% 10%, rgba(255, 255, 255, 0.95) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 72% 32%, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.9) 0 0.85px, transparent 1.2px),
    radial-gradient(circle at 12% 42%, #fff 0 0.75px, transparent 1.1px),
    radial-gradient(circle at 58% 48%, rgba(255, 255, 255, 0.88) 0 1px, transparent 1.35px),
    radial-gradient(circle at 82% 62%, #fff 0 0.95px, transparent 1.3px),
    radial-gradient(circle at 34% 72%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle at 92% 52%, #fff 0 0.7px, transparent 1px);
  background-repeat: no-repeat;
}

.theme-switch--vertical .theme-switch-knob {
  z-index: 1;
  top: var(--sw-inset);
  left: 50%;
  width: var(--sw-knob);
  height: var(--sw-knob);
  margin-left: calc(var(--sw-knob) / -2);
  border-radius: 50%;
  background: transparent;
  /* Бегунок приподнят над «ложем» дорожки — свет сверху-слева */
  box-shadow:
    4px 7px 14px rgba(0, 0, 0, 0.48),
    3px 4px 6px rgba(0, 0, 0, 0.28),
    -3px -4px 10px rgba(255, 255, 255, 0.22),
    -1px -1px 3px rgba(255, 255, 255, 0.12);
  transform: translateY(0);
  transition:
    transform var(--transition-slow),
    top var(--transition-slow),
    box-shadow var(--transition-medium);
}

[data-theme="dark"] .theme-switch--vertical:not(.theme-switch--mode-card) .theme-switch-knob {
  transform: translateY(calc(var(--sw-track-h) - var(--sw-knob) - 2 * var(--sw-inset)));
}

.theme-switch--vertical.theme-switch--mode-card .theme-switch-knob {
  transform: none;
  transition:
    top var(--transition-slow),
    box-shadow var(--transition-medium);
}

[data-theme="dark"] .theme-switch--vertical.theme-switch--mode-card .theme-switch-knob {
  top: calc(100% - var(--sw-knob) - var(--sw-inset));
}

.theme-switch-knob-sun,
.theme-switch-knob-moon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity var(--transition-slow);
}

.theme-switch-knob-sun {
  opacity: 1;
  background:
    radial-gradient(circle at 30% 28%, #ffffff 0%, transparent 38%),
    radial-gradient(circle at 35% 32%, rgba(255, 248, 220, 0.95) 0%, transparent 45%),
    radial-gradient(circle at 50% 52%, #ffdf4a 0%, #ffcc22 35%, #f0a010 72%, #c97800 100%);
  box-shadow:
    inset 4px 4px 8px rgba(255, 240, 190, 0.85),
    inset -4px -6px 12px rgba(160, 85, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.theme-switch-knob-moon {
  opacity: 0;
  background:
    radial-gradient(circle at 27% 31%, rgba(72, 74, 86, 0.65) 0 15%, transparent 16%),
    radial-gradient(circle at 63% 56%, rgba(68, 70, 82, 0.58) 0 13%, transparent 14%),
    radial-gradient(circle at 54% 27%, rgba(90, 92, 102, 0.45) 0 10%, transparent 11%),
    radial-gradient(circle at 44% 68%, rgba(80, 82, 94, 0.35) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #e2e4ea 0%, #c2c6d0 42%, #9a9eab 100%);
  box-shadow:
    inset 3px 3px 6px rgba(255, 255, 255, 0.75),
    inset -4px -5px 10px rgba(45, 48, 58, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .theme-switch-knob-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-switch-knob-moon {
  opacity: 1;
}

[data-theme="light"] .theme-switch--vertical .theme-switch-knob {
  box-shadow:
    4px 7px 12px rgba(15, 23, 42, 0.28),
    3px 4px 5px rgba(15, 23, 42, 0.15),
    -3px -4px 10px rgba(255, 255, 255, 0.85),
    -1px -1px 2px rgba(255, 255, 255, 0.5);
}

/* ========================= SHELL ========================= */

.shell {
  width: min(1340px, 100% - 32px);
  margin: 12px auto 16px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(176px, 198px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========================= CARDS ========================= */

.mode-card,
.panel-main,
.table-card,
.dev-card {
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  border-radius: var(--radius-lg);
  border: 1px solid var(--shadow-light);
  box-shadow:
    -8px -8px 18px var(--outset-top),
    10px 12px 24px var(--outset-bot);
  transition:
    box-shadow var(--transition-medium),
    background var(--transition-slow);
}

.mode-card {
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  align-self: stretch;
}

.panel-main {
  padding: 10px 14px 12px;
  align-self: stretch;
  min-height: 0;
}

.panel-main-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.panel-main-inner .mode-container {
  flex: 1 1 auto;
  min-width: 0;
}

/* Панель расчёта: один ряд, 7 равных колонок (AUTO: две последние — пустые ячейки) */
.panel-main .inputs-grid--main {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 12px;
  width: 100%;
}

.panel-main .inputs-grid--main > .field {
  width: 100%;
  min-width: 0;
  /* Без stretch колонка grid равная, но сами input визуально уже контента (align-items: center у .field). */
  align-items: stretch;
}

/* Нативные date/time часто не растягиваются от одного width:100% у .field-input. */
.panel-main .inputs-grid--main input.field-input[type="date"],
.panel-main .inputs-grid--main input.field-input[type="time"],
.panel-main .inputs-grid--main input.field-input[type="number"],
.panel-main .inputs-grid--main input.field-input[type="text"] {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.panel-main .field--compact.field--date {
  max-width: none;
}

.panel-main .field--time-col {
  max-width: none;
}

/* Время: input на всю ширину колонки (как дата); кнопка «сейчас» внутри правого края, не съедает ширину. */
.panel-main .field-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.panel-main .field-inline .field-input {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}

.panel-main .field-inline .field-input--time {
  padding-right: 50px;
}

.panel-main .field-inline .btn-icon-neon {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  margin-right: 5px;
  z-index: 1;
  flex-shrink: 0;
}

.panel-main .field-input--short {
  max-width: none;
}

.panel-main .panel-input-spacer {
  visibility: hidden;
  pointer-events: none;
  width: 100%;
  min-height: 1px;
}

.panel-main .field-input--compact {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
}

.panel-main .btn-icon-neon {
  width: 42px;
  height: 42px;
}

.panel-main .btn-icon-neon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1100px) {
  .panel-main .inputs-grid--main {
    column-gap: 6px;
  }
}

@media (max-width: 640px) {
  .panel-main .inputs-grid--main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.journal-actions-r2--panel {
  margin-top: 0;
}

@media (max-width: 900px) {
  .panel-main-inner {
    flex-direction: column;
  }
}

.table-card {
  margin-top: 12px;
  padding: 10px 12px 12px;
}

.dev-card {
  padding: 22px;
  margin: 0;
}

.panel-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.panel-header-line {
  margin-bottom: 8px;
}

.panel-heading {
  margin: 4px 0 6px;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* ========================= MODE TOGGLE ========================= */

.mode-card-header {
  margin-bottom: 8px;
  text-align: center;
  flex-shrink: 0;
}

.mode-card-controls {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.mode-card-toggle-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  justify-content: center;
}

.mode-card-controls .mode-toggle {
  margin: 0;
}

.mode-toggle {
  margin: 4px 0 8px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 8px;
}

.mode-toggle-text {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.15;
  max-width: 92%;
  user-select: none;
  transition: color var(--transition-medium);
}

.mode-toggle-text--active {
  color: var(--accent);
  font-weight: 700;
}

.mode-toggle-circle {
  --dock-scale: 1;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface-inset));
  box-shadow:
    -6px -6px 14px var(--outset-top),
    8px 10px 18px var(--outset-bot);
  border: 2px solid transparent;
  transition:
    box-shadow var(--transition-slow),
    transform var(--transition-medium),
    border-color var(--transition-medium),
    background var(--transition-slow);
  transform: scale(var(--dock-scale));
}

.mode-toggle--auto .mode-toggle-circle--auto,
.mode-toggle--manual .mode-toggle-circle--manual,
.mode-toggle--sched .mode-toggle-circle--sched {
  border-color: var(--border-glow);
  box-shadow:
    -4px -4px 12px var(--outset-top),
    6px 8px 16px var(--outset-bot),
    0 0 28px var(--accent-glow),
    0 0 0 1px var(--accent);
}

.mode-toggle-circle:hover {
  transform: translateY(-2px) scale(var(--dock-scale));
  box-shadow:
    -6px -6px 14px var(--outset-top),
    10px 12px 22px var(--outset-bot),
    0 0 20px var(--accent-glow);
}

/* ========================= FORMS ========================= */

.mode-form.is-hidden {
  display: none;
}

.mode-title {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-wrap: balance;
}

.inputs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}

/* One row: Date | Time+clock | Lat+Lon+Gyro (Calculate — только внизу журнала) */
.inputs-grid--main {
  grid-template-columns:
    minmax(0, 132px)
    minmax(0, 168px)
    minmax(0, 1fr);
  align-items: end;
  column-gap: 10px;
  row-gap: 10px;
}

.inputs-grid--main .field--date {
  min-width: 0;
}

.field--compact.field--date {
  max-width: 132px;
}

.field--time-col {
  max-width: 168px;
}

.field-coord-pair {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.field-coord-pair--with-gyro {
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field-coord-pair--with-gyro .field--coord {
  max-width: 102px;
  min-width: 0;
  flex: 1 1 auto;
}

.field-coord-pair--with-gyro .field--gyro-tight {
  max-width: 90px;
  flex: 0 0 auto;
}

#manual-form .field--manual-bearing .field-label {
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  .inputs-grid--main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-coord-pair--with-gyro {
    grid-column: 1 / -1;
  }

  .field-coord-pair--with-gyro .field--coord {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .inputs-grid--main {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-coord-pair {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Landscape phone: все поля и кнопки в одну строку */
@media (orientation: landscape) and (max-width: 932px) {
  .panel-main .inputs-grid--main {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 4px;
  }

  .panel-main .field-input--compact {
    min-height: 32px;
    font-size: 10px;
    padding: 0 6px;
  }

  .panel-main .field-inline .field-input--time {
    padding-right: 32px;
  }

  .panel-main .btn-icon-neon {
    width: 28px;
    height: 28px;
    margin-right: 2px;
  }

  .panel-main .btn-icon-neon svg {
    width: 12px;
    height: 12px;
  }

  .journal-actions-r2 {
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .journal-actions-r2 .btn-neon,
  .journal-actions-r2.journal-actions-r2--panel .btn-neon {
    flex: 1 1 0;
    min-width: 0;
    min-height: 28px;
    height: 28px;
    font-size: 7px;
    padding: 0 4px;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 1100px) {
  .inputs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .inputs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  min-width: 0;
  align-items: center;
}

.field-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 500;
  text-align: center;
  width: 100%;
}

/* Inset inputs — “pressed into” surface */
.field-input,
select.field-input {
  width: 100%;
  min-height: 38px;
  border-radius: var(--radius-pill);
  border: none;
  padding: 0 14px;
  font-size: 12px;
  color: var(--text-main);
  font-family: var(--font-mono);
  text-align: center;
  background: var(--surface-inset);
  box-shadow:
    inset 4px 4px 10px var(--inset-a),
    inset -3px -3px 8px var(--inset-b);
  outline: none;
  transition:
    box-shadow var(--transition-medium),
    transform var(--transition-medium),
    background var(--transition-slow),
    color var(--transition-slow);
  -webkit-appearance: none;
  appearance: none;
}

select.field-input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238f97a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

[data-theme="light"] select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.field-input::placeholder {
  color: var(--text-soft);
  opacity: 0.75;
}

.field-input:focus {
  box-shadow:
    inset 3px 3px 8px var(--inset-a),
    inset -2px -2px 6px var(--inset-b),
    0 0 0 2px var(--border-glow);
}

.field-input--short {
  max-width: 140px;
}

.field-input--compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

/* Time, coordinates, and course inputs — neon track colour, larger, centred */
.inputs-grid--main .field-input {
  color: var(--neon-track);
  font-size: 16px;
  text-align: center;
}

/* Fix native date/time pickers — centre the text in WebKit shadow DOM */
.inputs-grid--main input[type="date"]::-webkit-datetime-edit,
.inputs-grid--main input[type="time"]::-webkit-datetime-edit {
  text-align: center;
}
.inputs-grid--main input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.inputs-grid--main input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  justify-content: center;
}

/* NOW + Compute: muted neon, not bright */
.btn-icon-neon {
  --dock-scale: 1;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: rgba(130, 205, 235, 0.95);
  background: linear-gradient(
    160deg,
    var(--surface-raised),
    var(--surface-inset)
  );
  box-shadow:
    -2px -2px 6px var(--outset-top),
    3px 4px 10px var(--outset-bot),
    0 0 0 1px var(--neon-border),
    0 0 14px var(--neon-soft),
    inset 0 0 12px var(--neon-soft);
  transition:
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.25s ease,
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease;
  transform: scale(var(--dock-scale));
}

.btn-icon-neon:hover {
  color: rgba(190, 235, 255, 0.98);
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px rgba(0, 185, 225, 0.55),
    0 0 22px var(--neon-soft-mid),
    0 0 36px var(--neon-soft-glow);
  transform: translateY(-1px) scale(var(--dock-scale));
}

.btn-icon-neon:active {
  transform: translateY(0) scale(calc(var(--dock-scale) * 0.94));
  box-shadow:
    inset 3px 3px 10px rgba(0, 0, 0, 0.4),
    inset -1px -1px 6px rgba(0, 200, 240, 0.08),
    0 0 12px var(--neon-soft);
}

[data-theme="light"] .btn-icon-neon {
  color: rgba(25, 110, 170, 0.95);
  box-shadow:
    -2px -2px 6px var(--outset-top),
    3px 4px 10px var(--outset-bot),
    0 0 0 1px rgba(37, 99, 235, 0.22),
    0 0 14px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .btn-icon-neon:hover {
  color: rgba(30, 80, 180, 1);
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px rgba(37, 99, 235, 0.35),
    0 0 24px rgba(37, 99, 235, 0.18);
}

/* Calculate button (same neon family, but pill) */
.btn-neon {
  --dock-scale: 1;
  position: relative;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(190, 235, 255, 0.98);
  background: linear-gradient(165deg, rgba(0, 165, 210, 0.18), rgba(0, 145, 190, 0.08));
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px var(--neon-border),
    0 0 16px var(--neon-soft),
    inset 0 0 14px rgba(0, 200, 240, 0.08);
  transition:
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease,
    color 0.25s ease;
  white-space: nowrap;
  transform: scale(var(--dock-scale));
}

.btn-neon:hover {
  transform: translateY(-1px) scale(var(--dock-scale));
  box-shadow:
    -2px -2px 10px var(--outset-top),
    5px 7px 16px var(--outset-bot),
    0 0 0 1px rgba(0, 185, 225, 0.55),
    0 0 22px var(--neon-soft-mid),
    0 0 36px var(--neon-soft-glow);
}

.btn-neon:active {
  transform: translateY(0) scale(calc(var(--dock-scale) * 0.97));
  box-shadow:
    inset 3px 3px 10px rgba(0, 0, 0, 0.4),
    inset -1px -1px 6px rgba(0, 200, 240, 0.08),
    0 0 12px var(--neon-soft);
}

.btn-neon--active {
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px rgba(0, 185, 225, 0.65),
    0 0 26px var(--neon-soft-mid),
    0 0 40px var(--neon-soft-glow),
    inset 0 0 16px rgba(0, 200, 240, 0.12);
  color: #fff;
}

[data-theme="light"] .btn-neon--active {
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px rgba(37, 99, 235, 0.45),
    0 0 24px rgba(37, 99, 235, 0.22);
}

[data-theme="light"] .btn-neon {
  color: rgba(30, 80, 180, 1);
  background: linear-gradient(165deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.06));
  box-shadow:
    -2px -2px 8px var(--outset-top),
    4px 6px 14px var(--outset-bot),
    0 0 0 1px rgba(37, 99, 235, 0.22),
    0 0 16px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .btn-neon:hover {
  box-shadow:
    -2px -2px 10px var(--outset-top),
    5px 7px 16px var(--outset-bot),
    0 0 0 1px rgba(37, 99, 235, 0.35),
    0 0 24px rgba(37, 99, 235, 0.18);
}

/* ========================= BUTTONS ========================= */

.btn-neumo,
.btn-secondary {
  --dock-scale: 1;
  position: relative;
  min-height: 44px;
  min-width: 132px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    box-shadow var(--transition-medium),
    transform var(--transition-medium),
    background var(--transition-slow),
    color var(--transition-slow);
  transform: scale(var(--dock-scale));
}

.btn-neumo {
  color: #fff;
  background: linear-gradient(160deg, var(--accent), var(--accent-mid) 45%, var(--accent-deep));
  box-shadow:
    -4px -4px 10px var(--outset-top),
    6px 8px 16px var(--outset-bot),
    0 0 24px var(--accent-glow);
}

.btn-neumo::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
  transition: opacity var(--transition-medium);
}

.btn-neumo:hover {
  transform: translateY(-2px) scale(var(--dock-scale));
  box-shadow:
    -5px -5px 12px var(--outset-top),
    8px 10px 20px var(--outset-bot),
    0 0 32px var(--accent-glow);
}

.btn-neumo:active {
  transform: translateY(0) scale(var(--dock-scale));
  box-shadow:
    inset 3px 3px 10px rgba(0, 0, 0, 0.35),
    inset -2px -2px 6px rgba(255, 255, 255, 0.08);
}

.btn-secondary {
  min-width: 120px;
  color: var(--text-main);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow:
    -4px -4px 10px var(--outset-top),
    5px 6px 14px var(--outset-bot);
}

.btn-secondary:hover {
  transform: translateY(-2px) scale(var(--dock-scale));
  box-shadow:
    -5px -5px 12px var(--outset-top),
    7px 8px 18px var(--outset-bot);
}

.btn-secondary:active {
  transform: translateY(0) scale(var(--dock-scale));
  box-shadow:
    inset 3px 3px 8px var(--inset-a),
    inset -2px -2px 6px var(--inset-b);
}

.btn-neumo.btn-small,
.btn-secondary.btn-small {
  min-height: 40px;
  min-width: 112px;
  font-size: 11px;
}

/* ========================= JOURNAL — paper logbook strip ========================= */

.table-card--journal {
  padding: 8px 10px 10px;
}

.journal-shell.journal-paper {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.journal-paper-surface {
  position: relative;
  padding: 7px 8px 9px;
  background-color: #f4ecdf;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(40, 35, 25, 0.018) 1px,
      rgba(40, 35, 25, 0.018) 2px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(40, 35, 25, 0.014) 1px,
      rgba(40, 35, 25, 0.014) 2px
    ),
    linear-gradient(168deg, #faf6ef 0%, #f2e9d6 48%, #ebe4d0 100%);
  background-blend-mode: multiply, multiply, normal;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.07),
    0 14px 28px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .journal-paper-surface {
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.05),
    0 12px 24px rgba(15, 23, 42, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.journal-ideal-wrap.journal-logbook {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.journal-logbook {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.journal-sheet {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-sans);
  color: #1a1814;
}

.journal-col--date {
  width: 10%;
  min-width: 80px;
}

.journal-col--utc {
  width: 6%;
  min-width: 52px;
}

.journal-col--watch {
  width: 5%;
  min-width: 48px;
}

.journal-col--lat,
.journal-col--lon {
  width: 9%;
  min-width: 68px;
}

.journal-col--head-g,
.journal-col--head-m,
.journal-col--brg-t,
.journal-col--brg-g,
.journal-col--brg-m {
  width: 5%;
  min-width: 44px;
}

.journal-col--obj {
  width: 8%;
  min-width: 60px;
}

.journal-col--e-g,
.journal-col--e-m {
  width: 5%;
  min-width: 36px;
}

.journal-col--var,
.journal-col--dev {
  width: 7%;
  min-width: 48px;
}

.journal-col--rep {
  width: 9%;
  min-width: 84px;
}

/* ——— Single merged table ——— */
.journal-sheet {
  table-layout: fixed;
  width: 100%;
}

.journal-sheet th,
.journal-sheet td {
  border: 1px solid rgba(30, 25, 18, 0.42);
  padding: 2px 3px 3px;
  vertical-align: middle;
  text-align: center;
  line-height: 1.15;
}

/* Two-level header: group row (colspan) → thin line; leaf / rowspan → double at bottom of thead */
.journal-sheet thead tr:first-child th[colspan] {
  border-bottom: 1px solid rgba(30, 25, 18, 0.42);
}

.journal-sheet thead tr:first-child th[rowspan="2"] {
  border-bottom: 3px double rgba(30, 25, 18, 0.55);
  vertical-align: middle;
}

.journal-sheet thead tr:last-child th {
  border-bottom: 3px double rgba(30, 25, 18, 0.55);
}

.journal-sheet thead tr:only-child th {
  border-bottom: 3px double rgba(30, 25, 18, 0.55);
}

.journal-sheet th {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2c2620;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(230, 220, 200, 0.25) 100%);
  padding-top: 3px;
  padding-bottom: 3px;
}

.journal-th-group {
  font-size: 6.5px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 4px 2px;
  vertical-align: middle;
}

.journal-th-leaf {
  font-size: 7px;
}

.journal-sheet tbody td {
  background: rgba(255, 255, 255, 0.12);
  font-size: 9px;
}

/* Blue ink handwriting (values only) */
.journal-hand.journal-pod-value {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1px 2px 2px;
  font-family: var(--font-sans);
  font-size: clamp(8px, 0.9vw, 10px);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--ink-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: baseline;
}

.journal-hand.journal-pod-value[data-col="date"] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  hyphens: manual;
}

.journal-td-repeater .journal-hand.journal-pod-value {
  white-space: normal;
  word-break: break-word;
  line-height: 1.18;
  max-height: 2.5em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.journal-body-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #1a5080;
  opacity: 0.88;
}

.journal-body-svg {
  display: block;
}

.journal-body-svg--muted {
  opacity: 0.45;
}

.journal-pod-object-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.journal-object-cell .journal-pod-object-row .journal-pod-value {
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-height: 2.6em;
}

.journal-td-object {
  padding: 2px 2px 1px !important;
}

.journal-object-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  min-height: 100%;
}

.journal-object-cell .journal-body-reset {
  align-self: center;
  margin: 0;
  padding: 1px 6px 2px;
  border: none;
  border-radius: 3px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #2563a8;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    color 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease,
    visibility 0.15s ease;
}

.journal-object-cell .journal-body-reset--off {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.journal-object-cell .journal-body-reset:hover:not(.journal-body-reset--off) {
  background: rgba(37, 99, 168, 0.1);
}

[data-theme="light"] .journal-object-cell .journal-body-reset {
  color: #1d4ed8;
}

.journal-actions-r2 {
  margin-top: 8px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
  justify-content: center;
}

.journal-actions-r2 .btn-neon {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  padding: 0 8px;
  font-size: 9px;
  white-space: nowrap;
  align-self: stretch;
}

.journal-actions-r2.journal-actions-r2--panel .btn-neon {
  min-height: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 8px;
  letter-spacing: 0.07em;
}

@media (max-width: 900px) {
  .journal-actions-r2 .btn-neon {
    flex: 1 1 calc(33% - 6px);
    min-width: 96px;
  }
}

@media (max-width: 520px) {
  .journal-actions-r2 {
    flex-direction: column;
  }

  .journal-actions-r2 .btn-neon {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ========================= BODY PICKER MODAL ========================= */

.body-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
}

.body-modal--hidden {
  display: none;
}

.body-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(6px);
}

.body-modal-card {
  position: relative;
  width: min(420px, 100% - 32px);
  padding: 20px 22px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--shadow-light);
  box-shadow:
    -8px -8px 18px var(--outset-top),
    10px 12px 24px var(--outset-bot);
}

.body-modal-title {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.body-modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-soft);
  align-items: center;
  text-align: center;
}

.body-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Watch select buttons — bigger, 3 per row ── */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}
.watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.watch-btn:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.25);
  color: var(--text-bright, #e2e8f0);
}
.watch-btn.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5), 0 0 16px rgba(0, 229, 255, 0.2);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

/* ── W/E timezone direction buttons ── */
.we-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim, rgba(255, 255, 255, 0.4));
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.we-btn:hover {
  border-color: rgba(0, 229, 255, 0.35);
  color: var(--text-bright, #e2e8f0);
}
.we-btn.active {
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4), 0 0 16px rgba(0, 229, 255, 0.15);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
}
/* W button — red accent for West (negative offset) */
.we-btn--w.active {
  border-color: #f87171;
  color: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.4), 0 0 16px rgba(248, 113, 113, 0.15);
  text-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}
.we-btn--w:hover {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

/* ── Schedule ON toggle (persistent glow) ── */
.sched-toggle-btn.on {
  background: linear-gradient(145deg, #0a4a3a, #064a3a) !important;
  border-color: #00e5ff !important;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5), 0 0 24px rgba(0, 229, 255, 0.2), inset 0 0 8px rgba(0, 229, 255, 0.15) !important;
  color: #00e5ff !important;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.7);
  transition: all 0.3s ease;
}

/* ========================= DEVIATION MODAL ========================= */

.dev-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.dev-modal.dev-content--hidden {
  display: none;
}

.dev-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(8px);
  transition: opacity var(--transition-slow);
}

.dev-modal-window {
  position: relative;
  max-width: 1000px;
  width: min(1000px, calc(100vw - 24px));
  height: auto;
  max-height: min(94vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 14px 16px 14px;
}

/* Окно девиации по ширине таблицы + узкий график — без пустой полосы справа */
#dev-modal .dev-modal-window {
  width: fit-content;
  max-width: min(1000px, calc(100vw - 24px));
}

.dev-modal-window.dev-card {
  padding: 14px 16px 14px;
}

/* Star Finder — 80% окна браузера, без внутренней прокрутки; карта вписывается в остаток */
.star-finder-modal .star-finder-window {
  box-sizing: border-box;
  width: 80vw;
  max-width: 80vw;
  height: 80vh;
  max-height: 80vh;
  min-height: 0;
  padding: 12px 14px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@supports (height: 80dvh) {
  .star-finder-modal .star-finder-window {
    height: 80dvh;
    max-height: 80dvh;
  }
}

@supports (width: 80dvw) {
  .star-finder-modal .star-finder-window {
    width: 80dvw;
    max-width: 80dvw;
  }
}

.star-finder-modal .star-finder-window .dev-header-row {
  flex-shrink: 0;
  margin-bottom: 6px;
}

.star-finder-modal .star-finder-modal-title {
  margin: 0;
  padding-right: 44px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.star-finder-modal .star-finder-header-row {
  margin-bottom: 4px;
}

.star-finder-modal .star-finder-img-wrap {
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(6, 8, 12, 0.45);
  border-radius: var(--radius-md);
}

.star-finder-modal #star-finder-modal-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 4px;
}

.star-finder-modal .star-finder-status {
  flex-shrink: 0;
  min-height: 0;
  max-height: 3.6em;
  margin: 0 0 6px;
  font-size: clamp(0.75rem, 2vw, 1rem);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.star-finder-modal .dev-close-btn {
  width: 42px;
  height: 42px;
  font-size: 22px;
  top: 10px;
  right: 12px;
}

.dev-close-btn {
  --dock-scale: 1;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--text-main);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow:
    -3px -3px 8px var(--outset-top),
    4px 5px 10px var(--outset-bot);
  transition: box-shadow var(--transition-medium), transform var(--transition-medium);
  transform: scale(var(--dock-scale));
}

.dev-close-btn:hover {
  transform: scale(calc(var(--dock-scale) * 1.05));
}

.dev-header-row {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.dev-header-row .mode-title {
  margin: 0 0 4px;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#deviation-content.dev-content {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.dev-modal-window .dev-header-row {
  padding-right: 44px;
}

.dev-layout {
  display: grid;
  grid-template-columns: minmax(0, 292px) max-content;
  gap: 10px;
  align-items: stretch;
  flex: 0 1 auto;
  min-height: 0;
}

.dev-col-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: visible;
  justify-content: flex-start;
  align-items: stretch;
}

.dev-col-right {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: max-content;
  max-width: min(100%, calc(100vw - 308px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.dev-table {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.dev-table-header {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) minmax(64px, 1fr) 76px;
  column-gap: 8px;
  row-gap: 4px;
  align-items: end;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.dev-table-header span:nth-child(1),
.dev-table-header span:nth-child(2) {
  text-align: center;
  line-height: 1.25;
  hyphens: none;
  overflow-wrap: anywhere;
}

.dev-table-header-actions {
  display: block;
  text-align: center;
}

.dev-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.dev-row {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) minmax(64px, 1fr) 76px;
  column-gap: 8px;
  align-items: center;
}

.dev-row input {
  min-height: 36px;
  border-radius: var(--radius-pill);
  border: none;
  padding: 0 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-main);
  background: var(--surface-inset);
  box-shadow:
    inset 3px 3px 8px var(--inset-a),
    inset -2px -2px 6px var(--inset-b);
  transition: box-shadow var(--transition-medium);
  min-width: 0;
  text-align: center;
}

.dev-row-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
}

.dev-row-btn {
  --dock-scale: 1;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--neon-border);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  transition:
    box-shadow var(--transition-medium),
    transform var(--transition-medium),
    border-color var(--transition-medium),
    color var(--transition-medium),
    background var(--transition-medium);
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  color: var(--accent);
  box-shadow:
    -3px -3px 8px var(--outset-top),
    4px 5px 10px var(--outset-bot);
  transform: scale(var(--dock-scale));
}

.dev-row-btn:hover {
  transform: translateY(-1px) scale(var(--dock-scale));
  border-color: var(--accent);
  box-shadow:
    -2px -2px 6px var(--outset-top),
    3px 4px 12px var(--accent-glow),
    0 0 14px var(--neon-soft-glow);
}

.dev-row-btn:active {
  transform: translateY(0) scale(var(--dock-scale));
  box-shadow: inset 2px 2px 6px var(--inset-a);
}

.dev-row-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    -2px -2px 6px var(--outset-top),
    3px 4px 8px var(--outset-bot);
}

.dev-row-btn--remove {
  color: var(--text-soft);
  border-color: rgba(148, 163, 184, 0.35);
}

.dev-row-btn--remove:hover:not(:disabled) {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.55);
}

.dev-result {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  box-shadow:
    inset 4px 4px 10px var(--inset-a),
    inset -3px -3px 8px var(--inset-b);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dev-chart-title {
  margin: 0 0 6px;
  padding: 0 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
}

.dev-chart-wrap {
  flex: 1 1 0;
  min-height: 200px;
  /* Узкая область графика (~как раньше при 60% от широкой колонки), не растягиваем по оси X */
  width: 360px;
  max-width: 100%;
  align-self: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 163, 255, 0.04));
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .dev-chart-wrap {
  background: linear-gradient(180deg, #f8fafc, #e8edf3);
}

.dev-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dev-chart-tooltip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  line-height: 1.35;
  max-width: min(220px, 100%);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: var(--surface-raised);
  color: var(--text-main);
  border: 1px solid var(--border-glow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.dev-chart-tooltip.dev-chart-tooltip--visible {
  opacity: 1;
  visibility: visible;
}

@media print {
  .dev-chart-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .dev-result {
    break-inside: avoid;
  }
}

/* Блок «Deviation by course» скрыт; в DOM остаётся для логики deviation.js */
.dev-query {
  display: none !important;
  width: 260px;
  max-width: 100%;
}

.dev-query-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  font-size: 13px;
}

.dev-query-line span {
  min-width: 88px;
  color: var(--text-soft);
}

.status-text {
  font-size: 12px;
  color: var(--text-soft);
  margin-left: 8px;
  min-width: 0;
  flex: 1 1 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.dev-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin-top: 0;
  padding: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  border-radius: var(--radius-md);
  border: 1px solid var(--shadow-light);
  box-shadow:
    -3px -3px 8px var(--outset-top),
    4px 5px 10px var(--outset-bot);
  isolation: isolate;
}

.dev-actions .dev-actions-btn {
  min-height: 40px;
  height: auto;
  padding: 8px 10px;
  font-size: 9px;
  letter-spacing: 0.1em;
  width: 100%;
}

.dev-actions .dev-actions-status {
  grid-column: 1 / -1;
  margin-left: 0;
  text-align: center;
  flex: none;
}

@media (max-width: 720px) {
  .dev-modal-window {
    height: auto;
    max-height: min(98dvh, 800px);
  }

  #dev-modal .dev-modal-window {
    width: min(1000px, calc(100vw - 24px));
  }

  .dev-layout {
    grid-template-columns: 1fr;
  }

  .dev-col-right {
    width: 100%;
    max-width: 100%;
  }

  .dev-result {
    width: 100%;
    max-width: 100%;
  }

  .dev-chart-wrap {
    flex: 0 0 auto;
    width: 100%;
    min-height: 220px;
    height: min(55vh, 380px);
  }

  .dev-table-header,
  .dev-row {
    grid-template-columns: minmax(52px, 1fr) minmax(56px, 1fr) 76px;
    column-gap: 8px;
  }
}

/* ========================= SKY MAP ========================= */

.sky-map-section {
  margin-top: 12px;
}

.sky-map-inner {
  min-width: 0;
}

.sky-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 22%);
  gap: 12px;
  align-items: start;
}

.sky-map-lists {
  min-width: 0;
}

@media (max-width: 900px) {
  .sky-map-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sky-map-chart-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: visible;
  border: 1px solid var(--shadow-light);
  box-shadow:
    inset 0 1px 0 var(--inset-b),
    0 4px 14px var(--outset-bot);
}

.sky-map-chart-wrap canvas {
  display: block;
  width: 100%;
  vertical-align: top;
  border-radius: var(--radius-md);
}

.sky-map-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-main);
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--shadow-light);
  box-shadow:
    -4px -4px 12px var(--outset-top),
    6px 8px 18px var(--outset-bot);
}

.sky-map-tooltip[hidden] {
  display: none !important;
}

.sky-map-tooltip-title {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}

.sky-map-tooltip-line {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
}

.sky-map-col {
  background: var(--surface-inset);
  border-radius: var(--radius-md);
  border: 1px solid var(--journal-group-border);
  padding: 8px 10px 10px;
  min-width: 0;
}

.sky-map-col--muted {
  opacity: 0.92;
}

.sky-map-col-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.sky-map-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--status-green-a);
  font-size: 10px;
}

.sky-map-col-head {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  gap: 6px;
  font-size: 10px;
  color: var(--text-soft);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--journal-group-border);
  margin-bottom: 6px;
}

.sky-map-col-body {
  max-height: min(220px, 32vh);
  overflow-y: auto;
  font-size: 10px;
  font-family: var(--font-mono);
}

.sky-map-row {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  gap: 6px;
  padding: 3px 0;
  align-items: baseline;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .sky-map-row {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.sky-map-row:last-child {
  border-bottom: none;
}

.sky-map-pick {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.sky-map-pick:hover {
  text-decoration-color: var(--accent);
}

.sky-map-num {
  color: var(--text-soft);
  text-align: right;
}

.sky-map-row--sun .sky-map-pick {
  color: #fbbf24;
}

.sky-map-row--moon .sky-map-pick {
  color: #94a3b8;
}

.sky-map-row--planet .sky-map-pick {
  color: #4ade80;
}

.sky-map-row--star .sky-map-pick {
  color: #e8c547;
}

[data-theme="light"] .sky-map-row--sun .sky-map-pick {
  color: #b45309;
}

[data-theme="light"] .sky-map-row--moon .sky-map-pick {
  color: #475569;
}

[data-theme="light"] .sky-map-row--planet .sky-map-pick {
  color: #15803d;
}

[data-theme="light"] .sky-map-row--star .sky-map-pick {
  color: #92400e;
}

.sky-map-list-empty {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
  font-style: italic;
}

.sky-map-status {
  margin: 6px 0 0;
  font-size: 10px;
  color: var(--text-soft);
  font-family: var(--font-mono);
}

/* ========================= MOBILE ADAPTATIONS ========================= */

/* Journal table — scroll hint on mobile */
@media (max-width: 768px) {
  .journal-logbook {
    position: relative;
  }

  .journal-logbook::after {
    display: none;
  }

  .journal-paper-surface {
    padding: 0;
    clip-path: none !important;
    box-shadow: none !important;
    background: none;
  }

  .table-card--journal {
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
  }

  .journal-sheet {
    width: 100%;
    background-color: #f4ecdf;
    border-left: 1px solid rgba(30, 25, 18, 0.42);
    border-right: 1px solid rgba(30, 25, 18, 0.42);
  }

  .journal-logbook {
    overflow-x: auto;
  }

  .journal-sheet th,
  .journal-sheet td {
    padding: 1px 2px;
  }

  .journal-th-group {
    padding: 1px 1px;
  }

  .journal-paper-surface {
    padding: 0;
    box-shadow: none !important;
    background: none;
  }
  /* Sky map */
  .sky-map-lists {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sky-map-canvas {
    min-height: 320px;
  }

  .mode-card {
    padding: 6px 6px 8px;
  }

  .mode-card-controls {
    flex-direction: row;
    align-items: center;
  }

  .mode-card-toggle-stack {
    flex: 1;
  }

  .mode-toggle-circle {
    width: 48px;
    height: 48px;
  }

  .mode-toggle-text {
    font-size: 7px;
  }
}

@media (max-width: 480px) {
  .main-grid {
    gap: 8px;
  }

  .panel-main {
    padding: 8px 10px 10px;
  }

  .panel-main .field-input--compact {
    min-height: 38px;
    font-size: 11px;
    padding: 0 8px;
  }

  .panel-main .field-inline .field-input--time {
    padding-right: 42px;
  }

  .panel-main .btn-icon-neon {
    width: 34px;
    height: 34px;
  }

  .panel-main .btn-icon-neon svg {
    width: 14px;
    height: 14px;
  }

  .panel-label {
    font-size: 10px;
  }

  .journal-actions-r2.journal-actions-r2--panel .btn-neon {
    min-height: 32px;
    height: 32px;
    font-size: 7px;
    padding: 0 4px;
  }

  .journal-sheet {
    width: 100%;
  }

  .sky-map-section {
    margin-top: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .sky-map-section .sky-map-inner {
    min-width: 0;
  }

  .sky-map-section .sky-map-chart-wrap {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .sky-map-section canvas {
    border-radius: 0;
  }

  .sky-map-section .sky-map-layout {
    gap: 6px;
  }

  #sky-map-canvas {
    min-height: 260px;
  }

  .mode-toggle-circle {
    width: 42px;
    height: 42px;
  }

  .mode-toggle-text {
    font-size: 6.5px;
    max-width: 85%;
  }

  .shell {
    width: 100%;
    margin: 8px auto 10px;
  }

  /* Sky map — edge-to-edge on mobile */
  .sky-map-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
    margin-top: 8px;
    box-shadow: none;
  }
  .sky-map-chart-wrap {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
  .sky-map-chart-wrap canvas {
    border-radius: 0;
  }
  .sky-map-inner {
    padding: 0;
  }
}

/* Journal — keep mobile-friendly column widths for landscape phones */
@media (max-width: 640px) {
  .panel-main .inputs-grid--main {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-main .field--time-col {
    max-width: none;
  }

  .panel-main .field--compact.field--date {
    max-width: none;
  }

  /* Mobile: symmetrical padding for time input so text centres like date */
  .panel-main .field-inline .field-input--time {
    padding-left: 50px;
  }
}
