/* V2 skin for the standalone routes that link this file. */
:root.lm-ancillary-v2,
html.lm-ancillary-v2 body {
  --v2-ground: #15171c;
  --v2-panel: #1c1f27;
  --v2-raised: #222632;
  --v2-field: #171a21;
  --v2-rule: #343945;
  --v2-text: #f1f2f5;
  --v2-muted: #aeb3c0;
  --v2-action: #a4aaff;
  --v2-action-text: #191b2a;
  --bg: var(--v2-ground) !important;
  --bg-2: var(--v2-field) !important;
  --card: var(--v2-panel) !important;
  --surface: var(--v2-panel) !important;
  --surface-2: var(--v2-raised) !important;
  --panel: var(--v2-panel) !important;
  --panel-2: var(--v2-raised) !important;
  --ink: var(--v2-text) !important;
  --txt: var(--v2-text) !important;
  --text: var(--v2-text) !important;
  --ink2: var(--v2-text);
  --ink3: var(--v2-muted);
  --sub: var(--v2-muted) !important;
  --muted: var(--v2-muted) !important;
  --text-muted: var(--v2-muted) !important;
  --line: var(--v2-rule) !important;
  --border: var(--v2-rule) !important;
  --brand: var(--v2-action) !important;
  --brand-2: #828be8 !important;
  --brand-soft: #a4aaff1a !important;
  --pink: var(--v2-action) !important;
  --pink-2: var(--v2-action) !important;
  --primary: var(--v2-action) !important;
  --accent: var(--v2-action) !important;
  --accent-soft: #a4aaff1a !important;
  background: var(--v2-ground) !important;
  color: var(--v2-text) !important;
  color-scheme: dark;
}

.lm-ancillary-v2 body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.lm-ancillary-v2 body::before { content: none; }
.lm-ancillary-v2 :is(#lm-back, #lm-back-top) { display: none; }

.lm-ancillary-v2 :is(.wrap, .invoice-shell, body > main) {
  box-sizing: border-box;
  max-width: 1440px;
  margin-inline: auto;
  padding: 24px clamp(16px, 3.2vw, 48px) 56px;
}

.lm-ancillary-v2 :is(h1, h2, h3, h4) { color: var(--v2-text) !important; }
.lm-ancillary-v2 h1 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: -.035em;
  line-height: 1.2;
}

.lm-ancillary-v2 :is(.v2-page-chrome, .wrap > header, .wrap > .top, body > header, .invoice-top) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 20px;
  padding: 8px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--v2-rule);
  background: var(--v2-ground);
  color: var(--v2-text);
}

.lm-ancillary-v2 :is(.wrap > header, .wrap > .top, .invoice-top) {
  min-height: 48px;
  padding-inline: 0;
}

.lm-ancillary-v2 .v2-page-chrome > :first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.lm-ancillary-v2 .v2-page-chrome strong { font-size: 1rem; letter-spacing: .02em; }
.lm-ancillary-v2 .v2-page-chrome span { color: var(--v2-muted); }
.lm-ancillary-v2 .v2-page-chrome a { font-size: .86rem; text-decoration: none; }
.lm-ancillary-v2 a:hover { color: var(--v2-action) !important; }

.lm-ancillary-v2 :is(.card, .panel, .invoice-card, .invoice-dialog, .teamItem, .intro-item,
    .grid > .card, #list > .card) {
  border: 1px solid var(--v2-rule) !important;
  border-radius: 12px !important;
  background: var(--v2-panel) !important;
  color: var(--v2-text) !important;
  box-shadow: none !important;
}

.lm-ancillary-v2 :is(.grid, .layout, .invoice-layout) { gap: clamp(12px, 1.5vw, 20px); }
.lm-ancillary-v2 :is(.grid > .card, #list > .card):hover {
  border-color: #626881 !important;
  box-shadow: none !important;
  transform: none !important;
}
.lm-ancillary-v2 :is(.grid > .card, #list > .card)::before { display: none; }

.lm-ancillary-v2 :is(.muted, .sub, .lead, .tip, .hint, .meta, .desc, .note, .intro-tip, .empty, .invoice-muted) {
  color: var(--v2-muted) !important;
}
.lm-ancillary-v2 .note {
  border: 1px solid var(--v2-rule);
  border-radius: 10px;
  background: var(--v2-panel);
}
.lm-ancillary-v2 .note b,
.lm-ancillary-v2 .card .price { color: var(--v2-text) !important; }
.lm-ancillary-v2 .card .cat {
  background: var(--v2-raised);
  color: var(--v2-muted);
  border-color: var(--v2-rule);
}

.lm-ancillary-v2 :is(input, textarea, select):focus-visible,
.lm-ancillary-v2 :is(a, button, summary):focus-visible {
  outline: 2px solid var(--v2-action) !important;
  outline-offset: 2px;
}
.lm-ancillary-v2 :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), textarea, select) {
  min-width: 0;
  background: var(--v2-field) !important;
  color: var(--v2-text) !important;
  border: 1px solid var(--v2-rule) !important;
  border-radius: 8px !important;
}
.lm-ancillary-v2 :is(input, textarea)::placeholder { color: #8e95a4 !important; }
.lm-ancillary-v2 :is(input, textarea, select):focus {
  border-color: var(--v2-action) !important;
  box-shadow: 0 0 0 3px #a4aaff1f !important;
}
.lm-ancillary-v2 input:is([type=checkbox], [type=radio], [type=range]) { accent-color: var(--v2-action); }

.lm-ancillary-v2 :is(button:not([hidden]), .btn) {
  min-height: 34px;
  border-radius: 8px;
  box-shadow: none !important;
}
.lm-ancillary-v2 :is(button:not(.danger):not(.green), .btn:not(.danger):not(.green)) {
  border-color: var(--v2-rule) !important;
  background: var(--v2-raised) !important;
  color: var(--v2-text) !important;
}
.lm-ancillary-v2 :is(button:not(.danger):not(.green), .btn:not(.danger):not(.green)):hover {
  border-color: #636a84 !important;
}
.lm-ancillary-v2 :is(.btn.primary, .btn.brand, .invoice-primary, #publishBtn, #pubBtn,
    #pubSubmit, #saveProfile, #upload, #gen-open, #gen-submit, .cta .btn:not(.ghost)) {
  background: var(--v2-action) !important;
  border: 1px solid var(--v2-action) !important;
  color: var(--v2-action-text) !important;
  font-weight: 700;
}
.lm-ancillary-v2 :is(.btn.primary, .btn.brand, .invoice-primary, #publishBtn, #pubBtn, .cta .btn:not(.ghost)):hover {
  background: #b8bdff !important;
  color: var(--v2-action-text) !important;
  transform: none !important;
}
.lm-ancillary-v2 button:disabled { opacity: .55; cursor: not-allowed; }
.lm-ancillary-v2 :is(.chip.on, .tab.on, [data-tab].active) {
  border-color: #a4aaff70 !important;
  background: #a4aaff1f !important;
  color: #c7caff !important;
}
.lm-ancillary-v2 .tabs {
  padding: 4px !important;
  margin: 10px 0 16px !important;
  border: 1px solid var(--v2-rule);
  background: var(--v2-panel) !important;
}
.lm-ancillary-v2 .tabs .tab { padding: 8px 14px !important; }
.lm-ancillary-v2 .filters { gap: 8px !important; }
.lm-ancillary-v2 :is(.mask .modal, .modal-card, .gate-card, .dialog, .popup) {
  background: var(--v2-panel) !important;
  border-color: var(--v2-rule) !important;
  color: var(--v2-text) !important;
}
.lm-ancillary-v2 :is(.mask, .overlay) { background: #0c0f18c4 !important; }

.lm-ancillary-v2 table { color: var(--v2-text) !important; }
.lm-ancillary-v2 :is(th, td) { border-color: var(--v2-rule) !important; }
.lm-ancillary-v2 :is(thead th, tr:first-child > th) {
  background: var(--v2-raised) !important;
  color: var(--v2-muted) !important;
}

/* Task market: dense, readable rows from the existing task data. */
.v2-market :is(.wrap > .top, .wrap > div:has(> #qBox)),
.v2-skills :is(.wrap > .top, .searchbar) {
  align-items: center;
  flex-wrap: wrap;
}
.v2-market #list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.v2-market #list > article.card:has(> .title):has(> .foot) {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(110px, .8fr) minmax(180px, 1.25fr);
  grid-template-areas: "name cat details" "summary cat details";
  column-gap: 20px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
  padding: 14px 18px !important;
}
.v2-market #list > article.card > .title { grid-area: name; min-width: 0; font-size: 1.04rem !important; }
.v2-market #list > article.card > .desc { grid-area: summary; margin: 0; min-width: 0; }
.v2-market #list > article.card > .cat { grid-area: cat; justify-self: start; align-self: center; }
.v2-market #list > article.card > .foot {
  grid-area: details;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.v2-market .foot .meta { margin: 2px 0 0; }

/* Prompt shop: real covers, with the existing category, seller and price. */
.v2-skills #list {
  grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr));
}
.v2-skills #list > .card:has(> .thumb) { padding: 0 !important; }
.v2-skills #list > .card > .thumb {
  height: auto;
  aspect-ratio: 16 / 9;
  background-color: var(--v2-raised);
}
.v2-skills #list > .card > .body { padding: 14px 16px 16px; }
.v2-skills #skillTab { padding-bottom: 12px; border-bottom: 1px solid var(--v2-rule); }
.v2-skills .searchbar #qBox, .v2-market #qBox { flex: 1 1 16rem; max-width: 34rem; }

/* Team: practical navigation to the existing sections and horizontally scrollable data tables. */
.v2-team .wrap {
  display: grid;
  grid-template-columns: minmax(142px, 188px) minmax(0, 1fr);
  column-gap: 24px;
  align-items: start;
}
.v2-team .wrap > * { grid-column: 2; min-width: 0; }
.v2-team .wrap > header { grid-column: 1 / -1; grid-row: 1; }
.v2-team .v2-team-nav {
  grid-column: 1;
  grid-row: 2 / span 5;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--v2-rule);
  border-radius: 12px;
  background: var(--v2-panel);
}
.v2-team .v2-team-nav a {
  display: block;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--v2-muted);
}
.v2-team :is(.v2-team-nav a:hover, .v2-team-nav a:focus-visible),
.v2-team body:has(#membersTitle:target) .v2-team-nav a[href="#membersTitle"],
.v2-team body:has(#wlCard:target) .v2-team-nav a[href="#wlCard"],
.v2-team body:has(#keysSection:target) .v2-team-nav a[href="#keysSection"] {
  background: #a4aaff16;
  color: var(--v2-action);
  border-color: #a4aaff42;
}
.v2-team .wrap > .intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.v2-team .intro-item { padding: 10px 12px; }
.v2-team :is(.dot, .wrap .brand .dot) { background: var(--v2-raised); color: var(--v2-action); }
.v2-team .sec-head { gap: 8px 16px; flex-wrap: wrap; }
.v2-team .card:has(> table), .v2-agent .card:has(> table) { overflow-x: auto; }
.v2-team #main > section { scroll-margin-top: 20px; }

/* Benefits: side-by-side plans, restrained comparison tables and durable mobile flow. */
.v2-benefits .wrap { max-width: 1200px; }
.v2-benefits .hero { padding: 16px 0 8px; }
.v2-benefits .hero h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); margin: 10px 0; }
.v2-benefits .hero h1 em {
  background: none;
  color: var(--v2-text);
  -webkit-text-fill-color: currentColor;
}
.v2-benefits .wrap > .grid { margin: 20px 0 12px; }
.v2-benefits .grid > .card { padding: clamp(16px, 2vw, 28px) !important; }
.v2-benefits .card.member { border-color: #a4aaff5e !important; }
.v2-benefits .compare { margin-top: 24px; overflow-x: auto; }
.v2-benefits :is(.faq, .cta) {
  margin-block: 24px;
  padding: clamp(14px, 3vw, 26px);
  border: 1px solid var(--v2-rule);
  border-radius: 12px;
  background: var(--v2-panel);
}
.v2-benefits .brand i { background: var(--v2-action); }

/* Video replica: preserve existing editable analysis outputs and actual upload controls. */
.v2-replica .intro { margin-bottom: 18px; }
.v2-replica .eyebrow { color: var(--v2-muted); }
.v2-replica .layout { grid-template-columns: minmax(275px, .78fr) minmax(0, 1.6fr); align-items: start; }
.v2-replica .panel { padding: clamp(14px, 2vw, 26px); }
.v2-replica .panel > h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--v2-rule);
}
.v2-replica .upload { border-color: #657099; background: var(--v2-field); }
.v2-replica #shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 12px;
}
.v2-replica #shots > * {
  min-width: 0;
  overflow-wrap: anywhere;
  border-color: var(--v2-rule);
  background: var(--v2-field);
}
.v2-replica .composer { border-color: var(--v2-rule); background: var(--v2-field); }
.v2-replica .actions { gap: 8px; flex-wrap: wrap; }
.v2-replica #gen-open { order: 1; margin-left: auto; }

/* Invoice: order selection and company information remain two existing regions. */
.v2-invoices .invoice-shell { max-width: 1240px; }
.v2-invoices .invoice-area { color: var(--v2-text); }
.v2-invoices .invoice-top { color: var(--v2-muted); }
.v2-invoices .invoice-area a { color: var(--v2-action); }
.v2-invoices .invoice-hero { padding: 8px 0 14px; }
.v2-invoices .invoice-hero :is(h1, p) { margin: 8px 0; }
.v2-invoices .invoice-hero p { color: var(--v2-muted); }
.v2-invoices .invoice-eyebrow { color: var(--v2-action); }
.v2-invoices .invoice-layout { grid-template-columns: minmax(265px, .78fr) minmax(0, 1.22fr); align-items: start; }
.v2-invoices .invoice-card { padding: clamp(14px, 2.2vw, 26px); }
.v2-invoices .invoice-card h2 b,
.v2-invoices .invoice-order:has(input:checked) {
  background: #a4aaff14;
  color: var(--v2-action);
  border-color: #a4aaff66;
}
.v2-invoices :is(.invoice-order, .invoice-total, .invoice-record) { border-color: var(--v2-rule); }
.v2-invoices :is(.invoice-order strong, .invoice-total strong) { color: var(--v2-text); font-variant-numeric: tabular-nums; }
.v2-invoices :is(.invoice-total, .invoice-dialog dt) { color: var(--v2-muted); }

/* Agent: KPIs, invite utility and compact finance tables. */
.v2-agent .wrap { display: flex; flex-direction: column; max-width: 1200px; }
.v2-agent .head { padding: 8px 0 18px; }
.v2-agent .kpis { order: 1; margin-bottom: 12px; }
.v2-agent .invite { order: 2; margin-bottom: 22px; }
.v2-agent .sec { order: 3; margin-bottom: 26px; }
.v2-agent .kpi { padding: 14px 16px; border-radius: 12px; }
.v2-agent .sec-head h2 { font-size: 1.12rem; }
.v2-agent :is(.invite, .kpi) { border-color: var(--v2-rule); }
.v2-agent .invite code { background: var(--v2-field); color: var(--v2-text); }
.v2-agent .invite .link { min-width: 0; }
.v2-agent .top-right { flex-wrap: wrap; }
.v2-agent .sec .card:has(> table) { background: var(--v2-panel); }

/* Documentation: stable anchors and scalable code without rewriting existing examples. */
.v2-docs .v2-doc-layout {
  display: grid;
  grid-template-columns: minmax(152px, 190px) minmax(0, 1fr) minmax(125px, 150px);
  gap: clamp(16px, 3vw, 34px);
  align-items: start;
}
.v2-docs .v2-doc-links {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--v2-rule);
  border-radius: 12px;
  background: var(--v2-panel);
}
.v2-docs .v2-doc-links strong { padding: 7px 8px; color: var(--v2-text); }
.v2-docs .v2-doc-links a {
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--v2-muted);
  font-size: .86rem;
  line-height: 1.4;
  text-decoration: none;
}
.v2-docs .v2-doc-links a:hover { background: #a4aaff14; }
.v2-docs .v2-doc-content { min-width: 0; }
.v2-docs .v2-doc-content > nav { gap: 8px 14px; margin-bottom: 16px; }
.v2-docs .v2-doc-content :is(a, code) { color: #c4c9ff; }
.v2-docs .v2-doc-content :is(pre, table, .table-wrap) { background: var(--v2-panel); }
.v2-docs .v2-doc-content :is(pre, .table-wrap) { border: 1px solid var(--v2-rule); border-radius: 10px; }
.v2-docs .v2-doc-content :not(pre) > code { background: #a4aaff1a; }
.v2-docs .v2-doc-content h2 { border-color: var(--v2-rule); }
.v2-docs .v2-doc-content :target { scroll-margin-top: 18px; }

@media (max-width: 1020px) {
  .v2-docs .v2-doc-layout { grid-template-columns: 152px minmax(0, 1fr); }
  .v2-docs .v2-doc-notes { display: none; }
}

@media (max-width: 760px) {
  .v2-team .wrap, .v2-replica .layout, .v2-invoices .invoice-layout,
  .v2-docs .v2-doc-layout { grid-template-columns: minmax(0, 1fr); }
  .v2-team .wrap > * { grid-column: 1; }
  .v2-team .v2-team-nav {
    grid-row: auto;
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
    margin-bottom: 12px;
  }
  .v2-docs .v2-doc-links { position: static; grid-template-columns: repeat(auto-fit, minmax(min(105px, 100%), 1fr)); }
  .v2-docs .v2-doc-notes { display: none; }
  .v2-market #list > article.card:has(> .title):has(> .foot) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name cat" "summary summary" "details details";
    row-gap: 8px;
  }
  .v2-market #list > article.card > .foot { margin-top: 4px; }
  .v2-agent .invite .link { flex-basis: 100%; order: 1; }
}

@media (max-width: 420px) {
  .v2-benefits .wrap > .grid { grid-template-columns: minmax(0, 1fr); }
  .v2-replica #gen-open { margin-left: 0; }
  .v2-invoices .invoice-form-grid { grid-template-columns: minmax(0, 1fr); }
}

.lm-ancillary-v2 .v2-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 18px;
}
.lm-ancillary-v2 .v2-section-nav a {
  padding: 7px 13px;
  border: 1px solid var(--v2-rule);
  border-radius: 8px;
  background: var(--v2-panel);
  color: var(--v2-text);
}
.v2-team .wrap:has(#main[hidden]) .v2-team-nav { display: none; }
.v2-team .wrap:has(#main[hidden]) > :not(header) { grid-column: 1 / -1; }
.v2-team .wrap:has(#keysSection[hidden]) .v2-team-nav a[href="#keysSection"],
.v2-team .wrap:has(#wlCard[hidden]) .v2-team-nav a[href="#wlCard"],
.v2-team .wrap:has(#ownerOnly[hidden]) .v2-team-create { display: none; }
.lm-ancillary-v2 :is(.v2-withdraw-link, .v2-team-create),
html.lm-ancillary-v2 .tabs .tab.on {
  background: #a4aaff1f !important;
  border-color: #a4aaff70 !important;
  color: #c7caff !important;
}
.v2-invoices :is(#invoiceOrders, #invoiceHistory),
.v2-agent #payoutForm { scroll-margin-top: 76px; }
