/* Mieterportal-Demo: ergänzt /_kit/kit.css */

.ic { width: 18px; height: 18px; flex-shrink: 0; }
.btn .ic { width: 17px; height: 17px; }
.btn .ic.arrow { width: 16px; height: 16px; }
.spinner-light { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.badge-xs { height: 20px; padding: 0 8px; font-size: 11.5px; margin-left: 8px; vertical-align: 2px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--paper-2); font-size: 12px; font-weight: 500; color: var(--ink-2); vertical-align: 3px; font-variant-numeric: tabular-nums; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; border: 0; background: none; color: var(--ink-2); font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(18, 18, 17, 0.25); text-underline-offset: 4px; white-space: nowrap; }
.link-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }
.link-btn .ic { width: 15px; height: 15px; }

/* ---------- Demo-Steuerung ---------- */
.portal-section { padding-top: 8px; }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px 12px 12px 14px; margin-bottom: 18px; border: 1px dashed rgba(18, 18, 17, 0.24); border-radius: var(--radius); }
.dc-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dc-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 2px; }
.dc-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dc-hint { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--ink-3); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--paper-2); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 18, 17, 0.1), 0 4px 10px -6px rgba(18, 18, 17, 0.25); }
.seg-sm .seg-btn { height: 32px; padding: 0 12px; font-size: 13.5px; }
.seg-sm .ic { width: 16px; height: 16px; }

/* ---------- App-Rahmen ---------- */
.app { scroll-margin-top: 80px; background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.app-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex-shrink: 0; }
.app-brand-text { min-width: 0; }
.app-name { display: block; font-weight: 600; letter-spacing: -0.02em; font-size: 15.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sub { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.3; }
.app-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.app-user-text { display: flex; flex-direction: column; text-align: right; line-height: 1.25; }
.app-user-name { font-size: 14px; font-weight: 500; }
.app-user-sub { font-size: 12.5px; color: var(--ink-3); }
.avatar { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; flex-shrink: 0; }
.avatar-ink { background: var(--ink); color: var(--paper); }
.avatar-lg { width: 44px; height: 44px; font-size: 14px; }
@media (max-width: 600px) { .app-user-text { display: none; } }

.app-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.app-nav { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); background: var(--sheet); overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-item { position: relative; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 15px; cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s; }
.nav-item:hover { color: var(--ink); background: rgba(18, 18, 17, 0.04); }
.nav-item[aria-current="page"] { background: var(--white); color: var(--ink); box-shadow: 0 0 0 1px var(--line-soft); }
.nav-item .dot { margin-left: -2px; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--paper-2); font-size: 11.5px; font-weight: 500; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-cta { display: none; }
.nav-foot { display: none; }
@media (min-width: 960px) {
  .app-body { grid-template-columns: 236px minmax(0, 1fr); min-height: 680px; }
  .app-nav { flex-direction: column; align-items: stretch; gap: 14px; padding: 20px 14px; border-bottom: 0; border-right: 1px solid var(--line-soft); overflow: visible; }
  .nav-list { flex-direction: column; }
  .nav-item { width: 100%; }
  .nav-count { margin-left: auto; }
  .nav-item .dot + .nav-count { margin-left: 0; }
  .nav-item .dot { margin-left: auto; }
  .nav-cta { display: inline-flex; width: 100%; height: 40px; margin-bottom: 6px; }
  .nav-foot { display: block; margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line-soft); }
  .nav-foot p { margin: 0; }
}

.app-main { min-width: 0; padding: 22px 18px 30px; }
@media (min-width: 768px) { .app-main { padding: 32px 36px 40px; } }
.view-in { animation: kit-in .45s var(--ease) both; }
.view > * + * { margin-top: 18px; }
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; }
.view-head .eyebrow { margin-bottom: 8px; }
.view-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.view-title:focus { outline: none; }
.back { margin-bottom: -4px; text-decoration: none; }
.back:hover { text-decoration: underline; }

/* ---------- Karten im Portal ---------- */
.pcard { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--white); padding: 18px; }
@media (min-width: 768px) { .pcard { padding: 22px; } }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pcard-head .h3 { font-size: 1.08rem; }
.home-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.home-col { display: grid; gap: 18px; align-content: start; }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); } }
@media (min-width: 700px) and (max-width: 1099px) { .home-col:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-col:last-child > :last-child { grid-column: 1 / -1; } }

.notice .ic { margin-top: 2px; color: var(--ink-2); }
.notice p { margin: 0; }
.house-note { background: var(--sheet); }
.emergency { background: var(--err-soft); border-color: rgba(179, 38, 30, 0.18); color: var(--ink); margin-top: 22px; }
.emergency .ic { color: var(--err); }
.new-note { align-items: center; background: var(--signal-soft); border-color: rgba(255, 90, 31, 0.25); color: var(--ink); }
.new-note .dot { margin: 0 4px 0 2px; }

/* Status */
.st { gap: 7px; }
.st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: currentColor; flex-shrink: 0; }
.st-0 { background: var(--signal-soft); color: var(--signal-ink); }
.st-1 { background: var(--warn-soft); color: var(--warn); }
.st-2 { background: rgba(18, 18, 17, 0.07); color: var(--ink); }
.st-3 { background: var(--ok-soft); color: var(--ok); }
span.st-dot.st-0 { background: var(--signal); }
span.st-dot.st-1 { background: #e09412; }
span.st-dot.st-2 { background: var(--ink); }
span.st-dot.st-3 { background: var(--ok); }

/* Meldungsliste */
.tlist { margin: 0 -8px; padding: 0; list-style: none; }
.tlist li + li { border-top: 1px solid var(--line-soft); }
.trow { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 8px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; transition: background-color .2s; }
.trow:hover { background: rgba(18, 18, 17, 0.03); }
.trow-main { display: grid; gap: 3px; min-width: 0; }
.trow-title { font-weight: 500; font-size: 15px; }
.trow-meta { font-size: 13px; color: var(--ink-3); }
.trow-meta .mono { font-size: 12px; }
.cat-badge { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--paper); color: var(--ink); flex-shrink: 0; }
.cat-badge .ic { width: 19px; height: 19px; }
.prog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 220px; margin-top: 6px; }
.prog span { height: 3px; border-radius: 9px; background: var(--paper-2); transition: background-color .4s; }
.prog span.on { background: var(--ink); }
@media (max-width: 520px) {
  .trow { grid-template-columns: auto minmax(0, 1fr); }
  .trow-side { grid-column: 2; }
}

.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 22px 12px 8px; }
.empty p { margin: 0; }
.empty .btn { margin-top: 10px; }
.empty-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 99px; background: var(--ok-soft); color: var(--ok); margin-bottom: 4px; }
.empty-title { font-weight: 500; }

/* Termine */
.appts { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.appt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 0; }
.appt + .appt { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.appt-date { width: 52px; height: 56px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.appt-day { font-size: 21px; font-weight: 500; letter-spacing: -0.03em; }
.appt-mon { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.appt-main { display: grid; gap: 1px; min-width: 0; }
.appt-title { font-weight: 500; }
.appt-meta { font-size: 13.5px; color: var(--ink-2); }
.appt-note { font-size: 13px; color: var(--ink-3); }
@media (max-width: 520px) { .appt { grid-template-columns: auto minmax(0, 1fr); } .appt .link-btn { grid-column: 2; justify-self: start; } }

.flat-addr { display: flex; gap: 10px; margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.flat-addr .ic { margin-top: 2px; color: var(--ink-3); }
.kv { margin: 0; display: grid; gap: 0; font-size: 14px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; }
.person { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.person-name { display: block; font-weight: 500; margin: 0; }
.person-role { display: block; font-size: 13px; color: var(--ink-3); }
.contact { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.contact li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.contact .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--ink-3); }
.mini-docs { margin: 0 -8px; padding: 0; list-style: none; }
.mini-doc { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14.5px; cursor: pointer; }
.mini-doc:hover { background: rgba(18, 18, 17, 0.03); }
.mini-doc .ic { color: var(--ink-3); }
.mini-doc-title { flex: 1; min-width: 0; }

/* Detail */
.detail-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.detail-side { display: grid; gap: 18px; align-content: start; }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ticket-text { margin: 0 0 14px; font-size: 15px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.ticket-photo { margin: 0 0 14px; }
.ticket-photo img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-soft); }
.ticket-photo figcaption { margin-top: 6px; }
.ticket-photo-sm img { max-height: 220px; }
.no-photo { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.no-photo .ic { width: 16px; height: 16px; }
.craft-card .person-name { font-size: 17px; }
.craft-card p { margin: 0; }
.appt-inline { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px !important; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 14.5px; font-weight: 500; }

.demo-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; padding: 12px 14px; border: 1px dashed rgba(18, 18, 17, 0.24); border-radius: 12px; }
.demo-box p { margin: 0; flex: 1 1 260px; color: var(--ink-2); }
.demo-box .dc-tag { vertical-align: 1px; margin-right: 6px; }

/* Zeitstrahl */
.timeline { margin: 0; padding: 0; list-style: none; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 13.5px; top: 28px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item.is-done::before { background: var(--ink); }
.tl-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--white); }
.tl-dot .ic { width: 15px; height: 15px; }
.is-done .tl-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.is-current .tl-dot { border-color: var(--signal); }
.is-current .tl-dot::after { content: ""; width: 10px; height: 10px; border-radius: 99px; background: var(--signal); }
.is-current .tl-dot::before { content: ""; position: absolute; inset: -1px; border-radius: 99px; border: 1px solid var(--signal); animation: tl-pulse 2.4s ease-out infinite; }
@keyframes tl-pulse { from { transform: scale(1); opacity: .6; } to { transform: scale(1.55); opacity: 0; } }
.tl-body { padding-top: 3px; min-width: 0; }
.tl-title { margin: 0; font-weight: 500; }
.is-todo .tl-title { color: var(--ink-3); font-weight: 400; }
.tl-meta { margin: 2px 0 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.tl-note { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------- Schaden melden ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 26px 0 0 !important; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 2px solid var(--line); color: var(--ink-3); font-size: 14px; min-width: 0; transition: border-color .3s; }
.stepper li.is-done { border-top-color: var(--ink); color: var(--ink-2); }
.stepper li.is-current { border-top-color: var(--signal); color: var(--ink); font-weight: 500; }
.st-num { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 99px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.st-num .ic { width: 14px; height: 14px; }
.is-done .st-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.is-current .st-num { background: var(--signal); border-color: var(--signal); color: #fff; }
.st-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .stepper { display: flex; }
  .stepper li { flex: 0 0 40px; }
  .stepper li.is-current { flex: 1 1 auto; }
  .stepper li:not(.is-current) .st-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}

.report-form { margin-top: 26px !important; display: grid; gap: 20px; max-width: 760px; }
.fs { margin: 0; padding: 0; border: 0; min-width: 0; }
.fs-legend { padding: 0; margin-bottom: 14px; font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; }
.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
@media (max-width: 420px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat-tile { position: relative; display: grid; align-content: start; gap: 4px; padding: 16px 14px 14px; border: 1px solid rgba(18, 18, 17, 0.14); border-radius: 14px; background: var(--white); cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s, transform .25s var(--ease); }
.cat-tile:hover { border-color: rgba(18, 18, 17, 0.35); transform: translateY(-1px); }
.cat-tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cat-tile-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--paper); margin-bottom: 8px; transition: background-color .2s, color .2s; }
.cat-tile-ic .ic { width: 21px; height: 21px; }
.cat-tile-name { font-weight: 500; }
.cat-tile-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.cat-tile:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cat-tile:has(input:checked) .cat-tile-ic { background: var(--ink); color: var(--paper); }
.cat-tile:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.cat-tile:has(input:checked)::after { content: ""; position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 99px; background: var(--signal); }

.form-grid { display: grid; gap: 20px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b4a46' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; cursor: pointer; }
.select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.error { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 0; }
.error .ic { width: 15px; height: 15px; margin-top: 2px; }
.hint-row { display: flex; justify-content: space-between; gap: 12px; }
.hint-row .hint { margin-top: 6px; }
.counter { flex-shrink: 0; font-family: var(--mono); font-size: 12px; }
.input-date { max-width: 260px; }
.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; border: 1px dashed rgba(18, 18, 17, 0.28); border-radius: 14px; background: var(--sheet); transition: border-color .2s, background-color .2s; }
.dropzone p { flex: 1 1 200px; margin: 0; }
.dropzone.is-over { border-color: var(--ink); background: var(--paper); }
.dropzone.is-loading { justify-content: flex-start; }
.drop-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--white); border: 1px solid var(--line-soft); }
.photo-preview { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; margin: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--sheet); animation: kit-in .4s var(--ease) both; }
.photo-preview img { width: 140px; height: 105px; object-fit: cover; border-radius: 10px; }
.photo-preview figcaption { display: grid; gap: 4px; justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.photo-preview .btn { margin-top: 6px; }
@media (max-width: 460px) { .photo-preview { grid-template-columns: minmax(0, 1fr); } .photo-preview img { width: 100%; height: 180px; } }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { position: relative; cursor: pointer; }
.slot-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot-chip > span { display: grid; gap: 1px; padding: 10px 16px; border: 1px solid rgba(18, 18, 17, 0.15); border-radius: 12px; background: var(--white); font-size: 14px; transition: border-color .2s, background-color .2s, color .2s; }
.slot-chip strong { font-weight: 500; }
.slot-chip .tiny { color: var(--ink-3); }
.slot-chip:hover > span { border-color: rgba(18, 18, 17, 0.4); }
.slot-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.slot-chip input:checked + span .tiny { color: rgba(243, 242, 238, 0.75); }
.slot-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.access-check { padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sheet); }

.review { display: grid; gap: 14px; }
.review-list { margin: 0; border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.review-list > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; }
.review-list > div + div { border-top: 1px solid var(--line-soft); }
.review-list dt { color: var(--ink-3); font-size: 14px; padding-top: 1px; }
.review-list dd { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.review-list dd.pre { white-space: pre-line; display: block; }
.review-list .cat-badge { width: 30px; height: 30px; border-radius: 9px; }
.review-list .cat-badge .ic { width: 16px; height: 16px; }
.review-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
@media (max-width: 560px) { .review-list > div { grid-template-columns: minmax(0, 1fr) auto; } .review-list dd { grid-column: 1 / -1; grid-row: 2; } }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* Bestätigung */
.done { display: grid; justify-items: start; gap: 8px; }
.done p { margin: 0; }
.done-mark { width: 60px; height: 60px; margin-bottom: 8px; }
.done-mark svg { width: 60px; height: 60px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.done-mark circle { stroke: var(--ok); opacity: .25; }
.done-mark path { stroke: var(--ok); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .7s .15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .done-mark path { stroke-dashoffset: 0; } }
.ticket-nr { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--paper); color: var(--ink); font-weight: 500; }
.done-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 26px !important; }
@media (min-width: 1000px) { .done-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.done-actions .demo-box { flex-basis: 100%; margin-top: 8px; }

/* Dokumente */
.doc-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.doc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; }
.doc-row + .doc-row { border-top: 1px solid var(--line-soft); }
.doc-ic { position: relative; width: 42px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: var(--paper); color: var(--ink-2); }
.doc-ic .ic { width: 22px; height: 22px; }
.doc-ext { position: absolute; bottom: -5px; right: -6px; padding: 1px 5px; border-radius: 5px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; }
.doc-main { display: grid; gap: 2px; min-width: 0; }
.doc-title { font-weight: 500; }
.doc-meta { font-size: 13px; color: var(--ink-3); }
.doc-note { margin-top: 14px !important; }
@media (max-width: 520px) { .doc-row { grid-template-columns: auto minmax(0, 1fr); } .doc-row .btn { grid-column: 2; justify-self: start; } }

/* ---------- Verwaltung ---------- */
.stat-row { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-row .stat:first-child { grid-column: 1 / -1; }
@media (min-width: 760px) { .stat-row { grid-template-columns: repeat(5, minmax(0, 1fr)); } .stat-row .stat:first-child { grid-column: auto; } }
.stat { display: grid; gap: 2px; justify-items: start; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--white); text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.stat:hover { border-color: rgba(18, 18, 17, 0.35); }
.stat-n { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13px; color: var(--ink-3); }
.stat.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.stat.is-active .stat-l { color: var(--ink-2); }
@media (max-width: 759px) { .stat { padding: 10px 12px; } .stat-n { font-size: 20px; } }
.stat-0 .stat-n::after, .stat-1 .stat-n::after, .stat-2 .stat-n::after, .stat-3 .stat-n::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin-left: 8px; vertical-align: 5px; }
.stat-0 .stat-n::after { background: var(--signal); }
.stat-1 .stat-n::after { background: #e09412; }
.stat-2 .stat-n::after { background: currentColor; }
.stat-3 .stat-n::after { background: var(--ok); }

.admin-table { min-width: 720px; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.cell-btn { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.cell-btn .cat-badge { width: 34px; height: 34px; border-radius: 10px; }
.cell-btn .cat-badge .ic { width: 17px; height: 17px; }
.cell-btn:hover .cell-title { text-decoration: underline; text-underline-offset: 3px; }
.cell-title { display: block; font-weight: 500; white-space: nowrap; }
.cell-sub { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.cell-sub.mono { font-size: 11.5px; }

.board { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.board-col { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid transparent; min-height: 140px; transition: border-color .2s, background-color .2s; }
.board-col.is-over { border-color: var(--ink); background: var(--paper-2); }
.board-h { display: flex; align-items: center; gap: 8px; margin: 2px 2px 2px; font-size: 14px; font-weight: 500; }
.board-h .count { margin-left: auto; background: var(--white); }
.board-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bcard { position: relative; background: var(--white); border: 1px solid var(--line-soft); border-radius: 12px; box-shadow: 0 1px 2px rgba(18, 18, 17, 0.05); transition: box-shadow .2s, transform .25s var(--ease), opacity .2s; cursor: grab; }
.bcard:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.bcard.is-dragging { opacity: .45; }
.bcard.is-unread { box-shadow: inset 3px 0 0 var(--signal), 0 1px 2px rgba(18, 18, 17, 0.05); }
.bcard-open { display: grid; gap: 5px; width: 100%; padding: 12px 12px 8px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 12px; }
.bcard-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); }
.bcard-top .badge-xs { margin-left: 0; }
.bcard-title { display: flex; align-items: flex-start; gap: 7px; font-weight: 500; font-size: 14.5px; line-height: 1.35; }
.bcard-title .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--ink-2); }
.bcard-meta { font-size: 13px; color: var(--ink-2); }
.bcard-craft { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.bcard-craft .ic { width: 14px; height: 14px; }
.bcard-move { display: flex; justify-content: flex-end; gap: 4px; padding: 0 8px 8px; }
.icon-btn-sm { width: 30px; height: 30px; background: var(--white); }
.icon-btn-sm .ic { width: 15px; height: 15px; }
.icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.board-empty { padding: 18px 8px; text-align: center; font-size: 13px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 10px; }
.board-tip { margin-top: 12px !important; }

/* ---------- Seitenpanel ---------- */
html:has(dialog[open]) { overflow: hidden; }
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(18, 18, 17, 0.32); }
dialog.drawer { margin: 0 0 0 auto; padding: 0; width: min(540px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); }
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .42s var(--ease) both; }
dialog.drawer.is-closing { animation: drawer-out .18s ease-in both; }
dialog[open]::backdrop { animation: fade-in .3s ease both; }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } }
@keyframes drawer-out { to { transform: translateX(48px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.drawer-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.drawer-head p { margin: 0; }
.drawer-head .eyebrow { margin-bottom: 4px; }
.drawer-head h2:focus { outline: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px 28px; overscroll-behavior: contain; }
.dsec { padding: 18px 0; }
.dsec + .dsec { border-top: 1px solid var(--line-soft); }
.dsec-h { margin: 0 0 12px; font-family: var(--mono); font-size: 11.5px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dsec-h:focus { outline: none; }
.status-pick { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-opt { position: relative; cursor: pointer; }
.sp-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sp-opt > span { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid rgba(18, 18, 17, 0.14); border-radius: 10px; font-size: 14px; transition: border-color .2s, background-color .2s; }
.sp-opt:hover > span { border-color: rgba(18, 18, 17, 0.4); }
.sp-opt input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 500; }
.sp-opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.assign-form { display: grid; gap: 14px; }
.assign-form .btn { justify-self: start; }
.assign-form .hint { margin: -4px 0 0; }
.assign-row { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 460px) { .assign-row { grid-template-columns: minmax(0, 1fr); } }
.hist { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.hist li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; }
.hist .st-dot { margin-top: 7px; }
.hist-t { display: block; font-weight: 500; font-size: 14px; }
.hist-m { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.hist-n { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------- Dokumentvorschau ---------- */
dialog.docview { width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
dialog.docview[open] { display: flex; flex-direction: column; animation: pop-in .35s var(--ease) both; }
dialog.docview.is-closing, dialog.confirm.is-closing { animation: pop-out .18s ease-in both; }
@keyframes pop-in { from { transform: translateY(12px) scale(.98); opacity: 0; } }
@keyframes pop-out { to { transform: translateY(8px) scale(.98); opacity: 0; } }
.docview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.docview-head .eyebrow { margin-bottom: 4px; }
.docview-head h2:focus { outline: none; }
.docview-body { flex: 1; overflow-y: auto; padding: 20px; }
.docview-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.docview-foot p { margin: 0; }
.paper { max-width: 680px; margin: 0 auto; padding: 32px 28px 36px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 6px; box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.6; }
@media (min-width: 700px) { .paper { padding: 44px 52px 52px; } }
.paper p { margin: 0 0 12px; }
.paper-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.paper-from { font-size: 12px; }
.paper-to { font-size: 14px; }
.paper-date { text-align: right; font-size: 13.5px; color: var(--ink-2); }
.paper-title { margin: 18px 0 10px; font-size: 1.3rem; font-weight: 500; letter-spacing: -0.02em; }
.paper-h { margin: 18px 0 4px; font-size: 15px; font-weight: 600; }
.paper .table-wrap { margin: 14px 0 16px; }
.paper-table { font-size: 13.5px; min-width: 460px; }
.paper-table td, .paper-table th { padding: 8px 12px; }
.paper-table tfoot th { text-align: left; font-weight: 500; font-size: 13.5px; color: var(--ink); background: var(--white); border-top: 1px solid var(--line); }
.paper-table tfoot td { border-top: 1px solid var(--line); }
.paper-result th, .paper-result td { background: var(--ok-soft) !important; color: var(--ok); }

/* ---------- Rückfrage ---------- */
dialog.confirm { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); }
dialog.confirm[open] { animation: pop-in .3s var(--ease) both; }
dialog.confirm p { margin: 10px 0 0; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- Toast ---------- */
.toast[popover] { inset: auto auto 24px 50%; margin: 0; border: 0; overflow: visible; color: var(--paper); background: var(--ink); padding: 12px 18px; }
.toast { width: max-content; max-width: calc(100vw - 32px); white-space: normal; text-align: center; line-height: 1.4; border-radius: 16px; }
.toast:not([popover]) { display: block; }

/* ---------- Erklärung unter der Demo ---------- */
.explain { margin-top: 56px; }
.explain-list { display: grid; gap: 24px; margin: 22px 0 0; padding: 0; list-style: none; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .explain-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.explain-list li { padding-top: 16px; border-top: 1px solid var(--line); }
.explain-nr { font-family: var(--mono); font-size: 12px; color: var(--signal-ink); }
.explain-title { margin: 6px 0 6px; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.02em; }
.explain-list p { margin: 0; color: var(--ink-2); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .is-current .tl-dot::before { display: none; }
}

/* ---------- Feinschliff ---------- */
@media (min-width: 960px) { .hide-lg { display: none !important; } }
@media (max-width: 480px) {
  .xs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .app-nav { padding: 8px; }
  .nav-list { flex: 1; justify-content: space-between; gap: 2px; }
  .nav-item { padding: 0 10px; gap: 6px; font-size: 14px; }
  .nav-item > .ic { display: none; }
  .demo-controls { padding: 12px; }
  .demo-controls .dc-group:nth-child(2) { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .demo-controls .dc-group:nth-child(2) .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: 13px; }
  .docview-body { padding: 12px; }
  .paper { padding: 22px 18px 26px; }
  .paper-title { font-size: 1.15rem; }
}
