/* =========================================================================
   Tarko-Portal (remote.tarko.ch) – baut auf app.css des Geräts auf.
   Anmelden und Verbinden: Panel auf dem Alpenbild (wie beim ersten Start).
   Angemeldet: ruhige, helle Fläche – Inhalt zuerst, wie bei iCloud.com.
   ========================================================================= */

body { overflow: auto; }
#app { position: relative; inset: auto; min-height: 100vh; min-height: 100dvh; }

body.inside { background: var(--bg-2); color: var(--label); }
body.inside #wall { display: none; }
body.inside #app { display: flex; flex-direction: column; }

/* ---------- Obere Leiste ---------- */
.pbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: .5px solid var(--sep);
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
}
.pbar-in { height: 56px; width: min(1080px, 100%); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.pbar .brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--label); }
.pbar .brand svg { width: 24px; height: 24px; color: var(--tint); }
.pbar .brand b { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.pbar .brand span { font-size: 13px; color: var(--label-2); font-weight: 500; padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--sep); }
.pbar .grow { flex: 1; }
.pbar .who { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--label); height: 38px; padding: 0 5px 0 12px; border-radius: 99px; }
.pbar .who:hover { background: var(--hover); }
.pbar .who .nm { font-weight: 500; font-size: 13.5px; }

/* ---------- Inhalt ---------- */
.pmain { flex: 1; width: min(1080px, 100%); margin: 0 auto; padding: 44px 24px 56px; display: grid; gap: 28px; align-content: start; }
.phead { display: grid; gap: 6px; }
.phead h1 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 4vw, 36px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.phead p { margin: 0; font-size: 15px; color: var(--label-2); }
.phead .back { justify-self: start; margin-left: -10px; }
.sect { margin: 0 0 14px; font-size: 13px; font-weight: 650; color: var(--label-2); text-transform: uppercase; letter-spacing: .06em; }
.notices { display: grid; gap: 12px; }
.notices:empty { display: none; }

.card {
  background: var(--bg); color: var(--label); border-radius: 20px;
  box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .05);
}

/* Geräte */
.devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.dev { padding: 18px 18px 18px 14px; display: grid; gap: 14px; animation: stepIn .45s var(--ease) both; }
.dev-top { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: center; }
.dev .device.sm { width: 112px; height: 86px; margin: 0; }
.dev:not(.online) .device { filter: saturate(.3); opacity: .7; }
.dev:not(.online) .device .led { display: none; }
.dev-info { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.dev h3 { margin: 4px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.015em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev .meta { color: var(--label-2); font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--label-2); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.dev-host { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-left: 4px; border-radius: 11px; background: var(--fill-2); color: var(--label-2); font: 500 12.5px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; min-width: 0; }
.dev-host span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-host svg { width: 15px; height: 15px; flex: none; color: var(--label-3); }
.dev .acts { display: flex; gap: 8px; margin-left: 4px; }
.dev .acts .btn { flex: 1; height: 40px; font-size: 14.5px; font-weight: 600; text-decoration: none; }
.dev .acts .btn svg { width: 16px; height: 16px; }
.dev .acts .btn[aria-disabled="true"] { color: var(--label-2); }
.dev .acts .ibtn { width: 40px; height: 40px; border-radius: 99px; background: var(--fill); color: var(--label); }
.dev .acts .ibtn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--label) 6%); }

.dev-add {
  border: 1.5px dashed color-mix(in srgb, var(--label-3) 70%, transparent); background: transparent; box-shadow: none;
  display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 200px; padding: 20px; color: var(--label-2); text-align: center;
}
.dev-add:hover { border-color: var(--tint); color: var(--tint); background: var(--tint-weak); }
.dev-add .plus { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); margin-bottom: 6px; color: inherit; }
.dev-add .plus svg { width: 20px; height: 20px; }
.dev-add b { font-size: 15px; font-weight: 600; color: var(--label); }
.dev-add:hover b { color: var(--tint); }
.dev-add small { font-size: 12.5px; }

.devs.empty-grid { grid-template-columns: 1fr; }
.emptycard { padding: 34px 32px 36px; display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 560px; justify-self: center; width: 100%; }
.emptycard h2 { margin: 6px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.emptycard p { margin: 0 0 10px; color: var(--label-2); font-size: 14.5px; max-width: 42ch; }

.notice { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 18px; }
.notice .sq { width: 36px; height: 36px; border-radius: 10px; }
.notice .sq svg { width: 20px; height: 20px; }
.notice .grow { flex: 1; min-width: 0; }
.notice b { display: block; font-size: 14.5px; font-weight: 600; }
.notice small { display: block; color: var(--label-2); font-size: 13px; }

/* Fusszeile */
.pfoot { width: min(1080px, 100%); margin: 0 auto; padding: 22px 24px 30px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; color: var(--label-3); font-size: 12px; border-top: .5px solid var(--sep); }

/* Konto */
.acct { padding: 22px; display: grid; gap: 22px; max-width: 640px; }
.acct .list { background: var(--bg-2); box-shadow: none; }
.acct .who-head { display: flex; align-items: center; gap: 14px; padding: 2px 4px; }
.acct .who-head b { display: block; font-size: 17px; font-weight: 650; }
.acct .who-head small { color: var(--label-2); font-size: 13px; }

/* ---------- Anmelden, Gerät verbinden (auf dem Bild) ---------- */
.linkcode {
  font-size: 30px; font-weight: 650; letter-spacing: .14em; text-align: center; padding: 14px; border-radius: 14px;
  background: var(--fill-2); font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--label-2); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.okmark { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.okmark svg { width: 34px; height: 34px; stroke-width: 2.2; }
.panel .alt { text-align: center; color: var(--label-2); font-size: 13.5px; margin: 0; }
.panel .alt button { border: 0; background: none; color: var(--tint); font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.panel .alt button:hover { background: var(--tint-weak); }
.legal { position: fixed; left: 0; right: 0; bottom: 14px; text-align: center; color: rgba(255, 255, 255, .7); font-size: 12px; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); pointer-events: none; }
body.inside .legal { display: none; }

@media (max-width: 760px) {
  .pbar-in { padding: 0 14px; }
  .pmain { padding: 26px 16px 40px; gap: 22px; }
  .pbar .brand span, .pbar .who .nm { display: none; }
  .panel { padding: 28px 22px 24px; border-radius: 24px; }
  .devs { grid-template-columns: 1fr; }
  .notice { flex-wrap: wrap; }
  .notice .btn { width: 100%; }
}
