/* =========================================================
   PAGE 35 · SYSTEM ERRORS
   EDITORIAL RECOVERY SURFACE
   ========================================================= */
.lk3-system-state-body{
  --paper:#F4F0E7;--surface:#FBF8F1;--ink:#151515;--muted:#6D685F;
  --red:#EF2B2D;--cobalt:#315BFF;--container:1360px;--gutter:80px;
  margin:0;background:var(--paper);color:var(--ink);
  font-family:"Onest",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  overflow-x:hidden;
}
.lk3-system-state-body .error-page,.lk3-system-state-body .error-page *{box-sizing:border-box}

.error-page{padding:42px 0 96px}
.error-shell{
  width:min(var(--container,1360px),calc(100% - (var(--gutter,80px) * 2)));
  margin-inline:auto;
}
.error-kicker{
  display:block;
  color:#6B655D;
  font-size:14px;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
}

/* C182–C186 · Full-page recovery */
.recovery-surface{
  margin-top:0;
  min-height:560px;
  display:grid;
  grid-template-columns:minmax(280px,.31fr) minmax(0,.69fr);
  border-top:3px solid var(--ink);
  border-bottom:1px solid rgba(21,21,21,.18);
}
.state-marker{
  padding:42px 30px 36px 0;
  border-right:1px solid rgba(21,21,21,.18);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.state-marker .marker-label{
  color:#706A62;
  font-size:14px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.state-marker .marker-value{
  margin-top:16px;
  max-width:260px;
  font-size:clamp(72px,8.4vw,118px);
  line-height:.8;
  letter-spacing:-.07em;
  font-weight:900;
  overflow-wrap:anywhere;
}
.state-marker .marker-value.is-text{
  max-width:none;
  font-size:clamp(36px,4.15vw,58px);
  line-height:.9;
  letter-spacing:-.055em;
  white-space:nowrap;
  overflow-wrap:normal;
}
.marker-rule{
  width:70px;
  height:5px;
  background:var(--cobalt);
}

.recovery-content{
  padding:64px 0 44px 52px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.recovery-content h1{
  margin:10px 0 16px;
  max-width:920px;
  font-size:clamp(52px,5.1vw,64px);
  line-height:.93;
  letter-spacing:-.063em;
  font-weight:900;
  overflow-wrap:break-word;
  hyphens:none;
}
.recovery-content h1:focus{outline:none}
.recovery-content .recovery-body{
  margin:0;
  max-width:700px;
  color:var(--muted);
  font-size:16px;
  line-height:1.6;
}
.recovery-actions{
  margin-top:28px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.recovery-primary,
.recovery-secondary{
  min-width:44px;
  min-height:52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 18px;
  font-size:14px;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
  touch-action:manipulation;
  transition:background-color .16s ease,color .16s ease,border-color .16s ease,transform .16s ease;
}
.recovery-primary{
  border:2px solid var(--cobalt);
  background:var(--cobalt);
  color:#fff;
}
.recovery-primary.ink{
  border-color:var(--ink);
  background:var(--ink);
  color:var(--paper);
}
.recovery-auth-form{
  margin:0;
  display:inline-flex;
}
.recovery-auth-form .recovery-primary{
  width:100%;
}
.recovery-secondary{
  border:1px solid rgba(21,21,21,.28);
  background:transparent;
  color:var(--ink);
}
.recovery-primary:hover,
.recovery-primary:focus-visible{
  border-color:var(--ink);
  background:var(--ink);
  color:var(--paper);
}
.recovery-primary.ink:hover,
.recovery-primary.ink:focus-visible{
  border-color:var(--cobalt);
  background:var(--cobalt);
  color:#fff;
}
.recovery-secondary:hover,
.recovery-secondary:focus-visible{
  border-color:var(--ink);
  background:var(--ink);
  color:var(--paper);
}
.recovery-primary:focus-visible,
.recovery-secondary:focus-visible,
.discovery-link:focus-visible{
  outline:3px solid var(--red);
  outline-offset:3px;
}
.recovery-primary:active,
.recovery-secondary:active,
.discovery-link:active{transform:translateY(1px)}
.diagnostic-ref{
  display:none;
  margin-top:24px;
  color:#777169;
  font-size:14px;
  line-height:1.45;
}
.diagnostic-ref.is-visible{display:block}
.diagnostic-ref strong{
  color:var(--ink);
  font-weight:850;
}

.lk3-offline-screen{
  position:fixed;inset:0;z-index:999999;padding:22px;display:grid;place-items:center;
  background:rgba(21,21,21,.76);backdrop-filter:blur(4px);
}
.lk3-offline-screen[hidden]{display:none!important}
.lk3-offline-card{width:min(620px,100%);padding:clamp(28px,6vw,58px);background:#F4F0E7;color:#151515;border-top:6px solid #315BFF;outline:none;font-family:"Onest",Inter,ui-sans-serif,system-ui,sans-serif}
.lk3-offline-card>span{font-size:14px;font-weight:900;letter-spacing:.12em}
.lk3-offline-card h2{margin:12px 0;font-size:clamp(36px,7vw,58px);line-height:.94;letter-spacing:-.055em}
.lk3-offline-card p{margin:0;color:#6D685F;font-size:16px;line-height:1.6}
.lk3-offline-card button{min-height:52px;margin-top:24px;padding:0 20px;border:2px solid #151515;background:#151515;color:#F4F0E7;font:inherit;font-weight:900;cursor:pointer;touch-action:manipulation}
.lk3-offline-card button:hover,.lk3-offline-card button:focus-visible{border-color:#315BFF;background:#315BFF;outline:3px solid #EF2B2D;outline-offset:3px}

/* C187 · 404 discovery rail */
.discovery-rail{
  display:none;
  margin-top:58px;
  padding-top:24px;
  border-top:2px solid var(--ink);
}
.discovery-rail.is-visible{display:block}
.discovery-rail h2{
  margin:7px 0 18px;
  font-size:30px;
  line-height:1;
  letter-spacing:-.04em;
}
.discovery-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border-top:1px solid var(--ink);
  border-left:1px solid var(--ink);
}
.discovery-link{
  min-width:44px;
  min-height:96px;
  padding:17px;
  border-right:1px solid var(--ink);
  border-bottom:1px solid var(--ink);
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  font-size:15px;
  font-weight:850;
  color:var(--ink);
  text-decoration:none;
  cursor:pointer;
  touch-action:manipulation;
  transition:background-color .16s ease,color .16s ease,transform .16s ease;
}
.discovery-link:hover,
.discovery-link:focus-visible{
  background:var(--ink);
  color:var(--paper);
}

@media(min-width:1360px){.recovery-content h1{max-width:980px}}

/* C188 · Region failure */
.region-demo{
  display:none;
  margin-top:0;
}
.region-demo.is-visible{display:block}
.demo-page-context{
  border-top:3px solid var(--ink);
  padding:36px 0 0;
}
.demo-page-context h1{
  margin:8px 0 10px;
  font-size:52px;
  letter-spacing:-.055em;
}
.demo-page-context p{
  margin:0;
  max-width:720px;
  color:var(--muted);
  font-size:16px;
}
.region-shell{
  margin-top:52px;
  padding-top:22px;
  border-top:3px solid var(--ink);
}
.region-shell h2{
  margin:7px 0 7px;
  font-size:22px;
  line-height:1.15;
}
.region-shell p{
  margin:0;
  max-width:680px;
  color:var(--muted);
  font-size:16px;
  line-height:1.55;
}
.region-retry{
  min-height:44px;
  margin-top:10px;
  border:0;
  border-bottom:1px solid rgba(21,21,21,.28);
  background:transparent;
  padding:0;
  font-size:14px;
  font-weight:900;
}

/* C189 · Action failure */
.action-demo{
  display:none;
  width:min(780px,100%);
}
.action-demo.is-visible{display:block}
.action-demo h1{
  margin:9px 0 12px;
  font-size:48px;
  line-height:.98;
  letter-spacing:-.05em;
}
.action-demo p{
  margin:0;
  color:var(--muted);
  font-size:16px;
}
.demo-form{
  margin-top:36px;
  padding-top:24px;
  border-top:2px solid var(--ink);
  display:grid;
  gap:16px;
}
.demo-field{
  display:grid;
  gap:7px;
}
.demo-field label{
  color:#655F57;
  font-size:14px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.demo-field input,
.demo-field textarea{
  width:100%;
  min-height:52px;
  border:1px solid rgba(21,21,21,.3);
  background:var(--surface);
  border-radius:0;
  padding:12px 14px;
  font:inherit;
}
.demo-field textarea{
  min-height:150px;
  resize:vertical;
}
.action-error-summary{
  padding:13px 15px;
  border-left:5px solid var(--red);
  background:rgba(239,43,45,.055);
  color:#8D1D20;
  font-size:14px;
  line-height:1.5;
}
.demo-submit{
  min-height:50px;
  width:max-content;
  padding:0 18px;
  border:2px solid var(--ink);
  background:var(--ink);
  color:var(--paper);
  font-weight:900;
}

/* C190 · Offline rail */
.offline-rail{
  display:none;
  margin-bottom:22px;
  padding:13px 16px;
  border-top:2px solid var(--ink);
  border-bottom:1px solid rgba(21,21,21,.18);
  background:var(--surface);
}
.offline-rail.is-visible{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.offline-rail strong{font-size:14px}
.offline-rail span{
  color:var(--muted);
  font-size:14px;
}

/* Reduced chrome for maintenance */
body.reduced-chrome .site-header,
body.reduced-chrome .site-footer{display:none}
body.reduced-chrome .error-page{padding-top:36px}

@media(max-width:959px){
  .lk3-system-state-body{--gutter:32px}
  .recovery-surface{grid-template-columns:1fr}
  .state-marker{
    min-height:210px;
    padding:28px 0 24px;
    border-right:0;
    border-bottom:1px solid rgba(21,21,21,.18);
  }
  .recovery-content{padding:44px 0 34px}
}
@media(max-width:620px){
  .lk3-system-state-body{--gutter:18px}
  .error-page{padding-top:22px;padding-bottom:72px}
  .recovery-surface{min-height:0}
  .state-marker{min-height:150px}
  .state-marker .marker-value{
    font-size:70px;
    line-height:.84;
  }
  .state-marker .marker-value.is-text{
    font-size:clamp(36px,11.5vw,48px);
  }
  .recovery-content{padding:34px 0 28px}
  .recovery-content h1{font-size:40px}
  .recovery-content .recovery-body{font-size:15px}
  .recovery-actions{display:grid}
  .recovery-auth-form{display:block;width:100%}
  .recovery-primary,.recovery-secondary{width:100%}
  .discovery-grid{grid-template-columns:1fr}
  .demo-page-context h1{font-size:40px}
  .action-demo h1{font-size:38px}
  .demo-submit{width:100%}
  .offline-rail.is-visible{display:block}
  .offline-rail span{display:block;margin-top:4px}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}
