#shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--hair);
}

#brand {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin: -2px 4px -2px 0;
  padding-right: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 0 0 1px var(--ring);
  white-space: nowrap;
  user-select: none;
}

#brand img { display: block; image-rendering: pixelated; }
#brand .name { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; }

#shell .divider {
  width: 1px;
  height: 20px;
  background: var(--hair);
}

#shell .check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  white-space: nowrap;
}

#shell .note {
  color: var(--ink-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

#shell .tool:disabled, #shell .control:disabled {
  opacity: 0.5;
  cursor: default;
}

#shell .tool:disabled:hover { background: var(--bg); }

#files { max-width: 260px; }

#licenses {
  color: var(--link);
  font-size: 12px;
  white-space: nowrap;
}

#state {
  flex: 1 1 64px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--plane);
}

#stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

#viewer {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: var(--bg);
}

#signoff {
  flex: 0 0 380px;
  max-width: 45%;
  overflow: auto;
  padding: 10px 14px 16px;
  background: var(--panel);
  border-left: 1px solid var(--hair);
  color: var(--ink);
  font-size: 13px;
}

#signoff[hidden] { display: none; }
#signoff .so-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#signoff h2 { margin: 0; font-size: 15px; }
#signoff h3 { margin: 14px 0 6px; font-size: 13px; color: var(--ink-2); }
#signoff p { margin: 6px 0; }
#signoff .so-command { font: 12px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink-2); overflow-wrap: anywhere; }
#signoff .so-verdict { font-weight: 600; padding: 6px 8px; border-radius: 6px; background: var(--plane); border-left: 3px solid var(--muted); }
#signoff .so-verdict.open { border-left-color: var(--line-failed); }
#signoff .so-verdict.accepted { border-left-color: var(--line-oversize); }
#signoff .so-rule, #signoff .so-note { color: var(--ink-2); font-size: 12px; }
#signoff .so-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#signoff .so-item { border: 1px solid var(--hair); border-left: 3px solid var(--line-failed); border-radius: 6px; padding: 6px 8px; background: var(--bg); }
#signoff .so-item.accepted { border-left-color: var(--line-oversize); }
#signoff .so-item.pending { border-left-style: dashed; border-left-color: var(--line-oversize); }
#signoff .so-item.accepted.pending { border-left-color: var(--line-failed); }
#signoff .so-memories[hidden] { display: none; }
#signoff .so-memories { margin: 8px 0; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--hair); background: var(--plane); }
#signoff .so-memories p { margin: 0 0 6px; }
#signoff .so-pending[hidden] { display: none; }
#signoff .so-pending { position: sticky; top: -10px; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 6px 8px; border-radius: 6px; background: var(--plane); border: 1px solid var(--hair); }
#signoff .so-pending span { flex: 1 1 auto; }
#signoff .so-pending button { flex: 0 0 auto; white-space: nowrap; }
#signoff .so-item.chosen { box-shadow: 0 0 0 2px var(--line-cell-port); }
#signoff .so-top { display: flex; align-items: baseline; gap: 6px; }
#signoff .so-class { font: 600 11px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink-2); text-transform: uppercase; }
#signoff .so-title { flex: 1 1 auto; font-weight: 600; overflow-wrap: anywhere; }
#signoff .so-why { color: var(--ink-2); overflow-wrap: anywhere; }
#signoff .so-line { font: 11px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink-2); overflow-wrap: anywhere; }
#signoff .so-form { display: flex; gap: 6px; margin-top: 6px; }
#signoff .so-form input { flex: 1 1 auto; min-width: 0; }
#signoff .so-file { margin: 0; padding: 6px 8px; max-height: 160px; overflow: auto; background: var(--plane); border: 1px solid var(--hair); border-radius: 6px; font: 11px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
#signoff .so-actions { display: flex; gap: 8px; margin-top: 8px; }
#signoff .tool:disabled { opacity: 0.5; cursor: default; }

#intro, #dropzone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow: auto;
}

#intro { z-index: 2; background: var(--plane); }
#dropzone { z-index: 3; background: var(--hover); }

#intro .card, #dropzone .card {
  width: min(640px, 100%);
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

#dropzone .card {
  text-align: center;
  font-size: 15px;
  pointer-events: none;
}

#intro .card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

#intro .logo {
  flex: 0 0 auto;
  display: block;
  border-radius: 8px;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px var(--ring);
}

#intro .text { min-width: 0; }

#intro.loading .logo { animation: blink 1.2s steps(2, jump-none) infinite alternate; }

@keyframes blink { to { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  #intro.loading .logo { animation: none; }
}

#intro .late {
  opacity: 0;
  animation: late 0s 2s forwards;
}

@keyframes late { to { opacity: 1; } }

#intro h1 { margin: 2px 0 4px; font: 600 24px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; }
#intro p { color: var(--ink-2); margin: 6px 0; }
#intro .lead { color: var(--ink); font-size: 14px; }
#intro code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink); }

#log {
  flex: 0 0 auto;
  max-height: 30vh;
  margin: 0;
  overflow: auto;
  padding: 6px 12px;
  background: var(--panel);
  border-top: 1px solid var(--hair);
  color: var(--ink);
  font: 12px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  #files { max-width: 160px; }
  #stage { flex-direction: column; }
  #signoff { flex: 0 0 auto; max-width: none; max-height: 45vh; border-left: 0; border-top: 1px solid var(--hair); }
  #shell .note { display: none; }
  #brand { padding-right: 0; }
  #brand .name { display: none; }
  #intro .card { flex-direction: column; }
  #intro .logo { width: 64px; height: 64px; }
}
