:root {
  --nav-height: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #10151b;
  --panel: rgba(20, 27, 34, 0.97);
  --panel-soft: #1b242d;
  --text: #f4f7f8;
  --muted: #9caab4;
  --line: rgba(255,255,255,.12);
  --accent: #8fd3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset:
    0
    0
    calc(var(--nav-height) + var(--safe-bottom))
    0;
  display: none;
  overflow: hidden;
  background: var(--bg);
}

.view.active {
  display: block;
}

.map-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0d1820;
}

.placeholder {
  overflow: auto;
}

.placeholder-content {
  min-height: 100%;
  padding: 28px 22px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.placeholder-content h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 46px);
  font-weight: 650;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 17px;
}

.placeholder-content p {
  max-width: 520px;
  line-height: 1.5;
  color: var(--muted);
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));

  background: rgba(12, 17, 22, .96);
  border-top: 1px solid var(--line);

  z-index: 1000;
}

.nav-button {
  border: 0;
  margin: 0;
  padding: 5px 2px 3px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-width: 0;

  background: transparent;
  color: var(--muted);

  font-size: 10px;
  line-height: 1.05;
}

.nav-button.active {
  color: var(--accent);
}

.nav-icon {
  display: block;
  min-height: 21px;
  margin-bottom: 2px;

  font-size: 20px;
  line-height: 20px;
}

.scrim {
  position: absolute;
  inset: 0 0 calc(var(--nav-height) + var(--safe-bottom)) 0;

  display: none;
  background: rgba(0,0,0,.38);
  z-index: 1100;
}

.scrim.open {
  display: block;
}

.sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);

  display: none;

  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;

  box-shadow: 0 16px 50px rgba(0,0,0,.42);
  z-index: 1200;
}

.sheet.open {
  display: block;
}

.detail-sheet {
  max-height: min(70vh, 620px);
  overflow-y: auto;
}

.sheet-row {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;

  display: flex;
  align-items: center;
  gap: 12px;

  border: 0;
  border-bottom: 1px solid var(--line);

  background: transparent;
  color: var(--text);

  text-align: left;
}

.sheet-row:last-child {
  border-bottom: 0;
}

.sheet-icon {
  width: 28px;
  font-size: 20px;
  color: var(--accent);
}

.sheet-title-row {
  position: sticky;
  top: 0;

  min-height: 54px;
  padding: 0 10px 0 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.close-sheet {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 28px;
}

.settings-section {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.settings-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-soft);
}

.settings-card > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.settings-card span {
  color: var(--muted);
}

.toggle-row {
  margin-top: 10px;
  padding-top: 10px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  border-top: 1px solid var(--line);
}

.language-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.language-grid button {
  min-height: 42px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--panel-soft);
  color: var(--text);
}

.language-grid button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.edge-sensor-actions,
.edge-device-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.edge-sensor-actions button,
.edge-device-actions button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--text);
}

.edge-device-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.edge-device-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.edge-device-card strong,
.edge-device-card small { display: block; }
.edge-device-card small { margin-top: 3px; color: var(--muted); }

.edge-live-diagnostics {
  margin-top: 10px;
}

.edge-live-diagnostics summary {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.edge-live-diagnostics[open] summary {
  margin-bottom: 8px;
}

.diagnostic-service-actions {
  display: grid;
  gap: 8px;
}

.diagnostic-service-actions button {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.signal-tracker {
  display: grid;
  gap: 8px;
}

.signal-tracker select {
  min-height: 38px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.signal-tracker pre {
  max-height: 280px;
  margin: 0;
  padding: 9px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1117;
  color: #cbd5e1;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 390px) {
  :root {
    --nav-height: 54px;
  }

  .nav-button {
    font-size: 9px;
  }

  .nav-icon {
    font-size: 18px;
  }
}


/* ================================================================
   ARGOS CLIENT WORKSPACES v0.4
   ================================================================ */

.cockpit-view,
.weather-view,
.navigation-view {
  overflow: auto;
  background: #10151b;
}

.instrument-grid {
  min-height: 100%;
  padding: 8px;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  grid-auto-rows:
    minmax(150px, auto);

  gap: 8px;
}

.instrument-card {
  min-width: 0;
  min-height: 150px;

  overflow: hidden;

  border:
    1px solid
    rgba(255,255,255,.10);

  border-radius: 12px;

  background: #161e25;
}

.instrument-card iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
}

.instrument-main {
  grid-column: 1 / -1;
  min-height: 300px;
}

.metric-card {
  padding: 16px;

  display: grid;
  grid-template-columns:
    1fr auto;
  grid-template-rows:
    auto 1fr;

  align-items: center;
}

.metric-card span {
  grid-column: 1 / -1;

  color: #9caab4;
  font-size: 13px;
}

.metric-card strong {
  align-self: end;

  font-size:
    clamp(38px, 13vw, 72px);

  line-height: 1;
}

.metric-card small {
  align-self: end;

  padding-bottom: 5px;

  color: #9caab4;
  font-size: 15px;
}

.workspace-frame {
  display: block;

  width: 100%;
  height: 100%;

  border: 0;

  background: #10151b;
}

.navigation-summary {
  padding: 8px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 8px;
}

.nav-metric {
  min-height: 94px;
  padding: 12px;

  display: flex;
  flex-direction: column;

  border:
    1px solid
    rgba(255,255,255,.10);

  border-radius: 12px;

  background: #161e25;
}

.nav-metric span {
  color: #9caab4;
  font-size: 12px;
}

.nav-metric strong {
  margin-top: auto;

  font-size:
    clamp(22px, 7vw, 38px);
}

.navigation-empty {
  margin: 8px;
  padding: 24px;

  border:
    1px dashed
    rgba(255,255,255,.18);

  border-radius: 12px;

  color: #9caab4;

  text-align: center;
}


@media (min-width: 700px) {

  .instrument-grid {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }

  .instrument-main {
    grid-column:
      span 2;

    grid-row:
      span 2;
  }

}


/*
 * ARGOS_NAVIGATION_VIEW_V1A
 */

.navigation-view {
  overflow-y:
    auto;

  padding:
    18px;

  padding-bottom:
    calc(
      96px
      + env(
          safe-area-inset-bottom,
          0px
        )
    );
}


.navigation-planner-card {
  margin-top:
    14px;

  padding:
    14px;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      .11
    );

  border-radius:
    14px;

  background:
    rgba(
      255,
      255,
      255,
      .035
    );
}


.navigation-planner-head {
  display:
    flex;

  justify-content:
    space-between;

  align-items:
    flex-start;

  gap:
    12px;
}


.navigation-planner-head > div {
  display:
    flex;

  flex-direction:
    column;

  gap:
    4px;
}


.navigation-planner-head span {
  color:
    #8fa2b3;

  font-size:
    12px;
}


.navigation-action-row {
  display:
    grid;

  grid-template-columns:
    repeat(
      3,
      minmax(
        0,
        1fr
      )
    );

  gap:
    8px;

  margin-top:
    14px;
}


.navigation-action-button,
.navigation-secondary-button {
  border:
    1px solid
    rgba(
      255,
      255,
      255,
      .14
    );

  border-radius:
    10px;

  background:
    #17222d;

  color:
    #edf6fc;

  font:
    inherit;
}


.navigation-action-button {
  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    7px;

  min-height:
    48px;

  font-size:
    13px;

  font-weight:
    680;
}


.navigation-action-button span {
  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  width:
    23px;

  height:
    23px;

  border-radius:
    50%;

  background:
    #0d6e9b;
}


.navigation-secondary-button {
  padding:
    7px 9px;

  font-size:
    11px;
}


.navigation-speed-row {
  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    14px;

  margin-top:
    14px;

  padding-top:
    12px;

  border-top:
    1px solid
    rgba(
      255,
      255,
      255,
      .08
    );

  color:
    #a7b7c5;

  font-size:
    12px;
}


.navigation-speed-row > div {
  display:
    flex;

  align-items:
    center;

  gap:
    6px;
}


.navigation-speed-row input {
  width:
    70px;

  padding:
    7px;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      .16
    );

  border-radius:
    8px;

  background:
    #0d1720;

  color:
    white;

  font:
    inherit;

  text-align:
    right;
}


.navigation-plan-state {
  margin-top:
    12px;

  color:
    #91a6b6;

  font-size:
    12px;
}


.navigation-point-list {
  display:
    grid;

  gap:
    5px;

  margin-top:
    8px;
}


.navigation-point-row {
  display:
    grid;

  grid-template-columns:
    30px
    minmax(
      0,
      1fr
    )
    auto;

  gap:
    8px;

  align-items:
    center;

  padding:
    7px 8px;

  border-radius:
    8px;

  background:
    rgba(
      255,
      255,
      255,
      .035
    );

  font-size:
    11px;
}


.navigation-point-role {
  color:
    #35bdf5;

  font-weight:
    750;
}


.navigation-point-coordinates {
  color:
    #8397a8;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}


.navigation-v1-note {
  margin-top:
    10px;

  color:
    #718696;

  font-size:
    10px;

  line-height:
    1.4;
}


@media (
  max-width:
  620px
) {

  .navigation-view {
    padding:
      12px;
  }

  .navigation-action-row {
    grid-template-columns:
      1fr;
  }

}


/*
 * ARGOS_NAVIGATION_APP_CSS_V1B
 */

.navigation-point-row {
  grid-template-columns:
    30px
    minmax(0, 1fr)
    auto
    auto;
}

.navigation-point-actions-v1b {
  display: flex;
  gap: 5px;
}

.navigation-point-actions-v1b button {
  border:
    1px solid
    rgba(255, 255, 255, .12);

  border-radius:
    6px;

  padding:
    4px 6px;

  background:
    #172735;

  color:
    #dce8f0;

  font:
    inherit;

  font-size:
    9px;
}

.navigation-point-actions-v1b button.danger {
  color:
    #ff9c9c;
}

.navigation-leg-section-v1b {
  margin-top:
    14px;

  padding-top:
    12px;

  border-top:
    1px solid
    rgba(255, 255, 255, .08);
}

.navigation-leg-title-v1b {
  margin-bottom:
    7px;

  color:
    #8fa7ba;

  font-size:
    11px;

  font-weight:
    750;

  text-transform:
    uppercase;

  letter-spacing:
    .06em;
}

.navigation-leg-list-v1b {
  display:
    grid;

  gap:
    6px;
}

.navigation-leg-row-v1b {
  display:
    grid;

  grid-template-columns:
    28px
    repeat(
      5,
      minmax(62px, 1fr)
    );

  gap:
    7px;

  align-items:
    center;

  padding:
    8px;

  border:
    1px solid
    rgba(255, 255, 255, .07);

  border-radius:
    9px;

  background:
    rgba(255, 255, 255, .025);
}

.navigation-leg-row-v1b > div:not(
  .navigation-leg-number-v1b
):not(
  .navigation-leg-future-v1b
) {
  display:
    flex;

  flex-direction:
    column;

  gap:
    2px;
}

.navigation-leg-row-v1b span {
  color:
    #788d9e;

  font-size:
    9px;
}

.navigation-leg-row-v1b strong {
  font-size:
    11px;
}

.navigation-leg-number-v1b {
  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  width:
    24px;

  height:
    24px;

  border-radius:
    50%;

  background:
    #0e6f9c;

  font-size:
    10px;

  font-weight:
    800;
}

.navigation-leg-future-v1b {
  grid-column:
    2 / -1;

  color:
    #6f8798;

  font-size:
    9px;
}

.navigation-leg-empty-v1b {
  color:
    #788d9e;

  font-size:
    10px;
}

@media (max-width: 720px) {

  .navigation-leg-row-v1b {
    grid-template-columns:
      28px
      repeat(
        2,
        1fr
      );
  }

  .navigation-leg-future-v1b {
    grid-column:
      1 / -1;
  }

  .navigation-point-row {
    grid-template-columns:
      30px
      minmax(0, 1fr);
  }

  .navigation-point-actions-v1b {
    grid-column:
      1 / -1;
  }

}


/*
 * ARGOS_NAVIGATION_WIND_UI_CSS_V1C
 */

.navigation-leg-future-v1b {
  line-height:
    1.45;
}


.nav-leg-wind-value {
  color:
    #d8eef8;

  font-weight:
    700;
}


.nav-leg-env-unknown {
  color:
    #8297a8;
}


.navigation-point-actions-v1b button {
  min-width:
    29px;

  min-height:
    27px;

  padding:
    2px 7px;

  font-size:
    15px;

  line-height:
    1;
}


.navigation-point-actions-v1b button.danger {
  font-size:
    19px;

  font-weight:
    500;
}


/*
 * ARGOS_NAVIGATION_COMPACT_POINTS_V1C1
 *
 * Punktnummer · Rolle/Koordinate · Verschieben · Löschen
 * möglichst in EINER Zeile.
 */

.navigation-point-row {
  display:
    grid !important;

  grid-template-columns:
    28px
    minmax(
      0,
      1fr
    )
    auto !important;

  align-items:
    center;

  column-gap:
    7px;

  row-gap:
    0;
}


.navigation-point-actions-v1b {
  display:
    flex !important;

  grid-column:
    auto !important;

  flex-wrap:
    nowrap;

  gap:
    4px;

  align-items:
    center;

  justify-content:
    flex-end;
}


.navigation-point-actions-v1b button {
  width:
    28px;

  min-width:
    28px;

  height:
    28px;

  min-height:
    28px;

  padding:
    0;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;
}


.navigation-calculation-state-v1c1 {
  margin:
    0
    0
    8px;

  padding:
    6px
    8px;

  border-radius:
    7px;

  font-size:
    10px;

  line-height:
    1.3;
}


.navigation-calculation-state-v1c1.ready {
  color:
    #9fc2d5;

  background:
    rgba(
      40,
      112,
      145,
      .10
    );
}


.navigation-calculation-state-v1c1.error {
  color:
    #ff9f9f;

  background:
    rgba(
      180,
      45,
      45,
      .12
    );
}


/*
 * Auch auf dem iPhone zunächst einzeilig versuchen.
 * Nur extrem kleine Breiten dürfen natürlich
 * browserseitig enger werden.
 */
@media (max-width: 720px) {

  .navigation-point-row {
    grid-template-columns:
      26px
      minmax(
        0,
        1fr
      )
      auto !important;
  }


  .navigation-point-actions-v1b {
    grid-column:
      auto !important;
  }

}

/* ARGOS_CLIENT_STATUS_V1 */

.argos-status-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.argos-status-summary div div {
  margin-top: 3px;
  opacity: .65;
  font-size: 12px;
}

.argos-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
  background: #777;
}

.argos-status-dot.ok {
  background: #38a169;
}

.argos-status-dot.warn {
  background: #d69e2e;
}

.argos-status-grid {
  margin: 0 16px;
  border-radius: 12px;
  overflow: hidden;
}

.argos-status-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 12px;
  border-bottom:
    1px solid rgba(127,127,127,.18);
}

.argos-status-grid span {
  opacity: .68;
}

.argos-status-grid strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.argos-status-difference {
  margin: 14px 16px 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(127,127,127,.10);
  font-size: 13px;
}

.argos-status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}

.argos-status-actions button {
  min-height: 44px;
  border-radius: 10px;
}
.argos-status-section { margin: 14px 0; }
.argos-runtime-data-sources { display: grid; gap: 8px; margin-top: 8px; }
.argos-runtime-source { border: 1px solid rgba(148,163,184,.28); border-radius: 12px; padding: 10px; background: rgba(15,23,42,.04); }
.argos-runtime-source header { display:flex; justify-content:space-between; gap:8px; font-weight:700; }
.argos-runtime-source dl { display:grid; grid-template-columns:minmax(7rem,auto) 1fr; gap:3px 8px; margin:7px 0 0; font-size:.78rem; }
.argos-runtime-source dt { opacity:.62; }
.argos-runtime-source dd { margin:0; overflow-wrap:anywhere; }
.argos-freshness-fresh,.argos-freshness-available_local,.argos-freshness-available_remote { color:#15803d; }.argos-freshness-aging,.argos-freshness-stale,.argos-freshness-offline_last_known { color:#b45309; }.argos-freshness-expired,.argos-freshness-unavailable { color:#b91c1c; }
.argos-data-trust-warning { position:fixed; z-index:40; left:50%; top:max(10px,env(safe-area-inset-top)); transform:translateX(-50%); width:max-content; max-width:min(92vw,560px); max-height:min(28vh,150px); overflow:auto; overflow-wrap:anywhere; padding:8px 12px; border-radius:12px; background:#fff7ed; color:#9a3412; box-shadow:0 4px 18px rgba(15,23,42,.2); font-size:.82rem; line-height:1.35; }
@media (max-width: 520px) { .argos-data-trust-warning { top:max(6px,env(safe-area-inset-top)); max-width:calc(100vw - 20px); max-height:22vh; font-size:.74rem; padding:7px 10px; } }
