/* Production card visual layer: varied archival borders with quiet operational contrast. */
:root {
  --cv-ink: #173d3b;
  --cv-muted: #60746f;
  --cv-line: #bfd0ca;
  --cv-paper: #fbfaf4;
  --cv-teal: #2f776c;
  --cv-blue: #557c94;
  --cv-brass: #b28a4d;
  --cv-sage: #789b86;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
  .knowledge-v2__canvas-card, .knowledge-v2__distribution,
  .knowledge-v2__coverage, .knowledge-v2__focus, .reminder-v2-card,
  .items-v2-card, .profile-owner-card, .custom-info-card,
  .cc-profile__editor, .cc-profile__timeline, .cc-profile__structure,
  .cc-profile__archive-manager, .reminder-v2__editor-card,
  .reminder-v2__list-card
) {
  --cv-accent: var(--cv-teal);
  position: relative;
  isolation: isolate;
  min-width: 0;
  border: 0 !important;
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--cv-paper) 96%, transparent);
  background-color: var(--cv-paper);
  background-image: url("../assets/botanical-paper-r1.svg");
  background-position: center;
  background-size: cover;
  box-shadow: 0 12px 28px rgb(59 45 28 / 14%);
}

/* A fine inset keyline echoes the supplied framed reference without becoming ornate. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
  .knowledge-v2__canvas-card, .knowledge-v2__distribution,
  .knowledge-v2__coverage, .knowledge-v2__focus, .reminder-v2-card,
  .items-v2-card, .profile-owner-card, .custom-info-card,
  .cc-profile__editor, .cc-profile__timeline, .cc-profile__structure,
  .cc-profile__archive-manager, .reminder-v2__editor-card,
  .reminder-v2__list-card
)::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5px;
  border: 0;
  border-radius: 0;
  background: url("../assets/ornate-gold-frame-r1.svg") center / 100% 100% no-repeat;
  opacity: .98;
  pointer-events: none;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
  .knowledge-v2__canvas-card, .knowledge-v2__distribution,
  .knowledge-v2__coverage, .knowledge-v2__focus, .reminder-v2-card,
  .items-v2-card, .profile-owner-card, .custom-info-card,
  .cc-profile__editor, .cc-profile__timeline, .cc-profile__structure,
  .cc-profile__archive-manager, .reminder-v2__editor-card,
  .reminder-v2__list-card
)::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border: 1px solid #c49a4b;
  border-radius: 50%;
  background: radial-gradient(circle, #f2d18a 0 18%, #a8772e 20% 33%, #f6df9e 35% 42%, transparent 44%);
  box-shadow: 0 0 0 3px rgb(255 248 220 / 60%), 0 1px 4px rgb(82 53 14 / 25%);
  pointer-events: none;
}

/* Semantic variations keep the system expressive without random decoration. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget:nth-child(4n + 2) > .panel,
  .module-canvas-widget:nth-child(4n + 2) > .panel,
  .reminder-v2-card, .work-column
) { --cv-accent: var(--cv-brass); }

body.owner-shell-v1:not(.auth-required) #moduleStage :is(.panel, .work-column, .people-v2-card, .knowledge-v2-card, .vault-card, .reminder-v2-card) :is(.amount, .metric-value, .stat-value, .number, [data-value]) {
  color: #8b5f22;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 760;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 #fff4d0;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget:nth-child(4n + 3) > .panel,
  .module-canvas-widget:nth-child(4n + 3) > .panel,
  .people-v2-card, .profile-owner-card, .custom-info-card
) {
  --cv-accent: var(--cv-sage);
  background-image:
    linear-gradient(135deg, rgb(255 255 255 / 48%), transparent 42%),
    repeating-linear-gradient(118deg, transparent 0 17px, rgb(120 155 134 / 7%) 18px 19px, transparent 20px 35px);
  background-size: auto, 96px 96px;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget:nth-child(4n) > .panel,
  .module-canvas-widget:nth-child(4n) > .panel,
  .knowledge-v2-card, .vault-card, .knowledge-v2__canvas-card
) {
  --cv-accent: var(--cv-blue);
  background-image:
    linear-gradient(135deg, rgb(255 255 255 / 48%), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 20px, rgb(85 124 148 / 7%) 21px 22px, transparent 23px 42px);
  background-size: auto, 100% 42px;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel > h3, .panel > .command-console-head,
  .cc-profile__editor-head, .cc-profile__life-head,
  .cc-profile__timeline > header, .cc-profile__structure > header,
  .knowledge-v2__editor-head, .knowledge-v2__browser-head,
  .knowledge-v2__current-notes > header, .reminder-v2-section-title
) {
  position: relative;
  z-index: 1;
  color: var(--cv-ink) !important;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: 0;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel > p, .panel > small, .panel .muted,
  .card-meta, .record-meta, .module-subtitle
) { color: var(--cv-muted); font-size: 12px; line-height: 1.55; }

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel, .work-column, .people-v2-card, .knowledge-v2-card,
  .vault-card, .reminder-v2-card, .items-v2-card, .profile-owner-card,
  .custom-info-card
) :is(input, textarea, select, table, .tabulator, .list, .record-list, .form-grid) {
  position: relative;
  z-index: 2;
}

html[data-theme="night"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
  .knowledge-v2__canvas-card, .knowledge-v2__distribution,
  .knowledge-v2__coverage, .knowledge-v2__focus, .reminder-v2-card,
  .items-v2-card, .profile-owner-card, .custom-info-card,
  .cc-profile__editor, .cc-profile__timeline, .cc-profile__structure,
  .cc-profile__archive-manager, .reminder-v2__editor-card,
  .reminder-v2__list-card
) {
  --cv-ink: #e2f1eb;
  --cv-muted: #a8c1b8;
  --cv-line: #37655f;
  --cv-paper: #092e32;
  background-color: rgb(8 38 42 / 92%);
  background-image: linear-gradient(135deg, rgb(255 255 255 / 4%), transparent 42%);
  box-shadow: inset 0 1px rgb(210 245 230 / 7%), 0 10px 22px rgb(0 0 0 / 18%);
}

/* The primary overview card gets the full reference treatment rather than the legacy dark deck surface. */
body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck {
  position: relative;
  isolation: isolate;
  border: 0 !important;
  border-radius: 12px;
  color: #2e3a31 !important;
  background: #f7f1e4 url("../assets/botanical-paper-r1.svg") center / cover no-repeat !important;
  box-shadow: 0 12px 28px rgb(59 45 28 / 14%), inset 0 0 0 4px rgb(255 251 236 / 68%) !important;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 10px;
  border: 2px solid rgb(210 164 76 / 88%);
  border-radius: 8px;
  background: none;
  box-shadow: inset 0 0 0 1px rgb(246 216 139 / 72%), 0 0 0 1px rgb(111 75 22 / 55%);
  pointer-events: none;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 14px;
  border-radius: 5px;
  background:
    radial-gradient(circle at 0 0, #e6bd68 0 4px, transparent 5px),
    radial-gradient(circle at 100% 0, #e6bd68 0 4px, transparent 5px),
    radial-gradient(circle at 0 100%, #e6bd68 0 4px, transparent 5px),
    radial-gradient(circle at 100% 100%, #e6bd68 0 4px, transparent 5px);
  background-repeat: no-repeat;
  pointer-events: none;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck > * {
  position: relative;
  z-index: 1;
}

body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck :is(h1, h2, h3, strong, .metric-value, .number) {
  color: #734d1a !important;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  text-shadow: 0 1px 0 #fff7dc;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage .overview-command-deck {
  background: #f7f1e4 url("../assets/botanical-paper-r1.svg") center / cover no-repeat !important;
  color: #2e3a31 !important;
}

#moduleStage .overview-command-deck {
  background: #f7f1e4 url("../assets/botanical-paper-r1.svg") center / cover no-repeat !important;
  color: #2e3a31 !important;
}

/* Apply the supplied material treatment to every functional card, not only the overview deck. */
#moduleStage :is(
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
  .knowledge-v2__canvas-card, .knowledge-v2__distribution,
  .knowledge-v2__coverage, .knowledge-v2__focus, .reminder-v2-card,
  .items-v2-card, .profile-owner-card, .custom-info-card,
  .cc-profile__editor, .cc-profile__timeline, .cc-profile__structure,
  .cc-profile__archive-manager, .reminder-v2__editor-card,
  .reminder-v2__list-card
) {
  background-image:
    url("../assets/ornate-gold-frame-r1.svg"),
    url("../assets/botanical-paper-r1.svg") !important;
  background-position: center, center !important;
  background-size: 100% 100%, cover !important;
  background-repeat: no-repeat, no-repeat !important;
  box-shadow: 0 10px 24px rgb(59 45 28 / 12%), inset 0 0 0 3px rgb(255 251 236 / 45%) !important;
}

/* Profile editing uses its own quiet form hierarchy. The shared frame layer
   was never intended for the editor, structure manager, or archive lists and
   left a large gold outline over their controls. Keep the paper texture only. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .cc-profile__editor,
  .cc-profile__structure,
  .cc-profile__archive-manager
) {
  background-image: url("../assets/botanical-paper-r1.svg") !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 10px 24px rgb(59 45 28 / 12%) !important;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .cc-profile__editor,
  .cc-profile__structure,
  .cc-profile__archive-manager
)::before,
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .cc-profile__editor,
  .cc-profile__structure,
  .cc-profile__archive-manager
)::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
}

/* Dark overview copy must stay crisp: the old warm shadow created a doubled glyph edge. */
#moduleStage .overview-command-deck :is(
  h1, h2, h3, h4, h5, h6, strong, b, p, span, a, li, dt, dd, button
) {
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
#moduleStage .overview-command-deck > *,
#moduleStage .overview-command-deck > * > *,
#moduleStage .overview-command-deck > * > * > * {
  position: relative;
  z-index: 2;
}

@media (max-width: 760px) {
  body.owner-shell-v1:not(.auth-required) #moduleStage :is(
    .overview-canvas-widget > .panel:not(.overview-command-deck),
    .module-canvas-widget > .panel:not(.overview-command-deck),
    .work-column, .people-v2-card, .knowledge-v2-card, .vault-card,
    .knowledge-v2__canvas-card, .reminder-v2-card, .items-v2-card,
    .profile-owner-card, .custom-info-card
  ) { border-radius: 7px; box-shadow: inset 0 1px rgb(255 255 255 / 62%); }
}

/* r13 correction: target the real Work/Knowledge shells and keep fills intact. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-command-deck,
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-overview-shell,
  .knowledge-v2,
  .knowledge-v2__distribution,
  .knowledge-v2__coverage,
  .knowledge-v2__focus,
  .knowledge-v2__canvas-card,
  .people-v2-card,
  .vault-card,
  .reminder-v2-card,
  .items-v2-card,
  .profile-owner-card,
  .custom-info-card
) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgb(193 154 85 / 68%) !important;
  box-shadow: 0 10px 24px rgb(59 45 28 / 12%), inset 0 0 0 1px rgb(255 251 236 / 48%), inset 0 0 0 4px rgb(193 154 85 / 10%) !important;
  background-image: none !important;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-command-deck,
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-overview-shell,
  .knowledge-v2,
  .knowledge-v2__distribution,
  .knowledge-v2__coverage,
  .knowledge-v2__focus,
  .knowledge-v2__canvas-card,
  .people-v2-card,
  .vault-card,
  .reminder-v2-card,
  .items-v2-card,
  .profile-owner-card,
  .custom-info-card
)::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 5px;
  border: 1px solid rgb(222 188 116 / 82%);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(111 75 22 / 36%);
  background: none !important;
  pointer-events: none;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-command-deck,
  .overview-canvas-widget > .panel:not(.overview-command-deck),
  .module-canvas-widget > .panel:not(.overview-command-deck),
  .work-overview-shell,
  .knowledge-v2,
  .knowledge-v2__distribution,
  .knowledge-v2__coverage,
  .knowledge-v2__focus,
  .knowledge-v2__canvas-card,
  .people-v2-card,
  .vault-card,
  .reminder-v2-card,
  .items-v2-card,
  .profile-owner-card,
  .custom-info-card
)::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: url("../assets/botanical-paper-r1.svg") center / cover no-repeat !important;
  opacity: .22;
  mix-blend-mode: multiply;
  pointer-events: none;
}

body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-command-deck, .work-overview-shell, .knowledge-v2
) > * { position: relative; z-index: 2; }

/* Work columns are layout rails, not cards: remove the oversized nested frame. */
body.owner-shell-v1:not(.auth-required) #moduleStage .work-column {
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  background-image: none !important;
  background-color: transparent !important;
}
body.owner-shell-v1:not(.auth-required) #moduleStage .work-column::before,
body.owner-shell-v1:not(.auth-required) #moduleStage .work-column::after {
  content: none !important;
  display: none !important;
}
#moduleStage .work-column::before,
#moduleStage .work-column::after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

/* Put the botanical paper on the actual content cards, with their own fills intact. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .work-project-row,
  .work-overview-metrics > article,
  .work-overview-brief,
  .work-overview-timeline,
  .work-empty
) {
  background-image: url("../assets/botanical-paper-r1.svg") !important;
  background-position: center !important;
  background-size: cover !important;
  background-blend-mode: soft-light;
  box-shadow: inset 0 0 0 1px rgb(193 154 85 / 18%);
}

/* Same treatment for compact cards that previously inherited a plain white fill. */
body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .overview-action-panel,
  .overview-command-deck .metric-card,
  .finance-v2-card,
  .people-v2-card,
  .vault-card,
  .items-v2-card,
  .reminder-v2-card
) {
  background-image: url("../assets/botanical-paper-r1.svg") !important;
  background-position: center !important;
  background-size: cover !important;
  background-blend-mode: soft-light;
}
