@font-face { font-family: "Avenir Next LT Pro"; src: url(fonts/AvenirNextLTPro-Light.ttf) format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Avenir Next LT Pro"; src: url(fonts/AvenirNextLTPro-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Avenir Next LT Pro"; src: url(fonts/AvenirNextLTPro-Demi.ttf) format("truetype"); font-weight: 600; font-display: swap; }

/* TMC Atlas · gleiche Familie wie Kompass und Miles: warmes Papierweiß, Schwarz, Gelb als Akzent */
:root {
  --ink: #1A1A1A;
  --ink-2: #4D4A44;
  --muted: #6F6B63;
  --line: #E9E5DC;
  --line-2: #F2EFE8;
  --bg: #FAF9F6;
  --card: #FFFFFF;
  --yellow: #FECB00;
  --yellow-soft: #FFF6CF;
  --yellow-ink: #8A6A00;
  --bad: #A8231B;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(26,26,26,.04), 0 8px 24px rgba(26,26,26,.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 300 15px/1.5 "Avenir Next LT Pro", "Avenir Next", Avenir, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
h1, h2, h3, b, strong, th, label { font-weight: 600; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 10px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------- Marke: TMC-Logo + Atlas + Globus ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand .word { font-weight: 600; font-size: 19px; letter-spacing: .02em; }
.globe { flex: none; overflow: visible; }
.globe .spin { animation: spin 9s linear infinite; transform-origin: 20px 20px; }
@keyframes spin { from { transform: scaleX(1); } 25% { transform: scaleX(.25); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(-.25); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .globe .spin, .login, .lk-user { animation: none !important; } }

/* ---------- Rahmen ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; padding: 22px 16px;
  border-right: 1px solid var(--line); background: var(--card);
  display: flex; flex-direction: column; gap: 26px;
}
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); }
.nav a:hover { background: var(--line-2); }
.nav a.on { background: var(--yellow); color: var(--ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .foot { margin-top: auto; font-size: 13px; color: var(--muted); padding: 0 12px; }
.side .foot b { display: block; color: var(--ink); }
.side .foot button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }

main { padding: 30px 40px 120px; max-width: 1180px; width: 100%; }
.demo-band { background: var(--yellow-soft); border: 1px solid #F3E19A; color: #5B4600; border-radius: 12px; padding: 9px 14px; font-size: 13px; margin-bottom: 22px; }

/* ---------- Seitenkopf wie Kompass ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.top .greet { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.top .greet a { color: var(--muted); }
.top .lead { color: var(--ink-2); max-width: 60ch; margin: 8px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Abschnittstitel mit gelbem Balken darunter, wie bei Miles */
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; }
.sec-head h2::after { content: ""; display: block; width: 36px; height: 3px; background: var(--yellow); border-radius: 2px; margin-top: 6px; }
.sec-head a { font-size: 14px; color: var(--muted); }
section { margin-top: 34px; }

/* ---------- Buttons, Felder ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 400; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #D6D1C5; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); font-weight: 600; }
.btn.primary:hover { background: #F4C200; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 18px; flex: 1; min-width: 220px; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(254,203,0,.45); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; background: none; outline: none; padding: 11px 0; width: 100%; font-weight: 400; }
.search.big { box-shadow: var(--shadow); }
.search.big input { padding: 16px 0; font-size: 17px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 14px; font-weight: 400; min-width: 140px; }
.count { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }
.count button { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--ink); cursor: pointer; font-size: 13px; }

/* ---------- Karten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
a.card:hover { border-color: #D6D1C5; }
.card .top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .place { font-size: 13px; color: var(--muted); }
.card .sub { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.card .foot { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Startseite: Tools wie ein Dock */
.dock { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 14px; border-radius: var(--radius); text-decoration: none; text-align: center; background: var(--card); border: 1px solid var(--line); }
.app:hover { border-color: #D6D1C5; }
.app .ic { width: 52px; height: 52px; border-radius: 15px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.app .ic svg { width: 26px; height: 26px; }
.app .ic.yellow { background: var(--yellow); color: var(--ink); }
.app b { font-size: 14px; line-height: 1.2; }
.app span { font-size: 12px; color: var(--muted); line-height: 1.3; }

.dirs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dir .n { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.dir h3 { margin-top: 10px; }

.nudge { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--yellow-soft); border: 1px solid #F3E19A; border-radius: var(--radius); padding: 16px 20px; }
.nudge p { margin: 0; color: #5B4600; }
.nudge b { color: var(--ink); display: block; }

.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rows a { display: flex; gap: 14px; align-items: baseline; padding: 13px 20px; text-decoration: none; border-top: 1px solid var(--line-2); }
.rows a:first-child { border-top: 0; }
.rows a:hover { background: var(--bg); }
.rows .what { font-size: 12px; color: var(--muted); width: 110px; flex: none; }
.rows .title { font-weight: 400; flex: 1; min-width: 0; }
.rows .when { font-size: 13px; color: var(--muted); white-space: nowrap; }

.chip { display: inline-block; font-size: 12px; font-weight: 400; padding: 2px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; border: 0; }
button.chip { cursor: pointer; }
button.chip:hover { background: var(--line); }
.status { font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.status.bewährt { background: var(--ink); color: #fff; }
.status.getestet { background: var(--yellow); color: var(--ink); }
.status.neu { background: var(--line-2); color: var(--muted); font-weight: 400; }
.status.nicht-mehr { background: #FBE9E7; color: var(--bad); }
.rating { letter-spacing: 2px; font-size: 12px; color: var(--yellow-ink); white-space: nowrap; }
.rating i { font-style: normal; color: var(--line); }

/* ---------- Detailseite ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 400; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; }
.block { margin-bottom: 26px; }
.block > h2 { font-size: 17px; }
.note { border-top: 1px solid var(--line-2); padding: 14px 0; }
.note:first-child { border-top: 0; padding-top: 0; }
.note .meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.note .meta b { color: var(--ink); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.box h3 { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 6px; }
.box.good { background: #F4F8F1; border-color: #DDE8D6; }
.box.avoid { background: #FCF3F1; border-color: #F0DAD5; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; color: var(--muted); }
.empty b { color: var(--ink); display: block; margin-bottom: 2px; }

/* ---------- Formular ---------- */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); color: var(--ink); box-shadow: 0 24px 60px rgba(26,26,26,.25); }
dialog::backdrop { background: rgba(26,26,26,.45); }
.dlg-head { padding: 22px 26px 6px; display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { margin: 0; font-size: 21px; }
.dlg-head .x { background: var(--line-2); border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.dlg-body { padding: 12px 26px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.dlg-foot { padding: 16px 26px 22px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 400; }
.field label small { color: var(--muted); opacity: .85; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 15px; font-weight: 400; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(254,203,0,.45); }
.field textarea { min-height: 110px; resize: vertical; }
.stars { display: flex; gap: 4px; }
.stars button { border: 1px solid var(--line); background: #fff; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-weight: 600; }
.stars button.on { background: var(--yellow); border-color: var(--yellow); }
.err { color: var(--bad); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 50; }

/* ---------- Login: Sperrbildschirm wie Kompass ---------- */
.login {
  position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate;
  background: #141413; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(9vh + env(safe-area-inset-top)) 16px calc(7vh + env(safe-area-inset-bottom));
  animation: wake 1.4s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes wake { from { filter: blur(18px) brightness(.4); transform: scale(1.06); } to { filter: none; transform: none; } }
.lk-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.login::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.06) 38%, rgba(0,0,0,.10) 55%, rgba(0,0,0,.52)); }
.lk-clock { text-align: center; text-shadow: 0 2px 24px rgba(0,0,0,.18); }
.lk-date { font-size: clamp(17px, 2.2vw, 22px); font-weight: 400; opacity: .92; }
.lk-time { font-size: clamp(76px, 13vw, 132px); font-weight: 600; line-height: 1; letter-spacing: -.02em; margin-top: 4px; opacity: .95; }
.lk-user { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(320px, 100%); animation: rise 1.2s .25s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.lk-avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(20,20,20,.22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 8px 30px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.25); }
.lk-name { font-weight: 600; font-size: 17px; text-shadow: 0 1px 10px rgba(0,0,0,.25); margin-bottom: 4px; }
.lk-btn { border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.2); color: #fff; padding: 10px 20px; font-size: 14px; cursor: pointer; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: inline-flex; align-items: center; gap: 10px; }
.lk-btn:hover { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.lk-hint { font-size: 13px; opacity: .9; text-align: center; }
.lk-err { font-size: 13px; background: rgba(168,35,27,.75); padding: 6px 12px; border-radius: 999px; text-align: center; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; z-index: 5; padding: 12px 16px; flex-direction: row; align-items: center; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0; }
  .side .brand img { display: none; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 12px; white-space: nowrap; font-size: 14px; border-radius: 999px; }
  .nav a svg, .nav .group, .side .foot { display: none; }
  main { padding: 22px 16px 80px; }
  h1 { font-size: 25px; }
  .dirs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail, .split { grid-template-columns: 1fr; }
  .dlg-body { grid-template-columns: 1fr; padding: 10px 18px 6px; }
  .dlg-head, .dlg-foot { padding-left: 18px; padding-right: 18px; }
  .filters select { flex: 1; min-width: 0; }
  .rows .what { width: 84px; }
}

/* ---------- Live-Kacheln aus den anderen Tools ---------- */
.live { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.live-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.live-head h3 { flex: 1; }
.live-head .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.live-head .ic svg { width: 18px; height: 18px; }
.live-head .ic.yellow { background: var(--yellow); color: var(--ink); }
.live-list { display: flex; flex-direction: column; }
.live-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-2); }
.live-row:first-child { border-top: 0; }
.live-row > a:first-child { text-decoration: none; flex: 1; min-width: 0; }
.live-row a.chip { text-decoration: none; }
.live .big { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }

/* ---------- Atlas-Login: Nachtglobus statt Wolken (eigenes Cover, nicht mit Kompass verwechseln) ---------- */
.login.atlas { background: #141413; }
.login.atlas::after { display: none; }
.lk-globe { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.login.atlas .lk-avatar { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.login.atlas .lk-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.lk-source { position: absolute; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 11px; color: rgba(255,255,255,.45); }
