/* Shodan application layer for the canonical Interlisp Paper stylesheet. */

:root {
  --app-width: 1680px;
  --app-gap: 32px;
  --measure: 72ch;
}

html,
body,
.app-page {
  min-height: 100%;
}

body {
  background: var(--paper);
}

img {
  max-width: 100%;
}

button {
  font-family: var(--font-serif);
}

button:not(.button) {
  display: inline-block;
  min-height: 42px;
  padding: 9px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

button:not(.button):hover,
button:not(.button):focus-visible,
button:not(.button):active,
button[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
}

button:disabled,
.button:disabled {
  color: var(--ink);
  background: var(--paper);
  border-style: dashed;
  cursor: default;
}

button:disabled:hover,
.button:disabled:hover {
  color: var(--ink);
  background: var(--paper);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

pre {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
}

code {
  overflow-wrap: anywhere;
}

.hl-keyword {
  font-weight: 700;
}

.hl-comment {
  font-style: italic;
}

code var {
  font-weight: 700;
  font-style: italic;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  width: min(100%, var(--app-width));
  margin: 0 auto;
  padding: 3em 24px 72px;
}

.sidebar {
  position: sticky;
  top: 3em;
  display: grid;
  gap: 24px;
  align-content: start;
  min-width: 0;
}

.product-mark {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.product-mark img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  image-rendering: pixelated;
}

.product-mark p {
  max-width: 24ch;
  margin: 0 0 3px;
  font-size: 14px;
  font-style: italic;
  line-height: 1.18;
}

.product-mark h1 {
  margin: 0;
  font-size: 48px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.sidebar-nav,
.nav-list,
.nav-links,
.nav-utility,
.sidebar-actions {
  display: grid;
}

.sidebar-nav {
  gap: 12px;
}

.sidebar-nav a,
.sidebar-nav summary {
  color: var(--ink);
  font-style: normal;
  text-decoration: none;
}

.sidebar-nav a {
  min-height: 32px;
  padding: 5px 7px;
  line-height: 1.2;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a[aria-current="page"] {
  color: var(--paper);
  background: var(--ink);
  outline-offset: 0;
}

.nav-section > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 5px 7px;
  font-weight: 700;
}

.nav-section[open] > summary {
  font-style: italic;
}

.nav-section > summary::after {
  content: "+";
  font-style: normal;
}

.nav-section[open] > summary::after {
  content: "−";
}

.nav-links {
  padding-left: 14px;
}

.nav-utility {
  margin-top: 4px;
}

.sidebar-actions {
  gap: 8px;
}

.sidebar-actions form {
  margin: 0;
}

.workspace {
  display: grid;
  gap: 28px;
  align-content: start;
  min-width: 0;
}

.workspace a:not(.button):not(.tab):not([aria-current]),
.window-body a:not(.button):not(.tab) {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-heading {
  max-width: var(--measure);
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
}

.flow {
  display: grid;
  gap: var(--app-gap);
  min-width: 0;
}

.flow > * {
  min-width: 0;
}

.window {
  min-width: 0;
  isolation: isolate;
}

.workspace .window,
.auth-layout .window,
.modal-dialog,
.chat-dialog {
  max-width: none;
}

.workspace .window,
.auth-layout .window {
  width: calc(100% - 15px);
  margin: 0 15px 15px 0;
}

.window-titlebar h2,
.window-titlebar p {
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.window-titlebar {
  justify-content: space-between;
  gap: 12px;
}

.window-titlebar > div {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.window-body {
  min-width: 0;
  background: var(--paper);
}

.window-body.flow {
  gap: 16px;
}

.window-tools,
.window-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--paper);
}

.window-tools {
  justify-content: flex-end;
}

.window-meta {
  justify-content: flex-end;
}

.window-tools:empty,
.window-meta:empty {
  display: none;
}

details.window > summary {
  cursor: pointer;
  list-style: none;
}

details.window > summary::-webkit-details-marker {
  display: none;
}

.disclosure-title::after {
  content: "−";
  margin-left: auto;
  font-weight: 700;
}

details.window:not([open]) .disclosure-title::after {
  content: "+";
}

.auth-layout {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  padding: 72px 24px;
}

.auth-layout .window {
  width: min(calc(100% - 15px), 480px);
}

.auth-layout h1 {
  margin: 0;
  font-size: 38px;
}

.auth-layout form {
  display: grid;
  gap: 16px;
}

.filter-bar {
  display: grid;
  gap: 8px;
  max-width: var(--measure);
}

.control-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.actions[data-window-toggle],
.tab-row,
.account-tabs {
  display: flex;
  gap: 0;
  max-width: 100%;
  margin: 0 0 16px;
  overflow-x: auto;
}

.window-tools .actions[data-window-toggle] {
  margin: 0;
}

.actions[data-window-toggle] .button,
.tab,
.account-tabs a {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.actions[data-window-toggle] .button + .button,
.tab + .tab,
.account-tabs a + a {
  border-left: 0;
}

.actions[data-window-toggle] .button:hover,
.actions[data-window-toggle] .button:focus-visible,
.actions[data-window-toggle] .button[aria-pressed="true"],
.tab:hover,
.tab:focus-visible,
.tab-row input:checked + .tab,
.account-tabs a:hover,
.account-tabs a:focus-visible,
.account-tabs a[aria-current="page"] {
  color: var(--paper);
  background: var(--ink);
}

.field,
label {
  display: grid;
  gap: 4px;
}

label:has(input[type="search"]),
form:has(input[type="search"]) {
  width: 100%;
}

.choice-row,
.fieldset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.choice,
.check {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  line-height: 1.2;
}

.choice input,
.check input {
  flex: 0 0 auto;
  margin: 0;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--ink);
}

.helper-note {
  margin: 2px 0 0;
  font-size: 14px;
  font-style: italic;
}

.tabset > input[type="radio"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tab-panels {
  min-width: 0;
}

.tab-panel {
  display: none;
}

#mcp-tab-claude-code:checked ~ .tab-panels [data-mcp-panel="claude-code"],
#mcp-tab-codex:checked ~ .tab-panels [data-mcp-panel="codex"],
#mcp-tab-http:checked ~ .tab-panels [data-mcp-panel="http"] {
  display: grid;
  gap: 12px;
}

.table-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.table-scroll table {
  width: 100%;
  min-width: max(100%, 720px);
  max-width: none;
  margin: 0;
}

th[tabindex] {
  cursor: pointer;
}

th[aria-sort="ascending"]::after {
  content: " ↑";
}

th[aria-sort="descending"]::after {
  content: " ↓";
}

.property-sheet {
  max-width: 100%;
}

.property-sheet code {
  overflow-wrap: anywhere;
}

.state-tag,
.state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 20px 28px;
}

.stat {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stat-label {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 15px;
  font-weight: 700;
}

.stat-value {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: none;
  width: min(320px, 80vw);
  padding: 6px 8px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
}

.tooltip-trigger:hover .tooltip,
.tooltip-trigger:focus .tooltip,
.tooltip-trigger:focus-within .tooltip {
  display: block;
}

.figure {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 20px;
}

.figure-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: end;
  justify-content: space-between;
}

.figure-heading h2,
.figure-heading h3 {
  margin: 0;
  padding: 0;
}

.figure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.figure-body,
.nicehash-controls,
.breakdown-list,
.result-list,
.event-list {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.report-section {
  display: grid;
  gap: 32px;
  min-width: 0;
}

.figure-frame {
  position: relative;
  width: 100%;
  min-height: 280px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.figure-frame canvas,
.modal-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.object-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  min-width: 0;
}

.search-form,
.search-result {
  display: grid;
  gap: 14px;
}

.search-result {
  max-width: var(--measure);
}

.search-result h3,
.search-snippet {
  margin: 0;
}

.search-meta,
.search-stats,
.pagination,
.window-meta,
.state-list,
.inline-properties {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}

.search-meta-item,
.search-stat {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}

.search-link {
  font-weight: 700;
  font-style: italic;
  text-decoration: underline;
}

.copy-row {
  margin-bottom: 12px;
}

.snapshot-selector-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.snapshot-selector-form label {
  flex: 0 0 auto;
}

.snapshot-selector-form select {
  width: auto;
  min-width: 9rem;
}

.snapshot-selector-form .button {
  margin-top: 8px;
}

.library-downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.library-downloads .button {
  text-align: center;
}

.library-upload {
  max-width: 680px;
}

.library-upload h3 {
  margin: 0;
}

.library-upload .button[type="submit"] {
  margin-top: 12px;
}

.user-list {
  display: grid;
  gap: 40px;
}

.user-record {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.user-record-heading,
.user-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}

.user-record-heading h3 {
  margin: 0;
  font-size: 26px;
}

.user-properties {
  margin: 0;
}

.user-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px 16px;
  align-items: end;
  max-width: 860px;
}

.user-edit-form .check {
  align-self: center;
  justify-self: start;
}

.user-edit-form .button {
  justify-self: start;
}

.user-record-actions form {
  margin: 0;
}

.status-ledger {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 24px;
  margin: 0;
}

.status-ledger dt {
  font-weight: 700;
}

.status-ledger dd {
  margin: 0;
  font-style: italic;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--paper);
  background-image: var(--bitmap-dither);
  background-size: 3px 3px;
}

.modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0;
  background: var(--paper);
}

.modal-dialog::after {
  content: none;
}

.modal-dialog > .window-body {
  min-height: 0;
  overflow: auto;
}

.modal-frame {
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper);
}

.chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.chat-dialog {
  width: min(430px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 96px));
  margin: 0 15px 15px 0;
}

.chat-body {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  gap: 12px;
  max-height: 600px;
  overflow: hidden;
}

.chat-close {
  min-width: 36px;
  padding-inline: 10px;
  font-size: 24px;
  line-height: 1;
}

.chat-log {
  display: grid;
  gap: 10px;
  min-height: 120px;
  overflow-y: auto;
}

.chat-message {
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.chat-label {
  font-weight: 700;
}

.chat-meta {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
}

.event {
  display: grid;
  gap: 8px;
  max-width: var(--measure);
}

.event h3 {
  margin: 0;
}

.inline-properties {
  margin: 0;
}

.inline-properties dt {
  font-weight: 700;
}

.inline-properties dd {
  margin: 0;
  font-style: italic;
}

.public-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 48px 24px;
}

.signal-list {
  display: grid;
  gap: 24px;
}

.signal {
  display: grid;
  gap: 4px;
}

.signal-value {
  font-size: clamp(36px, 9vw, 64px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

[data-nicehash-breakdown] {
  display: grid;
  gap: 10px;
}

[data-nicehash-breakdown-header] {
  width: 100%;
  justify-content: space-between;
  text-align: left;
}

[data-nicehash-breakdown-content] {
  min-width: 0;
  padding-top: 8px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 32px;
  }

  .sidebar {
    position: static;
  }

  .product-mark p {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .app-shell,
  .auth-layout,
  .public-shell {
    padding-inline: 18px;
  }

  .app-shell {
    gap: 32px;
  }

  .product-mark {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .product-mark img {
    width: 62px;
    height: 62px;
  }

  .product-mark h1 {
    font-size: 40px;
  }

  .page-heading h1 {
    font-size: 42px;
  }

  .stats,
  .object-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-downloads,
  .user-edit-form,
  .status-ledger {
    grid-template-columns: minmax(0, 1fr);
  }

  .figure-frame {
    min-height: 220px;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal-dialog {
    max-height: calc(100vh - 24px);
  }

  .table-scroll table {
    min-width: 680px;
  }
}

@media print {
  .sidebar,
  .chat-launcher,
  .window::after {
    display: none;
  }

  .app-shell {
    display: block;
    width: auto;
    padding: 0;
  }
}
