:root{
  --app-bg:#f6f8fb;
  --app-surface:#ffffff;
  --app-surface-2:#f8fafc;
  --app-text:#0f172a;
  --app-muted:#64748b;
  --app-line:#dbe3ee;
  --app-accent:#2563eb;
  --app-accent-2:#1d4ed8;
  --app-danger:#b91c1c;
  --app-danger-soft:rgba(185,28,28,.08);
  --app-radius:20px;
  --app-radius-sm:14px;
  --app-shadow:0 18px 48px rgba(15,23,42,.08);
}

*,
*::before,
*::after{
  box-sizing:border-box;
}

html{
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.08), transparent 28%),
    var(--app-bg);
  color:var(--app-text);
  font:400 16px/1.65 Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a{
  color:var(--app-accent);
  text-decoration:none;
}

a:hover{
  text-decoration:underline;
}

.app-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.shell-topbar{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(10px);
  background:rgba(246,248,251,.88);
  border-bottom:1px solid rgba(219,227,238,.92);
}

.shell-topbar__inner,
.shell-footer__inner{
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
}

.shell-topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:72px;
}

.shell-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.shell-brand__dot{
  width:12px;
  height:12px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--app-accent), var(--app-accent-2));
  box-shadow:0 0 0 8px rgba(37,99,235,.10);
  flex:0 0 auto;
}

.shell-brand__content{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.shell-brand__title{
  font-size:1rem;
  line-height:1.2;
}

.shell-brand__meta{
  color:var(--app-muted);
  font-size:.875rem;
}

.shell-nav{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.shell-nav a{
  font-weight:600;
}

.shell-main{
  flex:1 1 auto;
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
  padding:32px 0 40px;
}

.shell-section{
  display:block;
}

.shell-card{
  background:var(--app-surface);
  border:1px solid var(--app-line);
  border-radius:var(--app-radius);
  box-shadow:var(--app-shadow);
  padding:24px;
}

.shell-card--narrow{
  max-width:780px;
  margin:0 auto;
}

.shell-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:0 14px;
  border-radius:999px;
  background:rgba(37,99,235,.08);
  color:var(--app-accent);
  font-size:.875rem;
  font-weight:700;
  letter-spacing:.02em;
}

.shell-badge--danger{
  background:var(--app-danger-soft);
  color:var(--app-danger);
}

.shell-title{
  margin:18px 0 10px;
  font-size:clamp(1.8rem, 4vw, 2.7rem);
  line-height:1.08;
}

.shell-lead{
  margin:0;
  max-width:68ch;
  color:var(--app-muted);
}

.shell-meta-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-top:24px;
}

.shell-meta-card{
  background:var(--app-surface-2);
  border:1px solid var(--app-line);
  border-radius:var(--app-radius-sm);
  padding:16px;
}

.shell-meta-card__label{
  display:block;
  color:var(--app-muted);
  font-size:.875rem;
  margin-bottom:8px;
}

.shell-meta-card__value{
  display:block;
  font-size:1rem;
  line-height:1.35;
  word-break:break-word;
}

.shell-actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:24px;
  flex-wrap:wrap;
}

.shell-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 18px;
  border-radius:14px;
  background:var(--app-accent);
  color:#fff;
  font-weight:700;
  box-shadow:0 12px 28px rgba(37,99,235,.18);
}

.shell-button:hover{
  text-decoration:none;
  background:var(--app-accent-2);
}

.shell-note{
  margin-top:18px;
  color:var(--app-muted);
  font-size:.95rem;
}

.shell-debug{
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid var(--app-line);
}

.shell-debug__row{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:14px;
}

.shell-debug__row span{
  color:var(--app-muted);
  font-size:.875rem;
}

.shell-debug__trace{
  margin:0;
  padding:16px;
  background:#0f172a;
  color:#e2e8f0;
  border-radius:14px;
  overflow:auto;
  font-size:.875rem;
  line-height:1.55;
}

.shell-footer{
  border-top:1px solid rgba(219,227,238,.92);
  background:rgba(255,255,255,.74);
}

.shell-footer__inner{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--app-muted);
  font-size:.92rem;
}

@media (max-width: 900px){
  .shell-meta-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .shell-topbar__inner{
    min-height:auto;
    padding:14px 0;
    align-items:flex-start;
    flex-direction:column;
  }

  .shell-main{
    width:min(100% - 24px, 1100px);
    padding:20px 0 28px;
  }

  .shell-card{
    padding:18px;
    border-radius:18px;
  }

  .shell-meta-grid{
    grid-template-columns:1fr;
  }

  .shell-footer__inner{
    min-height:auto;
    padding:14px 0;
    flex-direction:column;
    align-items:flex-start;
  }
}