:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --line: #d8dee4;
  --line-strong: #b8c2cc;
  --text: #17202a;
  --muted: #667382;
  --accent: #c41230;
  --accent-dark: #8c1024;
  --ok: #17693a;
  --warn: #9b5d00;
  --external: #4f4c8a;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 42vw) minmax(0, 1fr);
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
}

.left-pane {
  display: grid;
  grid-template-rows: 50% 50%;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--panel);
}

.list-pane,
.detail-pane {
  min-height: 0;
}

.list-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-bottom: 1px solid var(--line-strong);
  min-height: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-wrap {
  display: grid;
  gap: 5px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input[type="search"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 0 11px;
}

input[type="search"]:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(196, 18, 48, 0.14);
}

.download,
.open-proof {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  min-width: 68px;
  padding: 0 12px;
  text-decoration: none;
}

.download:hover,
.open-proof:hover {
  background: var(--accent-dark);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.sparkassen-list {
  overflow: auto;
}

.list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: inherit;
  cursor: pointer;
  padding: 10px 14px;
  text-align: left;
}

.list-item:hover,
.list-item.is-active {
  background: #f8fafc;
}

.list-item.is-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.item-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}

.item-sub,
.item-proof {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  white-space: nowrap;
}

.badge.ok {
  border-color: rgba(23, 105, 58, 0.26);
  color: var(--ok);
}

.badge.external {
  border-color: rgba(79, 76, 138, 0.28);
  color: var(--external);
}

.detail-pane {
  overflow: auto;
  padding: 16px;
  min-height: 0;
}

.empty-state {
  color: var(--muted);
  display: grid;
  height: 100%;
  place-items: center;
}

.detail h1 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.detail-section {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 7px 12px;
}

.kv-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.kv-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.people-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}

.person-name {
  font-weight: 750;
}

.person-role,
.person-source {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.right-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.frame-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 14px;
}

.frame-title {
  font-weight: 800;
}

.frame-url {
  color: var(--muted);
  font-size: 12px;
  max-width: 64vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

iframe {
  background: #fff;
  border: 0;
  height: 100%;
  width: 100%;
}

.frame-placeholder {
  align-content: center;
  color: var(--muted);
  display: grid;
  height: 100%;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(600px, 60vh) minmax(420px, 40vh);
  }

  .left-pane {
    border-right: 0;
  }
}
