:root{
  --bg:#edf6ff;
  --surface:#ffffff;
  --surface-soft:rgba(255,255,255,.96);
  --ink:#0f172a;
  --muted:#546477;
  --muted-strong:#24415f;
  --line:rgba(0,120,212,.14);
  --line-strong:rgba(0,120,212,.24);
  --azure:#0078d4;
  --azure-strong:#005ea8;
  --azure-soft:#edf6ff;
  --shadow-soft:0 14px 34px rgba(0,83,156,.06);
  --shadow-fine:0 6px 18px rgba(15,23,42,.05);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,.96), transparent 34%),
    linear-gradient(180deg, #f8fcff 0%, var(--bg) 28%, #eaf4ff 100%);
  color:var(--ink);
  font:15px/1.5 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.shell{
  max-width:1480px;
  margin:0 auto;
  padding:34px 28px 148px;
}

.masthead{
  position:relative;
  padding:10px 0 46px;
  border-bottom:1px solid var(--line);
}

.masthead::after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(15,23,42,.08) 16%, rgba(15,23,42,.08) 84%, transparent);
}

.masthead-topline{padding-bottom:28px}

.brand-mark,
.section-label,
.workflow-kicker,
.label,
.page-label{
  margin:0;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;
}

.brand-mark{
  color:var(--ink);
  font-size:13px;
  font-weight:650;
}

.masthead h1{
  margin:0 0 16px;
  max-width:26ch;
  font-size:clamp(2.7rem, 5.9vw, 6rem);
  line-height:.96;
  font-weight:630;
}

.masthead-lede{
  max-width:66rem;
  margin:0;
  color:var(--muted-strong);
  font-size:1.06rem;
}

.hero-actions,
.button-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.hero-actions{
  margin-top:28px;
  gap:12px;
}

.hero-notes{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  margin-top:18px;
  color:var(--muted);
  font-size:13px;
}

.hero-notes span{
  position:relative;
}

.hero-notes span:not(:last-child)::after{
  content:"";
  position:absolute;
  right:-10px;
  top:50%;
  width:2px;
  height:2px;
  border-radius:50%;
  background:rgba(0,120,212,.28);
  transform:translateY(-50%);
}

.workflow-strip{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:22px;
  padding:26px 0 16px;
  border-bottom:1px solid var(--line);
}

.workflow-step{
  position:relative;
  padding-right:14px;
}

.workflow-step:not(:last-child)::after{
  content:"";
  position:absolute;
  top:2px;
  right:0;
  width:1px;
  height:44px;
  background:var(--line);
}

.workflow-step strong{
  display:block;
  margin-top:7px;
  font-size:1rem;
  font-weight:620;
}

.workflow-step p,
.inline-note,
.upload-meta,
.scope-pill small,
.detail-meta,
.detail-list,
.detail-empty{
  margin:0;
  color:var(--muted);
}

.workflow-step p{
  margin-top:5px;
  font-size:.93rem;
}

.flow{display:grid}

.flow-step{
  padding:42px 0;
  border-bottom:1px solid var(--line);
}

.step-marker h2{
  margin:6px 0 0;
  font-size:clamp(1.7rem, 3vw, 2.3rem);
  line-height:1;
  font-weight:620;
}

.section-intro{
  max-width:56rem;
  margin:12px 0 0;
  color:var(--muted);
  font-size:.98rem;
  line-height:1.55;
}

.control-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:18px 22px;
  margin-top:26px;
}

.input-grid{
  grid-template-columns:1fr;
  gap:18px;
}

.span-2{grid-column:auto}

.stack,
.scope-list{
  display:grid;
  gap:12px;
}

.toggle-row{
  grid-template-columns:repeat(2, minmax(0,1fr));
  margin-top:30px;
}

textarea,
input[type="search"],
select,
input[type="file"]{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-soft);
  color:var(--ink);
  padding:13px 14px;
  font:inherit;
  outline:none;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea:focus,
input[type="search"]:focus,
select:focus,
input[type="file"]:focus{
  border-color:rgba(0,120,212,.42);
  box-shadow:0 0 0 4px rgba(0,120,212,.1);
  background:#fff;
}

textarea{
  min-height:240px;
  resize:vertical;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

input[type="file"]{
  max-width:640px;
  padding:10px 12px;
}

input[type="file"]::file-selector-button{
  margin-right:12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#f7fbff;
  color:#0e3f6d;
  padding:10px 14px;
  font:620 14px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Arial,sans-serif;
  cursor:pointer;
}

.notice-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  margin-top:10px;
}

.inline-note{
  font-size:13px;
}

button{
  border:1px solid transparent;
  border-radius:999px;
  background:transparent;
  color:inherit;
  padding:11px 18px;
  font:600 14px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Arial,sans-serif;
  cursor:pointer;
  transition:transform .14s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

button:hover{transform:translateY(-1px)}
button:active{transform:translateY(0)}

.primary{
  background:var(--azure);
  color:#fff;
  box-shadow:0 12px 24px rgba(0,120,212,.24);
}

.primary:hover{background:var(--azure-strong)}

.secondary,
.ghost{
  border-color:var(--line);
  background:rgba(255,255,255,.82);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}

.secondary{color:var(--ink)}
.ghost{color:var(--muted-strong)}
.ghost:hover,
.secondary:hover{
  border-color:rgba(0,120,212,.24);
  background:#ffffff;
}

.floating-dock{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:40;
  pointer-events:none;
}

.floating-dock-inner{
  display:grid;
  gap:10px;
  min-width:min(720px, calc(100vw - 32px));
  padding:14px;
  border:1px solid rgba(0,120,212,.14);
  border-radius:24px;
  background:rgba(255,255,255,.84);
  box-shadow:0 18px 40px rgba(0,83,156,.14);
  backdrop-filter:blur(18px) saturate(160%);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
  pointer-events:auto;
}

.floating-dock-label{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.floating-dock-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.floating-dock .primary,
.floating-dock .secondary,
.floating-dock .ghost{
  min-height:42px;
}

.scope-pill{
  display:grid;
  gap:5px;
  padding:18px 0 0;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0;
  background:transparent;
}

.scope-pill.compact{
  grid-template-columns:auto 1fr;
  column-gap:12px;
  align-items:start;
}

.scope-pill.compact span,
.scope-pill.compact small{
  grid-column:2;
}

.scope-pill input{
  margin-top:4px;
  accent-color:var(--azure);
}

.scope-pill span{
  color:var(--ink);
  font-weight:620;
}

.workspace-band{
  display:grid;
  gap:28px;
}

.workspace-top{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  justify-content:space-between;
  gap:18px;
}

.stats-table,
.coverage-table{
  width:100%;
  border-collapse:collapse;
}

.stats-table{
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:transparent;
}

.stats-table th,
.stats-table td,
.coverage-table th,
.coverage-table td{
  padding:14px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

.stats-table th,
.coverage-table th{
  width:24%;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;
}

.stats-table td,
.coverage-table td{
  color:var(--ink);
  font-weight:620;
  font-size:1.02rem;
}

.workspace-stack{
  display:grid;
  gap:28px;
}

.inspection-grid,
.coverage-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:36px;
}

.diagram-stage,
.inspector,
.coverage-panel{
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}

.panel-head{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.panel-head h3{
  margin:4px 0 0;
  font-size:1.08rem;
  font-weight:620;
}

.diagram-shell{
  min-height:860px;
  padding:22px;
  border:1px solid rgba(0,120,212,.14);
  border-radius:28px;
  background:linear-gradient(180deg, rgba(255,255,255,.99), rgba(240,248,255,.98));
  box-shadow:var(--shadow-soft);
  overflow:auto;
}

.diagram-empty{
  display:grid;
  place-items:center;
  min-height:820px;
  color:var(--muted);
  text-align:center;
  font-size:1.08rem;
}

#diagram-shell svg{
  width:max-content;
  min-width:100%;
  height:auto;
}

.diagram-collection{
  display:grid;
  gap:22px;
}

.diagram-card{
  display:grid;
  gap:14px;
  padding:18px;
  border:1px solid rgba(0,120,212,.14);
  border-radius:24px;
  background:rgba(255,255,255,.76);
  box-shadow:var(--shadow-fine);
}

.diagram-card-head{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:10px 16px;
}

.diagram-card-head strong{
  font-size:14px;
  font-weight:620;
}

.diagram-card-head span{
  color:var(--muted);
  font-size:12px;
}

.diagram-card-shell{
  overflow:auto;
}

.diagram-card-shell svg{
  width:max-content;
  min-width:100%;
  height:auto;
}

.inventory{
  display:grid;
  gap:8px;
  max-height:420px;
  overflow:auto;
  padding:0 4px 0 0;
}

.inventory-item{
  display:grid;
  gap:5px;
  width:100%;
  padding:14px 0;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:transparent;
  text-align:left;
}

.inventory-item:hover{
  border-bottom-color:rgba(0,120,212,.32);
}

.inventory-item.is-active{
  border-bottom-color:rgba(0,120,212,.5);
  background:transparent;
}

.inventory-item strong{
  font-size:14px;
  font-weight:620;
}

.inventory-item span{
  color:var(--muted);
  font-size:12px;
  word-break:break-word;
}

.inventory-empty{
  color:var(--muted);
  font-size:14px;
}

.detail-panel{
  display:grid;
  gap:14px;
  min-height:220px;
  padding-top:4px;
}

.detail-panel h4{
  margin:0;
  font-size:1.16rem;
  font-weight:620;
}

.detail-meta{
  font-size:13px;
  word-break:break-word;
}

.detail-block{
  display:grid;
  gap:8px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.detail-block strong{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.02em;
}

.detail-list{
  padding-left:18px;
  font-size:13px;
}

.detail-grid{
  display:grid;
  gap:10px;
  margin:0;
}

.detail-grid-row{
  display:grid;
  grid-template-columns:minmax(120px, 180px) 1fr;
  gap:12px;
  align-items:start;
}

.detail-grid-row dt,
.detail-grid-row dd{
  margin:0;
  font-size:13px;
}

.detail-grid-row dt{
  color:var(--muted);
  font-weight:600;
}

.detail-grid-row dd{
  color:var(--ink);
  word-break:break-word;
}

.detail-json{
  border-top:1px solid var(--line);
  padding-top:12px;
}

.detail-json summary{
  color:var(--ink);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  list-style:none;
}

.detail-json summary::-webkit-details-marker{
  display:none;
}

.detail-json pre{
  margin:12px 0 0;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(247,251,255,.9);
  color:var(--ink);
  font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
}

.coverage-table th{
  width:auto;
}

.coverage-table td{
  width:88px;
}

.output-head{
  margin-top:22px;
}

.output-area{
  min-height:300px;
  margin-top:8px;
  border-radius:24px;
  background:rgba(255,255,255,.94);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
  padding:18px 20px;
  line-height:1.6;
  font-size:14px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

.studio-controls .control-grid{
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}

.studio-controls .stack{
  gap:10px;
}

.studio-controls select,
.studio-controls input[type="search"]{
  border-radius:12px;
  background:rgba(255,255,255,.88);
}

.stats-shell{
  position:relative;
}

.canvas-tools{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.78);
  box-shadow:var(--shadow-fine);
}

.canvas-tools .ghost{
  border-color:transparent;
  background:transparent;
  box-shadow:none;
}

.canvas-tools .ghost:hover{
  border-color:var(--line);
  background:rgba(255,255,255,.96);
}

.inspection-grid,
.coverage-grid{
  padding-top:8px;
  border-top:1px solid var(--line);
}

.inspection-grid > *:first-child,
.coverage-grid > *:first-child{
  padding-right:18px;
}

.inspection-grid > *:last-child,
.coverage-grid > *:last-child{
  padding-left:18px;
  border-left:1px solid var(--line);
}

.output-band .panel-head{
  margin-bottom:10px;
}

@media (max-width: 1180px){
  .workflow-strip,
  .control-grid,
  .toggle-row,
  .inspection-grid,
  .coverage-grid{
    grid-template-columns:1fr 1fr;
  }

  .input-grid{
    grid-template-columns:1fr;
  }

  .inspection-grid > *:first-child,
  .coverage-grid > *:first-child,
  .inspection-grid > *:last-child,
  .coverage-grid > *:last-child{
    padding-right:0;
    padding-left:0;
    border-left:0;
  }
}

@media (max-width: 820px){
  .shell{
    padding:22px 18px 168px;
  }

  .workflow-strip,
  .control-grid,
  .toggle-row,
  .inspection-grid,
  .coverage-grid{
    grid-template-columns:1fr;
  }

  .workflow-step{
    padding-right:0;
    padding-bottom:12px;
  }

  .workflow-step::after{
    display:none;
  }

  .diagram-shell{
    min-height:620px;
  }

  .diagram-empty{
    min-height:580px;
  }

  .detail-grid-row{
    grid-template-columns:1fr;
    gap:4px;
  }

  .floating-dock{
    right:12px;
    left:12px;
    bottom:12px;
  }

  .floating-dock-inner{
    min-width:0;
    border-radius:22px;
    padding:12px;
  }

  .floating-dock-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}
