:root{
  --rk-dunkelrot:#B70E0C;--rk-dunkelrot-d:#960A08;--rk-black:#1A1A1A;--rk-grey-bar:#565656;
  --rk-muted:#6E6E6E;--rk-line:#DCDCDC;--rk-bg:#F2F2F2;--rk-surface:#FFFFFF;--rk-soft:#F7E9E8;
  --sans:"Helvetica Neue",Helvetica,Arial,sans-serif;--mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--rk-bg);color:var(--rk-black);font-family:var(--sans);line-height:1.5;-webkit-font-smoothing:antialiased}

.brand{background:var(--rk-surface);border-bottom:1px solid var(--rk-line)}
.brand-inner{max-width:680px;margin:0 auto;padding:14px 20px;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
/* Logo bündig mit dem Textblock (oben Channel, unten grauer Balken) */
.logo{height:52px;width:auto;flex:none}
.welsmap{height:44px;width:auto;flex:none;margin-left:auto}
.desig{display:flex;flex-direction:column;align-items:stretch;gap:5px}
.channel{color:var(--rk-dunkelrot);font-weight:700;font-size:28px;letter-spacing:.03em;text-transform:uppercase;line-height:1.05;white-space:nowrap;text-align:center}
/* Graues Feld bündig auf die Breite des Channel-Worts gestreckt (klein genug,
   dass es auch unter kurze Wörter wie „TOOLBOX" passt) */
.dienststelle{display:block;width:100%;box-sizing:border-box;text-align:center;background:var(--rk-grey-bar);color:#fff;font-size:10px;letter-spacing:.02em;padding:3px 6px;text-transform:uppercase;font-weight:700;white-space:nowrap}

.titlebar{background:var(--rk-dunkelrot);color:#fff}
.titlebar-inner{max-width:680px;margin:0 auto;padding:16px 20px;display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.titlebar h1{font-size:21px;margin:0;font-weight:700}
.titlebar span{color:#FAD9D8;font-size:13.5px}

.wrap{max-width:680px;margin:0 auto;padding:22px 20px 80px}
.intro{font-size:14px;color:var(--rk-muted);margin:6px 0 22px}
.req{color:var(--rk-dunkelrot);font-weight:700}
.opt{color:var(--rk-muted);font-weight:400;font-size:.85em}

.field{background:var(--rk-surface);border:1px solid var(--rk-line);border-radius:10px;padding:16px 16px 18px;margin-bottom:14px}
.field>label{display:block;font-weight:700;font-size:14px;margin-bottom:8px}
.help{font-size:12px;color:var(--rk-muted);margin:8px 0 0}
.counter{font-family:var(--mono);font-size:11px;color:var(--rk-muted);text-align:right;margin-top:6px}

input[type=text],input[type=password],select,textarea{
  width:100%;border:1px solid var(--rk-line);border-radius:8px;padding:11px 12px;font-family:var(--sans);font-size:15px;background:#fff;color:var(--rk-black)
}
textarea{resize:vertical;min-height:120px;line-height:1.5}
input[type=file]{width:100%;font-size:14px;padding:11px 12px;border:1px dashed var(--rk-line);border-radius:8px;background:#fafafa;color:var(--rk-muted);cursor:pointer}
input[type=file]::file-selector-button{padding:9px 14px;margin-right:12px;border:0;border-radius:6px;background:var(--rk-dunkelrot);color:#fff;font-weight:700;font-family:var(--sans);font-size:14px;cursor:pointer}
input[type=file]::-webkit-file-upload-button{padding:9px 14px;margin-right:12px;border:0;border-radius:6px;background:var(--rk-dunkelrot);color:#fff;font-weight:700;font-family:var(--sans);font-size:14px;cursor:pointer}
input:focus,select:focus,textarea:focus{outline:2px solid var(--rk-dunkelrot);outline-offset:1px;border-color:var(--rk-dunkelrot)}
.field.invalid input,.field.invalid select,.field.invalid textarea{border-color:var(--rk-dunkelrot);background:#fff7f7}

/* Credit-Zeilen */
.credit-row{display:flex;align-items:center;gap:10px;margin-top:10px}
.credit-thumb{width:46px;height:46px;border-radius:6px;object-fit:cover;border:1px solid var(--rk-line);flex:none;background:var(--rk-bg)}
.credit-row input{flex:1}
.credit-name{font-size:11px;color:var(--rk-muted);font-family:var(--mono);max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-rm{flex:none;border:1px solid var(--rk-line);background:#fff;color:var(--rk-dunkelrot);cursor:pointer;border-radius:6px;width:26px;height:26px;font-size:16px;line-height:1}
.file-rm:hover{background:var(--rk-soft);border-color:var(--rk-dunkelrot)}

/* Themen-Blöcke */
.thema-block{background:var(--rk-surface);border:1px solid var(--rk-line);border-left:4px solid var(--rk-dunkelrot);border-radius:10px;padding:14px 16px 16px;margin-bottom:14px}
.thema-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.thema-title{font-weight:700;font-size:16px;color:var(--rk-dunkelrot)}
.thema-remove{border:0;background:transparent;color:var(--rk-muted);font-size:12.5px;cursor:pointer;padding:2px 4px}
.thema-remove:hover{color:var(--rk-dunkelrot)}
.subfield{margin-top:12px}
.subfield>label{display:block;font-weight:700;font-size:13.5px;margin-bottom:6px}
.btn.add{width:100%;background:#fff;color:var(--rk-dunkelrot);border:1px dashed var(--rk-dunkelrot);margin-bottom:6px}
.btn.add:hover{background:var(--rk-soft)}

.actions{margin-top:18px}
.btn{border:0;border-radius:8px;padding:13px 22px;font-size:15px;font-weight:700;font-family:var(--sans);cursor:pointer;background:var(--rk-dunkelrot);color:#fff;width:100%;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.btn:hover{background:var(--rk-dunkelrot-d)}
.btn:disabled{opacity:.5;cursor:not-allowed}

.result{margin-top:16px;font-size:14px;border-radius:8px;padding:0}
.result.show{padding:13px 14px}
.result.ok{background:#E9F5EE;border:1px solid #BEE3CB;color:#246B43}
.result.err{background:var(--rk-soft);border:1px solid #EBD3D2;color:var(--rk-dunkelrot-d)}

/* Status: aktuelle Edition / geschlossen */
.banner{background:var(--rk-soft);border:1px solid #EBD3D2;border-left:4px solid var(--rk-dunkelrot);border-radius:8px;padding:13px 15px;margin-bottom:18px}
.banner .b-title{font-weight:700;font-size:16px;color:var(--rk-dunkelrot)}
.banner .b-sub{font-size:12.5px;color:var(--rk-muted);margin-top:3px}
.code-status{display:none;font-size:12.5px;font-weight:700;margin-top:6px}
.code-status.checking{display:block;color:var(--rk-muted);font-weight:400}
.code-status.ok{display:block;color:#2F7D4F}
.code-status.bad{display:block;color:var(--rk-dunkelrot)}
.notice{background:#fff;border:1px solid var(--rk-line);border-radius:10px;padding:22px 18px;text-align:center;color:var(--rk-black);font-size:15px}
.notice .n-sub{font-size:12.5px;color:var(--rk-muted);margin-top:8px}
.banner .b-back{display:inline-block;margin-top:9px;background:none;border:0;padding:0;color:var(--rk-dunkelrot);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:underline}

/* Auswahl, wenn mehrere Uploads gleichzeitig offen sind */
.chooser-box{margin-bottom:18px}
.chooser-head{font-size:15px;color:var(--rk-black);margin-bottom:12px}
.chooser-tiles{display:flex;flex-wrap:wrap;gap:14px}
.chooser-tile{display:flex;flex-direction:column;gap:5px;align-items:flex-start;text-align:left;flex:1 1 220px;background:#fff;border:1px solid var(--rk-line);border-left:4px solid var(--rk-dunkelrot);border-radius:10px;padding:16px 18px;cursor:pointer;transition:.15s}
.chooser-tile:hover{border-color:var(--rk-dunkelrot);box-shadow:0 4px 14px rgba(183,14,12,.12);transform:translateY(-1px)}
.chooser-tile .ct-title{font-weight:700;font-size:16px;color:var(--rk-dunkelrot)}
.chooser-tile .ct-sub{font-size:12.5px;color:var(--rk-muted)}

/* Fortschrittsanzeige beim Absenden */
.progress-wrap{margin-top:14px}
.progress-label{font-size:12.5px;color:var(--rk-muted);margin-bottom:5px}
.progress{background:var(--rk-line);border-radius:8px;height:14px;overflow:hidden}
.progress-bar{height:100%;width:0;background:var(--rk-dunkelrot);border-radius:8px;transition:width .15s ease}
.progress-bar.indet{width:100%;animation:indet 1.1s ease-in-out infinite;background:linear-gradient(90deg,var(--rk-dunkelrot) 30%,#d4413f 50%,var(--rk-dunkelrot) 70%);background-size:200% 100%}
@keyframes indet{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* Honeypot unsichtbar */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* Toolbox-Startseite: Funktions-Kacheln (Stil wie in der App) */
.tiles{display:flex;flex-wrap:wrap;gap:16px;margin-top:8px}
.linktile{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:9px;width:160px;min-height:120px;box-sizing:border-box;background:#fff;border:1px solid var(--rk-line);border-radius:12px;padding:16px 12px;cursor:pointer;text-decoration:none;font-size:13px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--rk-black);transition:.15s}
.linktile:hover{border-color:var(--rk-dunkelrot);box-shadow:0 4px 14px rgba(183,14,12,.12);transform:translateY(-1px)}
.linktile svg{display:block}

@media (max-width:560px){
  .brand-inner{gap:10px;padding:12px 14px}
  .logo{height:44px}
  .welsmap{height:34px}
  .channel{font-size:22px}
  .dienststelle{font-size:9px;letter-spacing:.01em}
  .titlebar-inner{padding:14px 16px}
  .titlebar h1{font-size:20px}
  .wrap{padding:16px 12px calc(28px + env(safe-area-inset-bottom))}
  .intro{margin:4px 0 16px}
  .field{padding:14px 13px 15px;border-radius:12px;margin-bottom:12px}
  .field>label{font-size:15px}
  /* 16px verhindert das automatische Hineinzoomen von iOS beim Fokus */
  input[type=text],input[type=password],select,textarea{font-size:16px;padding:13px 13px}
  textarea{min-height:150px}
  input[type=file]{font-size:15px;padding:13px}
  input[type=file]::file-selector-button,input[type=file]::-webkit-file-upload-button{padding:11px 16px;font-size:15px}
  .btn{padding:16px 20px;font-size:16px}
  .file-rm{width:34px;height:34px;font-size:20px}
  .credit-thumb{width:42px;height:42px}
  .chooser-tile{flex:1 1 100%}
  .banner .b-title,.thema-title,.chooser-tile .ct-title{font-size:15px}
}
@media (max-width:380px){
  .credit-name{display:none}
  .channel{font-size:20px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
