:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #64707d;
  --line: #d7dde4;
  --surface: #ffffff;
  --panel: #f5f7f9;
  --accent: #c96d24;
  --accent-strong: #a94f13;
  --marine: #4d9fc7;
  --marine-deep: #a9daf0;
  --steel: #9cafbd;
  --danger: #9b2c2c;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #b8e3f5;
  font-family: "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.ambient-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.app-shell,
.customer-app,
.prospect-app {
  position: relative;
  z-index: 1;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.library-view {
  width: min(1900px, calc(100% - 12px));
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  padding: 8px 0;
  overflow: hidden;
}

.library-header {
  display: block;
  padding: 0 4px 6px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.book-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 31px;
  line-height: 1.06;
}

.library-header h1 {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.library-header h1 span {
  color: #315e79;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.library-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.library-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 7px;
  height: calc(100% - 50px);
  margin-top: 7px;
}

.local-file-notice {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin: 64px auto 0;
  padding: 28px 32px;
  border: 1px solid rgba(32, 109, 148, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #173f56;
  text-align: center;
  box-shadow: 0 16px 42px rgba(31, 92, 125, 0.12);
}

.local-file-notice strong {
  font-size: 22px;
}

.local-file-notice span {
  color: #4a7085;
  line-height: 1.7;
}

.catalog-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
  text-decoration: none;
  cursor: pointer;
}

.catalog-card:focus-visible,
.icon-button:focus-visible,
.tool-button:focus-visible,
.search-box button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.cover-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #dce7ea, #eef3f2 48%, #e8ecef);
}

.cover-frame img {
  position: absolute;
  inset: 5px;
  display: block;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: contain;
  background: white;
  box-shadow: 0 18px 35px rgba(31, 41, 51, 0.22);
}

.card-copy {
  padding: 5px 8px 6px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.card-copy h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.22;
}

.card-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.reader-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-group {
  min-width: 240px;
}

.book-kicker {
  margin-bottom: 3px;
  font-size: 11px;
}

.icon-button,
.tool-button,
.search-box button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.tool-button,
.search-box button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 12px;
  font-size: 14px;
  text-decoration: none;
}

.tool-button[aria-pressed="true"] {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.icon-button:hover,
.tool-button:hover,
.search-box button:hover {
  border-color: var(--accent);
}

.page-jump {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.page-jump input {
  width: 62px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: right;
}

.page-jump input:focus {
  outline: none;
}

.page-jump span,
.zoom-label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.reader-layout {
  display: grid;
  grid-template-columns: 292px 1fr;
  min-height: 0;
}

.reader-layout.panel-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.side-panel {
  min-height: calc(100vh - 63px);
  padding: 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-box input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.search-status {
  min-height: 24px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 8px;
}

.result-button {
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.result-button strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
}

.result-button span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: calc(100vh - 63px);
  overflow: auto;
  padding: 2px;
  background:
    linear-gradient(90deg, rgba(31, 41, 51, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 41, 51, 0.05) 1px, transparent 1px),
    #e6ebef;
  background-size: 32px 32px;
}

.book-index-panel {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 4;
  width: clamp(320px, 25vw, 430px);
  max-height: calc(100vh - 142px);
  overflow: hidden;
  color: #173f56;
  background: rgba(249, 253, 255, 0.97);
  border: 1px solid rgba(47, 126, 170, 0.3);
  border-top: 4px solid #df7828;
  border-radius: 8px;
  box-shadow: 0 20px 55px rgba(28, 83, 114, 0.28);
  backdrop-filter: blur(14px);
}

.book-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 11px 18px;
  border-bottom: 1px solid rgba(47, 126, 170, 0.18);
}

.book-index-head > div {
  display: grid;
  gap: 2px;
}

.book-index-head strong {
  font-size: 20px;
}

.book-index-head span {
  color: #5d8093;
  font-size: 11px;
  font-weight: 700;
}

.book-index-head .icon-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.book-index-list {
  max-height: calc(100vh - 220px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.book-index-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px;
  color: #173f56;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(47, 126, 170, 0.12);
  cursor: pointer;
}

.book-index-item:hover,
.book-index-item:focus-visible {
  background: #e6f5fb;
  outline: none;
}

.book-index-number {
  color: #d66f20;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.book-index-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.book-index-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-index-copy small {
  overflow: hidden;
  color: #638093;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-index-arrow {
  color: #3b86ad;
  font-size: 24px;
}

.reader-progress {
  position: fixed;
  left: 50%;
  bottom: 8px;
  z-index: 18;
  display: grid;
  grid-template-columns: 42px minmax(160px, 620px) 52px;
  align-items: center;
  gap: 10px;
  width: min(760px, calc(100% - 34px));
  min-height: 40px;
  padding: 6px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(173, 184, 194, 0.88);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.15);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.reader-progress output {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.reader-progress span {
  font-size: 13px;
  white-space: nowrap;
}

.reader-progress input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.loading-state {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
}

.flip-book-shell {
  --book-zoom: 1;
  --book-max-width: 1540px;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, var(--book-max-width));
  min-height: calc(100vh - 92px);
  padding: 0 2px 48px;
  zoom: var(--book-zoom);
  transition: filter 180ms ease;
}

.flip-book-shell::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 16px;
  height: 34px;
  z-index: -1;
  border-radius: 50%;
  background: rgba(31, 41, 51, 0.22);
  filter: blur(18px);
  opacity: 0.54;
  transition: opacity 180ms ease, transform 180ms ease;
}

.flip-book-shell.single-page-book {
  align-self: start;
  width: 100%;
  max-width: none;
}

.flip-book-shell.split-page-book {
  align-self: start;
  width: min(100%, var(--book-max-width));
  max-width: var(--book-max-width);
}

.flip-book-shell.is-flipping::after {
  opacity: 0.72;
  transform: scaleX(0.94);
}

.flip-book {
  margin: 0 auto;
}

.flip-page {
  position: relative;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 51, 0.08);
}

.book-index-rail {
  position: absolute;
  top: 18px;
  right: 2px;
  bottom: 66px;
  z-index: 4;
  display: grid;
  grid-template-rows: repeat(9, 1fr);
  width: clamp(38px, 3.4vw, 58px);
  overflow: visible;
}

.book-index-rail.is-tabbed {
  top: 12px;
  left: -64px;
  right: -64px;
  bottom: 54px;
  z-index: 7;
  display: block;
  width: auto;
  pointer-events: none;
}

.book-index-rail-side {
  position: absolute;
  top: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: repeat(var(--rail-count), minmax(0, 1fr));
  width: clamp(74px, 5vw, 90px);
  pointer-events: auto;
  filter: drop-shadow(4px 6px 14px rgba(31, 41, 51, 0.18));
}

.book-index-rail-side.is-left {
  left: var(--rail-left-offset, 0);
}

.book-index-rail-side.is-right {
  right: var(--rail-right-offset, 0);
}

.book-index-rail-item {
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.book-index-rail.is-tabbed .book-index-rail-item {
  background: linear-gradient(90deg, #f6f8f9 0%, #d9dee1 100%);
  border: 1px solid rgba(31, 41, 51, 0.62);
  box-shadow: inset 8px 0 12px rgba(255, 255, 255, 0.42);
}

.book-index-rail-side.is-left .book-index-rail-item {
  border-right: 0;
}

.book-index-rail-side.is-right .book-index-rail-item {
  border-left: 0;
}

.book-index-rail.is-tabbed .book-index-rail-item + .book-index-rail-item {
  border-top: 0;
}

.book-index-rail-side.is-right .book-index-rail-item:first-child {
  border-top-right-radius: 3px;
}

.book-index-rail-side.is-right .book-index-rail-item:last-child {
  border-bottom-right-radius: 3px;
}

.book-index-rail-side.is-left .book-index-rail-item:first-child {
  border-top-left-radius: 3px;
}

.book-index-rail-side.is-left .book-index-rail-item:last-child {
  border-bottom-left-radius: 3px;
}

.book-index-rail.is-tabbed .book-index-rail-item.is-active {
  background: linear-gradient(90deg, #fff56a 0%, #ffd91f 100%);
}

.book-index-rail-item span {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  padding: 4px 7px;
  color: #fff;
  background: rgba(21, 64, 87, 0.92);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.book-index-rail.is-tabbed .book-index-rail-item span {
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(112px, calc((100svh - 150px) / var(--rail-count)));
  overflow: hidden;
  padding: 0;
  color: #1f2933;
  background: transparent;
  border-radius: 0;
  font-size: clamp(12px, 0.76vw, 14px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  opacity: 1;
  text-overflow: ellipsis;
  transform: translate(-50%, -50%) rotate(90deg);
}

.book-index-rail-side.is-left .book-index-rail-item span {
  transform: translate(-50%, -50%) rotate(-90deg);
}

.book-index-rail-item:hover,
.book-index-rail-item:focus-visible {
  background: rgba(50, 157, 208, 0.24);
  box-shadow: inset 0 0 0 1px rgba(38, 127, 172, 0.52);
  outline: none;
}

.book-index-rail.is-tabbed .book-index-rail-item:hover,
.book-index-rail.is-tabbed .book-index-rail-item:focus-visible {
  background: linear-gradient(90deg, #fff8a8 0%, #ffe15a 100%);
  box-shadow:
    inset 8px 0 12px rgba(255, 255, 255, 0.38),
    inset 0 0 0 2px rgba(223, 120, 40, 0.42);
}

.book-index-rail-item:hover span,
.book-index-rail-item:focus-visible span {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.book-index-rail.is-tabbed .book-index-rail-item:hover span,
.book-index-rail.is-tabbed .book-index-rail-item:focus-visible span {
  transform: translate(-50%, -50%) rotate(90deg);
}

.book-index-rail-side.is-left .book-index-rail-item:hover span,
.book-index-rail-side.is-left .book-index-rail-item:focus-visible span {
  transform: translate(-50%, -50%) rotate(-90deg);
}

.flip-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(24, 35, 45, 0.09), transparent 7%, transparent 93%, rgba(24, 35, 45, 0.06));
  opacity: 0.42;
}

.flip-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.flip-cover {
  background: #e9edf0;
  box-shadow:
    inset 0 0 0 1px rgba(31, 41, 51, 0.18),
    inset -7px 0 13px rgba(31, 41, 51, 0.1);
}

.flip-cover::after {
  background: linear-gradient(90deg, rgba(21, 31, 40, 0.2), transparent 5%, transparent 95%, rgba(21, 31, 40, 0.08));
  opacity: 0.58;
}

.flip-page-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9ba5ae;
  background:
    linear-gradient(90deg, rgba(31, 41, 51, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 41, 51, 0.035) 1px, transparent 1px),
    #f8f9fa;
  background-size: 24px 24px;
  font-size: 13px;
}

.flip-page.is-rendered .flip-page-loader {
  display: none;
}

@media (max-width: 980px) {
  .library-view {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    height: auto;
  }

  .catalog-card {
    min-height: 390px;
  }

  .cover-frame {
    min-height: 320px;
  }

  .reader-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .title-group {
    flex: 1 1 100%;
  }

  .reader-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-stage {
    min-height: calc(100vh - 180px);
    padding: 14px;
  }

  .flip-book-shell {
    min-height: calc(100vh - 190px);
    padding: 12px 20px 28px;
  }
}

@media (max-width: 620px) {
  .book-index-panel {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 190px);
  }

  .book-index-list {
    max-height: calc(100vh - 270px);
  }

  .library-view {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .library-header {
    display: block;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .library-meta {
    margin-top: 12px;
  }

  .library-actions {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 12px;
  }

  h1 {
    font-size: 32px;
  }

  .reader-toolbar {
    padding: 10px;
  }

  .page-tools,
  .view-tools {
    width: 100%;
    justify-content: space-between;
  }

  .search-results {
    grid-template-columns: 1fr;
  }

  .flip-book-shell {
    width: 100%;
    min-height: calc(100vh - 250px);
    padding: 8px 4px 24px;
  }

  .reader-progress {
    grid-template-columns: 34px minmax(100px, 1fr) 42px;
    gap: 7px;
    width: calc(100% - 20px);
    min-height: 36px;
    padding: 4px 9px;
  }
}

.customer-app {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.customer-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.customer-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtle-danger {
  color: var(--danger);
}

.lead-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}

.lead-form,
.lead-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

.lead-form {
  padding: 20px;
}

.form-section + .form-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.form-section h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 15px;
}

.form-grid input,
.form-grid select {
  height: 40px;
  padding: 0 11px;
}

.form-grid textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.45;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.wide-field {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.primary-button {
  height: 40px;
  padding: 0 18px;
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.lead-panel {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.lead-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.lead-summary span {
  color: var(--accent);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.lead-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.lead-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 172px);
  overflow: auto;
  padding: 12px;
}

.lead-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.lead-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.lead-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.lead-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.lead-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.lead-card dl div {
  padding: 8px;
  background: var(--panel);
  border-radius: 6px;
}

.lead-card dt,
.lead-card dd {
  margin: 0;
  font-size: 12px;
}

.lead-card dt {
  color: var(--muted);
}

.lead-card dd {
  margin-top: 3px;
  color: var(--ink);
  font-weight: 700;
}

.lead-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.empty-state {
  margin: 0;
  padding: 20px 12px;
  color: var(--muted);
  text-align: center;
}

.prospect-app {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.prospect-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.prospect-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.finder-bar {
  display: grid;
  grid-template-columns: 180px 160px 150px 1fr;
  gap: 12px;
  align-items: end;
  margin-top: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finder-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finder-bar select {
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.finder-check {
  display: flex !important;
  align-items: center;
  height: 38px;
  gap: 8px !important;
}

.finder-check input {
  width: 18px;
  height: 18px;
}

.finder-stat {
  justify-self: end;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
}

.finder-stat strong {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.prospect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.prospect-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

.prospect-card.is-filed {
  border-color: rgba(15, 118, 110, 0.46);
  background: #f3faf8;
}

.prospect-card.is-sent {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.14), 0 10px 28px rgba(31, 41, 51, 0.08);
}

.prospect-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prospect-card h2 {
  margin-top: 5px;
  font-size: 20px;
}

.prospect-region {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.filed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 78px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-toggles {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.filed-toggle input {
  width: 17px;
  height: 17px;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.match-高 {
  color: #075e54;
  background: #d9f3ee;
}

.match-中 {
  color: #755306;
  background: #fff0c2;
}

.difficulty-低 {
  color: #075e54;
  background: #e0f5e9;
}

.difficulty-中 {
  color: #755306;
  background: #fff0c2;
}

.difficulty-高 {
  color: #8a1f1f;
  background: #ffe0df;
}

.prospect-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.prospect-details div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.prospect-details dt,
.prospect-details dd {
  margin: 0;
}

.prospect-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prospect-details dd {
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.48;
}

.prospect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.mail-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 41, 51, 0.36);
}

.mail-panel-card {
  width: min(820px, 100%);
  max-height: min(880px, calc(100vh - 36px));
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(31, 41, 51, 0.28);
}

.mail-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mail-panel-card label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mail-panel-card input,
.mail-panel-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 15px;
}

.mail-panel-card input {
  height: 42px;
  padding: 0 11px;
}

.mail-panel-card textarea {
  resize: vertical;
  min-height: 360px;
  padding: 12px;
  line-height: 1.5;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .customer-header,
  .customer-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-workspace {
    grid-template-columns: 1fr;
  }

  .lead-panel {
    position: static;
  }

  .lead-list {
    max-height: none;
  }

  .prospect-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .finder-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finder-stat {
    justify-self: start;
  }

  .prospect-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .customer-app {
    width: min(100% - 22px, 1280px);
    padding-top: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .primary-button,
  .form-actions .tool-button {
    width: 100%;
  }

  .prospect-app {
    width: min(100% - 22px, 1280px);
    padding-top: 22px;
  }

  .finder-bar {
    grid-template-columns: 1fr;
  }

  .customer-nav {
    width: 100%;
  }

  .customer-nav .tool-button {
    width: 100%;
  }

  .prospect-card-top,
  .mail-panel-head {
    flex-direction: column;
  }

  .status-toggles {
    justify-items: start;
  }

  .mail-actions .tool-button,
  .mail-actions .primary-button {
    width: 100%;
  }
}

/* NEKEKE marine brand treatment */
.library-view {
  color: #16384d;
}

.library-header {
  border-bottom-color: rgba(39, 105, 145, 0.26);
}

.library-header .eyebrow,
.library-header .library-meta {
  color: #456a80;
}

.library-header .eyebrow {
  color: #f29a52;
}

.library-actions .tool-button {
  color: #21495f;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(46, 128, 174, 0.38);
}

.catalog-card {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 42px rgba(5, 20, 20, 0.32);
}

.catalog-card:hover {
  border-color: rgba(242, 154, 82, 0.86);
  box-shadow: 0 22px 50px rgba(5, 20, 20, 0.42);
  transform: translateY(-2px);
}

.cover-frame {
  background-color: #dce4e2;
  background-image: none;
  border-top: 4px solid var(--accent);
}

.card-copy {
  background: #fff;
  border-top-color: #d3dcda;
}

.reader-toolbar {
  color: var(--ink);
  background: rgba(252, 254, 255, 0.92);
  border-bottom-color: rgba(46, 132, 181, 0.26);
  box-shadow: 0 8px 24px rgba(35, 101, 139, 0.14);
}

.reader-toolbar h2 {
  color: #18364a;
}

.reader-toolbar .book-kicker {
  color: #f29a52;
}

.reader-toolbar .icon-button,
.reader-toolbar .tool-button,
.reader-toolbar .page-jump {
  color: #24495f;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(55, 129, 171, 0.28);
}

.reader-toolbar .page-jump input {
  color: #18364a;
}

.reader-toolbar .page-jump span,
.reader-toolbar .zoom-label {
  color: #557286;
}

.reader-toolbar .icon-button:hover,
.reader-toolbar .tool-button:hover {
  background: rgba(201, 109, 36, 0.24);
  border-color: #e98c43;
}

.reader-toolbar .tool-button[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: #ed9a58;
}

.side-panel {
  color: var(--ink);
  background: rgba(239, 249, 253, 0.96);
  border-right-color: rgba(54, 132, 176, 0.25);
}

.side-panel .search-status {
  color: #557286;
}

.book-stage {
  background: rgba(201, 235, 248, 0.06);
}

.book-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.06);
}

.flip-book-shell {
  z-index: 1;
}

.flip-book-shell::after {
  background: rgba(0, 0, 0, 0.48);
}

.reader-progress {
  color: #557286;
  background: rgba(253, 254, 255, 0.95);
  border-color: rgba(53, 133, 178, 0.32);
  box-shadow: 0 10px 28px rgba(35, 101, 139, 0.2);
}

.reader-progress output {
  color: #f29a52;
}

.reader-progress input[type="range"] {
  accent-color: #e48335;
}

.loading-state {
  z-index: 2;
  color: #24506a;
}

.customer-app,
.prospect-app {
  color: #16384d;
}

.customer-header,
.prospect-header {
  border-bottom-color: rgba(39, 105, 145, 0.26);
}

.prospect-subtitle {
  color: #456a80;
}

.finder-bar,
.lead-form,
.lead-panel,
.prospect-card {
  color: var(--ink);
}

@media (max-width: 620px) {
  .reader-toolbar {
    background: rgba(249, 253, 255, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-background {
    opacity: 0.92;
  }
}
