.ai-smart-board.board-app {
  --bg: #151d21;
  --surface: #1b252a;
  --surface-raised: #222e34;
  --field: #172126;
  --text: #e4ebee;
  --muted: #a8b8c0;
  --line: #34434a;
  --border-control: #64767e;
  --accent: #70c8c1;
  --accent-text: #102c30;
  --selected: #203e40;
  --warn: #f4c779;
  --focus: #bfe6e2;
  --radius: 6px;
  --primary: var(--accent);
  --primary-text: var(--accent-text);
  --shadow: 0 16px 60px #0005;
  min-height: 0;
  margin: 28px 0 36px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

.ai-smart-board.board-app[data-theme="light"] {
  --bg: #f3f2ef;
  --surface: #fff;
  --surface-raised: #f6f5f2;
  --field: #fff;
  --text: #232b2f;
  --muted: #596770;
  --line: #d9ddde;
  --border-control: #889298;
  --accent: #806345;
  --accent-text: #fff;
  --selected: #eee9e2;
  --warn: #865915;
  --focus: #73522e;
  --radius: 3px;
  --primary: #252c30;
  --primary-text: #fff;
  --shadow: 0 16px 60px #20282d24;
  color-scheme: light;
}

.ai-smart-board.board-app *,
.ai-smart-board.board-app *::before,
.ai-smart-board.board-app *::after {
  box-sizing: border-box;
}

.board-app .preview-tag {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 18px;
}

.board-app .pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 23px;
  gap: 20px;
}

.board-app .eyebrow {
  font-size: 9px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.board-app h1 {
  font: 600 clamp(24px, 3vw, 32px)/1.25 Manrope, Inter, sans-serif;
  letter-spacing: -.8px;
  color: var(--text);
  margin: 9px 0 12px;
}

.board-app .board-bullets {
  display: flex;
  gap: 9px 25px;
  list-style: disc;
  padding-left: 15px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.board-app .board-bullets li::marker {
  color: var(--accent);
}

.board-app .themes {
  display: inline-flex;
  flex-shrink: 0;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.board-app .themes button {
  min-height: 43px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.board-app .themes button:last-child {
  border-right: 0;
}

.board-app .themes button.active {
  background: var(--selected);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.board-app .toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.board-app .search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 47px;
  width: min(100%, 560px);
  padding: 0 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--muted);
}

.board-app .search input {
  width: 100%;
  min-height: 42px;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.board-app .search input::placeholder {
  color: var(--muted);
}

.board-app .btn,
.board-app .btn-secondary,
.board-app .filters select {
  min-height: 44px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.board-app .btn,
.board-app .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  text-decoration: none;
  cursor: pointer;
}

.board-app .btn {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  font-weight: 700;
}

.board-app .filters {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.board-app .filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.board-app .filters select {
  margin: 0;
  padding: 0 12px;
  min-width: 210px;
}

.board-app .match-console {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 0 15px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.board-app .mode-control {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.board-app .mode-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-control);
  border-radius: 20px;
  background: var(--surface);
  padding: 4px;
  min-width: 67px;
  min-height: 30px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.board-app .switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-control);
  transition: transform .2s, background-color .2s;
}

.board-app .mode-switch[aria-checked="true"] {
  background: var(--selected);
  border-color: var(--accent);
  color: var(--accent);
  flex-direction: row-reverse;
  padding-right: 4px;
  padding-left: 8px;
}

.board-app .mode-switch[aria-checked="true"] .switch-thumb {
  background: var(--accent);
}

.board-app .match-console p {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 15px;
}

.board-app .mobile-side-tabs {
  display: none;
}

.board-app .twin-board {
  --row-height: 184px;
  --center: 106px;
  --lane-height: 960px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.board-app .twin-head,
.board-app .twin-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--center) minmax(0, 1fr);
}

.board-app .twin-head {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
}

.board-app .twin-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 20px;
}

.board-app .twin-head > div:nth-child(2) {
  justify-content: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--accent);
  padding: 10px;
}

.board-app .twin-head h2 {
  font: 700 clamp(15px, 1.55vw, 20px)/1.2 Inter, sans-serif;
  letter-spacing: .2px;
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
}

.board-app .twin-head span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.board-app .scroll-lane {
  min-width: 0;
  height: auto;
  overflow: visible;
  position: relative;
}

.board-app .scroll-lane:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.board-app .connector-lane {
  height: auto;
  overflow: hidden;
  background: var(--surface-raised);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.board-app .lane-card,
.board-app .connector-slot {
  min-height: 276px;
  border-bottom: 1px solid var(--line);
}

.board-app .lane-card {
  display: flex;
  flex-direction: column;
  padding: 19px 20px 15px;
  background: var(--surface);
  position: relative;
  min-width: 0;
}

.board-app .lane-card:hover {
  background: var(--selected);
}

.board-app .card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.board-app .card-heading h3 {
  font: 600 19px/1.25 Manrope, Inter, sans-serif;
  letter-spacing: -.4px;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.board-app .card-heading span {
  font-size: 9px;
  color: var(--muted);
}

.board-app .card-purity {
  font-size: 12px;
  margin: 6px 0 0;
  color: var(--text);
}

.board-app .reservation-badge {
  align-self: flex-start;
  background: var(--selected);
  color: var(--warn);
  border: 1px solid var(--line);
  padding: 2px 7px;
  font-size: 10px;
  margin-top: 10px;
  border-radius: 3px;
}

.board-app .position-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 22px;
  margin: 13px 0 10px;
  font-size: 11px;
  line-height: 1.5;
}

.board-app .position-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.board-app .position-facts dt {
  color: var(--muted);
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
}

.board-app .position-facts dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.board-app .public-reference {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.board-app .card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.board-app .card-actions:has(.card-action-counteroffer) {
  flex-wrap: wrap;
}

.board-app .card-actions button,
.board-app .card-actions a,
.board-app .empty-slot a,
.board-app .lane-empty a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.board-app .card-actions button:hover,
.board-app .card-actions a:hover,
.board-app .empty-slot a:hover,
.board-app .lane-empty a:hover {
  text-decoration: underline;
}

.board-app .card-actions .card-action-primary {
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
}

.board-app .card-actions .card-action-secondary {
  font-weight: 600;
}

.board-app .card-extra {
  display: grid;
  gap: 5px;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.board-app .card-extra p {
  margin: 0;
}

.board-app .free-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
  padding: 50px 8px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}

.board-app .free-connector span:first-child {
  color: var(--accent);
  font-size: 23px;
}

.board-app .empty-slot {
  background: var(--surface-raised);
  justify-content: center;
  gap: 13px;
}

.board-app .empty-slot h3 {
  font: 500 13px/1.5 Inter, sans-serif;
  color: var(--muted);
  margin: 0;
}

.board-app .category-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.board-app .lane-empty {
  padding: 45px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.board-app .lane-empty p {
  margin: 12px 0;
}

.board-app .unmatched-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}

.board-app .unmatched-bar > div {
  display: grid;
  gap: 4px;
}

.board-app .unmatched-bar strong {
  font-weight: 500;
  font-size: 13px;
}

.board-app .unmatched-bar span {
  font-size: 11px;
  color: var(--muted);
}

.board-app .unmatched-bar .btn {
  font-size: 11px;
}

.board-app .board-note {
  margin: 15px 0 22px;
  font-size: 10px;
  color: var(--muted);
}

.board-app .network-signature {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 17px;
  border-top: 1px solid var(--line);
  padding-top: 21px;
  color: var(--muted);
  font-size: 10px;
}

.board-app .network-signature strong {
  font: 600 12px Manrope, Inter, sans-serif;
  letter-spacing: 1.1px;
  color: var(--text);
}

.ai-stock-original-hidden,
.ai-search-original-hidden {
  display: none !important;
}

.stock-note,
.transaction-reminder {
  display: none !important;
}

@media (max-width: 1000px) {
  .ai-smart-board.board-app {
    padding: 20px;
  }

  .board-app .pagehead {
    flex-direction: column;
    gap: 16px;
  }

  .board-app .themes {
    align-self: flex-end;
    margin-top: -6px;
  }

  .board-app .twin-board {
    --center: 80px;
  }

  .board-app .lane-card {
    padding: 18px 16px 13px;
  }

  .board-app .card-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .board-app .twin-head > div {
    padding: 15px 16px;
  }

  .board-app .twin-head span {
    font-size: 9px;
  }
}

@media (max-width: 700px) {
  .ai-smart-board.board-app {
    padding: 17px;
  }

  .board-app .match-console {
    display: none;
  }

  .board-app .mobile-side-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .board-app .mobile-side-tabs button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    text-align: left;
  }

  .board-app .mobile-side-tabs button[aria-selected="true"] {
    border-color: var(--accent);
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .board-app .mobile-side-tabs strong {
    color: var(--accent);
    font-size: 13px;
  }

  .board-app .twin-head,
  .board-app .connector-lane {
    display: none;
  }

  .board-app .twin-body {
    display: block;
  }

  .board-app .scroll-lane {
    height: auto;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .board-app[data-mobile-side="offer"] .twin-body > .scroll-lane:nth-child(3),
  .board-app[data-mobile-side="demand"] .twin-body > .scroll-lane:nth-child(1) {
    display: none;
  }

  .board-app .twin-head > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 13px 12px;
  }

  .board-app .twin-head > div:nth-child(2) {
    align-items: center;
  }

  .board-app .twin-head h2 {
    font-size: 13px;
    letter-spacing: 0;
  }

  .board-app .card-heading span {
    display: none;
  }

  .board-app .card-heading h3 {
    font-size: 17px;
  }

  .board-app .lane-card {
    min-height: 0;
    padding: 17px 12px 12px;
  }

  .board-app .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .board-app .card-action-counteroffer {
    grid-column: 1 / -1;
  }

  .board-app .card-actions button,
  .board-app .card-actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .board-app .unmatched-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .board-app .network-signature {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .board-app .toolbar {
    flex-wrap: nowrap;
  }
}

@media (max-width: 450px) {
  .ai-smart-board.board-app {
    padding: 12px;
    margin-bottom: 25px;
  }

  .board-app .preview-tag {
    font-size: 8px;
    margin-bottom: 15px;
  }

  .board-app h1 {
    font-size: 24px;
  }

  .board-app .themes button {
    min-height: 32px;
    padding: 0 10px;
  }

  .board-app .lane-card {
    padding: 15px 9px 10px;
  }

  .board-app .card-heading h3 {
    font-size: 15px;
  }

  .board-app .position-facts > div {
    display: block;
  }

  .board-app .position-facts dt {
    font-size: 9px;
  }

  .board-app .public-reference {
    font-size: 8px;
  }

  .board-app .mode-control {
    gap: 6px;
    font-size: 8px;
  }
}

/* Public card photos only: fixed overlay, with the original card geometry and typography. */
.board-app .lane-card:not(.empty-slot) .card-heading { padding-right: 84px; }

.board-app .stock-card-media {
  position: absolute;
  top: 19px;
  right: 20px;
  z-index: 1;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid #b9d4e5;
  border-radius: 6px;
  background: #eaf3f9;
  touch-action: pan-y;
}

.board-app .stock-photo-open,
.board-app .stock-photo-open img {
  display: block;
  width: 100%;
  height: 100%;
}

.board-app .stock-photo-open {
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.board-app .stock-photo-open img {
  object-fit: contain;
}

.board-app .stock-photo-open:focus-visible,
.board-app .stock-photo-arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.board-app .stock-photo-arrow {
  position: absolute;
  top: 20px;
  z-index: 2;
  width: 16px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #07385add;
  color: #fff;
  font: 18px/1 Arial, sans-serif;
  cursor: pointer;
}

.board-app .stock-photo-prev { left: 1px; }
.board-app .stock-photo-next { right: 1px; }

.board-app .stock-photo-count {
  position: absolute;
  right: 1px;
  bottom: 1px;
  left: 1px;
  z-index: 2;
  border-radius: 2px;
  background: #07385add;
  color: #fff;
  font-size: 8px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

.stock-photo-dialog {
  max-width: 94vw;
  max-height: 94vh;
  padding: 8px;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 70px #0008;
}

.stock-photo-dialog::backdrop { background: #071522d9; }

.stock-photo-dialog img {
  display: block;
  width: min(82vw, 800px);
  height: min(82vh, 700px);
  max-width: calc(94vw - 16px);
  max-height: calc(94vh - 16px);
  object-fit: contain;
}

.stock-photo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #071522e8;
  color: #fff;
  font: 28px/1 Arial, sans-serif;
  cursor: pointer;
}

.stock-photo-close:focus-visible { outline: 3px solid #1478b5; }

@media (max-width: 700px) {
  .board-app .lane-card:not(.empty-slot) .card-heading { padding-right: 74px; }
  .board-app .stock-card-media { top: 17px; right: 10px; }
}

@media (max-width: 450px) {
  .board-app .lane-card:not(.empty-slot) .card-heading { padding-right: 69px; }
  .board-app .stock-card-media { top: 15px; right: 5px; }
}
