:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  color: #1d3034;
  background: #f4f6f5;
  --ink: #183e3d;
  --accent: #16655e;
  --line: #dce4e1;
}
.studio-banner { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:28px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(120deg,#e3f0ed,#fff); }
.studio-banner h2 { margin:8px 0; font-size:clamp(1.4rem,3vw,2rem); }
.plan-card { text-align:left; display:grid; gap:12px; padding:22px; border:1px solid var(--line); border-radius:14px; }
.plan-card strong { font-size:1.1rem; }
.routing-editor { margin-top:28px; padding:24px; background:white; border:1px solid var(--line); border-radius:16px; }
.routing-editor details { margin:18px 0; padding:18px; border:1px solid var(--line); border-radius:12px; }
.routing-editor summary { font-weight:650; cursor:pointer; padding:4px; }
.routing-editor details[open] summary { margin-bottom:18px; }
.flow-steps { display:grid; gap:18px; }
.flow-step { padding:20px; border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:12px; background:#fafcfb; }
.step-number { display:grid; place-items:center; border-radius:50%; background:var(--accent); color:white; width:30px; height:30px; flex-shrink:0; }
.target-row { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:16px 0; }
.target-row label { flex:1; min-width:150px; }
.menu-keys { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.editor-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
.simulator { margin-top:22px; }
.simulator li { padding:12px 0; border-bottom:1px solid var(--line); }
fieldset { border:1px solid var(--line); border-radius:12px; padding:18px; margin:16px 0; }
button:focus-visible, summary:focus-visible { outline:3px solid #258f85; outline-offset:3px; }
@media(max-width:600px) { .studio-banner { display:block; padding:18px; } .routing-editor { padding:14px; } .flow-step { padding:12px; } .routing-editor details { padding:12px; } .studio-banner .badge { display:inline-block; margin-top:12px; } }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: var(--accent);
  color: white;
  padding: 12px 19px;
  border-radius: 8px;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: #e8efeb;
  color: var(--ink);
}
.danger {
  background: #8a3833;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  background: white;
  border: 1px solid #b9c8c3;
  border-radius: 7px;
  margin: 6px 0 17px;
  color: inherit;
}
input[type="checkbox"] {
  width: 20px;
  display: inline;
  vertical-align: middle;
  margin: 0 8px 0 0;
}
label {
  font-size: 14px;
  font-weight: 550;
  display: block;
}
.check {
  margin: 18px 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
}
h2 {
  font-size: 20px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.65;
  color: #5a6c6b;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 9px;
  color: #758781;
}
.brand {
  width: 100%;
  max-width: 368px;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(115deg, #e1ece5, #f7f7f2);
}
.login form {
  max-width: 440px;
  width: calc(100% - 40px);
  padding: 36px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 70px #153c3310;
}
.login .brand {
  margin-bottom: 24px;
}
.login button {
  width: 100%;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 30px 22px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
nav {
  margin-top: 45px;
  display: grid;
  gap: 5px;
}
nav button {
  text-align: left;
  font-weight: 500;
  background: none;
  color: #536763;
  padding: 12px 14px;
}
nav button.active {
  background: #e7f0eb;
  color: #174e43;
}
nav button span {
  display: inline-block;
  width: 27px;
  opacity: 0.65;
}
.aside-bottom {
  margin-top: auto;
  font-size: 13px;
}
.aside-bottom small {
  display: block;
  color: #788b85;
  margin: 8px 0 20px;
}
main {
  margin-left: 248px;
  padding: 40px 46px;
  max-width: 1600px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.badge {
  font-size: 12px;
  padding: 7px 11px;
  background: #e5ede8;
  border-radius: 30px;
  white-space: nowrap;
}
.badge.bad {
  background: #f9e4df;
  color: #852f22;
}
.badge.good {
  background: #dcf0e6;
  color: #23604c;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.card .big {
  font-size: 35px;
  color: var(--ink);
  margin: 15px 0 0;
}
.card small {
  color: #71817b;
}
.section-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 17px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #e9eeeb;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #71817b;
  background: #fafcfb;
}
td button {
  padding: 7px 10px;
  font-size: 12px;
  margin: 3px;
}
.empty {
  padding: 46px 24px;
  text-align: center;
  color: #71817b;
}
.muted {
  font-size: 13px;
  color: #7b8c85;
}
footer {
  font-size: 11px;
  color: #87968f;
  margin-top: 44px;
}
#notice {
  padding: 13px 18px;
  background: #fff1db;
  border-radius: 8px;
  margin-bottom: 18px;
}
#notice, #dialog-notice {
  white-space: pre-line;
}
dialog {
  max-width: 660px;
  width: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
dialog::backdrop {
  background: #102d2c77;
}
#pool-list, [data-pool-options] > .grid {
  max-height: 28rem;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  padding: 4px;
}
[data-pool-label] { cursor: pointer; margin: 0; }
[data-pool-label] input { width: auto; }
[data-pool-label]:has(input:disabled) { opacity: .55; cursor: not-allowed; background: #f1f3f2; }
[data-pool-label]:has(input:checked) { border-color: #147967; }
[data-pool-label]:focus-within { outline: 2px solid #147967; outline-offset: 2px; }
[data-pool-label][hidden] { display: none; }
.close {
  float: right;
  background: #eef2ef;
  color: #253e34;
  padding: 4px 12px;
  font-size: 22px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.warning-row {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 10px;
  margin: 14px 0;
}
.warning-row .row {
  grid-template-columns: 1fr 1fr 1fr;
}
audio {
  width: 100%;
  min-width: 180px;
  height: 34px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.progress {
  height: 5px;
  background: #e8eeea;
  border-radius: 3px;
  margin: 20px 0;
  overflow: hidden;
}
.progress span {
  display: block;
  background: #2f8271;
  height: 100%;
}
.code {
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
}
[hidden] {
  display: none !important;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #67aaa0;
  outline-offset: 3px;
}
@media (max-width: 1000px) {
  aside {
    width: 210px;
  }
  main {
    margin-left: 210px;
    padding: 28px 22px;
  }
}
@media (max-width: 680px) {
  aside {
    position: relative;
    width: auto;
    padding: 18px;
  }
  aside .brand {
    width: calc(100% - 100px);
    max-width: 260px;
  }
  nav {
    margin-top: 18px;
    display: flex;
    overflow: auto;
  }
  nav button {
    white-space: nowrap;
    font-size: 12px;
    padding: 10px;
  }
  nav button span {
    display: none;
  }
  .aside-bottom {
    display: block;
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 0;
  }
  .aside-bottom small {
    display: none;
  }
  .aside-bottom button {
    font-size: 11px;
    padding: 8px 10px;
  }
  main {
    margin: 0;
    padding: 24px 16px;
  }
  h1 {
    font-size: 27px;
  }
  header {
    align-items: flex-start;
    gap: 10px;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .card {
    padding: 17px;
  }
  .row,
  .warning-row .row {
    grid-template-columns: 1fr;
  }
  .badge {
    font-size: 10px;
  }
  .section-head {
    align-items: flex-start;
  }
  dialog {
    padding: 20px;
  }
}
audio { width: 100%; max-width: 34rem; }
.recording-card { margin-bottom: 1rem; overflow-wrap: anywhere; }
.recording-scope { background: linear-gradient(145deg, var(--panel, #fff), var(--surface-soft, #f4f8f8)); }
.recording-scope legend { padding: 0 .5rem; font-weight: 750; color: var(--ink); }
.recording-all { margin: .25rem 0 1rem; padding: .85rem 1rem; border: 1px solid var(--accent, #0f766e); border-radius: 10px; background: color-mix(in srgb, var(--accent, #0f766e) 8%, white); font-weight: 700; }
.recording-options { align-items: stretch; }
.recording-options article,.recording-extensions { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel, #fff); }
.recording-options h4,.recording-extensions h4 { margin-top: 0; }
.extension-options { margin-top: .75rem; }
.extension-options .check { min-width: 0; overflow-wrap: anywhere; }
.extension-options input:disabled + * { opacity: .7; }
@media (max-width:680px) { .recording-options,.extension-options { grid-template-columns: 1fr; } }
.transfer-form { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line, #dbe5e5); border-radius: 12px; }
/* KI-Beratung: profile-first editing and an explicit, recordable prompt flow. */
.ai-profile-bar { margin-bottom: 28px; padding: 24px; background: linear-gradient(125deg,#e4f1ee,#fff); border: 1px solid var(--line); border-radius: 16px; }
.ai-profile-tabs { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 10px; margin: 18px 0; }
.ai-profile-tabs button { min-height: 72px; text-align: left; border: 1px solid #bdd0ca; background: #fff; }
.ai-profile-tabs button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.ai-profile-tabs span,.ai-profile-tabs small { display: block; }
.ai-profile-tabs small { margin-top: 6px; font-weight: 400; opacity: .82; }
.ai-new-profile { margin-top: 14px; }
.ai-new-profile summary { cursor: pointer; color: var(--accent); font-weight: 650; padding: 10px 0; }
.ai-new-profile .card { margin-top: 10px; }
.ai-section-navigation { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 8px; background: #f6faf9eb; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px #153c3312; backdrop-filter: blur(8px); }
.ai-section-navigation button { flex: 1 1 180px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; }
.ai-section-navigation button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.ai-section-navigation button.active .badge { color: var(--accent); background: #fff; }
.ai-editor-section { margin: 22px 0; padding: 26px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.ai-editor-section > .section-head:first-child { margin-top: 0; }
.ai-announcement-list { display: grid; gap: 16px; }
.ai-announcement-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.ai-announcement-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; }
.ai-announcement-heading h3 { margin: 3px 0 4px; font-size: 17px; }
.ai-script-label { margin-top: 14px; }
.ai-script { min-height: 86px; resize: vertical; line-height: 1.55; background: #fff; color: #263d3a; }
.ai-audio-controls { display: grid; grid-template-columns: minmax(240px,1fr) minmax(220px,1fr); gap: 18px; align-items: center; margin-top: 14px; }
.ai-save-bar { position: sticky; bottom: 12px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; background: #fff; border: 1px solid #aac4bc; border-radius: 14px; box-shadow: 0 12px 35px #153c3326; }
.ai-save-bar p { margin: 0; }
.ai-memory-list { display: grid; gap: 14px; margin-top: 20px; }
.ai-memory-customer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.ai-memory-customer h3 { margin: 0 0 5px; }
.ai-memory-customer p { margin: 0; }
.ai-memory-detail { grid-column: 1 / -1; padding-top: 4px; }
.ai-empty-state { padding: 24px; text-align: center; border: 1px dashed #aac4bc; border-radius: 14px; background: #f7fbfa; }
.ai-empty-state h3 { margin-top: 0; }
.ai-transcript { margin-top: 12px; overflow: hidden; border: 1px solid #cbdad6; border-radius: 12px; background: #fff; }
.ai-transcript summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; cursor: pointer; background: #f2f7f5; }
.ai-transcript-lines { display: grid; gap: 10px; padding: 14px; }
.ai-transcript-turn { display: grid; gap: 6px; width: min(92%,56rem); margin: 0; padding: 12px 14px; border-radius: 12px; }
.ai-transcript-turn.caller { justify-self: end; background: #e7f3ef; }
.ai-transcript-turn.assistant { justify-self: start; background: #f1f3f5; }
.ai-transcript-turn > div { line-height: 1.55; white-space: normal; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.ai-diagnostic-list { display: grid; gap: 14px; margin-top: 20px; }
.ai-diagnostic-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.ai-diagnostic-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ai-diagnostic-heading h3 { margin: 0 0 5px; }
.ai-diagnostic-heading p { margin: 0; }
.ai-diagnostic-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.ai-diagnostic-grid > div { display: grid; align-content: start; gap: 4px; min-height: 84px; padding: 12px; border: 1px solid #d8e3df; border-radius: 11px; background: #fff; }
.ai-diagnostic-grid small,.ai-diagnostic-grid span { color: var(--muted); }
.ai-diagnostic-grid span { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.ai-diagnostic-result { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.ai-journal-section > p { max-width: 76rem; }
.ai-journal-section a.button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 19px; color: var(--ink); text-decoration: none; border-radius: 8px; font-weight: 600; }
.ai-journal-filter { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); gap: 12px; align-items: end; margin: 20px 0; padding: 18px; border: 1px solid #d8e3df; border-radius: 14px; background: #f7faf9; }
.ai-journal-filter label { margin: 0; }
.ai-journal-filter input,.ai-journal-filter select { margin-bottom: 0; }
.ai-journal-filter .actions { grid-column: 1 / -1; justify-content: flex-end; }
.ai-journal-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.ai-journal-summary article { display: grid; gap: 4px; padding: 17px; border: 1px solid #d8e3df; border-radius: 13px; background: #fff; }
.ai-journal-summary small,.ai-journal-summary span { color: var(--muted); }
.ai-journal-summary strong { font-size: 22px; }
.ai-journal-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #d8e3df; border-radius: 13px; }
.ai-journal-table { width: 100%; min-width: 720px; border-collapse: collapse; background: #fff; }
.ai-journal-table th,.ai-journal-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e0e8e5; vertical-align: top; }
.ai-journal-table th { background: #f0f6f4; }
.ai-journal-table tbody tr:last-child td { border-bottom: 0; }
.ai-journal-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.ai-journal-table td small { display: block; margin-top: 3px; color: var(--muted); white-space: nowrap; }
.ai-journal-sort { width: 100%; padding: 0; text-align: left; color: var(--ink); background: transparent; border-radius: 4px; }
.ai-journal-sort:hover { color: var(--accent); filter: none; }
.ai-journal-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 20px; }
.ai-journal-breakdown { margin-top: 18px; }
.ai-journal-breakdown > summary { cursor: pointer; color: var(--accent); font-weight: 650; padding: 12px 0; }
.ai-journal-breakdown .ai-journal-table-wrap { margin-top: 8px; }
@media (max-width:680px) {
  .ai-profile-bar,.ai-editor-section { padding: 17px; }
  .ai-section-navigation { top: 4px; }
  .ai-section-navigation button { flex-basis: 100%; }
  .ai-announcement-card { padding: 14px; }
  .ai-announcement-heading { grid-template-columns: auto 1fr; }
  .ai-announcement-heading .badge { grid-column: 2; justify-self: start; }
  .ai-audio-controls { grid-template-columns: 1fr; gap: 4px; }
  .ai-save-bar { bottom: 6px; align-items: stretch; flex-direction: column; }
  .ai-save-bar .actions button { flex: 1; }
  .ai-memory-customer { grid-template-columns: 1fr; }
  .ai-memory-detail { grid-column: 1; }
  .ai-transcript summary { align-items: flex-start; flex-direction: column; }
  .ai-transcript-turn { width: auto; }
  .ai-diagnostic-heading { flex-direction: column; }
  .ai-diagnostic-grid { grid-template-columns: 1fr; }
  .ai-journal-section .section-head { gap: 14px; flex-direction: column; }
  .ai-journal-section .section-head .actions { width: 100%; }
  .ai-journal-section .section-head .actions a { flex: 1; }
  .ai-journal-filter { grid-template-columns: 1fr; padding: 14px; }
  .ai-journal-filter .actions { grid-column: 1; }
  .ai-journal-summary { grid-template-columns: 1fr 1fr; }
  .ai-journal-pager { align-items: stretch; flex-direction: column; }
}
/* Advanced settings: one navigable topic at a time, consistent on mobile. */
.advanced-topic { margin: 1rem 0; border: 1px solid var(--border, #cbd5e1); border-radius: .75rem; overflow: hidden; }
.advanced-topic > summary { padding: 1rem; font-weight: 650; cursor: pointer; background: var(--surface, #f8fafc); }
.advanced-topic > summary:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.advanced-topic > .card { margin: .75rem; }
.advanced-topic-navigation { display: flex; flex-wrap: wrap; gap: .5rem; }
.advanced-topic-navigation button { white-space: normal; min-height: 44px; }
.advanced-topic input, .advanced-topic select { max-width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .advanced-topic-navigation button { flex: 1 1 45%; } .advanced-topic > .card { margin: .4rem; } }
