/* Personal archive + command desk visual language.
   This is intentionally a final, presentation-only layer. */
:root {
  --archive-ink: #19362f;
  --archive-paper: #fbfaf4;
  --archive-olive: #647763;
  --archive-brass: #b78b43;
  --archive-brass-soft: rgb(183 139 67 / 20%);
  --archive-teal: #2f8777;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--archive-ink) 24%, transparent);
  border-radius: 6px;
  background-color: var(--archive-paper);
  background-image:
    linear-gradient(90deg, transparent 0 27px, rgb(183 139 67 / 13%) 27px 28px, transparent 28px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 4%) 30px 31px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%), 0 8px 24px rgb(18 46 39 / 8%);
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel > :is(h3, .command-console-head, .overview-section-head, .people-section-head) {
  position: relative;
  z-index: 1;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel > h3,
body.owner-shell-v1:not(.auth-required) #moduleStage .command-console-head {
  margin-bottom: 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--archive-brass-soft);
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel > h3 {
  color: var(--archive-ink);
  font-size: 16px;
  font-weight: 800;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel:has(form) {
  border-top: 3px solid var(--archive-teal);
  background-image:
    linear-gradient(90deg, rgb(47 135 119 / 8%), transparent 34%),
    linear-gradient(90deg, transparent 0 27px, rgb(183 139 67 / 13%) 27px 28px, transparent 28px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 4%) 30px 31px);
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-finance="true"] .panel {
  border-top: 3px solid var(--archive-brass);
  background-image:
    linear-gradient(90deg, transparent 0 18px, rgb(183 139 67 / 24%) 18px 19px, transparent 19px),
    repeating-linear-gradient(90deg, transparent 0 126px, rgb(25 54 47 / 4%) 126px 127px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 4%) 30px 31px);
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-people="true"] .panel {
  border-left: 3px solid var(--archive-olive);
  background-image:
    radial-gradient(circle at 28px 28px, rgb(100 119 99 / 22%) 0 2px, transparent 2.5px),
    linear-gradient(90deg, transparent 0 27px, rgb(100 119 99 / 14%) 27px 28px, transparent 28px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 4%) 30px 31px);
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] .panel,
body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-knowledge="true"] .panel {
  border-style: solid;
  border-color: color-mix(in srgb, var(--archive-olive) 44%, transparent);
  background-image:
    linear-gradient(135deg, transparent 0 12px, rgb(100 119 99 / 12%) 12px 13px, transparent 13px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 4%) 30px 31px);
}

body.owner-shell-v1:not(.auth-required) #moduleStage .panel:hover {
  border-color: color-mix(in srgb, var(--archive-brass) 72%, var(--archive-ink));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%), 0 12px 30px rgb(18 46 39 / 12%);
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(.overview-signal-card, .asset-reference-card, .asset-status-card, .answer-card) {
  border: 1px solid var(--archive-brass-soft);
  border-radius: 4px;
  background: rgb(255 253 245 / 76%);
}

/* Vault credentials: the shared resizable-field grid must keep the safety
   notice and actions across the full form width. */
body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form > .field {
  grid-column: span 6;
  min-width: 0;
  width: auto;
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form > .library-safety-callout,
body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form > .finance-record-actions,
body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form-status {
  grid-column: 1 / -1;
  min-width: 0;
  width: auto;
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-safety-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  writing-mode: horizontal-tb;
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .finance-record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .finance-record-actions :is(button, a) {
  writing-mode: horizontal-tb;
  white-space: nowrap;
}

/* The shell mark reads as a small archival seal instead of a placeholder. */
body.owner-shell-v1:not(.auth-required) .mark {
  position: relative;
  isolation: isolate;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--archive-brass) 72%, #ffffff);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgb(255 255 255 / 38%) 0 4px, transparent 5px),
    linear-gradient(145deg, #2c786b, #163b37 72%);
  box-shadow: 0 0 0 3px rgb(183 139 67 / 13%), inset 0 1px 0 rgb(255 255 255 / 34%), 0 5px 14px rgb(12 41 35 / 24%);
}

body.owner-shell-v1:not(.auth-required) .mark::before {
  position: absolute;
  z-index: -1;
  inset: 5px;
  border: 1px solid rgb(232 207 151 / 72%);
  border-radius: 50%;
  content: "";
}

body.owner-shell-v1:not(.auth-required) .mark::after {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 1px solid #f5dfaa;
  border-radius: 2px;
  background: var(--archive-brass);
  box-shadow: 0 1px 4px rgb(12 41 35 / 24%);
  content: "";
  transform: rotate(18deg);
}

body.owner-shell-v1:not(.auth-required) .mark span {
  position: relative;
  z-index: 1;
  color: #f5e6bd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
}

@media (max-width: 760px) {
  body.owner-shell-v1:not(.auth-required) #moduleStage .panel {
    background-image:
      linear-gradient(90deg, transparent 0 18px, rgb(183 139 67 / 11%) 18px 19px, transparent 19px),
      repeating-linear-gradient(0deg, transparent 0 30px, rgb(25 54 47 / 3%) 30px 31px);
  }

  body.owner-shell-v1:not(.auth-required) #moduleStage .panel > h3 {
    font-size: 15px;
  }

  body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .library-form > .field {
    grid-column: 1 / -1;
  }

  body.owner-shell-v1:not(.auth-required) #moduleStage [data-command-library="vault"] [data-tab-panel="vault-secrets"] .finance-record-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.owner-shell-v1:not(.auth-required) #moduleStage .panel {
    transition: none;
  }
}
