.cspv2 {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #eef2fb;
  --line: #dfe6f2;
  --text: #172033;
  --muted: #667085;
  --accent: #071a4a;
  --accent-2: #1d6bb2;
  --warm: #c84d2e;
  --danger: #b63632;
  --good-bg: #fff0e4;
  --fallback-bg: #f7f9fb;
  --shadow: 0 14px 36px rgba(25, 32, 25, 0.09);
  width: min(1240px, calc(100vw - 32px));
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  color: var(--text);
  font-family: var(--boyneyo-font, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.45;
}

.cspv2[data-theme="dark"] {
  --bg: #0b1226;
  --panel: #111a33;
  --panel-2: #17213c;
  --line: #2a385f;
  --text: #edf3ff;
  --muted: #aeb9d4;
  --accent: #9bb4ff;
  --accent-2: #72b8ff;
  --warm: #ff8b63;
  --danger: #ff7771;
  --good-bg: #39261f;
  --fallback-bg: #202a32;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.cspv2 * { box-sizing: border-box; }
.cspv2 button, .cspv2 input, .cspv2 select, .cspv2 textarea { font: inherit; }
.cspv2 code { font-family: Consolas, "Malgun Gothic", monospace; }

.cspv2-login-required {
  max-width: 720px;
  margin: 40px auto;
  padding: 28px;
  border: 1px solid #d7ded4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(25, 32, 25, 0.09);
  font-family: var(--boyneyo-font, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif);
}

.cspv2-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 8px;
  background: #071a4a;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.cspv2-login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cspv2-signup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #071a4a;
  border-radius: 8px;
  background: #fff;
  color: #071a4a;
  text-decoration: none;
  font-weight: 800;
}

.cspv2-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.cspv2 { padding-top: 24px; }

.cspv2-page > .page-title {
  position: relative;
  overflow: hidden;
  padding: 24px 26px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(115deg, #f8fbfa 0%, var(--panel) 58%, #f2f6fb 100%);
  box-shadow: 0 12px 34px rgba(28, 41, 36, .07);
}

.cspv2-page > .page-title::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
  content: "";
}

.cspv2-page > .page-title h1,
.cspv2-page > .page-title h2 {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -.035em;
}

.cspv2-card {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(28, 41, 36, .065);
}

.cspv2-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cspv2-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  object-fit: cover;
}

.cspv2 h1, .cspv2 h2, .cspv2 h3, .cspv2 h4, .cspv2 p { margin-top: 0; }
.cspv2 h1 { margin-bottom: 2px; font-size: 27px; letter-spacing: 0; }
.cspv2-brand p, .page-title p, .section-head span { margin: 0; color: var(--muted); font-size: 14px; }
.cspv2-app-title { margin-bottom: 2px !important; color: var(--text) !important; font-size: 27px !important; font-weight: 900; line-height: 1.15; }

.cspv2-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.cspv2-nav button,
.cspv2-nav a,
.cspv2-actions .ghost,
.history-tools button,
.button-row .ghost,
.button-row .danger,
.cspv2 button {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cspv2 button {
  min-height: 40px;
  padding: 8px 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.cspv2 button:disabled { opacity: 0.55; cursor: not-allowed; }
.cspv2 button.ghost, .cspv2 .ghost {
  background: var(--panel-2);
  color: var(--text);
}
.cspv2 button.danger { background: var(--danger); }

.cspv2-nav button,
.cspv2-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.cspv2-nav button.active,
.cspv2-nav a.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.cspv2-nav .cspv2-stock-menu {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

.cspv2-nav .cspv2-stock-menu-title {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.cspv2-nav .cspv2-stock-menu-title::after {
  display: inline-block;
  margin-left: 6px;
  content: "⌄";
  font-size: 12px;
  transition: transform .18s ease;
}

.cspv2-nav .cspv2-stock-menu.is-open > .cspv2-stock-menu-title::after {
  transform: rotate(180deg);
}

.cspv2-nav .cspv2-stock-menu.is-current > .cspv2-stock-menu-title,
.cspv2-nav .cspv2-stock-menu.is-open > .cspv2-stock-menu-title {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.cspv2-nav .cspv2-stock-submenu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 50%;
  display: none;
  min-width: 168px;
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(28, 41, 36, .14);
}

.cspv2-nav .cspv2-stock-menu.is-open > .cspv2-stock-submenu {
  display: grid;
}

.cspv2-nav .cspv2-stock-submenu a {
  justify-content: flex-start;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.cspv2-nav .cspv2-stock-submenu a.active,
.cspv2-nav .cspv2-stock-submenu a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.cspv2-nav button.soon {
  color: var(--muted);
  background: var(--panel-2);
}

.cspv2-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.cspv2-internal-account {
  display: none !important;
}

.cspv2-actions .link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 8px;
}

.cspv2-menu-toggle {
  display: none;
  width: 44px;
  padding: 0;
}

.cspv2-notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #ead7aa;
  border-radius: 10px;
  background: #fff8e8;
  color: #6b4c14;
  font-size: 13px;
}

.cspv2[data-theme="dark"] .cspv2-notice {
  background: #2c2717;
  color: #f1dda5;
  border-color: #5e5128;
}

.cspv2-mini-disclaimer,
.cspv2-result-disclaimer {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warm) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, #fff4c4);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.cspv2-result-disclaimer {
  margin: 12px 0 0;
}

.cspv2[data-theme="dark"] .cspv2-mini-disclaimer,
.cspv2[data-theme="dark"] .cspv2-result-disclaimer {
  background: #2c2717;
  color: #f1dda5;
  border-color: #5e5128;
}

.cspv2-basis-card {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 9px 25px rgba(28, 41, 36, .055);
}

.cspv2-basis-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 19px;
  cursor: pointer;
  list-style: none;
}

.cspv2-basis-card summary::-webkit-details-marker { display: none; }

.cspv2-basis-heading { min-width: 0; }

.cspv2-basis-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.cspv2-basis-heading h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -.02em;
}

.cspv2-basis-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cspv2-basis-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.cspv2-basis-action::after {
  margin-left: 7px;
  content: "＋";
}

.cspv2-basis-card[open] .cspv2-basis-action::after { content: "−"; }

.cspv2-basis-detail {
  padding: 17px 19px 19px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 50%, var(--panel));
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.cspv2-basis-detail ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.cspv2-basis-detail li + li { margin-top: 5px; }
.cspv2-basis-detail p { margin: 0 0 12px; }

.cspv2-basis-formula {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
}

.cspv2-basis-formula span { font-weight: 850; }
.cspv2-basis-formula code { font-size: 13px; }

.cspv2-basis-link {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.cspv2-basis-link:hover { text-decoration: underline; }

.market-notice {
  margin: 12px 0 14px;
  padding: 11px 13px;
  border: 1px solid #ead7aa;
  border-radius: 8px;
  background: #fff8e8;
  color: #6b4c14;
  font-size: 13px;
  line-height: 1.55;
}

.cspv2[data-theme="dark"] .market-notice {
  background: #2c2717;
  color: #f1dda5;
  border-color: #5e5128;
}

.scan-market-notice {
  border-left: 4px solid var(--warm);
  background: linear-gradient(180deg, #fff8e8, #fffdf7);
}
.scan-market-notice b,
.scan-market-notice span {
  display: block;
}
.scan-market-notice b {
  margin-bottom: 4px;
  color: var(--warm);
  font-size: 14px;
  font-weight: 900;
}
.cspv2[data-theme="dark"] .scan-market-notice {
  background: linear-gradient(180deg, #2c2717, #221f15);
}

.cspv2-page { display: none; }
.cspv2-page.active { display: block; }

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-title h1,
.page-title h2 { margin-bottom: 4px; font-size: 24px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cspv2-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-head h3 { margin: 0; font-size: 20px; }
.cspv2-scanner-card {
  margin-top: 30px;
}
.cspv2-page[data-stock-section="scanner"] > .cspv2-scanner-card {
  margin-top: 0;
}
.cspv2-page[data-market] > .cspv2-card > .section-head h3 {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--warm) 26%, var(--line));
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  background: #fff8f4;
  color: var(--accent);
  font-weight: 900;
}

.toolbar,
.scanner-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 160px) auto;
  gap: 10px;
  align-items: end;
}
.scanner-controls { grid-template-columns: repeat(4, minmax(150px, 1fr)); }

.cspv2-quick-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cspv2-quick-list-actions span {
  font-weight: 700;
}

.cspv2-quick-list-actions button {
  min-height: 32px;
  padding: 6px 10px;
}

.cspv2 label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  position: relative;
}

.cspv2 input,
.cspv2 select,
.cspv2 textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

.cspv2 textarea {
  min-height: 260px;
  resize: vertical;
  font-family: Consolas, "Malgun Gothic", monospace;
}

.cspv2 [data-stock-input] {
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 3px rgba(29, 107, 178, 0.08);
}

.cspv2 [data-stock-input]:focus {
  outline: 0;
  border-color: #0b63ce;
  box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.16);
}

.clear {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--muted) !important;
}

.dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 270px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.drop-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.drop-item:hover { background: var(--panel-2); }
.drop-code, .small, .status { color: var(--muted); font-size: 14px; }
.status { min-height: 22px; margin-top: 10px; }
.status:empty { display: none; }
.status.error { color: var(--danger); }

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}
.time-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
}
.time-grid > div:nth-child(2) { border-left-color: var(--accent-2); }
.time-grid span { display: block; color: var(--muted); font-size: 13px; }
.time-grid b { display: block; margin-top: 3px; font-size: 16px; }
.time-grid p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.verify-panel {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
}
.verify-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.verify-panel p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.verify-panel.good { border-left-color: var(--warm); }
.verify-panel.bad { border-left-color: var(--accent-2); }
.verify-panel.error { border-left-color: var(--danger); }

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 24px 0 12px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--warm) 34%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(135deg, #fff8f4, #fff0e8);
}
.result-head h3 {
  margin: 0;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}
.result-head h3::before {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  content: "분석 종목";
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.result-head .small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.result-head .badge {
  background: #fff9f5;
  color: var(--warm);
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.metrics > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
  min-width: 0;
}
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 13px; }
.metrics b { display: block; margin: 4px 0; font-size: 21px; overflow-wrap: anywhere; }
.metrics .metric-band {
  border-left-color: var(--accent-2);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.metrics .metric-band b { color: var(--accent-2); }

.up { color: var(--warm) !important; }
.down { color: var(--accent-2) !important; }
.flat { color: var(--muted) !important; }

.chart-shell {
  position: relative;
  height: 360px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.chart-shell canvas { display: block; width: 100%; height: 100%; }
.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 142px;
  max-width: min(230px, calc(100% - 16px));
  padding: 8px 10px;
  border: 1px solid rgba(23, 32, 51, .14);
  border-radius: 8px;
  background: rgba(13, 18, 32, .92);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}
.chart-tooltip b,
.chart-tooltip span {
  display: block;
}
.chart-tooltip b {
  margin-bottom: 3px;
  font-size: 12px;
}
.chart-tooltip span {
  color: rgba(255, 255, 255, .82);
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.details > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.details h4 { margin: 0 0 8px; color: var(--accent); }
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 14px;
}
.kv:first-child { border-top: 0; }
.kv b { color: var(--text); text-align: right; }

.signed {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 6px;
}
.signed button { padding: 0; background: var(--panel-2); color: var(--text); }
.signed input { text-align: center; }

.button-row,
.history-tools,
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.cspv2 progress {
  display: none;
  width: 100%;
  height: 7px;
  margin-top: 10px;
  accent-color: var(--accent);
}

.cspv2 progress[data-scan-progress] {
  height: 14px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #ffe3dc;
  accent-color: #ff4d2f;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 47, 0.22);
}

.cspv2 progress[data-scan-progress]::-webkit-progress-bar {
  border-radius: 999px;
  background: #ffe3dc;
}

.cspv2 progress[data-scan-progress]::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6a2f 0%, #ff2f55 100%);
}

.cspv2 progress[data-scan-progress]::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6a2f 0%, #ff2f55 100%);
}

.cspv2[data-theme="dark"] progress[data-scan-progress] {
  background: #3b2021;
  box-shadow: inset 0 0 0 1px rgba(255, 139, 99, 0.32);
}

.cspv2[data-theme="dark"] progress[data-scan-progress]::-webkit-progress-bar {
  background: #3b2021;
}

.scan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
}
.scan-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.scan-legend .scan-legend-text {
  flex-basis: 100%;
}
.scan-legend .scan-legend-item {
  white-space: nowrap;
}
.scan-legend i {
  width: 18px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.scan-legend .match { background: var(--good-bg); border-left: 4px solid var(--warm); }
.scan-legend .fallback { background: var(--fallback-bg); border-left: 4px solid #9aa9b5; }
.scan-filter-guide {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 18%, var(--line));
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 7%, var(--panel));
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.scan-filter-guide b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}
.scan-filter-guide p {
  margin: 0;
}
.scan-filter-guide strong {
  color: var(--accent);
}
.cspv2-scan-disclaimer {
  margin-top: 12px;
}

.scan-save-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.scan-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cspv2 button.scan-save-result {
  border-color: var(--warm);
  background: var(--warm);
  color: #fff;
}
.cspv2 button.scan-list-add-major {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}
.cspv2 button.scan-list-add-watch {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: color-mix(in srgb, var(--panel) 82%, #fff4c4);
  color: var(--text);
}
.scan-save-tools.bottom { margin-top: 8px; }
.scan-save-tools span { color: var(--muted); font-size: 13px; }
.scan-save-tools.hidden { display: none; }
.scan-save-status:empty { display: none; }

.table-wrap {
  position: relative;
  overflow-x: auto;
  box-shadow: inset -18px 0 18px -18px rgba(7, 26, 74, .32);
}
.table-wrap::after {
  display: none;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 8px 8px 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7, 26, 74, .9);
  color: #fff;
  content: "오른쪽으로 밀어 더 보기 >";
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}
.cspv2 table {
  width: 100%;
  min-width: 720px;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 14px;
}
.cspv2 th, .cspv2 td {
  padding: 8px 7px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}
.cspv2 th:first-child, .cspv2 td:first-child { text-align: left; }
.cspv2 th.scan-check,
.cspv2 td.scan-check {
  width: 38px;
  text-align: center;
}
.scan-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.cspv2 th.scan-check + th,
.cspv2 td.scan-check + td { text-align: left; }
.cspv2 th { background: var(--panel-2); color: var(--muted); font-size: 13px; }
.scan-row-match td { background: var(--good-bg); }
.scan-row-match td:first-child { box-shadow: inset 4px 0 0 var(--warm); }
.scan-row-fallback td { background: var(--fallback-bg); color: var(--muted); }
.scan-row-fallback td:first-child { box-shadow: inset 4px 0 0 #9aa9b5; }
.rank {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
}
.verify-mini { margin-top: 3px; font-size: 12px; }

.history-tools { margin: 0 0 12px; }
.history-tools.cspv2-history-tools-v1528 {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.history-tools.cspv2-history-tools-v1528 [data-history-market] {
  box-sizing: border-box;
  width: 82px;
  min-width: 82px;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
}
.history-tools.cspv2-history-tools-v1528 .cspv2-mypage-back {
  display: none !important;
}
.cspv2-history-right-tools {
  display: flex !important;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 26px;
  flex: 1 0 100%;
  width: 100%;
  max-width: 100%;
  min-height: 90px;
  white-space: nowrap;
}
.cspv2-history-right-tools-v1528 {
  width: 100% !important;
  max-width: 100%;
  margin: 0 !important;
  gap: 26px;
  min-height: 90px;
}
.cspv2-history-actions {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: 0;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
}
.history-tools .cspv2-history-button-pair-v1521,
.history-tools .cspv2-history-button-pair-v1522 {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  margin-left: auto;
  white-space: nowrap;
}
.cspv2-history-pending-count,
.cspv2-history-verify-label {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.cspv2-history-pending-count {
  color: #13623e;
  font-weight: 800;
}
.cspv2-history-verify-label {
  color: var(--muted);
  font-weight: 500;
}
.history-tools .cspv2-history-refresh-control,
.history-tools .cspv2-history-refresh,
.history-tools .cspv2-score-refresh-button,
.history-tools .cspv2-score-refresh-chip-v1518,
.history-tools .cspv2-score-refresh-chip-v1519,
.history-tools .cspv2-score-refresh-chip-v1520,
.history-tools .cspv2-score-refresh-chip-v1521,
.history-tools .cspv2-score-refresh-chip-v1522,
.history-tools .cspv2-score-refresh-chip-v1523,
.history-tools .cspv2-score-refresh-chip-v1524,
.history-tools .cspv2-refresh-marker-v1526,
.history-tools .cspv2-refresh-marker-v1527,
.cspv2-refresh-marker-v1528 {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: static !important;
  float: none !important;
  transform: none !important;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  width: auto !important;
  min-width: 66px !important;
  max-width: none !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 11px !important;
  border: 1px solid #0f8f5b !important;
  border-color: #0f8f5b !important;
  background: #159461 !important;
  color: #fff !important;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  box-shadow: 0 5px 12px rgba(21, 148, 97, .16);
}
.history-tools .cspv2-history-refresh-control:hover,
.history-tools .cspv2-history-refresh:hover,
.history-tools .cspv2-score-refresh-button:hover,
.history-tools .cspv2-score-refresh-chip-v1518:hover,
.history-tools .cspv2-score-refresh-chip-v1519:hover,
.history-tools .cspv2-score-refresh-chip-v1520:hover,
.history-tools .cspv2-score-refresh-chip-v1521:hover,
.history-tools .cspv2-score-refresh-chip-v1522:hover,
.history-tools .cspv2-score-refresh-chip-v1523:hover,
.history-tools .cspv2-score-refresh-chip-v1524:hover,
.history-tools .cspv2-refresh-marker-v1526:hover,
.history-tools .cspv2-refresh-marker-v1527:hover,
.cspv2-refresh-marker-v1528:hover {
  background: #0f8053 !important;
  color: #fff !important;
}
.history-tools .hidden,
.cspv2-history-right-tools .hidden {
  display: none !important;
}
.cspv2-history-actions.hidden {
  display: inline-flex !important;
  visibility: hidden;
  pointer-events: none;
}
.history-tools .cspv2-history-delete,
.cspv2-history-delete {
  flex: 0 0 auto;
  justify-self: auto !important;
  height: 32px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.history-tools [data-history-market] {
  background: var(--panel-2);
  color: var(--text);
}
.history-tools [data-history-market].active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cspv2-history-status-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.cspv2-history-status-main {
  color: var(--muted);
}
.cspv2-mypage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cspv2-mypage-tile {
  position: relative;
  display: grid;
  min-height: 122px;
  align-content: center;
  gap: 9px;
  padding: 23px 24px 23px 78px;
  overflow: hidden;
  border: 1px solid #dbe3f2;
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: 0 7px 20px rgba(16, 57, 47, .055);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.cspv2-mypage-tile::before {
  position: absolute;
  top: 50%;
  left: 22px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 13px;
  background: #eef2fb;
  color: #071a4a;
  content: "✓";
  font-size: 19px;
  font-weight: 900;
}
.cspv2-mypage-tile:nth-child(2n)::before {
  background: #edf2fb;
  color: #315f9c;
}
.cspv2-mypage-tile:hover {
  transform: translateY(-2px);
  border-color: #7e8fb9;
  background: #f8faff;
  box-shadow: 0 14px 30px rgba(7, 68, 54, .11);
}
.cspv2-mypage-tile b { color: var(--text); font-size: 18px; line-height: 1.35; }
.cspv2-mypage-tile span { color: var(--muted); font-size: 14px; line-height: 1.55; }
.cspv2-mypage-back { margin-right: auto; }

.cspv2[data-theme="dark"] .cspv2-mypage-tile {
  border-color: #344137;
  background: #1f2822;
  box-shadow: none;
}
.cspv2[data-theme="dark"] .cspv2-mypage-tile:hover {
  border-color: var(--accent);
  background: #243028;
}

@media (max-width: 680px) {
  .cspv2-mypage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .cspv2-mypage-tile {
    min-height: 58px;
    padding: 10px 8px;
    border-radius: 12px;
    gap: 2px;
    text-align: center;
  }
  .cspv2-mypage-tile::before {
    display: none;
  }
  .cspv2-mypage-tile b {
    font-size: clamp(15px, 4.2vw, 17px);
    line-height: 1.2;
  }
  .cspv2-mypage-tile span {
    font-size: 11px;
    line-height: 1.25;
  }
}

.cspv2-mypage-redesign {
  --mypage-soft: #f6f7f9;
  --mypage-soft-2: #f1f3f6;
  --mypage-line: #e8eaed;
  --mypage-line-strong: #d7dade;
  --mypage-text: #1a1d21;
  --mypage-muted: #5b6470;
  --mypage-faint: #9aa1ab;
  --mypage-blue: #2f6df0;
  --mypage-blue-bg: #eaf1ff;
  --mypage-green: #15875a;
  --mypage-green-bg: #e6f5ee;
  --mypage-red: #d23b3b;
  --mypage-red-bg: #fdeced;
  --mypage-warn: #b06a00;
  --mypage-warn-bg: #fff4e0;
}

.cspv2-mypage-redesign .cspv2-mypage-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--mypage-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}

.cspv2-mypage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.cspv2-mypage-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cspv2-mypage-logo {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--mypage-blue-bg);
}

.cspv2-mypage-logo svg {
  width: 24px;
  height: 24px;
  stroke: var(--mypage-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cspv2-mypage-head h1 {
  margin: 0;
  color: #000;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
}

.cspv2-mypage-head p {
  margin: 3px 0 0;
  color: var(--mypage-muted);
  font-size: 13px;
}

.cspv2-mypage-private {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--mypage-line);
  border-radius: 999px;
  color: var(--mypage-muted);
  font-size: 12px;
  white-space: nowrap;
}

.cspv2-mypage-notice {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid var(--mypage-line);
  border-radius: 10px;
  background: var(--mypage-soft);
  color: var(--mypage-muted);
  font-size: 12px;
  line-height: 1.6;
}

.cspv2-mypage-notice p { margin: 0; }

.cspv2-mypage-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.cspv2-mypage-metrics > div {
  min-height: 85px;
  padding: 15px 16px;
  border-radius: 10px;
  background: var(--mypage-soft);
}

.cspv2-mypage-metrics > div.warn { background: var(--mypage-warn-bg); }
.cspv2-mypage-metrics span { color: var(--mypage-muted); font-size: 12px; }
.cspv2-mypage-metrics .warn span { color: var(--mypage-warn); }

.cspv2-mypage-metrics b {
  display: block;
  margin-top: 6px;
  color: #000;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
}

.cspv2-mypage-metrics b.good { color: var(--mypage-green); }
.cspv2-mypage-metrics .warn b { color: var(--mypage-warn); }
.cspv2-mypage-metrics small { color: var(--mypage-faint); font-size: 13px; font-weight: 500; }

.cspv2-history-performance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.cspv2-history-performance > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--mypage-line);
  border-radius: 10px;
  background: #fff;
}

.cspv2-history-performance span,
.cspv2-history-performance small {
  display: block;
  color: var(--mypage-muted);
  font-size: 12px;
  line-height: 1.35;
}

.cspv2-history-performance b {
  display: block;
  overflow-wrap: anywhere;
  margin: 4px 0;
  color: var(--mypage-text);
  font-size: 15px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .cspv2-history-performance {
    grid-template-columns: 1fr;
  }
}

.cspv2-history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 8px;
  border: 1px solid var(--mypage-line);
  border-radius: 12px;
  background: var(--mypage-soft);
}

.cspv2-history-tabs [data-history-market] {
  position: relative;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--mypage-line);
  border-radius: 10px;
  background: #fff;
  color: var(--mypage-muted);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(25, 29, 35, 0.04);
}

.cspv2-history-tabs [data-history-market].active {
  border-color: var(--mypage-blue);
  color: #fff;
  background: var(--mypage-blue);
  box-shadow: 0 8px 18px rgba(47, 109, 240, 0.22);
}

.cspv2-history-tabs [data-history-market].active::after {
  content: none;
}

.cspv2-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cspv2-history-toolbar .status {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mypage-muted);
  font-size: 13px;
}

.cspv2-loading-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cspv2-loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(47, 109, 240, .18);
  border-top-color: var(--mypage-blue);
  border-radius: 999px;
  animation: cspv2-spin .72s linear infinite;
}

.cspv2 .status.is-loading {
  color: var(--mypage-muted);
}

.cspv2-loading-block,
.cspv2-loading-line,
.cspv2-loading-pill,
.cspv2-loading-check,
.cspv2-managed-stock-loading i,
.cspv2-managed-stock-loading small,
.cspv2-my-posts-loading span,
.cspv2-my-posts-loading strong,
.cspv2-my-posts-loading em {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #edf0f4 0%, #f7f8fa 45%, #edf0f4 100%);
  background-size: 220% 100%;
  animation: cspv2-loading-sweep 1.05s ease-in-out infinite;
}

.cspv2-history-row-loading {
  pointer-events: none;
}

.cspv2-loading-check {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

.cspv2-loading-block {
  display: block;
  width: 100%;
  height: 38px;
  border-radius: 8px;
}

.cspv2-loading-block.wide { height: 46px; }
.cspv2-loading-block.short { width: 76%; height: 30px; justify-self: end; }
.cspv2-loading-pill {
  justify-self: end;
  width: 84px;
  height: 30px;
  border-radius: 999px;
}

.cspv2-loading-row td {
  padding: 15px 12px !important;
}

.cspv2-loading-line {
  display: block;
  width: 100%;
  height: 18px;
  border-radius: 999px;
}

@keyframes cspv2-spin {
  to { transform: rotate(360deg); }
}

@keyframes cspv2-loading-sweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.cspv2[data-theme="dark"] .cspv2-loading-block,
.cspv2[data-theme="dark"] .cspv2-loading-line,
.cspv2[data-theme="dark"] .cspv2-loading-pill,
.cspv2[data-theme="dark"] .cspv2-loading-check,
.cspv2[data-theme="dark"] .cspv2-managed-stock-loading i,
.cspv2[data-theme="dark"] .cspv2-managed-stock-loading small,
.cspv2[data-theme="dark"] .cspv2-my-posts-loading span,
.cspv2[data-theme="dark"] .cspv2-my-posts-loading strong,
.cspv2[data-theme="dark"] .cspv2-my-posts-loading em {
  background: linear-gradient(90deg, #27312d 0%, #36423d 45%, #27312d 100%);
  background-size: 220% 100%;
}

.cspv2-history-toolbar [data-history-actions] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cspv2-history-toolbar [data-history-actions].hidden { display: none !important; }

.cspv2-history-refresh,
.cspv2-history-delete {
  min-height: 36px !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.cspv2-history-refresh {
  border-color: var(--mypage-line-strong) !important;
  background: #fff !important;
  color: var(--mypage-text) !important;
}

.cspv2-history-refresh::before {
  content: "↻";
  font-size: 17px;
  line-height: 1;
}

.cspv2-history-delete {
  border-color: #f0c4c4 !important;
  background: #fff !important;
  color: var(--mypage-red) !important;
}

.cspv2-history-delete::before {
  content: "⌫";
  font-size: 15px;
  line-height: 1;
}

.cspv2-history-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cspv2-history-row {
  display: grid;
  grid-template-columns: 18px 1.25fr 1.55fr 1fr 104px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--mypage-line);
  border-radius: 12px;
  background: #fff;
  color: var(--mypage-text);
  transition: border-color .15s ease, background .15s ease;
}

.cspv2-history-row:hover {
  border-color: var(--mypage-line-strong);
  background: var(--mypage-soft);
}

.cspv2-history-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--mypage-blue);
}

.cspv2-history-stock b {
  display: block;
  color: #000;
  font-size: 14.5px;
  font-weight: 800;
}

.cspv2-history-stock span,
.cspv2-history-stock small {
  display: block;
  color: var(--mypage-faint);
  font-size: 11px;
  line-height: 1.45;
}

.cspv2-history-pred { color: var(--mypage-muted); font-size: 13px; }
.cspv2-history-pred b { color: #000; font-weight: 800; }
.cspv2-history-pred small { display: block; margin-top: 3px; font-size: 12px; }
.cspv2-history-pred em { color: var(--mypage-faint); font-style: normal; }
.cspv2-history-pred .cspv2-history-extra {
  margin-top: 5px;
  color: var(--mypage-muted);
  line-height: 1.45;
  word-break: keep-all;
}

.cspv2-history-actual { text-align: right; }
.cspv2-history-actual b { display: block; color: #000; font-size: 14px; font-weight: 800; }
.cspv2-history-actual span { display: block; margin-top: 2px; font-size: 12px; }
.cspv2-history-actual.muted { color: var(--mypage-faint); font-size: 13px; }

.cspv2-history-badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cspv2-history-badge.wait { background: var(--mypage-soft-2); color: var(--mypage-muted); }
.cspv2-history-badge.hit { background: var(--mypage-green-bg); color: var(--mypage-green); }
.cspv2-history-badge.miss { background: var(--mypage-red-bg); color: var(--mypage-red); }
.cspv2-history-badge::before { content: "⊙"; font-size: 13px; line-height: 1; }

.cspv2-history-badge-wrap {
  position: relative;
  justify-self: end;
  display: inline-flex;
  align-items: center;
}

.cspv2 button.cspv2-history-badge-info {
  min-height: 0;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--mypage-soft-2);
  color: var(--mypage-muted);
  cursor: help;
  font-family: inherit;
  line-height: 1.2;
}

.cspv2 button.cspv2-history-badge-info:hover,
.cspv2 button.cspv2-history-badge-info:focus {
  background: var(--mypage-soft-2);
  color: var(--mypage-muted);
}

.cspv2 button.cspv2-history-badge-info:focus-visible {
  outline: 2px solid rgba(58, 109, 240, .45);
  outline-offset: 2px;
}

.cspv2-history-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 20;
  width: min(268px, calc(100vw - 44px));
  padding: 10px 12px;
  border: 1px solid var(--mypage-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mypage-text);
  box-shadow: 0 12px 28px rgba(17, 24, 39, .16);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  white-space: normal;
  word-break: keep-all;
}

.cspv2-history-popover::after {
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--mypage-line);
  border-bottom: 1px solid var(--mypage-line);
  background: inherit;
  content: "";
  transform: rotate(45deg);
}

.cspv2-history-badge-wrap:hover .cspv2-history-popover,
.cspv2-history-badge-wrap:focus-within .cspv2-history-popover,
.cspv2-history-badge-wrap.open .cspv2-history-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cspv2[data-theme="dark"] .cspv2-history-popover {
  border-color: #344137;
  background: #1f2822;
  color: #e8f0ea;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .34);
}

.cspv2-history-empty {
  padding: 32px 16px;
  border: 1px dashed var(--mypage-line-strong);
  border-radius: 12px;
  color: var(--mypage-muted);
  text-align: center;
}

.cspv2-mypage-redesign .history-pagination { margin-top: 22px; }
.cspv2-mypage-redesign .history-pagination button {
  min-width: 32px;
  min-height: 32px;
  padding: 6px 10px;
  border-color: var(--mypage-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mypage-muted);
  font-size: 13px;
}
.cspv2-mypage-redesign .history-pagination button.active {
  border-color: var(--mypage-blue);
  background: var(--mypage-blue);
  color: #fff;
}
.cspv2-mypage-redesign .up { color: #e5363b; }
.cspv2-mypage-redesign .down { color: var(--mypage-blue); }

@media (max-width: 760px) {
  .cspv2-mypage-redesign .cspv2-mypage-shell { padding: 20px 16px; }
  .cspv2-mypage-head { align-items: flex-start; }
  .cspv2-mypage-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cspv2-history-row { grid-template-columns: 18px 1fr 90px; row-gap: 8px; }
  .cspv2-history-pred,
  .cspv2-history-actual { grid-column: 2 / -1; text-align: left; }
  .cspv2-history-badge,
  .cspv2-history-badge-wrap { grid-column: 3; grid-row: 1; }
  .cspv2-history-popover {
    right: 0;
    width: min(256px, calc(100vw - 38px));
  }
}

.cspv2-list-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cspv2-list-management-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.cspv2-list-management-card .section-head { margin: 0 0 12px; }
.cspv2-managed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cspv2-managed-stock {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.cspv2-managed-stock b { font-size: 13px; }
.cspv2-managed-stock-loading {
  min-width: 96px;
  border-color: var(--mypage-line);
  background: #fff;
}
.cspv2-managed-stock-loading i,
.cspv2-managed-stock-loading small {
  display: block;
  height: 13px;
  border-radius: 999px;
}
.cspv2-managed-stock-loading small { width: 70%; }
.cspv2-managed-stock small,
.lotto-result-repeated { color: var(--muted); font-size: 12px; }
.history-check {
  width: 42px;
  text-align: center !important;
}
.history-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent);
}
[data-stock-history] .table-wrap table,
[data-lotto-history] .lotto-history-table,
[data-compatibility-history] .compatibility-history-table {
  width: max-content;
  min-width: 100% !important;
  table-layout: auto;
}
[data-stock-history] th,
[data-stock-history] td,
[data-lotto-history] th,
[data-lotto-history] td,
[data-compatibility-history] th,
[data-compatibility-history] td {
  text-align: center !important;
  white-space: nowrap;
}
[data-stock-history] td:nth-child(3),
[data-lotto-history] td:nth-child(4),
[data-lotto-history] td:nth-child(5),
[data-compatibility-history] td:nth-child(3) {
  white-space: normal;
}
.history-score-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 8px;
  color: #fff !important;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.history-score-badge.score-good {
  background: #d33b32;
}
.history-score-badge.score-bad {
  background: #1769c2;
}
.history-score-badge.score-pending {
  background: #64748b;
}
.history-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.history-pagination button {
  min-width: 40px;
  min-height: 36px;
  padding: 6px 10px;
}
.history-pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.lotto-notice {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--panel) 82%, #fff4c4);
  color: var(--text);
}

.lotto-generate-tools {
  display: grid;
  grid-template-columns: minmax(150px, 210px) auto auto auto;
  gap: 10px;
  align-items: end;
}

.lotto-summary {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
}
.lotto-summary span { color: var(--muted); font-size: 13px; }

.lotto-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.lotto-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.lotto-set-card {
  display: grid !important;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px !important;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}
.lotto-set-card:hover { border-color: var(--accent); }
.lotto-set-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--panel) 90%, var(--accent));
}
.lotto-set-card input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent);
}
.lotto-set-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.lotto-set-card .lotto-balls { grid-column: 1 / -1; }
.lotto-set-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.lotto-set-meta b { color: var(--accent); }
.lotto-set-meta small { text-align: right; }
.lotto-set-basis {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.lotto-set-basis span {
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lotto-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.lotto-ball {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #152016;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.lotto-balls.small .lotto-ball { width: 29px; height: 29px; font-size: 12px; }
.lotto-yellow { background: #f6c64c; }
.lotto-blue { background: #69b7e5; }
.lotto-red { background: #ed7272; }
.lotto-gray { background: #aeb5b8; }
.lotto-green { background: #83c66b; }
.lotto-ball.bonus { outline: 3px solid var(--accent); }
.lotto-plus { color: var(--muted); font-weight: 900; }

.lotto-factor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lotto-factor-grid > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.lotto-factor-grid b, .lotto-factor-grid span, .lotto-factor-grid small { display: block; }
.lotto-factor-grid b { margin-bottom: 3px; color: var(--text); font-size: 14px; }
.lotto-factor-grid span { min-width: 0; }
.lotto-factor-grid small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.lotto-factor-icon {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
}
.lotto-factor-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lotto-insight-card { padding-bottom: 16px; }
.lotto-section-head { margin-bottom: 10px; }
.lotto-section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.lotto-official-stats {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.lotto-static-loading {
  margin-top: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.lotto-static-loading.error { color: #b33a3a; }
.lotto-official-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.lotto-official-head h3 { margin: 0; }
.lotto-official-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.lotto-official-head a {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.lotto-official-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.lotto-official-primary > div,
.lotto-official-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}
.lotto-official-primary > div {
  padding: 13px 15px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel-2));
}
.lotto-official-primary span,
.lotto-official-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.lotto-official-primary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.2;
}
.lotto-official-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lotto-official-grid > div { padding: 10px 12px; }
.lotto-official-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.lotto-official-update {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.lotto-official-update span:not(:empty)::before { content: " · 최근 동기화 "; }
.lotto-history-table { min-width: 850px !important; }

.compatibility-notice { border-left-color: #9b5de5; }
.compatibility-form { display: grid; gap: 14px; }
.compatibility-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compatibility-person { margin: 0; }
.compatibility-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent) !important;
  font-size: 11px !important;
  font-weight: 900;
  letter-spacing: .12em;
}
.compatibility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.compatibility-grid.common { max-width: 720px; }
.compatibility-criteria-grid.single { grid-template-columns: 1fr; }
.compatibility-summary-scores:has(> :only-child) { grid-template-columns: 1fr; }
.compatibility-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.compatibility-grid input, .compatibility-grid select { width: 100%; }
.compatibility-person [data-zodiac-preview] {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent) !important;
  font-size: 18px !important;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}
.compatibility-calendar-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.compatibility-calendar-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.compatibility-calendar-toggle label {
  display: block;
  min-width: 0;
}
.compatibility-calendar-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.compatibility-calendar-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.compatibility-calendar-toggle input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.compatibility-calendar-toggle input:focus-visible + span {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.compatibility-grid label > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.compatibility-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.compatibility-consent input {
  width: 19px;
  height: 19px;
  min-height: 0;
  margin-top: 1px;
  flex: 0 0 19px;
  accent-color: var(--accent);
}
.compatibility-actions { margin-top: 14px; }
.compatibility-result { scroll-margin-top: 24px; }
.compatibility-result-card { overflow: hidden; border-color: var(--accent); }
.compatibility-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.compatibility-result-head h2 { margin-bottom: 3px; }
.compatibility-result-head p { margin: 0; color: var(--muted); }
.compatibility-total {
  display: none;
  align-items: baseline;
  white-space: nowrap;
  color: var(--accent);
}
.compatibility-total strong { font-size: 54px; line-height: 1; }
.compatibility-total span { color: var(--muted); font-weight: 800; }
.compatibility-summary-scores {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.compatibility-summary-scores > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.compatibility-summary-scores span { color: var(--muted); font-size: 13px; font-weight: 800; }
.compatibility-summary-scores b { color: var(--accent); font-size: 24px; }
.compatibility-summary-scores small { color: var(--muted); font-size: 12px; }
.compatibility-charts, .compatibility-analysis, .compatibility-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.compatibility-charts > div, .compatibility-analysis > div, .compatibility-insights > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.compatibility-charts h3, .compatibility-analysis h3, .compatibility-insights h3 { margin-bottom: 10px; }
.compatibility-charts h3 small { color: var(--accent); }
.compatibility-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.compatibility-pillars > div {
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  text-align: center;
}
.compatibility-pillars span, .compatibility-pillars b, .compatibility-pillars small { display: block; }
.compatibility-pillars span, .compatibility-pillars small { color: var(--muted); font-size: 11px; }
.compatibility-pillars b { margin: 3px 0; color: var(--text); font-size: 19px; }
.compatibility-score-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.compatibility-score-row b { color: var(--text); }
.compatibility-score-row i {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}
.compatibility-score-row i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #9b5de5);
}
.compatibility-reading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 18px !important;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line)) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 88%, #fff7d6), var(--panel)) !important;
}
.compatibility-reading h3 {
  margin: 2px 0 12px !important;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}
.compatibility-reading-body {
  display: grid;
  gap: 10px;
  color: #2b3446;
  font-size: 15px;
  line-height: 1.72;
  word-break: keep-all;
}
.compatibility-reading-body p {
  margin: 0;
}
.compatibility-reading-body p:first-child::first-letter {
  color: var(--accent);
  font-size: 26px;
  font-weight: 950;
}
.compatibility-score-visual {
  display: grid;
  grid-template-columns: minmax(138px, 180px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 14px 18px;
  min-height: 100%;
  padding: 18px !important;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line)) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--panel)), var(--panel)) !important;
}
.compatibility-total-gauge {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 57%, transparent 58%),
    conic-gradient(var(--accent) var(--compatibility-score), #e8edf6 0);
  box-shadow: inset 0 0 0 1px var(--line), 0 16px 34px rgba(15, 23, 42, .08);
}
.compatibility-total-gauge > div {
  display: grid;
  place-items: center;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
}
.compatibility-total-gauge strong {
  color: var(--accent);
  font-size: 46px;
  line-height: .9;
}
.compatibility-total-gauge span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.compatibility-score-meta h3 {
  margin: 2px 0 6px !important;
  color: var(--text);
  font-size: 21px;
}
.compatibility-score-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.compatibility-score-meters {
  display: grid;
  align-self: end;
  gap: 10px;
}
.compatibility-score-meter > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.compatibility-score-meter b {
  color: var(--text);
  white-space: nowrap;
}
.compatibility-score-meter i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf6;
}
.compatibility-score-meter i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #102552, #9b5de5);
}
.compatibility-insights ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}
.compatibility-insights .good { border-left: 4px solid var(--good); }
.compatibility-insights .care { border-left: 4px solid var(--warm); }
.compatibility-advice {
  margin-top: 14px;
  padding: 14px;
  border-radius: 9px;
  background: var(--panel-2);
}
.compatibility-advice p { margin: 5px 0 0; color: var(--muted); line-height: 1.65; }
.compatibility-save-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.compatibility-save-box label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.compatibility-save-box input {
  width: 19px;
  height: 19px;
  min-height: 0;
  flex: 0 0 19px;
  accent-color: var(--accent);
}
.compatibility-save-box .status {
  grid-column: 1 / -1;
  margin: 0;
}
.compatibility-criteria { margin-top: 14px; }
.compatibility-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.compatibility-criteria-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.compatibility-criteria-grid h4 { margin: 0 0 10px; }
.compatibility-criteria-grid ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.compatibility-criteria-grid li + li { margin-top: 5px; }
.compatibility-criteria-grid b { color: var(--text); }
.compatibility-method-note {
  margin-top: 12px;
  padding: 13px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
}
.compatibility-method-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.compatibility-method-note p + p { margin-top: 7px; }
.compatibility-method-note b { color: var(--text); }
.compatibility-history-table { min-width: 800px !important; }
.compatibility-history-score { color: var(--accent); font-size: 18px; }
.compatibility-history-score.history-score-badge {
  color: #fff !important;
  font-size: 12px;
}

[data-compatibility-history-detail] {
  margin-top: 20px;
}

.cspv2-my-posts-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cspv2-my-posts-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--mypage-line);
  border-radius: 14px;
  background: #fff;
}

.cspv2-my-posts-head {
  align-items: flex-start;
}

.cspv2-my-posts-more {
  flex: 0 0 auto;
}

.cspv2-my-posts-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cspv2-my-posts-item {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--mypage-line);
  border-radius: 12px;
  background: var(--mypage-soft);
  color: var(--mypage-text) !important;
  text-decoration: none !important;
}

.cspv2-my-posts-item:hover {
  border-color: var(--mypage-blue);
  background: var(--mypage-blue-bg);
}

.cspv2-my-posts-loading {
  pointer-events: none;
}

.cspv2-my-posts-loading span,
.cspv2-my-posts-loading strong,
.cspv2-my-posts-loading em {
  display: block;
  border-radius: 999px;
}

.cspv2-my-posts-loading span { width: 58%; height: 13px; }
.cspv2-my-posts-loading strong { width: 86%; height: 17px; }
.cspv2-my-posts-loading em { width: 72%; height: 13px; }

.cspv2-my-posts-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--mypage-muted);
  font-size: 12px;
}

.cspv2-my-posts-meta b {
  color: var(--mypage-blue);
  font-weight: 800;
}

.cspv2-my-posts-meta em {
  color: var(--mypage-faint);
  font-style: normal;
}

.cspv2-my-posts-item strong {
  color: var(--mypage-text);
  font-size: 15px;
}

.cspv2-my-posts-item span:not(.cspv2-my-posts-meta),
.cspv2-my-posts-item small,
.cspv2-my-posts-empty {
  color: var(--mypage-muted);
  font-size: 13px;
  line-height: 1.55;
}

.cspv2-my-posts-empty {
  padding: 18px;
  border: 1px dashed var(--mypage-line-strong);
  border-radius: 12px;
  background: var(--mypage-soft);
}

.cspv2-my-posts-more-bottom {
  width: 100%;
  margin-top: 14px;
}

.cspv2-my-posts-layer {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.cspv2-my-posts-layer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 26, 74, .54);
}

.cspv2-my-posts-layer-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid var(--mypage-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 26, 74, .26);
}

.cspv2-my-posts-layer-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 56px 16px 20px;
  border-bottom: 1px solid var(--mypage-line);
}

.cspv2-my-posts-layer-head h3 {
  margin: 0 0 5px;
  color: var(--mypage-text);
  font-size: 20px;
}

.cspv2-my-posts-layer-head span {
  color: var(--mypage-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cspv2 button.cspv2-my-posts-layer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #071a4a;
  color: #fff;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.cspv2 button.cspv2-my-posts-layer-close::before,
.cspv2 button.cspv2-my-posts-layer-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.cspv2 button.cspv2-my-posts-layer-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.cspv2 button.cspv2-my-posts-layer-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.cspv2-my-posts-layer-list {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 16px 20px;
  overflow: auto;
}

.cspv2-my-posts-layer-pagination {
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 20px 18px;
}

.cspv2 button.compact { min-height: 32px; padding: 4px 9px; font-size: 12px; }

.cspv2-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.cspv2-modal-card {
  width: min(720px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cspv2-dialog {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.cspv2-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 26, 74, .48);
}
.cspv2-dialog-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 35, 56, .24);
}
.cspv2-dialog-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}
.cspv2-dialog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.cspv2-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-head h2 { margin: 0; }
.modal-head .icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: var(--panel-2);
  color: var(--text);
}

.hidden { display: none !important; }

@media (max-width: 980px) {
  .cspv2-header { grid-template-columns: 1fr auto; }
  .cspv2-menu-toggle { display: inline-grid; place-items: center; }
  .cspv2-nav {
    display: none;
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .cspv2.menu-open .cspv2-nav {
    display: grid;
  }
  .cspv2-nav { grid-template-columns: 1fr 1fr; }
  .cspv2-nav .cspv2-stock-menu {
    display: block;
    width: 100%;
  }
  .cspv2-nav .cspv2-stock-menu.is-open {
    grid-column: 1 / -1;
  }
  .cspv2-nav .cspv2-stock-menu-title {
    width: 100%;
  }
  .cspv2-nav .cspv2-stock-submenu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    transform: none;
    box-shadow: none;
  }
  .cspv2-nav .cspv2-stock-menu.is-open > .cspv2-stock-submenu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .cspv2-nav .cspv2-stock-submenu a {
    justify-content: center;
  }
  .toolbar { grid-template-columns: 1fr 150px; }
  .toolbar button[data-analyze] { grid-column: 1 / -1; }
  .scanner-controls { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lotto-generate-tools { grid-template-columns: 1fr 1fr; }
  .lotto-factor-grid, .lotto-official-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compatibility-people { grid-template-columns: 1fr; }
  .table-wrap::after {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .cspv2-list-management-grid { grid-template-columns: 1fr; }
  .cspv2 { width: min(100%, calc(100vw - 18px)); }
  .cspv2-header, .page-title, .section-head, .result-head { align-items: flex-start; }
  .page-title, .section-head, .result-head { flex-direction: column; }
  .cspv2 h1, .cspv2-app-title { font-size: 20px !important; }
  .cspv2-basis-card summary { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
  .cspv2-basis-detail { padding: 16px; }
  .cspv2-basis-action { min-height: 32px; }
  .cspv2-basis-formula { align-items: flex-start; flex-direction: column; gap: 3px; }
  .toolbar, .scanner-controls, .time-grid, .details, .metrics { grid-template-columns: 1fr; }
  .button-row > *, .modal-actions > * { flex: 1 1 100%; }
  .history-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }
  .history-tools.cspv2-history-tools-v1528 {
    display: flex !important;
    justify-content: flex-start !important;
    min-height: 0;
  }
  .history-tools.cspv2-history-tools-v1528 [data-history-market] {
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    height: 40px;
    min-height: 40px;
    padding: 0 6px;
    font-size: 14px;
  }
  .history-tools > * {
    min-width: 0;
  }
  .history-tools .cspv2-mypage-back {
    display: none !important;
  }
  .history-tools [data-history-market] {
    min-height: 44px;
    padding: 8px 6px;
    font-size: clamp(13px, 3.8vw, 15px);
    line-height: 1.2;
  }
  .cspv2-history-right-tools {
    align-items: flex-end;
    width: 100%;
    max-width: 100%;
    min-height: 72px;
    gap: 14px;
    margin: 2px 0 0;
  }
  .cspv2-history-actions {
    flex-wrap: nowrap;
    gap: 6px;
    max-width: 100%;
    margin: 0;
  }
  .history-tools .cspv2-history-button-pair-v1521,
  .history-tools .cspv2-history-button-pair-v1522 {
    gap: 6px;
  }
  .history-tools .cspv2-history-refresh-control,
  .history-tools .cspv2-history-refresh,
  .history-tools .cspv2-score-refresh-button,
  .history-tools .cspv2-score-refresh-chip-v1518,
  .history-tools .cspv2-score-refresh-chip-v1519,
  .history-tools .cspv2-score-refresh-chip-v1520,
  .history-tools .cspv2-score-refresh-chip-v1521,
  .history-tools .cspv2-score-refresh-chip-v1522,
  .history-tools .cspv2-score-refresh-chip-v1523,
  .history-tools .cspv2-score-refresh-chip-v1524,
  .history-tools .cspv2-refresh-marker-v1526,
  .history-tools .cspv2-refresh-marker-v1527,
  .cspv2-refresh-marker-v1528 {
    height: 32px !important;
    min-height: 32px !important;
    min-width: 66px !important;
    padding: 0 10px !important;
    font-size: 11px;
  }
  .history-tools .cspv2-history-delete {
    justify-self: auto !important;
    height: 32px;
    min-height: 32px;
    width: auto !important;
    padding: 0 10px;
    font-size: 11px;
  }
  [data-stock-history],
  [data-lotto-history],
  [data-compatibility-history] {
    clear: both;
  }
  .status {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 8px;
    word-break: keep-all;
    overflow-wrap: normal;
    font-size: 13px;
    line-height: 1.45;
  }
  .cspv2-history-status-wrap {
    gap: 7px;
  }
  .cspv2-history-status-main {
    width: 100%;
  }
  .table-wrap {
    margin-top: 8px;
  }
  .table-wrap::after {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .lotto-generate-tools, .lotto-results, .lotto-factor-grid, .lotto-official-primary, .lotto-official-grid { grid-template-columns: 1fr; }
  .compatibility-grid, .compatibility-summary-scores, .compatibility-charts, .compatibility-analysis, .compatibility-insights { grid-template-columns: 1fr; }
  .compatibility-criteria-grid, .compatibility-save-box { grid-template-columns: 1fr; }
  .compatibility-save-box button { width: 100%; }
  .compatibility-result-head { align-items: flex-start; flex-direction: column; }
  .compatibility-total strong { font-size: 44px; }
  .compatibility-score-visual {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .compatibility-total-gauge {
    grid-row: auto;
    max-width: 210px;
  }
  .lotto-official-head { align-items: flex-start; flex-direction: column; }
  .chart-shell { height: 280px; }
  .cspv2 table { min-width: 620px; font-size: 12px; }
  .cspv2 th, .cspv2 td { padding: 7px 5px; }
}

@media (max-width: 680px) {
  .cspv2-mypage-redesign .history-tools.cspv2-history-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 0 0 18px !important;
    padding: 7px !important;
    border: 1px solid var(--mypage-line);
    border-radius: 12px;
    background: var(--mypage-soft);
  }
  .cspv2-mypage-redesign .history-tools.cspv2-history-tabs [data-history-market] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--mypage-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--mypage-muted) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }
  .cspv2-mypage-redesign .history-tools.cspv2-history-tabs [data-history-market].active {
    border-color: var(--mypage-blue) !important;
    color: #fff !important;
    background: var(--mypage-blue) !important;
  }
  .cspv2-mypage-redesign .cspv2-history-toolbar {
    align-items: flex-start;
  }
  .cspv2-mypage-redesign .cspv2-history-toolbar [data-history-actions],
  .cspv2-mypage-redesign .cspv2-history-delete {
    margin-left: 0;
  }
  .cspv2-my-posts-grid {
    grid-template-columns: 1fr;
  }
  .cspv2-my-posts-card {
    padding: 14px;
  }
  .cspv2-my-posts-head {
    gap: 10px;
  }
  .cspv2-my-posts-head .cspv2-my-posts-more {
    align-self: stretch;
    width: 100%;
  }
  .cspv2-my-posts-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .cspv2-my-posts-layer {
    padding: 10px;
  }
  .cspv2-my-posts-layer-card {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }
  .cspv2-my-posts-layer-head {
    padding: 16px 52px 13px 16px;
  }
  .cspv2-my-posts-layer-head h3 {
    font-size: 18px;
  }
  .cspv2 button.cspv2-my-posts-layer-close {
    top: 10px;
    right: 10px;
  }
  .cspv2-my-posts-layer-list {
    padding: 12px;
  }
  .cspv2-my-posts-layer-pagination {
    gap: 6px;
    padding: 0 12px 14px;
  }
}
