:root{--blue:#144169;--sand:#c3b98c;--ink:#2c2b2d;--moon:#f2f2f2;font:16px/1.5 system-ui,sans-serif;color:var(--ink);background:#f7f8f9}*{box-sizing:border-box}body{margin:0}header{height:80px;background:white;display:flex;align-items:center;gap:24px;padding:0 max(5vw,20px);border-bottom:1px solid #ddd}header .brand-logo{display:block;width:210px;height:auto;flex:none}header span{border-left:2px solid var(--sand);padding-left:24px}header small{margin-left:auto}main,#error{max-width:1180px;margin:42px auto;padding:0 24px}h1,h2,h3{color:var(--blue);line-height:1.15}h1{font-size:clamp(29px,4vw,44px);letter-spacing:-1.5px;margin:0 0 22px}h2{font-size:22px;margin:0 0 20px}.panel,article{background:#fff;border:1px solid #d6dce1;border-radius:10px;padding:24px;margin:16px 0}.login{max-width:470px;margin:8vh auto}.row,nav{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}button,a{font:inherit;color:var(--blue)}button,.btn{padding:10px 16px;background:white;border:1px solid #b9c7d2;border-radius:6px;cursor:pointer}.primary,button[aria-pressed=true]{background:var(--blue);color:white;border-color:var(--blue)}button:hover{outline:1px solid var(--blue)}:focus-visible{outline:3px solid #1866a4;outline-offset:3px}input,select,textarea{width:100%;padding:10px;border:1px solid #aab8c3;border-radius:5px;font:inherit}label{display:block;margin:12px 0}input[type=checkbox]{width:auto}fieldset{border:0;padding:0}nav{margin:20px 0}nav button{font-weight:600}.grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:18px}.grid .panel{min-width:0}.pdf{width:100%;height:65vh;border:1px solid #bcc6ce}small,.muted{color:#53626c}.hash{overflow-wrap:anywhere;font-family:monospace}.list{padding-left:24px}.list li{padding:8px 0}.list button{padding:5px 12px;margin-left:6px}#error{color:#9d281b;position:sticky;bottom:12px}#error:not(:empty){background:#fff3ef;border:1px solid #d28a7c;padding:14px}button:disabled{opacity:.5;cursor:default}dialog{max-width:min(490px,94vw);border:1px solid #afbec8;border-radius:9px;padding:24px}dialog::backdrop{background:#16304966}article h3{margin:6px 0}.progress{color:var(--blue);font-weight:650}.mobiletabs{display:none}@media(max-width:730px){main{margin:24px auto;padding:0 14px}header{gap:12px}header span{display:none}.grid{display:block}.panel,article{padding:16px}.pdf{height:52vh}.mobiletabs{display:flex}.grid[data-tab=document] aside,.grid[data-tab=steps] .document{display:none}}
.actions{position:sticky;bottom:0;background:white;padding:14px;border-top:2px solid var(--sand)}[hidden]{display:none!important}
.roles{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:22px 0}.role{padding:14px;border:1px solid #c5cfd6;border-radius:8px}.role legend{font-weight:650;color:var(--blue)}.role p{font-size:.92rem}.summary{font-weight:650;border-left:4px solid var(--sand);padding:8px 12px}.message{white-space:pre-wrap;overflow-wrap:anywhere}#order li{padding:5px}#order button{margin-left:6px}summary{cursor:pointer;color:var(--blue);padding:8px 0}
@media(max-width:730px){.grid[data-tab=comments],.discussion:not([data-tab=comments]){display:none}.mobiletabs button{flex:1;padding:10px 6px}}
.role input[type=radio]{width:auto}#mentionsList:not(:empty){padding:10px 0}
#case-search{margin:16px 0 20px}#case-search label{font-weight:600;color:var(--blue);margin:0 0 6px}#case-query{flex:1 1 240px;max-width:640px}

.metadata-review {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
.metadata-review summary { font-weight: 650; }
.metadata-review .pdf { display: block; margin-bottom: 8px; }
@media (max-width: 730px) {
  .metadata-review { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .metadata-review .pdf { height: 44vh; }
}

.signature-setup{max-width:850px;margin:auto}
#signature-canvas{width:100%;height:auto;aspect-ratio:10/3;border:1px solid #aab8c3;border-radius:8px;background:white;touch-action:none}
.signature-image{display:block;width:280px;max-width:100%;height:84px;object-fit:contain}
.signature-preview{border:1px solid #ccd5dd;border-radius:8px;padding:20px;margin:20px 0}
.signature-preview img{display:block;width:100%;max-width:400px;aspect-ratio:10/3;object-fit:contain;border-bottom:1px solid #aab8c3}
.signature-preview span,.signature-preview small{display:block}
#signature-error{color:#9d281b}

.signature-preview img:not([src]){display:none}

@media(max-width:730px){header{height:72px}header .brand-logo{width:164px}header small{font-size:12px;line-height:1.25;text-align:right;max-width:112px}}
@media(max-width:360px){header{padding:0 14px}header .brand-logo{width:148px}header small{max-width:104px}}

/* Clear hierarchy and larger touch targets for the approval workflow. */
:root{background:#f5f7f8;color:var(--ink)}
header{border-color:#e7eaed;box-shadow:0 2px 16px #14416908}
main{max-width:1240px}
h1{letter-spacing:-.035em}
.panel,article{border-color:#e2e8ec;border-radius:14px;box-shadow:0 4px 18px #173e5e08}
button,.btn{min-height:44px;border-radius:9px;font-weight:600;transition:background-color .15s,border-color .15s,box-shadow .15s}
button:hover:not(:disabled){outline:none;border-color:var(--blue);box-shadow:0 2px 9px #14416918}
button.primary:hover:not(:disabled){background:#0d3150;color:#fff}
button:disabled{opacity:.55}
nav{gap:6px;padding:5px;width:fit-content;max-width:100%;border-radius:12px;background:#e9eef1}
nav button{border-color:transparent;background:transparent}
nav button[aria-pressed=true]{box-shadow:0 2px 5px #14416918}
article h3{font-size:1.2rem;overflow-wrap:anywhere}
article.row{gap:20px}
.review-access{background:#f3f7f8;border:1px solid #dae6e9;border-radius:10px;padding:16px;margin:20px 0}
.review-access h3{margin:0 0 12px}.review-access p{margin:8px 0}.review-access small{display:block;margin-top:12px}
#error:not(:empty){z-index:5;border-radius:10px;box-shadow:0 6px 20px #2c2b2d20}
@media(max-width:730px){header{height:72px;padding:0 16px}header .brand-logo{width:170px}header small{font-size:.75rem}main{margin:22px auto}.panel,article{border-radius:12px}nav{width:100%}nav button{flex:1 1 auto}.row.between>div.row{width:100%}.actions button{flex:1 1 130px}}
@media(prefers-reduced-motion:reduce){button,.btn{transition:none}}

#login-error { margin: 0; color: #9d281b; overflow-wrap: anywhere; }
#login-error:empty { display: none; }
.login form + button { margin-top: 12px; }
.panel, .list li, dialog, main h1 { overflow-wrap: anywhere; }
.pdf + a, a.btn { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 640px) {
  header { height: 54px; }
  header .brand-logo { width: 126px; }
  main:has(.login) { padding: 0 16px; margin: 20px auto; }
  .login { margin: 0 auto; padding: 20px; }
  .login h1 { font-size: 26px; margin-bottom: 16px; }
  .login form { display: grid; gap: 14px; }
  .login label { margin: 0; }
  .login input, .login .primary { min-height: 46px; }
  .login button { width: 100%; }
  .login #forgot { background: transparent; border-color: transparent; }
  .actions { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .roles { grid-template-columns: minmax(0, 1fr); }
}

#account-tools, .area-short { display: none; }
body:has(.dashboard-heading) #account-tools { display: flex; gap: 6px; align-items: center; }
#settings { position: relative; }
#settings summary, #logout { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--blue, #144169); cursor: pointer; background: white; border: 1px solid #bac8d1; border-radius: 9px; }
#settings summary::-webkit-details-marker { display: none; }
#settings summary:focus-visible { outline: 3px solid #144169; outline-offset: 2px; }
.settings-panel { position: absolute; z-index: 6; right: 0; top: calc(100% + 6px); width: 206px; padding: 12px; background: white; border: 1px solid #d5dfe6; border-radius: 12px; box-shadow: 0 6px 24px #14416926; }
.settings-panel strong { display: block; padding: 6px 8px; font-size: .85rem; }
.settings-panel button { width: 100%; min-height: 44px; border-color: transparent; text-align: left; padding: 8px; }
@media(max-width:730px) {
  body:has(.dashboard-heading) header small { display: none; }
  #account-tools { margin-left: auto; }
  .dashboard-heading #new { width: 100%; }
  nav[aria-label="Arbeitsbereich"] {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 1.65fr);
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
  }
  nav[aria-label="Arbeitsbereich"] button { padding: 5px 3px; min-height: 44px; font-size: .85rem; overflow-wrap: anywhere; }
  .area-full { display: none; }
  .area-short { display: inline; }
}
