/* Selbst gehostete Schriften (keine Verbindung zu Google) */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Webseite Abo – App & Admin. Tokens identisch zur Landingpage. */
:root {
  --paper: #F2F5F9;
  --surface: #FFFFFF;
  --ink: #13203A;
  --ink-2: #3A4964;
  --muted: #6A7890;
  --line: #DDE3EC;
  --line-strong: #C4CEDC;
  --accent: #2440F0;
  --accent-ink: #1A30C2;
  --accent-soft: #E6EAFE;
  --user: #C27A00;        /* Kunde ist dran */
  --user-soft: #FFF3D9;
  --admin: #2440F0;       /* Wir sind dran */
  --admin-soft: #E6EAFE;
  --live: #0E8A5F;
  --live-soft: #DDF4EA;
  --danger: #C8323C;
  --danger-soft: #FCE6E7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 32, 58, .05), 0 8px 24px -12px rgba(19, 32, 58, .14);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; font-family: var(--font); letter-spacing: 0; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar__in {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.brand {
  font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 9px; letter-spacing: -0.02em;
}
.brand__mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  display: grid; grid-template-rows: 5px 1fr; gap: 2px; padding: 3px;
}
.brand__mark::before, .brand__mark::after { content: ""; background: rgba(255,255,255,.9); border-radius: 2px; }
.brand__mark::after { background: rgba(255,255,255,.55); }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a, .nav button {
  color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500;
  background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.nav form { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap--narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 14px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card__head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 20px 40px; }
.footer a { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1;
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink-2); padding-left: 10px; padding-right: 10px; }
.btn--quiet:hover { background: var(--paper); color: var(--ink); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #EDB9BD; }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--sm { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.btn--lg { padding: 15px 22px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------- Formulare ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.opt { color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #9AA6B9; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; margin-top: 5px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row--3 { grid-template-columns: 120px 1fr; }
@media (max-width: 560px) { .row, .row--3 { grid-template-columns: 1fr; } }
.check, .field > label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; cursor: pointer; margin: 0; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* ---------- Hinweise ---------- */
.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert--ok { background: var(--live-soft); border-color: #B5E3CF; color: #0A5C40; }
.alert--error { background: var(--danger-soft); border-color: #F2C2C5; color: #8E1F27; }
.alert--info { background: var(--accent-soft); border-color: #C9D2FC; color: #1A2C9E; }

/* ---------- Status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 4px 10px 4px 8px; border-radius: 99px; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--user { background: var(--user-soft); color: var(--user); }
.badge--admin { background: var(--admin-soft); color: var(--admin); }
.badge--live { background: var(--live-soft); color: var(--live); }
.badge--off { background: #ECEFF4; color: var(--muted); }

.turn {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14.5px;
}
.turn strong { display: block; font-size: 15px; margin-bottom: 1px; }
.turn__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 15px; }
.turn--user { background: var(--user-soft); color: #6B4400; }
.turn--user .turn__icon { background: var(--user); color: #fff; }
.turn--admin { background: var(--admin-soft); color: #1A2C9E; }
.turn--admin .turn__icon { background: var(--admin); color: #fff; }
.turn--live { background: var(--live-soft); color: #0A5C40; }
.turn--live .turn__icon { background: var(--live); color: #fff; }
.turn--off { background: #ECEFF4; color: var(--ink-2); }
.turn--off .turn__icon { background: var(--muted); color: #fff; }

/* Timeline */
.timeline { display: flex; gap: 0; margin: 4px 0 18px; padding: 0; list-style: none; }
.timeline li { flex: 1; position: relative; text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 22px; }
.timeline li::before {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1;
}
.timeline li::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.timeline li:first-child::after { display: none; }
.timeline li.done { color: var(--ink-2); }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.done::after { background: var(--accent); }
.timeline li.current { color: var(--ink); font-weight: 600; }
.timeline li.current::before { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li.current::after { background: var(--accent); }

/* ---------- Dashboard ---------- */
.site-list { display: grid; gap: 14px; }
.site-card {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.site-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.site-card__name { font-family: var(--display); font-size: 19px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site-card__meta { color: var(--muted); font-size: 14px; }
.site-card__turn { grid-column: 1 / -1; margin-top: 8px; }
.site-card__side { text-align: right; font-size: 14px; color: var(--muted); }
.site-card__price { font-weight: 600; color: var(--ink); font-size: 15px; }
.dot-unread { background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 8px; font-family: var(--font); }

.empty { text-align: center; padding: 48px 20px; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 20px; }

/* ---------- Chat ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg__meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: normal; }
.msg--me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg--me .msg__meta { color: rgba(255,255,255,.75); }
.msg--me a { color: #fff; }
.msg--them { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; }
.msg--system { align-self: center; background: none; color: var(--muted); font-size: 13px; text-align: center; padding: 4px 10px; max-width: 92%; }
.msg--system .msg__meta { display: inline; margin-left: 6px; }
.msg--note { align-self: stretch; max-width: none; background: #FFF9E6; border: 1px dashed #E8C66A; color: #5E4A00; }
.msg__files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg__files a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: rgba(255,255,255,.18); padding: 5px 9px; border-radius: 7px; text-decoration: none; }
.msg--them .msg__files a, .msg--note .msg__files a { background: var(--surface); border: 1px solid var(--line); }
.msg__files img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; }
.msg__files a.img { padding: 0; background: none; border: 0; }
.composer { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.composer textarea { min-height: 70px; }
.composer__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer__files { font-size: 13px; color: var(--muted); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.thread-empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 14px; }

/* ---------- DNS ---------- */
.dns-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dns-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 0 10px 8px 0; }
.dns-table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.dns-table code { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper); padding: 5px 7px; border-radius: 6px; }
.copy { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 2px 4px; }
.light { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.light::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 4px; }
.light--ok { color: var(--live); } .light--ok::before { background: var(--live); }
.light--bad { color: var(--danger); } .light--bad::before { background: var(--danger); }
.light--wait { color: var(--muted); } .light--wait::before { background: var(--line-strong); }

/* ---------- Definition-Listen ---------- */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs a { display: block; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.thumbs .file-chip { display: inline-flex; align-items: center; height: 84px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; text-decoration: none; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth__box { width: 100%; max-width: 400px; }
.auth__box .brand { margin-bottom: 28px; }
.auth__box .card { padding: 28px; }
.auth__alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- Tabellen (Admin) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link-row { cursor: pointer; }
.table tr.link-row:hover td { background: #F8FAFC; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Modal */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: 0 30px 80px -20px rgba(19,32,58,.45); color: var(--ink); }
dialog::backdrop { background: rgba(19, 32, 58, .45); }
.dialog__body { padding: 24px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 640px) {
  .topbar__in { gap: 10px; }
  .nav a, .nav button { padding: 8px 8px; font-size: 14px; }
  .wrap { padding-top: 24px; }
  .card { padding: 18px; }
  .site-card { grid-template-columns: 1fr; }
  .site-card__side { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
