:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #637083;
  --line: #d9e1e8;
  --paper: #ffffff;
  --soft: #f3f7f6;
  --blue: #185c9f;
  --green: #107b55;
  --red: #a83232;
  --gold: #c28a1d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(16, 123, 85, .12), transparent 28rem),
    linear-gradient(135deg, #f7faf8 0%, #edf3f7 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: var(--blue); font-weight: 800; text-decoration: none; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 24px auto 48px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px; height: 44px; border-radius: 8px;
  background: linear-gradient(135deg, #17202a, #185c9f);
  color: #fff; display: grid; place-items: center; font-weight: 900;
  box-shadow: 0 12px 28px rgba(24, 92, 159, .22);
}
h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
.title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.version-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c7d6e7;
  background: #edf4fb;
  color: #185c9f;
  font-size: 12px;
  font-weight: 900;
}
h2 { margin: 0 0 12px; font-size: 21px; }
p { line-height: 1.48; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel, .card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 42, .08);
}
.panel { padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 16px; }
.metric { font-size: 32px; font-weight: 900; }
.label { display: block; margin: 12px 0 6px; color: #465365; font-size: 13px; font-weight: 900; text-transform: uppercase; }
input, select, textarea {
  width: 100%; border: 1px solid #cfd9e2; border-radius: 6px; padding: 11px 12px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
button, .button {
  border: 0; border-radius: 6px; padding: 11px 14px; font-weight: 900; cursor: pointer;
  background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.button.secondary, button.secondary { background: #e8eef3; color: #17202a; }
.button.green, button.green { background: var(--green); }
.button.red, button.red { background: var(--red); }
.notice { padding: 12px 14px; border-radius: 6px; margin: 12px 0; border: 1px solid var(--line); background: #fff; }
.notice.ok { border-color: #b8dfcf; color: var(--green); }
.notice.error { border-color: #efc4c4; color: var(--red); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: #637083; text-transform: uppercase; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef3f7; font-weight: 900; font-size: 12px; }
.pill.active, .pill.finalised { color: var(--green); background: #dff4eb; }
.pill.pending, .pill.draft { color: #8a5a00; background: #fff1cc; }
.pill.failed { color: var(--red); background: #f8dddd; }
.question-cell { white-space: pre-wrap; }
.berlin-page .panel { border-color: #d7e2ef; }
.berlin-page .notice { background: rgba(255,255,255,.92); }
.berlin-page .berlin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.berlin-page .berlin-stat {
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff, #eef5fb);
  border: 1px solid #d7e2ef;
}
.berlin-page .berlin-stat .value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 900;
  color: #17202a;
}
.berlin-page .berlin-image-preview {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.berlin-page .berlin-image-preview img {
  width: 132px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #cfd9e2;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23,32,42,.08);
}
.berlin-page .berlin-image-fallback {
  width: 132px;
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #cfd9e2;
  background: #f5f8fb;
  color: #637083;
  font-size: 12px;
  text-align: center;
}
.berlin-page .berlin-category-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: #fffaf0;
}
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; align-items: start; }
.generating-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #c5d7e8;
  border-radius: 6px;
  background: #f4f9fd;
  color: #185c9f;
  font-weight: 900;
}
.generating-status[hidden] { display: none; }
.generating-gif {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}
.hero-panel {
  min-height: 180px;
  background:
    linear-gradient(rgba(23, 32, 42, .78), rgba(23, 32, 42, .72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='360' viewBox='0 0 1200 360'%3E%3Crect width='1200' height='360' fill='%23185c9f'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.24' stroke-width='3'%3E%3Cpath d='M80 90h180v90H80zM330 60h230v130H330zM640 100h160v100H640zM880 70h230v150H880z'/%3E%3Cpath d='M110 250h980M180 290h820'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.9' font-family='Arial' font-weight='700'%3E%3Ctext x='104' y='145' font-size='54'%3EQ%3C/text%3E%3Ctext x='410' y='142' font-size='42'%3EA%3C/text%3E%3Ctext x='700' y='162' font-size='50'%3E?%3C/text%3E%3Ctext x='975' y='158' font-size='44'%3ETGS%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
}
.hero-panel p { color: rgba(255,255,255,.82); max-width: 760px; }
.block-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.block-form .button,
.block-form button {
  padding: 7px 10px;
  font-size: 12px;
}
.block-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.block-chip.soft { background: #e7f3ff; color: #185c9f; }
.block-chip.medium { background: #fff1cc; color: #8a5a00; }
.block-chip.hard { background: #f8dddd; color: #a83232; }
@media (max-width: 850px) {
  .grid, .grid.two, .split { grid-template-columns: 1fr; }
  .berlin-page .berlin-summary { grid-template-columns: 1fr 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  td { border-bottom: 0; padding: 5px 0; }
}
