:root {
  --blue: #263f86;
  --blue-2: #16285d;
  --red: #ed1c24;
  --green: #13a56b;
  --amber: #f5a623;
  --ink: #111827;
  --text: #243044;
  --muted: #667085;
  --line: #d9e2ef;
  --soft: #f5f7fb;
  --card: rgba(255,255,255,.94);
  --shadow: 0 24px 70px rgba(17, 24, 39, .10);
  --radius: 24px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Inter, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--text);
  background: #f2f5fb;
}
.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 6%, rgba(38,63,134,.22), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(237,28,36,.12), transparent 31rem),
    linear-gradient(180deg, #f9fbff 0%, #eef3fa 100%);
}
.app-shell { position: relative; width: min(1480px, calc(100% - 32px)); margin: 24px auto 70px; }
.hero, .card, .metric-card {
  background: var(--card);
  border: 1px solid rgba(217,226,239,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero { border-radius: 32px; padding: 26px; margin-bottom: 18px; }
.hero-top { display: flex; justify-content: space-between; gap: 22px; align-items: stretch; }
.brand { display: flex; align-items: center; gap: 28px; min-width: 0; }
.brand img { width: min(360px, 30vw); min-width: 220px; max-height: 105px; object-fit: contain; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 900; color: var(--blue); }
h1 { margin: 0 0 8px; font-size: clamp(34px, 5vw, 58px); line-height: .95; letter-spacing: -.05em; color: var(--ink); }
h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
h3 { margin: 0 0 14px; font-size: 20px; color: var(--ink); }
p { line-height: 1.55; }
.lead { max-width: 850px; margin: 0; color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); margin: 8px 0 0; }
.status-card {
  min-width: 245px;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.status-card small { display: block; margin-top: 3px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; background: var(--green); box-shadow: 0 0 0 6px rgba(19,165,107,.12); }
.dot.muted { background: #98a2b3; box-shadow: 0 0 0 6px rgba(152,162,179,.15); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 6px rgba(245,166,35,.15); }
.dot.error { background: var(--red); box-shadow: 0 0 0 6px rgba(237,28,36,.12); }
.toolbar { margin-top: 22px; display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.glass { background: rgba(255,255,255,.58); border: 1px solid rgba(217,226,239,.85); border-radius: 24px; padding: 16px; }
.input-group { display: flex; flex-direction: column; gap: 7px; }
.input-group.grow { flex: 1 1 260px; }
.input-group.wide, .wide { grid-column: 1 / -1; }
label, .field-label { color: #334155; font-size: 13px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 13px;
  font: inherit;
  outline: none;
  transition: border .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(38,63,134,.55); box-shadow: 0 0 0 4px rgba(38,63,134,.10); }
input[readonly] { background: #f8fafc; color: #64748b; }
.secret-row { display: flex; gap: 7px; }
.icon-btn { width: 48px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.btn {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(38,63,134,.18);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(38,63,134,.23); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.secondary { background: #eef3ff; color: var(--blue); box-shadow: none; border: 1px solid #dbe6ff; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, var(--red), #b91119); }
.btn.big { min-height: 54px; padding-inline: 26px; }
.btn.tiny { min-height: 34px; padding: 0 12px; font-size: 12px; }
.card { border-radius: var(--radius); padding: 22px; }
.search-panel { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 16px; }
.search-row { display: flex; gap: 10px; flex: 1; max-width: 640px; }
.search-input { min-height: 54px; font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { border-radius: 20px; padding: 18px; min-width: 0; }
.metric-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin-top: 8px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-card { position: sticky; top: 16px; }
.check-line, .check-card, .checks-grid label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  color: #344054;
}
.check-line.strong { font-weight: 900; }
.check-line input, .check-card input, .checks-grid input { width: 18px; min-height: 18px; accent-color: var(--blue); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.actions-stack { display: grid; gap: 10px; margin-top: 16px; }
.note { background: #fff8e5; border: 1px solid #ffe2a8; border-radius: 16px; padding: 12px; color: #7a4d00; font-size: 13px; }
.form-main { display: grid; gap: 16px; }
.section-card { overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-head.compact { margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: #f1f5ff; color: var(--blue); font-weight: 900; font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; background: #fbfdff; }
.checks-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checks-grid label { border: 1px solid var(--line); border-radius: 16px; padding: 9px 12px; background: #fbfdff; font-weight: 800; }
.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.output-card pre {
  margin: 0;
  min-height: 300px;
  max-height: 520px;
  overflow: auto;
  border-radius: 18px;
  padding: 16px;
  background: #0b1220;
  color: #e6edf9;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(460px, calc(100% - 44px));
  border-radius: 18px;
  padding: 15px 17px;
  color: #fff;
  background: #111827;
  box-shadow: 0 20px 60px rgba(17,24,39,.25);
  font-weight: 800;
}
.toast.ok { background: #08784f; }
.toast.error { background: #b91119; }
.toast.warn { background: #9a5b00; }
[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .hero-top, .search-panel { flex-direction: column; align-items: stretch; }
  .brand { flex-direction: column; align-items: flex-start; }
  .brand img { width: 100%; max-width: 360px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .checks-grid { grid-template-columns: repeat(2, 1fr); }
  .output-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app-shell { width: min(100% - 18px, 1480px); margin-top: 10px; }
  .hero, .card { border-radius: 18px; padding: 16px; }
  .toolbar, .search-row { flex-direction: column; align-items: stretch; }
  .summary-grid, .grid-2, .checks-grid { grid-template-columns: 1fr; }
}
