[hidden] { display: none !important; }

.footer a { text-decoration: underline; }

/* Start */
.lens-start {
  padding: 72px 0 72px;
  background:
    radial-gradient(600px 300px at 85% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(500px 280px at 10% 90%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
}
.lens-start .xpu-row { margin-top: 28px; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  margin-top: 36px; padding: 44px 20px; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--border); border-radius: 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); }
.drop.over { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.drop input, .open-another input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { font-size: 17px; font-weight: 600; }
.drop span { color: var(--text-dim); font-size: 14.5px; }
.samples-head { font-size: 17px; letter-spacing: -0.01em; font-weight: 600; margin-top: 36px; }
.samples { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.samples button {
  display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; padding: 16px 18px; text-align: left;
  color: inherit; font: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.samples button:hover { border-color: var(--accent); }
.samples b { font-weight: 600; }
.samples span { color: var(--text-dim); font-size: 14px; }
.samples em { font-style: normal; color: var(--accent); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; margin-top: auto; padding-top: 6px; }

/* Status */
.busy, .error { margin: 16px 0; padding: 12px 16px; border-radius: 10px; font-size: 15px; border: 1px solid var(--border); background: var(--surface); }
.error { color: #b42318; border-color: color-mix(in srgb, #b42318 40%, var(--border)); overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .error { color: #fda29b; } }

/* Result */
.lens-result { padding: 24px; max-width: 1500px; margin: 0 auto; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-title { min-width: 0; }
.result-title h1 { font-size: clamp(20px, 3vw, 28px); letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.result-title p { color: var(--text-dim); font-size: 14.5px; margin-top: 4px; overflow-wrap: anywhere; }
.open-another { position: relative; flex: none; cursor: pointer; color: var(--text) !important; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { color: var(--text-dim); font-size: 13.5px; }

.tabs { display: flex; gap: 4px; margin-top: 20px; border-bottom: 1px solid var(--border); overflow: auto hidden; }
.tabs button {
  flex: none; padding: 10px 14px; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text-dim); cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.pane { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 14px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
#tree { max-height: calc(100vh - 150px); overflow: auto; }
.detail { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; padding: 18px; font-size: 14.5px; }
.detail h3 { font-size: 20px; }
.detail p { color: var(--text-dim); margin-top: 6px; }
.detail .lpath { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; margin-top: 2px; }
.detail .hint { margin: 0; }
.detail section { margin-top: 16px; }
.detail h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 600; margin-bottom: 6px; }
.detail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin-top: 12px; }
.detail section dl { margin-top: 0; }
.detail dt { color: var(--text-dim); }
.detail dd { overflow-wrap: anywhere; }

.tree, .tree ul { list-style: none; }
.tree .tree { margin-left: 14px; padding-left: 8px; border-left: 1px solid var(--border); }
.block, .layer {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; width: 100%; padding: 6px 8px; text-align: left;
  color: inherit; font: inherit; font-size: 14px; cursor: pointer; background: none; border: 0; border-radius: 6px;
}
.block:hover, .layer:hover { background: var(--bg-alt); }
.layer.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.caret { width: 12px; flex: none; color: var(--text-dim); font-size: 12px; transition: transform 0.1s ease; }
.caret.open { transform: rotate(90deg); }
.bname { font-weight: 500; min-width: 0; flex: 1 1 40%; overflow-wrap: anywhere; }
.cost { margin-left: auto; color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.op { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--accent); }
.lname { color: var(--text-dim); font-size: 12.5px; min-width: 0; flex: 1 1 30%; overflow-wrap: anywhere; }
.bar { display: block; flex: 1 0 100%; height: 3px; margin-top: 4px; border-radius: 99px; overflow: hidden; background: var(--bg-alt); }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

.tensors, .links { list-style: none; display: grid; gap: 8px; }
.tensors li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 13.5px; }
.slot { color: var(--text-dim); font-size: 12px; }
.tname { min-width: 0; overflow-wrap: anywhere; }
.tshape { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--accent); }
.tquant { color: var(--text-dim); font-size: 12px; flex-basis: 100%; }
.links button { width: 100%; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; background: none; border: 0; padding: 2px 0; overflow-wrap: anywhere; }
.links button:hover { color: var(--accent); }
.links span { color: var(--text-dim); font-size: 12px; }

.graph { position: relative; height: calc(100vh - 150px); min-height: 480px; margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.graph iframe { width: 100%; height: 100%; border: 0; }
.graph-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: var(--surface); color: var(--text-dim); }

.ops { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding: 18px; }
.ophead { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.ophead b { font-weight: 600; overflow-wrap: anywhere; }
.ophead span { color: var(--text-dim); }
.ops p { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; }

.io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.io .pane { padding: 18px; }
.io h3 { margin-bottom: 10px; }

.fine { color: var(--text-dim); font-size: 13px; margin-top: 14px; }

@media (max-width: 900px) {
  .split, .io, .ops { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; max-height: none; }
  #tree { max-height: 60vh; }
  .stats, .samples { grid-template-columns: repeat(2, 1fr); }
  .lens-result { padding: 16px; }
}
@media (max-width: 520px) {
  .samples { grid-template-columns: minmax(0, 1fr); }
  .result-head { flex-direction: column; }
  .lens-start { padding: 48px 0; }
}
