/* ── Reset & Variablen ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --imi-dark:   #05263d;
  --imi-navy:   #0b3c5d;
  --imi-teal:   #00bfae;
  --imi-teal-d: #00897b;
  --imi-bg:     #f8fafc;
  --imi-border: #d1dce6;
  --imi-muted:  #5a7080;
  --imi-light:  #e7f3fd;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--imi-bg);
  color: #333;
  line-height: 1.6;
  font-size: 15px;
}
.container { max-width: 1000px; margin: 30px auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: linear-gradient(90deg, var(--imi-dark) 0%, var(--imi-navy) 100%);
  padding: 15px 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.sitename {
  font-size: 24px; font-weight: 700; text-decoration: none;
  color: #fff; display: inline-flex; align-items: center; gap: 10px;
}
.sitename img { height: 32px; width: auto; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { margin-top: 8px; font-size: 12px; color: #cbd5e1; }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { color: var(--imi-teal); }
.back-link {
  display: inline-block; margin-bottom: 15px;
  text-decoration: none; color: var(--imi-navy); font-size: 14px; font-weight: 700;
}
.back-link:hover { color: var(--imi-teal-d); }

/* ── Intro ───────────────────────────────────────────────────────────────── */
.imi-intro {
  background: linear-gradient(90deg, var(--imi-light), #f4faff);
  border-left: 5px solid var(--imi-navy);
  padding: 24px 28px; border-radius: 4px; margin-bottom: 22px;
}
.imi-intro h2 { margin-bottom: 10px; color: var(--imi-navy); font-size: 20px; }
.imi-intro p  { font-size: 15px; color: #444; }

/* ── Content-Box ─────────────────────────────────────────────────────────── */
.content-box {
  background: #fff; border: 1px solid var(--imi-border);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.05); margin-bottom: 22px;
}
.box-header {
  background: var(--imi-navy); color: #fff;
  padding: 12px 20px; font-size: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.box-body { padding: 22px 24px; }

/* ── Format-Tabs ─────────────────────────────────────────────────────────── */
.format-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  padding: 5px 14px; border: 2px solid rgba(255,255,255,.35);
  border-radius: 5px; background: transparent; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .18s; font-family: inherit; min-height: 34px;
}
.tab-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.7); }
.tab-btn.active { background: var(--imi-teal); border-color: var(--imi-teal); }
.tab-btn:focus-visible { outline: 3px solid var(--imi-teal); outline-offset: 2px; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar-row {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Format-Badge ────────────────────────────────────────────────────────── */
.format-badge {
  display: inline-block; background: var(--imi-light); color: var(--imi-navy);
  border: 1px solid var(--imi-border); border-radius: 4px;
  font-size: 12px; font-weight: 700; padding: 3px 10px; letter-spacing: .08em;
  margin-bottom: 8px;
}

/* ── Code-Editor ─────────────────────────────────────────────────────────── */
.code-editor {
  width: 100%; min-height: 220px;
  padding: 12px 14px; border: 1px solid var(--imi-border); border-radius: 6px;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; line-height: 1.65;
  background: #f5f9fc; color: #1a2a3a; resize: vertical; transition: border .2s;
  display: block;
}
.code-editor:focus {
  outline: none; border-color: var(--imi-navy);
  box-shadow: 0 0 0 3px rgba(11,60,93,.1);
}
.code-editor[readonly] { background: #eef4f9; cursor: default; }

/* ── Fehlermeldung ───────────────────────────────────────────────────────── */
.error-msg {
  min-height: 18px; margin-top: 6px; font-size: 13px;
  color: #c62828; font-weight: 600; display: none;
}
.error-msg.visible { display: block; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 700;
  transition: all .2s; font-family: inherit; min-height: 44px;
}
.btn:focus-visible { outline: 3px solid var(--imi-teal); outline-offset: 2px; }
.btn-primary  { background: var(--imi-navy); color: #fff; }
.btn-primary:hover  { background: #1565a0; }
.btn-accent   { background: var(--imi-teal); color: #fff; }
.btn-accent:hover   { background: var(--imi-teal-d); }
.btn-outline  { background: #fff; color: var(--imi-navy); border: 2px solid var(--imi-navy); }
.btn-outline:hover  { background: var(--imi-navy); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 36px; }
.upload-label { cursor: pointer; }
.upload-label:hover { background: var(--imi-navy); color: #fff; }

/* ── Konvertier-Grid ─────────────────────────────────────────────────────── */
.convert-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.btn-convert {
  flex-direction: column; gap: 5px; padding: 14px 8px;
  background: #fff; border: 2px solid var(--imi-border);
  color: var(--imi-navy); border-radius: 8px;
  font-size: 13px; font-weight: 700; min-height: 70px;
  justify-content: center; transition: all .2s;
}
.btn-convert:hover { border-color: var(--imi-teal); background: var(--imi-light); }
.btn-convert.active-target { border-color: var(--imi-teal); background: var(--imi-teal); color: #fff; }
.btn-convert:focus-visible { outline: 3px solid var(--imi-teal); outline-offset: 2px; }
.btn-convert-txt { border-color: var(--imi-teal); color: var(--imi-teal-d); }
.btn-convert-txt:hover { background: var(--imi-teal); color: #fff; }
.fmt-icon { font-size: 17px; font-weight: 900; font-family: monospace; line-height: 1; }

/* ── Konvertier-Hinweis ──────────────────────────────────────────────────── */
.convert-hint { margin-top: 10px; font-size: 13px; color: var(--imi-muted); min-height: 18px; }
.convert-hint.success { color: var(--imi-teal-d); font-weight: 600; }
.convert-hint.warn    { color: #e65100; font-weight: 600; }

/* ── Kopier-Bestätigung ──────────────────────────────────────────────────── */
.copy-confirm {
  margin-top: 6px; font-size: 13px; color: var(--imi-teal-d);
  font-weight: 600; min-height: 18px; opacity: 0; transition: opacity .3s;
}
.copy-confirm.show { opacity: 1; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  text-align: center; font-size: 13px; color: #64748b;
  margin-top: 40px; padding-bottom: 30px;
}
footer a { color: var(--imi-navy); text-decoration: none; margin: 0 8px; }
footer a:hover { color: var(--imi-teal-d); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 750px) {
  .convert-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 550px) {
  .convert-grid { grid-template-columns: repeat(2, 1fr); }
  .box-body { padding: 14px; }
  .box-header { font-size: 13px; padding: 10px 14px; }
  .code-editor { font-size: 12px; min-height: 160px; }
  .toolbar-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 360px) {
  .convert-grid { grid-template-columns: 1fr; }
}
