body:has(.shell[data-command-view]) {
  background: #100f0c;
}

body .shell[data-command-view] {
  width: min(640px, calc(100% - 32px));
  min-height: 100svh;
  padding: 20px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
  letter-spacing: 0;
}

.shell[data-command-view] :is([hidden], .command-away, .command-page-away),
.shell[data-command-view] .workbench-view-control,
.shell[data-command-view] .command-internal-heading,
.shell[data-command-view] .spell-stage > :not(.command-title, #spell-form, #magic-release-update) {
  display: none !important;
}

.shell[data-command-view] :is(.workbench, .pane, .spell-stage) {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.shell[data-command-view] .command-title {
  font-size: 28px;
  font-weight: 650;
  line-height: 1.5;
  margin: 0 0 12px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.command-purpose {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.command-status { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 16px 0; }
.command-warning { padding: 12px; border-inline-start: 3px solid #de8976; line-height: 1.7; }
.shell[data-command-view] .command-title:focus-visible { outline: none; }

.command-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.shell[data-command-view] button,
.shell[data-command-view] summary {
  min-height: 44px;
  max-width: 100%;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}

.shell[data-command-view] button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 16px;
  background: transparent;
  color: var(--ink);
}

.shell[data-command-view] button:disabled {
  opacity: 0.45;
  filter: none;
  cursor: not-allowed;
}

.shell[data-command-view] button:not(:disabled):hover {
  background: #242219;
  border-color: var(--accent);
}

.shell[data-command-view] :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shell[data-command-view] .command-nav button {
  border: 0;
  padding: 4px 10px;
}

.shell[data-command-view] .command-wordmark {
  font-family: ui-serif, Georgia, serif;
  font-size: 24px;
  color: var(--accent);
}

.shell[data-command-view] .command-back,
.shell[data-command-view] .command-settings {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 24px;
}

.command-settings { margin-inline-start: auto; }

.command-menu {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px;
  background: #191711;
}

.shell[data-command-view] .command-choice {
  display: flex;
  align-items: center;
  gap: 16px;
  border-color: transparent;
  min-height: 60px;
  text-align: start;
  font-size: 18px;
}

.command-choice::before {
  content: "›";
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 24px;
}

.command-steps {
  display: flex;
  gap: 0;
  margin: 4px 0 24px;
  border-bottom: 1px solid var(--line);
}

.shell[data-command-view] .command-step {
  flex: 1 1 0;
  border: 0;
  border-radius: 0;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 14px;
}

.shell[data-command-view] .command-step[aria-current="step"] {
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}

.shell[data-command-view] :is(input, textarea, select) {
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.65;
}

.shell[data-command-view] :is(input[type="checkbox"], input[type="radio"]) {
  min-height: 20px;
  width: 20px;
}

.shell[data-command-view] :is(.calendar-time-grid, .memory-controls, .world-controls, .calendar-connection-actions) {
  grid-template-columns: minmax(0, 1fr);
}

.shell[data-command-view] :is(.handoff-actions, .transfer-actions, .command-actions, .voice-tempus-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shell[data-command-view] .command-actions {
  margin: 20px 0;
  flex-direction: column;
}

.shell[data-command-view] .command-actions > button:not(.command-quiet) {
  border-color: var(--accent);
  background: var(--accent);
  color: #171209;
  font-weight: 650;
}

.shell[data-command-view] .command-quiet {
  color: var(--muted);
  border-color: transparent;
}

.shell[data-command-view] .command-safety {
  margin-top: 16px;
}

.command-details {
  border-top: 1px solid var(--line);
  margin: 20px 0;
  min-width: 0;
}

.command-details > summary {
  padding: 12px 0;
  color: var(--muted);
  cursor: pointer;
}

.command-details[open] > summary { margin-bottom: 12px; }

.command-review h3 { font-size: 18px; line-height: 1.6; }
.command-facts { margin: 20px 0; }
.command-pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; color: var(--muted); }
.command-pager button { width: 44px; }
.shell[data-command-view] .command-outcome h3 { font-size: 18px; line-height: 1.6; }
.command-facts dt { color: var(--muted); font-size: 13px; margin-top: 16px; }
.command-facts dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.shell[data-command-view] :is(pre, .artifact-body) { white-space: pre-wrap; overflow-wrap: anywhere; }
.shell[data-command-view] :is(.memory-detail, .result, .artifact-result) h2 { font-size: 20px; }
.shell[data-command-view] :is(.memory-state, .draft-field) { overflow-wrap: anywhere; line-height: 1.7; }
.shell[data-command-view] .command-pane > .memory-detail { border: 0; padding: 0; }
.shell[data-command-view] .command-pane { display: block; }
.shell[data-command-view] .command-pane > :is([class$="-form"], .memory-list) { margin: 20px 0; }
.shell[data-command-view] .magic-starter-list { grid-template-columns: minmax(0, 1fr); }
.shell[data-command-view] .memoria-nav .memoria-wordmark { display: none; }
.shell[data-command-view] .memoria-nav { border: 0; padding: 0; }
.shell[data-command-view] #memoria-step-title { font-size: 28px; letter-spacing: 0; }
.shell[data-command-view] #spell-form { margin-top: 24px; }
.shell[data-command-view] .spell-submit-row { display: flex; flex-wrap: wrap; }
.shell[data-command-view] .spell-stage #draft-button { background: var(--accent); color: #171209; }

@media (max-width: 440px) {
  .shell[data-command-view] :is(.memory-fields, .cast-route-detail) { grid-template-columns: minmax(0, 1fr); }
  .shell[data-command-view] .draft-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .shell[data-command-view] * { scroll-behavior: auto !important; transition: none !important; }
}
