@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --ink:       #0D0F12;
  --ink-2:     #3A3E47;
  --ink-3:     #9A9FA8;
  --surface:   #F7F6F3;
  --card:      #FFFFFF;
  --good:      #1A7A4A;
  --good-bg:   #E8F8EF;
  --bad:       #C0392B;
  --bad-bg:    #FDECEA;
  --accent:    #5DE896;
  --border:    rgba(13,15,18,0.09);
  --border-strong: rgba(13,15,18,0.16);
  --shadow-sm: 0 2px 12px rgba(13,15,18,0.06);
  --shadow-md: 0 8px 32px rgba(13,15,18,0.10);

  /* legacy compat */
  --brand-blue:       #0D0F12;
  --brand-green:      #5DE896;
  --brand-green-dark: #1A7A4A;
  --bg:               #F7F6F3;
  --text:             #0D0F12;
  --muted:            #9A9FA8;
  --auto:             #EEEDF0;

  --field-height:    50px;
  --field-padding-x: 14px;
  --field-padding-y: 8px;
  --label-size:      10px;
  --input-size:      16px;
  --row-gap:         8px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  background: #fff;
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.logged-in {
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.logged-in > .header { flex-shrink: 0; }
body.logged-in > main { flex: 1 0 auto; }
body.logged-in > .app-footer { flex-shrink: 0; margin-top: 0; }
body.paywall-open { overflow: hidden; }

/* ── INPUTS: prevent iOS zoom ── */
input, select, textarea {
  font-size: 16px !important;
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.header {
  background: rgba(247,246,243,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

/* Logo: brand-lockup */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-header {
  width: 32px;
  height: 32px;
  background: var(--ink);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon-header svg {
  width: 19px;
  height: 19px;
  display: block;
}

.brand-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}

.brand-wordmark strong {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-rent {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  color: var(--ink);
}

.brand-ability {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 3px;
  align-self: center;
}

.brand-sub { display: none; }

/* ─────────────────────────────────────────
   AUTH NAV
───────────────────────────────────────── */
#auth-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─────────────────────────────────────────
   LANG SWITCH
───────────────────────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
  height: 36px;
  position: relative;
}

.lang-switch input { display: none; }

.lang-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  transition: color .25s ease, opacity .25s ease;
}

.lang-text-left  { left: 10px; }
.lang-text-right { right: 10px; }

.lang-switch .slider {
  position: relative;
  width: 72px;
  height: 32px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: background .25s ease;
}

.lang-switch .slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(13,15,18,0.2);
  transition: transform .25s ease;
  z-index: 2;
}

.lang-switch input:checked + .slider::before {
  transform: translateX(34px);
}

body.lang-de .lang-text-left  { color: #fff; opacity: 1; }
body.lang-de .lang-text-right { color: var(--ink-3); opacity: 1; }
body.lang-en .lang-text-left  { color: var(--ink-3); opacity: 1; }
body.lang-en .lang-text-right { color: #fff; opacity: 1; }

.gate-lang-switch {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1);
}
.gate-lang-switch.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity .18s ease, transform .18s ease;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }

.btn.ghost {
  background: var(--card);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.btn.ghost:hover { background: var(--surface); }

.btn.small {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */
main {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 32px;
}

@media (min-width: 900px) {
  main {
    max-width: 1100px;
  }

  .dash-hero h1 { font-size: 56px; }
  .dash-eyebrow { font-size: 12px; }
  .dash-hero p { font-size: 15px; }

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

  .kpi-card { padding: 24px 22px; }
  .kpi-card .val { font-size: 42px; }

  .object-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-actions .btn { height: 52px; font-size: 15px; }

  .section-label { font-size: 12px; }

  /* Object card desktop sizing */
  .item-top { padding: 26px 28px 22px !important; }
  .item-left strong { font-size: 20px !important; }
  .cf-pill { font-size: 17px !important; padding: 8px 16px !important; }

  .badge {
    padding: 18px 22px !important;
    font-size: 12px !important;
  }
  .badge b { font-size: 20px !important; }

  .item-footer { padding: 16px 28px !important; }
  .pdf-btn { font-size: 14px !important; }
}

/* ── FIX: nur Dashboard verstecken, nicht main ── */
body:not(.logged-in) #dash,
body:not(.logged-in) #paymentMessage {
  display: none !important;
}

body:not(.logged-in) .header {
  display: none;
}

body:not(.logged-in) .app-footer {
  display: none;
}

body.logged-in main {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 32px;
  width: 100%;
}

/* ─────────────────────────────────────────
   DASHBOARD
───────────────────────────────────────── */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-hero-text { flex: 1; min-width: 0; }

.dash-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.dash-hero h1 {
  margin: 0 0 4px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.dash-hero h1 em { font-style: italic; }

.dash-hero p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
}

.dash-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.main-btn { white-space: nowrap; flex: 1; }

/* mobile: stack hero vertically, buttons full-width row */
@media (max-width: 600px) {
  .dash-hero {
    flex-direction: column;
    gap: 20px;
  }
  .dash-actions {
    width: 100%;
    padding-top: 0;
  }
  .dash-actions .btn {
    flex: 1;
  }
  .dash-hero h1 { font-size: 34px; }
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  background: var(--card);
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.kpi-card:first-child {
  background: var(--ink);
}

.kpi-card:first-child span {
  color: rgba(255,255,255,0.4) !important;
}

.kpi-card:first-child .val {
  color: var(--accent) !important;
}

.kpi-card span {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}

.kpi-card .val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

@media (min-width: 600px) {
  .kpi-card .val { font-size: 38px; }
  .kpi-card { padding: 22px 20px; }
}

/* OBJECT LIST */
.object-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-text {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 300;
}

/* SECTION LABEL */
.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

/* ITEM (object card) */
.item {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}

.item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.item-top {
  padding: 16px 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item-left {
  flex: 1;
  min-width: 0;
}

.item-left strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.4;
  display: block;
}

@media (min-width: 900px) {
  .item-left strong { font-size: 20px; }
  .item-top { padding: 26px 28px 22px; }
}

.item-right {
  display: flex;
  align-items: center;
  margin-left: 12px;
  flex-shrink: 0;
}

/* KPI BADGES → now inline metrics row */
.kpi-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

.badge {
  padding: 11px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: none;
  border-radius: 0;
  white-space: nowrap;
}

.badge:last-child { border-right: none; }

.badge b {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-transform: none;
}

@media (min-width: 900px) {
  .badge b { font-size: 20px; }
  .badge { font-size: 12px; padding: 18px 22px; }
}

.badge.good b { color: var(--good); }
.badge.bad  b { color: var(--bad); }

/* Cashflow badge pill (top right) */
.cf-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .cf-pill { font-size: 17px; padding: 8px 16px; }
}
.cf-pill.pos { background: var(--good-bg); color: var(--good); }
.cf-pill.neg { background: var(--bad-bg);  color: var(--bad); }

/* Item footer */
.item-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-btn {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  letter-spacing: 0.04em;
  padding: 4px 0;
  transition: color .15s ease;
}

.pdf-btn:hover { color: var(--ink); }

/* ─────────────────────────────────────────
   MODAL OVERLAY
───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,15,18,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-overlay:target { display: flex; }

.modal-window {
  background: var(--surface);
  width: 95%;
  max-width: 1080px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(13,15,18,0.2);
}

.modal-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  max-height: 90vh;
  overflow: hidden;
}

.calc-form {
  overflow: auto;
  padding-right: 8px;
  -webkit-overflow-scrolling: touch;
}

.calc-preview {
  position: sticky;
  top: 0;
  align-self: start;
}

/* Modal header */
.modal-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header-simple h2 {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.close-icon {
  width: 32px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  transition: background .15s ease;
}
.close-icon:hover { background: var(--surface); }

/* ─────────────────────────────────────────
   TABS
───────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  margin-bottom: 16px;
  position: relative;
  align-content: flex-start;
  background: none;
  border: none;
}

.tabs input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.tabs label {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: -0.01em;
  transition: all .15s ease;
  color: var(--ink-3);
  background: var(--card);
  border: 1px solid var(--border);
  z-index: 10;
}

.tabs input:checked + label {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tab-content {
  display: none;
  width: 100%;
  margin-top: 4px;
  position: relative;
  z-index: 5;
}

/* Live result strip */
.live-strip {
  background: var(--ink);
  border-radius: 16px;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.live-strip-item {
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 0 4px;
}
.live-strip-item:last-child { border-right: none; }

.live-strip-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 7px;
  display: block;
}

.live-strip-val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.01em;
  display: block;
}

.live-strip-val.pos { color: var(--accent); }
.live-strip-val.neg { color: #FF6B6B; }

/* ─────────────────────────────────────────
   FORM INPUTS
───────────────────────────────────────── */
.in-row {
  display: flex;
  flex-direction: column;
  background: var(--card);
  padding: var(--field-padding-y) var(--field-padding-x);
  border-radius: 12px;
  margin-bottom: var(--row-gap);
  border: 1px solid var(--border);
  height: var(--field-height);
  justify-content: center;
  transition: border-color .15s ease;
}

.in-row:focus-within { border-color: var(--ink); }

.in-row span {
  font-size: var(--label-size);
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.07em;
  display: block;
}

.in-row input,
.select-field {
  border: none;
  background: transparent;
  font-weight: 400;
  font-size: var(--input-size);
  outline: none;
  width: 100%;
  color: var(--ink);
  line-height: 1.2;
  font-family: inherit;
  padding: 0;
}

.in-row.auto {
  background: #EEEDF0;
  border-style: solid;
  border-color: transparent;
}

.in-row.auto input { font-weight: 600; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: start;
}

.divider {
  margin: 14px 0 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────
   PREVIEW / CALC SIDEBAR
───────────────────────────────────────── */
.preview-card {
  background: var(--ink);
  border: none;
  padding: 20px;
  border-radius: 20px;
}

.prev-item.big .label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.prev-item.big .val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.03em;
  line-height: 1;
}

.prev-item.big .val.negative { color: #FF6B6B; }

.prev-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}

.prev-item hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 12px 0; }

.prev-item .label {
  color: rgba(255,255,255,0.45);
  font-weight: 400;
}

.val-s {
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

.comparison-box {
  margin-top: 18px;
  background: rgba(255,255,255,0.06);
  padding: 14px;
  border-radius: 14px;
}

.comparison-eyebrow {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 10px;
}

.comparison-box .prev-item b {
  color: rgba(255,255,255,0.85);
}

/* ─────────────────────────────────────────
   SAVE / DELETE BUTTONS
───────────────────────────────────────── */
.save-btn {
  height: 50px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.delete-btn {
  height: 50px;
  background: var(--card);
  color: var(--bad);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
}

/* ─────────────────────────────────────────
   AUTOCOMPLETE
───────────────────────────────────────── */
.ac-results {
  position: absolute;
  background: var(--card);
  z-index: 10001;
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  max-height: 250px;
  overflow-y: auto;
  top: calc(100% + 6px);
  left: 0;
}

.ac-item {
  padding: 12px 15px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s ease;
}

.ac-item:hover { background: var(--surface); }

/* ─────────────────────────────────────────
   QUICK ANALYSIS (Schnellanalyse)
───────────────────────────────────────── */
.quick-window {
  max-width: 680px;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.quick-title {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.quick-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s;
}
.quick-close:hover { background: var(--surface); }

/* Progress bar */
.quick-progress {
  padding: 12px 22px 0;
  flex-shrink: 0;
}
.quick-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}
.quick-progress-meta strong { color: var(--ink); }
.quick-progress-bar {
  height: 3px;
  background: rgba(13,15,18,0.08);
  border-radius: 10px;
  overflow: hidden;
}
.quick-progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 10px;
  transition: width .4s ease;
}

.quick-body {
  padding: 18px 22px;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 52svh;
}

.quick-footer {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.quick-input {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 14px;
  font-weight: 400;
  outline: none;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s;
}
.quick-input:focus { border-color: var(--ink); }

.quick-send {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-bottom {
  padding: 0 22px 18px;
  background: var(--surface);
  flex-shrink: 0;
}

.quick-apply {
  width: 100%;
  margin-top: 8px;
}

/* Chat bubbles */
.qa-row {
  display: flex;
  margin: 0;
  animation: fadeUp .25s ease forwards;
}
.qa-row.left  { justify-content: flex-start; align-items: flex-end; gap: 8px; }
.qa-row.right { justify-content: flex-end; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qa-bot-icon {
  width: 28px;
  height: 28px;
  background: var(--ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-bubble {
  max-width: 75%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.qa-bubble.left {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}

.qa-bubble.right {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* Result card in chat */
.qa-result {
  background: var(--ink);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 18px;
  max-width: 85%;
}

.qa-result-eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
  display: block;
}

.qa-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.qa-result-item-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.qa-result-item-val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.02em;
  display: block;
}

.qa-result-item-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
  display: block;
}

.qa-result-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 12px 0;
}

.qa-result-cf-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.qa-result-cf-val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1;
  display: block;
}
.qa-result-cf-val.pos { color: var(--accent); }
.qa-result-cf-val.neg { color: #FF6B6B; }

.qa-result-cf-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 5px;
  display: block;
}

.qa-followup {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-top-left-radius: 4px;
  padding: 12px 14px;
  max-width: 85%;
  margin-top: 6px;
}

.qa-followup p {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 10px;
}

/* ─────────────────────────────────────────
   AUTH
───────────────────────────────────────── */
.auth-window {
  max-width: 420px;
  padding: 36px;
  position: relative;
  background: var(--card);
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
}

.auth-mode-btn {
  height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}

.auth-mode-btn.active {
  background: var(--ink);
  color: #fff;
}

.auth-hint {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: center;
}

/* ─────────────────────────────────────────
   STARTSCREEN / GATE
───────────────────────────────────────── */
#loggedOutGate {
  display: none;
  min-height: 100svh;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.gate-shell {
  min-height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 24px 72px;
  text-align: center;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(0px) scale(.985);
  will-change: transform, opacity;
}

.hero-intro.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 1.35s ease, transform 1.35s cubic-bezier(.2,.8,.2,1);
}

.hero-intro.lift {
  transform: translateY(-36px);
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}

/* Splash logo */
.logo-splash {
  width: 72px;
  height: 72px;
  background: var(--ink);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-splash svg {
  width: 40px;
  height: 40px;
}

.logo-mark { display: none; }

.intro-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.intro-wordmark .brand-rent {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.intro-wordmark .brand-ability {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 4px;
  align-self: center;
}

.gate-copy {
  margin-top: 28px;
  opacity: 0;
  transform: translateY(8px);
  max-width: 640px;
}

.gate-copy.show {
  animation: gateCopyReveal .5s ease forwards;
}

.gate-text {
  margin: 0 auto;
  max-width: 520px;
  min-height: 56px;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.75;
  color: var(--ink-3);
  font-weight: 300;
}

#gateTypeText {
  font-weight: 500;
  color: var(--ink);
}

#gateCursor {
  display: inline-block;
  width: 10px;
  margin-left: 2px;
  color: var(--ink);
  animation: gateBlink 1s steps(2, end) infinite;
}

.gate-cta-wrap {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1);
}

.gate-cta-wrap.show {
  opacity: 1;
  transform: translateY(0);
}

.gate-cta {
  display: inline-flex;
  width: auto !important;
  min-width: 260px;
  height: 52px !important;
  padding: 0 28px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.gate-login {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1);
}

.gate-login.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.gate-top-actions {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.gate-top-actions .gate-login { position: static; }

.gate-top-actions .lang-switch {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1);
}

.gate-top-actions .lang-switch.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   PREVIEW LOCK
───────────────────────────────────────── */
#calcPreviewWrap {
  position: sticky;
  top: 0;
  align-self: start;
}

#calcPreviewWrap.preview-locked .preview-card {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.preview-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-lock-card {
  max-width: 300px;
  width: 100%;
  background: rgba(247,246,243,0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  text-align: center;
}

.preview-lock-card strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
}

.preview-lock-card p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}

.preview-lock-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─────────────────────────────────────────
   MOBILE PAYWALL
───────────────────────────────────────── */
.mobile-paywall {
  position: fixed;
  inset: 0;
  z-index: 10050;
}

.mobile-paywall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,15,18,0.5);
  backdrop-filter: blur(8px);
}

.mobile-paywall-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 50px rgba(13,15,18,0.18);
  padding: 18px 20px 32px;
}

.mobile-paywall-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-paywall-content { padding-top: 16px; }

.mobile-paywall-content h3 {
  margin: 0 0 8px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mobile-paywall-content p {
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 300;
}

.mobile-paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-paywall-actions .btn { width: 100%; }

.mobile-paywall-later {
  width: 100%;
  margin-top: 12px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

/* ─────────────────────────────────────────
   SELECT
───────────────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

select:focus { border-color: var(--ink); }

.select-wrap {
  position: relative;
}

.select-wrap span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  bottom: 14px;
  pointer-events: none;
  font-size: 12px;
  color: var(--ink-3);
}

/* ─────────────────────────────────────────
   TOOLTIP / INFO
───────────────────────────────────────── */
.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ink);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  z-index: 9999;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

/* ─────────────────────────────────────────
   PAYMENT MESSAGE
───────────────────────────────────────── */
.payment-message {
  max-width: 680px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border);
}

.payment-message.success { background: var(--good-bg); border-color: #c0e8d0; color: var(--good); }
.payment-message.cancel  { background: #fff7e8; border-color: #f1dfb3; color: #8a6a16; }
.payment-message.error   { background: var(--bad-bg); border-color: #f7d6d6; color: var(--bad); }

/* ─────────────────────────────────────────
   PAYWALL AUTH HINT
───────────────────────────────────────── */
.paywall-auth-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.paywall-auth-hint p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

.paywall-auth-hint .btn { width: 100%; }

/* ─────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────── */
@keyframes gateBlink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes gateCopyReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color .15s ease;
}

.footer-links a:hover { color: var(--ink); }

.footer-copy {
  font-size: 12px;
  color: var(--ink-3);
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 1024px) {
  .modal-body {
    grid-template-columns: 1fr !important;
    padding: 14px;
    gap: 14px;
    max-height: 86vh;
    overflow: auto;
  }

  .calc-preview { display: none !important; }
  .calc-form { padding-right: 0; }
  .preview-lock-card { max-width: 100%; }
}

@media (max-width: 850px) {
  main { margin: 20px auto; padding: 0 18px; }

  .kpi-card .val { font-size: 26px; }

  .object-list { grid-template-columns: 1fr; }

  .gate-shell { padding: 32px 20px 60px; }
  .gate-text { font-size: 15px; line-height: 1.65; min-height: 60px; }
  .gate-cta-wrap { margin-top: 32px; }
  .gate-top-actions { top: 16px; right: 16px; gap: 8px; }

  #calc .tabs label { font-size: 11px; padding: 0 10px; }

  #quick { align-items: flex-end; padding: 0; }
  #quick .quick-window {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 88svh;
  }
  #quick .quick-body { max-height: 45svh; }
}

@media (min-width: 851px) {
  .mobile-paywall { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-intro, .gate-copy, .gate-cta-wrap, .gate-login,
  .btn, .item, .lang-switch, .qa-row {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ─────────────────────────────────────────
   SUPPORT FAB + MODAL
───────────────────────────────────────── */
#supportFab {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0D0F12;
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13,15,18,0.25);
  z-index: 9998;
  transition: transform .18s ease, box-shadow .18s ease;
}

@media (min-width: 851px) {
  #supportFab { bottom: 28px; right: 28px; }
}
#supportFab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(13,15,18,0.25); }

.support-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,15,18,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.support-window {
  background: var(--surface);
  width: 95%;
  max-width: 480px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(13,15,18,0.2);
}
.support-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.support-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.support-sub { font-size: 13px; color: var(--ink-3); font-weight: 300; margin: 0; }
.support-form { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.support-input { border: none; background: transparent; font-size: 16px; font-weight: 400; outline: none; width: 100%; color: var(--ink); font-family: inherit; padding: 0; }
.support-textarea-row { height: auto !important; padding-top: 10px !important; padding-bottom: 10px !important; }
.support-textarea { border: none; background: transparent; font-size: 16px; font-weight: 400; outline: none; width: 100%; color: var(--ink); font-family: inherit; padding: 0; resize: none; line-height: 1.5; }
.support-error { font-size: 13px; color: var(--bad); background: var(--bad-bg); border-radius: 10px; padding: 10px 14px; }
.support-success { font-size: 13px; color: var(--good); background: var(--good-bg); border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.support-actions { display: flex; gap: 10px; margin-top: 6px; }
.support-actions .btn { flex: 2; height: 50px; }
.support-actions .btn.ghost { flex: 1; height: 50px; }

#btnSupport { display: none; }
