:root {
  --bg: #0b0c0e;
  --bg-elevated: #13151a;
  --bg-panel: #171a20;
  --border: #2a2e38;
  --border-soft: #22262f;
  --text: #eceef2;
  --muted: #8e94a3;
  --muted-2: #6b7280;
  --green: #3dce7a;
  --yellow: #d4b45a;
  --red: #e05a5a;
  --blue: #4a9eff;
  --focus: #7aa2ff;
  --radius: 10px;
  --card-width: 310px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(74, 158, 255, 0.08), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(61, 206, 122, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.page {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-header {
  display: grid;
  gap: 1.15rem;
  margin-bottom: 1.75rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.brand-sub {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.owner-link {
  color: #b8bfcc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}

.owner-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.browse-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  padding: 0.15rem 0 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.browse-item {
  position: relative;
}

.browse-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d7dbe5;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.browse-tab:hover {
  color: #ffffff;
}

.browse-tab.is-active,
.browse-tab.is-open {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.browse-hamburger,
.browse-hamburger::before,
.browse-hamburger::after {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

.browse-hamburger {
  position: relative;
}

.browse-hamburger::before,
.browse-hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.browse-hamburger::before {
  top: -4px;
}

.browse-hamburger::after {
  top: 4px;
}

.browse-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
}

.browse-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  z-index: 20;
  min-width: 240px;
  max-width: min(360px, 90vw);
  max-height: min(420px, 60vh);
  overflow: auto;
  padding: 0.85rem 0.75rem 0.9rem;
  border-radius: 0 0 14px 14px;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.browse-menu-title {
  margin: 0 0.55rem 0.65rem;
  color: #8b92a1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.browse-menu-list {
  display: grid;
  gap: 0.15rem;
}

.browse-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e8ebf2;
  text-align: left;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}

.browse-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.browse-option.is-selected {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 650;
}

.toolbar {
  margin-bottom: 1.15rem;
  padding: 0.85rem;
  background:
    linear-gradient(180deg, rgba(28, 31, 38, 0.95), rgba(16, 18, 23, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 40px rgba(0, 0, 0, 0.28);
}

.toolbar-main {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  color: #7d8494;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.search-wrap input[type="search"] {
  width: 100%;
  background: rgba(8, 9, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.85rem 1.1rem 0.85rem 2.7rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search-wrap input[type="search"]::placeholder {
  color: #6f7685;
}

.search-wrap input[type="search"]:focus {
  border-color: rgba(122, 162, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.12);
  background: rgba(8, 9, 12, 0.92);
}

.search-wrap input[type="search"]:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-chip select:focus {
  border-color: rgba(122, 162, 255, 0.55);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.filter-chip {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.filter-chip span {
  color: #8b92a1;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 0.35rem;
}

.filter-chip select {
  width: 100%;
  appearance: none;
  background:
    #0c0e12
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23898fa0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.85rem center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.72rem 2rem 0.72rem 0.95rem;
  outline: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-chip select:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-chip select:focus {
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.12);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  outline: none;
}

.field input[readonly] {
  color: var(--muted);
  cursor: default;
  background: #0f1115;
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.result-count {
  margin: 0;
  justify-self: end;
  color: #d7dbe5;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.demo-banner {
  margin: 0;
  color: #9a9070;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
  gap: 1.1rem;
  justify-content: start;
}

.article-card {
  width: 100%;
  max-width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: #3a4150;
  transform: translateY(-2px);
  outline: none;
}

.card-image {
  aspect-ratio: 4 / 5;
  background: #0f1115;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 0.85rem 0.95rem 1rem;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-brand {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-year {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.card-name {
  margin: 0.25rem 0 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.market-value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.price-change {
  font-size: 0.85rem;
  font-weight: 600;
}

.price-change.up,
.value-positive {
  color: var(--green);
}

.price-change.down,
.value-negative {
  color: var(--red);
}

.price-change.flat,
.value-neutral {
  color: var(--yellow);
}

.signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.signal.attraktiv {
  color: var(--green);
  background: rgba(61, 206, 122, 0.1);
  border-color: rgba(61, 206, 122, 0.28);
}

.signal.neutral {
  color: var(--yellow);
  background: rgba(212, 180, 90, 0.1);
  border-color: rgba(212, 180, 90, 0.28);
}

.signal.abwarten {
  color: var(--red);
  background: rgba(224, 90, 90, 0.1);
  border-color: rgba(224, 90, 90, 0.28);
}

.empty-state {
  color: var(--muted);
  padding: 3rem 0;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.modal-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #111318;
  border: 1px solid #2a2f3a;
  border-radius: 22px;
  box-shadow: var(--shadow);
  z-index: 1;
}

.modal-panel.detail-panel {
  width: min(980px, 100%);
  overflow: hidden;
}

.modal-panel.narrow {
  width: min(420px, 100%);
  padding: 1.25rem 1.25rem 1.4rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: #f2f3f5;
  color: #111318;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.modal-close:hover {
  background: #ffffff;
}

.modal-content {
  display: grid;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  min-height: 520px;
}

.detail-media {
  background: #d8dbe2;
  padding: 1.1rem;
  display: flex;
}

.detail-media-frame {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #0f1115;
  min-height: 100%;
}

.detail-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-side {
  position: relative;
  padding: 1.6rem 1.7rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #111318;
}

.detail-category {
  margin: 0;
  color: #8b92a1;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.detail-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  font-weight: 700;
}

.detail-meta {
  margin: 0.45rem 0 0;
  color: #8b92a1;
  font-size: 0.92rem;
}

.detail-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.metric-box {
  padding: 0.95rem 1rem;
  border: 1px solid #2c3340;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.metric-box .label {
  color: #8b92a1;
  font-size: 0.86rem;
}

.metric-box .value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric-box .value.quick {
  color: #3dce7a;
}

.metric-box .value.normal {
  color: #e0b34d;
}

.metric-box .value.patience {
  color: #6eb6ff;
}

.metric-box .value.maxbuy {
  color: #f2f3f5;
}

.roi-box {
  margin-top: auto;
  border: 1px solid rgba(61, 206, 122, 0.28);
  border-radius: 16px;
  padding: 1.05rem 1.1rem 1rem;
  background:
    linear-gradient(180deg, rgba(61, 206, 122, 0.16), rgba(61, 206, 122, 0.03) 42%, rgba(17, 19, 24, 0.2));
  box-shadow: inset 0 1px 0 rgba(61, 206, 122, 0.25);
}

.roi-box .label {
  display: block;
  color: #8b92a1;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.roi-box .value {
  display: block;
  color: #3dce7a;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.roi-box .hint {
  display: block;
  margin-top: 0.55rem;
  color: #7f8796;
  font-size: 0.82rem;
}

.muted,
.small {
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-heading {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

/* Auth */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-shell {
  width: min(420px, 100%);
}

.back-link {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.auth-brand {
  font-size: 1.8rem;
}

.auth-lead {
  margin: 0.35rem 0 1.2rem;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: #41485a;
  background: rgba(255, 255, 255, 0.03);
}

.btn-primary {
  background: #e8eaef;
  color: #111318;
  border-color: #e8eaef;
  font-weight: 650;
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.btn-ghost {
  color: var(--muted);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(224, 90, 90, 0.35);
}

.btn-block {
  width: 100%;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 0.88rem;
}

.form-success {
  margin: 0;
  color: var(--green);
  font-size: 0.88rem;
}

/* Admin */
.admin-header {
  align-items: center;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.session-email {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 1.1rem;
  align-items: start;
}

.admin-form-panel,
.admin-list-panel {
  background: rgba(19, 21, 26, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.upload-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.upload-row input[type="file"] {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
}

.image-preview {
  margin-top: 0.6rem;
  width: 120px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-toolbar {
  margin-bottom: 0.9rem;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(19, 21, 26, 0.9);
  border: 1px solid var(--border-soft);
  box-shadow: none;
}

.admin-toolbar .search-wrap input[type="search"] {
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.admin-toolbar .filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-toolbar .field {
  display: grid;
  gap: 0.35rem;
}

.admin-toolbar .result-count {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 400;
  color: var(--muted);
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.2);
}

.admin-thumb {
  width: 44px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #0f1115;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
}

.status-pill {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-pill.published {
  color: var(--green);
  border-color: rgba(61, 206, 122, 0.35);
}

.status-pill.draft {
  color: var(--yellow);
  border-color: rgba(212, 180, 90, 0.35);
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: min(92vh, 900px);
    overflow: auto;
  }

  .detail-media {
    min-height: 280px;
    padding: 0.9rem;
  }

  .detail-media-frame {
    min-height: 260px;
    aspect-ratio: 4 / 5;
  }

  .detail-side {
    padding: 1.25rem 1.15rem 1.3rem;
  }

  .metric-box .value {
    font-size: 1.35rem;
  }
}

@media (max-width: 980px) {
  .toolbar-main {
    grid-template-columns: 1fr;
  }

  .result-count {
    justify-self: start;
  }
}

@media (max-width: 800px) {
  .filters,
  .admin-toolbar .filters {
    grid-template-columns: 1fr;
  }

  .browse-nav {
    gap: 0;
  }

  .browse-tab {
    padding: 0.7rem 0.7rem;
    font-size: 0.92rem;
  }

  .browse-menu {
    left: 0;
    right: auto;
    min-width: min(280px, 88vw);
  }

  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 1.2rem, 1400px);
    padding-top: 1.25rem;
  }

  .toolbar {
    padding: 0.7rem;
    border-radius: 16px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    max-width: none;
  }

  .modal-panel.detail-panel {
    width: 100%;
    border-radius: 18px;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }
}
