﻿:root {
  --bg: #dde3d9;
  --card: #f9f8f0;
  --card-short: #ede4e4;
  --bg-box: #ffffff;
  --bg-box-border: rgba(0, 0, 0, 0.06);
  --bg-tag: rgba(255, 255, 255, 0.7);
  --bg-prz: #fde8e8;
  --border-prz: #f5b8b8;
  --prz-text: #7f1d1d;
  --prz-label: #991b1b;
  --bg-ob: #e8f5e8;
  --border-ob: #b8e8b8;
  --ob-text: #1a5c1a;
  --bg-score: #1a1a1a;
  --text: #1a1a1a;
  --text-secondary: #9ca3af;
  --text-tag: #6b7280;
  --muted: #6b7280;
  --accent: #f7d66f;
  --border: rgba(0, 0, 0, 0.08);
  --card-strong: #f8f5e9;
  --card-soft: #f2f2f0;
  --long: #1d9e75;
  --short: #d85a30;
  --warn: #d8a83e;
  --black: #1a1a1a;
  --cream: #ffffff;
  --sage: #c9d8bd;
  --lavender: #9f94f5;
  --blue: #a8c9e8;
  --pink: #eeb7cd;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 14px;
  --zone-red-bg: #fde8e8;
  --zone-red-border: #f5b8b8;
  --zone-red-text: #7f1d1d;
  --prz-active-blue: #3b82f6;
  --prz-active-blue-soft: rgba(59, 130, 246, 0.18);
  --hx-green: #1d9e75;
  --hx-red: #d85a30;
  --hx-blue: #2563eb;
  --hx-muted: #64748b;
  --status-ok-text: #1A6E4B;
  --status-ok-bg: #DCEFE6;
  --status-run-text: #1F5FA6;
  --status-run-bg: #E2EDF8;
  --status-warn-text: #9A6800;
  --status-warn-bg: #F8EFD6;
  --status-err-text: #B23A3A;
  --status-err-bg: #F8E3E3;
}

/* Pool Status */
.pool-status-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tone-ok,
.tone-running {
  color: var(--status-ok-text);
}

.tone-running {
  color: var(--status-run-text);
}

.tone-error {
  color: var(--status-err-text);
}

.tone-warning {
  color: var(--status-warn-text);
}

.tone-muted {
  color: var(--hx-muted);
}

.pool-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.pool-summary-card,
.pool-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.pool-summary-card {
  min-height: 78px;
  padding: 14px 16px;
  border-left: 3px solid transparent;
}

.pool-summary-card span {
  display: block;
  color: #8A8778;
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-transform: uppercase;
}

.pool-summary-card strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  color: #0f172a;
  font-size: 24px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pool-section {
  padding: 18px;
}

.pool-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
}

.pool-section-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.pool-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.scanner-runtime-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.pool-run-button[hidden] {
  display: none !important;
}

.pool-run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.20);
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pool-run-button.secondary {
  background: #fff;
  color: #111827;
}

.pool-run-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.pool-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.pool-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pool-table-wide {
  min-width: 1180px;
}

.pool-table-compact {
  min-width: 680px;
}

.pool-table-compact th:first-child,
.pool-table-compact td:first-child {
  min-width: 128px;
}

.pool-table-compact th:nth-child(5),
.pool-table-compact td:nth-child(5) {
  min-width: 118px;
  text-align: right;
}

.pool-table-compact th:nth-child(6),
.pool-table-compact td:nth-child(6) {
  min-width: 104px;
}

.pool-reason {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pool-schedule-table {
  min-width: 640px;
}

.pool-table th {
  padding: 11px 12px;
  background: var(--card-strong);
  color: var(--muted);
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.pool-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}

.pool-table-compact th:nth-child(3),
.pool-table-compact td:nth-child(3),
.pool-table-compact th:nth-child(4),
.pool-table-compact td:nth-child(4) {
  text-align: right;
}

.pool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 22px;
  min-width: 74px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill {
  min-width: 82px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border-color: var(--status-ok-text);
}

.status-run {
  background: var(--status-run-bg);
  color: var(--status-run-text);
  border-color: var(--status-run-text);
}

.status-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-text);
}

.status-err {
  background: var(--status-err-bg);
  color: var(--status-err-text);
  border-color: var(--status-err-text);
}

.pool-delta {
  display: inline-flex;
  margin-left: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pool-delta.up {
  color: #166534;
}

.pool-delta.down {
  color: #991b1b;
}

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

.pool-rule-group {
  min-height: 104px;
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #f8fafc;
}

.pool-rule-group strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.pool-rule-group ul {
  margin: 0;
  padding-left: 16px;
}

.pool-rule-group li {
  margin: 5px 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.pool-settings-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
}

.pool-setting-field {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.pool-setting-field.full,
.pool-settings-actions {
  grid-column: 1 / -1;
}

.pool-setting-field input,
.pool-setting-field textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  padding: 7px 9px;
  color: #0f172a;
  background: #fff;
  font-size: 12px;
}

.pool-setting-readonly {
  min-height: 68px;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}

.pool-setting-readonly strong {
  color: #0f172a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pool-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pool-settings-result {
  margin-top: 10px;
}

.pool-settings-message,
.pool-settings-diff,
.pool-settings-counts,
.pool-settings-samples {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.pool-settings-message.error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.pool-settings-diff div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pool-core,
.state-ok,
.state-idle,
.stage-ok,
.result-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
}

.pool-watch,
.state-cooldown,
.stage-running,
.state-running,
.state-scanning {
  background: var(--status-run-bg);
  color: var(--status-run-text);
}

.pool-whale {
  background: #ede9fe;
  color: #5b21b6;
}

.tag-whale,
.pool-whale-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  border-color: rgba(91, 33, 182, 0.25);
  background: #f5f3ff;
  color: #5b21b6;
}

.pool-excluded,
.stage-skipped,
.result-skipped {
  background: #f1f5f9;
  color: #64748b;
}

.state-error,
.stage-error,
.result-error {
  background: var(--status-err-bg);
  color: var(--status-err-text);
}

.stage-pending,
.state-unknown,
.stage-unknown,
.result-unknown,
.result-no_pattern,
.result-no_patterns {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.pool-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.pool-settings-schedule h3 {
  margin: 0 0 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.harmonic-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.harmonic-policy-grid article {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
}

.harmonic-policy-grid strong,
.harmonic-policy-grid span {
  display: block;
}

.harmonic-policy-grid strong {
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.harmonic-policy-grid span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.pool-runtime-health {
  width: 100%;
}

.pool-health-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid currentColor;
  border-radius: var(--radius-sm);
  background: var(--card-strong);
}

.pool-health-bar.tone-ok {
  background: var(--status-ok-bg);
}

.pool-health-bar.tone-running {
  background: var(--status-run-bg);
}

.pool-health-bar.tone-warning {
  background: var(--status-warn-bg);
}

.pool-health-bar.tone-error {
  background: var(--status-err-bg);
}

.pool-health-bar div {
  min-width: 0;
}

.pool-health-bar span {
  display: block;
  color: #8A8778;
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-transform: uppercase;
}

.pool-health-bar strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pool-critical-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--hx-red);
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
}

.pool-critical-alert strong {
  font-size: 13px;
  font-weight: 700;
}

.pool-critical-alert span {
  flex: 1 1 auto;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 700;
}

.pool-critical-alert button {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #991b1b;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.pool-schedule-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-strong);
}

.pool-schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pool-schedule-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-schedule-row .pool-badge {
  justify-self: start;
  max-width: 100%;
}

.pool-schedule-row:first-child {
  border-top: 0;
}

.pool-setting-field small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.pool-schedule-row strong {
  color: #0f172a;
  font-size: 12px;
}

.pool-schedule-row .status-pill.status-ok {
  color: var(--status-ok-text);
}

.pool-schedule-row .status-pill.status-run {
  color: var(--status-run-text);
}

.pool-schedule-row .status-pill.status-warn {
  color: var(--status-warn-text);
}

.pool-schedule-row .status-pill.status-err {
  color: var(--status-err-text);
}

.pool-schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: #8A8778;
  font-size: 11px;
  font-weight: 700;
}

.pool-schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pool-schedule-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.pool-schedule-legend .status-ok {
  background: transparent;
  color: var(--status-ok-text);
}

.pool-schedule-legend .status-run {
  background: transparent;
  color: var(--status-run-text);
}

.pool-schedule-legend .status-warn {
  background: transparent;
  color: var(--status-warn-text);
}

.pool-schedule-legend .status-err {
  background: transparent;
  color: var(--status-err-text);
}

.pool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-list-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1fr);
  gap: 4px 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
}

.pool-list-row strong {
  color: #0f172a;
  font-size: 13px;
}

.pool-list-row span,
.pool-list-row em,
.pool-list-row time {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.pool-list-row time {
  text-align: right;
}

.pool-list-row.error {
  border-color: #fecaca;
  background: #fff7f7;
}

.pool-list-row.error.history {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.pool-list-row.error.history strong {
  color: #64748b;
}

.pool-list-row.decision.core {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.pool-list-row.decision.watch {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.pool-list-row.decision.excluded {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.pool-change-groups details,
.pool-details {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
  color: var(--muted);
  font-size: 12px;
}

.pool-change-groups summary,
.pool-details summary {
  color: #0f172a;
  font-weight: 700;
}

.pool-change-groups {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pool-change-groups p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.pool-details {
  margin-top: 10px;
}

.pool-empty {
  padding: 18px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 760px) {
  .pool-section-head,
  .pool-two-column {
    display: block;
  }

  .pool-filter-chips {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .pool-rules-grid {
    grid-template-columns: 1fr;
  }

  .pool-settings-panel,
  .harmonic-policy-grid {
    grid-template-columns: 1fr;
  }

  .pool-health-bar,
  .pool-schedule-row {
    grid-template-columns: 1fr;
  }

  .scanner-runtime-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .pool-table-compact {
    min-width: 420px;
  }

  .pool-table-compact th:nth-child(3),
  .pool-table-compact td:nth-child(3),
  .pool-table-compact th:nth-child(4),
  .pool-table-compact td:nth-child(4),
  .pool-table-compact th:nth-child(6),
  .pool-table-compact td:nth-child(6) {
    display: none;
  }

  .pool-table-compact th,
  .pool-table-compact td {
    padding-inline: 7px;
  }

  .pool-two-column .pool-section + .pool-section {
    margin-top: 16px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  /* Pretendard Variable */
  font-family:
    "Pretendard Variable",
    Pretendard,
    -system-ui,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 32px;
}

.topbar,
.tab-menu,
.tab-panel,
.summary-grid,
.content-grid,
.filter-bar {
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 56px;
  margin: 0 0 12px;
  padding: 8px 0;
  background: rgba(221, 227, 217, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.title-block {
  min-width: 0;
  flex: 1;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  width: 100%;
}

h1 {
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  color: #101828;
  letter-spacing: 0;
}

.muted,
small {
  color: var(--muted);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
  min-height: 32px;
  color: var(--muted);
  font-size: 11px;
}

.connection-note:empty {
  display: none;
}

.next-scan-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 150ms ease;
}

.next-scan-link:hover,
.next-scan-link:focus-visible {
  background: rgba(15, 23, 42, 0.06);
  outline: none;
}

.top-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  margin-left: 0;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1f2937;
  line-height: 1;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.top-action-button:hover,
.top-action-button.active {
  transform: none;
  height: 32px;
  padding: 0 12px;
  border-width: 1px;
  border-color: rgba(26, 26, 26, 0.28);
  background: #1a1a1a;
  color: #fff;
}

.pill,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.pill {
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--text);
  font-size: 11px;
}

.pill.live {
  border-color: rgba(247, 214, 111, 0.32);
  background: #fff7dc;
  color: #6e5a1b;
}

.pill.offline {
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.12);
  color: var(--short);
}

.tab-menu {
  display: flex;
  gap: 8px;
  padding: 0;
  margin-top: 0;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  flex-wrap: wrap;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.tab-button:hover {
  background: rgba(0, 0, 0, 0.04);
}

.tab-button.active {
  background: #1a1a1a;
  color: #ffffff;
}

.tab-panel {
  display: none;
  padding: 0;
}

.tab-panel.active {
  display: block;
}

.summary-tile,
.candidate-card,
.filter-bar,
.empty-state,
.calculator-card,
.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.nebula-stack {
  display: grid;
  gap: 0;
}

.nebula-section {
  margin-bottom: 32px;
}

.nebula-section:last-child {
  margin-bottom: 0;
}

.nebula-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-top: 0;
}

.nebula-section-head h2 {
  color: #101828;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.nebula-more {
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.nebula-empty {
  padding: 18px 12px;
  border: 0.5px dashed rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: transparent;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.tile-label,
.field span,
.result-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nebula-mini-list {
  display: grid;
  gap: 5px;
}

.nebula-mini-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 16px;
  background: var(--card);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.nebula-mini-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.12);
}

.nebula-mini-card.dir-short {
  background: var(--card-short);
}

.mini-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-line .mini-symbol {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.mini-line .mini-meta-text {
  flex: 0 0 auto;
  color: var(--text-tag);
  font-size: 11px;
  font-weight: 600;
}

.mini-line .mini-gap {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nebula-mini-card.dir-long .mini-gap {
  color: #27500a;
}

.nebula-mini-card.dir-short .mini-gap {
  color: #7f1d1d;
}

.mini-line .mini-direction {
  color: #667085;
  font-size: 11px;
  font-weight: 600;
}

.mini-line .mini-score {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #101828;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.mini-line.mini-zone-line {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #475467;
  flex-wrap: wrap;
}

.mini-zone-line .mini-zone-z {
  color: #a32d2d;
  font-weight: 700;
}

.mini-zone-line .mini-zone-ob {
  color: #3b6d11;
  font-weight: 700;
}

.mini-zone-line .mini-zone-sep {
  color: #98a2b3;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.summary-tile {
  min-height: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: none;
  position: relative;
  overflow: hidden;
}

.summary-tile .tile-label {
  display: block;
  color: #999999;
  font-size: 12px;
  font-weight: 400;
}

.summary-tile strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.summary-tile small {
  display: block;
  margin-top: 6px;
  color: #6b6b6b;
  font-size: 12px;
  font-weight: 400;
}


.filter-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(251, 250, 241, 0.82);
  border: 4px solid rgba(255, 255, 255, 0.5);
  overflow: visible;
  white-space: normal;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.chip-group,
.filter-row {
  display: contents;
}

.filter-row-secondary {
  justify-content: flex-start;
}

.layout-chip-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.chip {
  min-height: 30px;
  padding: 6px 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: var(--text-tag);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.chip.active {
  background: var(--bg-score);
  color: #ffffff;
  border-color: var(--bg-score);
}

.chip.pattern-filter-chip {
  background: var(--pat-bg, #ffffff);
  border-color: var(--pat-border, rgba(0, 0, 0, 0.1));
  color: var(--pat-fg, var(--text-tag));
}

.chip.pattern-filter-chip.active {
  background: var(--pat-bg, var(--bg-score));
  color: var(--pat-fg, #ffffff);
  border-color: var(--pat-border, var(--bg-score));
  box-shadow: inset 0 0 0 1px currentColor;
}

.timeframe-filter-chip {
  min-width: 44px;
}

.timeframe-filter-chip.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.info-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 0.5px solid var(--bg-box-border);
  border-radius: 14px;
  background: var(--bg-box);
}

.info-cell {
  display: grid;
  gap: 4px;
}

.info-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.info-value {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.harmonic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.harmonic-grid .prz-box {
  margin-bottom: 0;
}

.candidate-grid--three .harmonic-grid {
  grid-template-columns: 1fr;
}

.candidate-grid--three .price-prz-grid {
  grid-template-columns: 1fr;
}

.candidate-grid--three .pattern-box,
.candidate-grid--three .prz-box,
.candidate-grid--three .price-prz-box {
  padding: 12px;
}

.candidate-grid--three .pattern-box-value,
.candidate-grid--three .prz-box-value,
.candidate-grid--three .price-prz-value {
  font-size: 18px;
}

.pattern-box {
  display: block;
  min-width: 0;
  padding: 14px 16px;
  border: 0.5px solid var(--pat-border, var(--bg-box-border));
  border-radius: 16px;
  background: var(--pat-bg, var(--bg-box));
}

.pattern-box-link,
.prz-box-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.pattern-box-link:hover,
.prz-box-link:hover,
.pattern-box-link:focus-visible,
.prz-box-link:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.pattern-box-label {
  display: block;
  margin-bottom: 4px;
  color: var(--pat-fg, var(--text-secondary));
  opacity: 0.75;
  font-size: 11px;
  font-weight: 600;
}

.pattern-box-value {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--pat-fg, var(--text));
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pattern-point-label {
  display: block;
  margin-top: 5px;
  color: var(--pat-fg, var(--text-secondary));
  opacity: 0.7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.pattern-ratio-line {
  display: block;
  margin-top: 6px;
  color: var(--pat-fg, var(--text-secondary));
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0.68;
}

.cypher-prz-ratio {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  color: var(--pat-fg, var(--text-secondary));
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0.76;
}

.prz-box {
  display: block;
  margin-bottom: 8px;
  padding: 14px 16px;
  border: 0.5px solid var(--border-prz);
  border-radius: 16px;
  background: var(--bg-prz);
}

.prz-box-label {
  display: block;
  margin-bottom: 4px;
  color: var(--prz-label);
  font-size: 11px;
  font-weight: 600;
}

.prz-box-value {
  display: block;
  color: var(--prz-text);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
  word-break: normal;
}

@media (max-width: 380px) {
  .prz-box-value {
    font-size: 18px;
  }
}

/* v6: info-box 슬림 (2셀) */
.info-box.info-box--slim {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-toggle {
  display: block;
  width: 100%;
  min-height: 18px;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 700;
  line-height: 0.8;
  box-shadow: none;
}

.detail-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--text-secondary);
}

.detail-toggle span {
  display: inline-block;
  transform: translateY(-2px);
}

.harmonic-detail {
  margin-top: 10px;
  padding: 12px;
  border: 0.5px solid var(--bg-box-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.detail-block + .detail-block,
.detail-validation,
.detail-excluded {
  margin-top: 12px;
}

.detail-block h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.detail-table-wrap {
  overflow-x: auto;
}

.detail-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.detail-table th,
.detail-table td {
  padding: 7px 8px;
  border-bottom: 0.5px solid var(--bg-box-border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.detail-table th {
  color: var(--text-secondary);
  font-weight: 700;
}

.detail-table td {
  color: var(--text);
  font-weight: 600;
}

.detail-result {
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.detail-result.pass {
  background: #eaf3de;
  color: #27500a;
}

.detail-result.fail {
  background: #f9d0d0;
  color: #7f1d1d;
}

.detail-result.projected {
  background: var(--bg-tag);
  color: var(--muted);
}

.detail-validation,
.harmonic-detail-empty {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

body.pattern-detail-open {
  overflow: hidden;
}

.pattern-detail-modal[hidden] {
  display: none;
}

.pattern-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pattern-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(7px);
  animation: pattern-detail-fade 180ms ease both;
}

.pattern-detail-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(940px, 100%);
  max-height: min(88vh, 840px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: #fbfaf3;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  color: var(--text);
  outline: none;
  animation: pattern-detail-sheet-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pattern-detail-head {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -18px 0;
  padding: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(251, 250, 243, 0.82);
  backdrop-filter: blur(18px);
}

.pattern-detail-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pattern-detail-head h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.pattern-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pattern-detail-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.70);
  color: #111827;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.pattern-detail-section,
.pattern-detail-metric {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.pattern-detail-section {
  padding: 14px;
}

.pattern-detail-section h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.pattern-chart-section {
  overflow: hidden;
}

.pattern-chart-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  background: #111827;
}

.pattern-chart {
  --harmonic-prz-fill: rgba(239, 68, 68, 0.075);
  --harmonic-prz-stroke: rgba(248, 113, 113, 0.48);
  --harmonic-prz-label: #fecaca;
  display: block;
  width: 100%;
  min-width: 720px;
  min-height: 560px;
  height: auto;
}

.pattern-chart-bg {
  fill: #111827;
}

.pattern-chart-grid line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.pattern-chart-grid text,
.pattern-price-line text,
.pattern-chart-point text,
.pattern-prz-label,
.pattern-ratio-label text,
.pattern-right-rail-label text {
  font-size: 11px;
  font-weight: 700;
  fill: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.pattern-chart-label-layer text,
.pattern-right-rail-layer text {
  paint-order: stroke;
  stroke: rgba(17, 24, 39, 0.78);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.pattern-candle line {
  stroke-width: 1.2;
}

.pattern-candle.up line,
.pattern-candle.up rect {
  stroke: #34d399;
  fill: #34d399;
}

.pattern-candle.down line,
.pattern-candle.down rect {
  stroke: #fb7185;
  fill: #fb7185;
}

.pattern-harmonic-fill-layer {
  pointer-events: none;
}

.pattern-harmonic-fill {
  fill: rgba(148, 163, 184, 0.06);
  stroke: rgba(203, 213, 225, 0.08);
  stroke-width: 0.8;
  pointer-events: none;
}

.pattern-harmonic-fill.fill-2 {
  fill: rgba(100, 116, 139, 0.055);
}

.pattern-harmonic-fill.fill-3 {
  fill: rgba(226, 232, 240, 0.05);
}

.pattern-xabcd-line {
  fill: none;
  stroke: #facc15;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pattern-ratio-guide-line {
  fill: none;
  stroke: rgba(203, 213, 225, 0.42);
  stroke-width: 1.15;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  pointer-events: none;
}

.pattern-chart-point circle {
  fill: #facc15;
  stroke: #111827;
  stroke-width: 2;
}

.pattern-label-box {
  fill: rgba(17, 24, 39, 0.86);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.pattern-point-badge-text {
  fill: #fde68a;
  font-size: 10px;
  font-weight: 800;
  stroke: none;
  paint-order: normal;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.78));
}

/* PRZ 띠 색·투명도 config (방향별). 한 곳에서 조정. */
:root {
  --prz-short-fill: rgba(239, 68, 68, 0.22);
  --prz-short-stroke: rgba(248, 113, 113, 0.9);
  --prz-long-fill: rgba(34, 197, 94, 0.20);
  --prz-long-stroke: rgba(56, 189, 248, 0.9);
}
.pattern-prz-box {
  fill: rgba(239, 68, 68, 0.24);
  stroke: rgba(248, 113, 113, 0.9);
  stroke-width: 0.5;
}
.pattern-prz-zone.prz-short .pattern-prz-box {
  fill: var(--prz-short-fill);
  stroke: var(--prz-short-stroke);
}
.pattern-prz-zone.prz-long .pattern-prz-box {
  fill: var(--prz-long-fill);
  stroke: var(--prz-long-stroke);
}
.pattern-prz-zone.prz-long .pattern-prz-edge {
  stroke: rgba(187, 247, 208, 0.95);
}

.pattern-prz-zone {
  pointer-events: none;
}

.pattern-prz-edge {
  stroke: rgba(254, 202, 202, 0.95);
  stroke-width: 1;
}

.pattern-prz-component-layer,
.pattern-prz-component-label-layer {
  pointer-events: none;
}

.pattern-prz-component line {
  pointer-events: none;
}

/* 보조 피보 레벨 — 솔리드 라인. 컬러로 타입 구분, 투명도로 중요도 구분 */
.pattern-prz-component line {
  stroke-width: 1.1;
  stroke-dasharray: none;
}

/* PRZ 구성에 포함된 레벨 (가장 중요) */
.pattern-prz-component.included line {
  stroke: rgba(248, 113, 113, 0.85);
  stroke-width: 1.3;
  stroke-dasharray: none;
}

/* 타입별 기본 컬러 — XA(빨강) / BC프로젝션(블루) / AB=CD(핑크) */
.pattern-prz-component.reference.xa line {
  stroke: rgba(248, 113, 113, 0.40);
}
.pattern-prz-component.reference.bc line {
  stroke: rgba(96, 165, 250, 0.40);
}
.pattern-prz-component.reference.abcd line {
  stroke: rgba(240, 160, 192, 0.40);
}

.pattern-prz-component.reference line {
  stroke-opacity: 1;
}

/* PRZ 가까운 레벨 — 진하게 (중요) */
.pattern-prz-component.near-prz.reference.xa line {
  stroke: rgba(248, 113, 113, 0.78);
}
.pattern-prz-component.near-prz.reference.bc line {
  stroke: rgba(96, 165, 250, 0.78);
}
.pattern-prz-component.near-prz.reference.abcd line {
  stroke: rgba(240, 160, 192, 0.78);
}

/* PRZ 먼 레벨 — 많이 흐리게 (덜 중요) */
.pattern-prz-component.distant-prz.reference.xa line {
  stroke: rgba(248, 113, 113, 0.18);
}
.pattern-prz-component.distant-prz.reference.bc line {
  stroke: rgba(245, 158, 66, 0.18);
}
.pattern-prz-component.distant-prz.reference.abcd line {
  stroke: rgba(96, 165, 250, 0.18);
}

/* 먼 레벨 라벨도 흐리게 */
.pattern-prz-component-label.distant-prz text {
  opacity: 0.3;
}

.pattern-prz-component-label text {
  font-size: 9px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(17, 24, 39, 0.78);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.pattern-prz-component-label.included text {
  fill: rgba(254, 202, 202, 0.94);
}

.pattern-prz-component-label.reference text {
  fill: rgba(203, 213, 225, 0.62);
}

.pattern-prz-component-label.reference.xa text {
  fill: rgba(252, 165, 165, 0.72);
}

/* BC — 블루 */
.pattern-prz-component-label.reference.bc text {
  fill: rgba(147, 197, 253, 0.72);
}

/* AB=CD — 핑크 */
.pattern-prz-component-label.reference.abcd text {
  fill: rgba(240, 160, 192, 0.72);
}

.pattern-verification-zone {
  pointer-events: none;
}

.pattern-verification-zone rect {
  fill: none;
}

.pattern-verification-line {
  stroke: rgba(155, 145, 232, 0.38);
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.pattern-verification-zone line {
  stroke: rgba(155, 145, 232, 0.38);
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.pattern-projection-line line {
  stroke-width: 1.1;
  stroke-dasharray: none;
  opacity: 0.7;
}

/* BC 프로젝션 — 블루 */
.pattern-projection-line.bc line {
  stroke: #6fb0ec;
}

/* AB=CD 프로젝션 — 핑크 */
.pattern-projection-line.abcd line {
  stroke: #f0a0c0;
}

/* XA — 청록 */
.pattern-projection-line.xa line {
  stroke: #5dcaa5;
  stroke-dasharray: none;
  opacity: 0.85;
}

.pattern-prz-label {
  fill: var(--harmonic-prz-label);
}

.pattern-ratio-label text {
  font-size: 10px;
  fill: rgba(241, 245, 249, 0.9);
  stroke: none;
  paint-order: normal;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.78));
}

.pattern-right-rail-axis {
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 1;
}

.pattern-right-rail-box {
  fill: rgba(15, 23, 42, 0.9);
  stroke: none;
}

.pattern-current-rail-box {
  stroke: none;
}

.pattern-tp-rail-box {
  stroke: none;
}

.pattern-prz-rail-box {
  stroke: none;
}

.pattern-projection-rail-box.bc {
  stroke: none;
}

.pattern-projection-rail-box.abcd {
  stroke: none;
}

.pattern-projection-rail-box.xa {
  stroke: none;
}

.pattern-right-rail-label text {
  font-size: 10.5px;
}

.pattern-price-line line {
  stroke-width: 1.25;
  stroke-dasharray: 5 7;
  opacity: 0.58;
}

.pattern-price-line.current line {
  stroke: rgba(229, 231, 235, 0.68);
}

.pattern-price-line.current text {
  fill: #e5e7eb;
}

.pattern-price-line.tp line {
  stroke: #22c55e;
  stroke-dasharray: none;
  opacity: 0.5;
}

.pattern-price-line.tp text {
  fill: #bbf7d0;
}

.pattern-price-line.sl line {
  stroke: #f97316;
  stroke-width: 1.1;
  stroke-dasharray: 4 5;
  opacity: 0.75;
}

.pattern-price-line.sl text {
  fill: #fed7aa;
}

.pattern-price-line.invalid line {
  stroke: #f97316;
}

.pattern-price-line.invalid text {
  fill: #fed7aa;
}

.pattern-chart-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #111827;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

/* ── 타겟 줄 ───────────────────────────────────────────── */
.pattern-detail-targets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pattern-detail-targets strong {
  color: var(--hx-green);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pattern-detail-targets span:last-child strong {
  color: var(--text);
}

/* ── 포지션 계산기 ─────────────────────────────────────── */
.pattern-position-calc {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow);
}

.pattern-position-calc h3,
.pattern-detection-details summary {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.position-basis-grid,
.position-input-grid,
.position-output-grid {
  display: grid;
  gap: 6px;
}

.position-basis-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 8px;
}

.position-input-grid,
.position-output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.position-input-grid {
  margin: 8px 0;
}

/* 기준값 타일 */
.position-basis {
  min-width: 0;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-strong);
}

.position-basis span,
.position-basis small,
.position-input-grid span,
.position-output span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.position-basis small {
  margin-top: 2px;
  font-size: 10px;
}

.position-basis strong {
  display: block;
  margin: 3px 0 1px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.position-basis .danger {
  color: var(--hx-red);
}

/* 입력칸 */
.position-input-grid input {
  width: 100%;
  height: 36px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--cream);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.position-input-grid input:focus {
  outline: 0;
  border-color: var(--lavender);
  box-shadow: 0 0 0 2px rgba(159, 148, 245, 0.22);
}

/* 결과 타일 */
.position-output {
  min-width: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-strong);
}

.position-output strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.position-output.qty {
  background: rgba(159, 148, 245, 0.10);
  border-color: rgba(159, 148, 245, 0.28);
}

.position-output.qty span {
  color: #534ab7;
}

.position-output.qty strong {
  color: #26215c;
  font-size: 22px;
}

.position-output.margin strong {
  font-size: 22px;
}

/* ── 검출 상세 토글 ────────────────────────────────────── */
.pattern-detection-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

.pattern-detection-details summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background 0.12s;
}

.pattern-detection-details summary:hover {
  background: var(--card-strong);
  color: var(--text);
}

.pattern-detection-details summary::-webkit-details-marker {
  display: none;
}

.pattern-detection-details summary::before {
  content: "▸";
  display: inline-block;
  width: 16px;
  color: var(--muted);
  transition: transform 0.12s;
}

.pattern-detection-details[open] summary::before {
  content: "▾";
}

.pattern-detection-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.pattern-detail-decision {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.pattern-detail-metric {
  min-width: 0;
  padding: 12px;
}

.pattern-detail-metric span,
.pattern-detail-lines span,
.pattern-tp-row span,
.pattern-tp-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pattern-detail-metric strong,
.pattern-detail-lines strong,
.pattern-tp-row strong {
  display: block;
  margin-top: 5px;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pattern-point-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pattern-point-row {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.04);
}

.pattern-point-row strong,
.pattern-point-row span,
.pattern-point-row small {
  display: block;
}

.pattern-point-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.pattern-point-row span {
  margin-top: 5px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pattern-point-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.pattern-detail-lines,
.pattern-tp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pattern-detail-lines.ratio-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pattern-detail-lines > div,
.pattern-tp-row {
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.04);
}

.pattern-detail-lines small {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.pattern-tp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pattern-tp-row.reached {
  background: rgba(37, 99, 235, 0.10);
}

.pattern-tp-row.reached small {
  color: var(--hx-blue);
}

.pattern-detail-ratio-table {
  min-width: 520px;
}

.pattern-detail-loading,
.pattern-detail-error,
.pattern-detail-empty {
  padding: 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.pattern-detail-error {
  background: #f9d0d0;
  color: #7f1d1d;
}

@keyframes pattern-detail-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pattern-detail-sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .pattern-detail-modal {
    align-items: end;
    padding: 0;
  }

  .pattern-detail-sheet {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    animation-name: pattern-detail-sheet-up;
  }

  .pattern-detail-head {
    align-items: flex-start;
  }

  .pattern-detail-head h2 {
    font-size: 20px;
  }

  .pattern-detail-decision {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .position-basis-grid .position-basis:nth-child(3) {
    grid-column: 1 / -1;
  }

  .pattern-chart {
    min-width: 640px;
    min-height: 500px;
  }

  .pattern-point-map,
  .pattern-tp-grid,
  .pattern-detail-lines.ratio-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .pattern-detail-sheet {
    padding: 14px;
  }

  .pattern-detail-head {
    top: -14px;
    margin: -14px -14px 0;
    padding: 14px;
  }

  .pattern-detail-head-actions {
    gap: 6px;
  }

  .pattern-detail-decision,
  .pattern-detail-lines {
    grid-template-columns: 1fr;
  }

  .position-input-grid,
  .position-output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes pattern-detail-sheet-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pattern-detail-backdrop,
  .pattern-detail-sheet {
    animation-duration: 1ms;
    transition: none;
  }
}

.detail-excluded {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.detail-excluded strong {
  flex-basis: 100%;
  color: var(--text-secondary);
}

.detail-excluded span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-tag);
}

.prz-box.ob-box {
  border-color: var(--border-ob);
  background: var(--bg-ob);
}

.prz-box.ob-box .prz-box-label,
.prz-box.ob-box .prz-box-value {
  color: var(--ob-text);
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  position: sticky;
  right: 0;
  padding-left: 6px;
  background: rgba(251, 250, 241, 0.92);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.search input,
.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cream);
  color: var(--text);
  outline: none;
}

.field input {
  border-radius: var(--radius-sm);
}

.search input {
  width: 100px;
  padding: 4px 8px;
  font-size: 12px;
}

.search input::placeholder,
.field input::placeholder {
  color: rgba(146, 151, 141, 0.58);
}

.search input:focus,
.field input:focus {
  border-color: rgba(247, 214, 111, 0.86);
  box-shadow: 0 0 0 4px rgba(247, 214, 111, 0.22);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
}

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

.candidate-grid.candidate-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.candidate-card {
  min-height: 0;
  padding: 18px 18px 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}


.candidate-card.new {
  box-shadow: 0 0 0 1px rgba(247, 214, 111, 0.34), var(--shadow);
}

.candidate-card.lifecycle-prz-waiting,
.candidate-card.lifecycle-prz-touched,
.candidate-card.lifecycle-prz-exceeded {
  border-color: rgba(216, 90, 48, 0.56);
  box-shadow: 0 0 0 1px rgba(216, 90, 48, 0.10), var(--shadow);
}

.candidate-card.lifecycle-near {
  border-color: rgba(100, 116, 139, 0.28);
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.08), var(--shadow);
}

.candidate-card.lifecycle-prz-waiting,
.candidate-card.lifecycle-prz-exceeded {
  animation: prz-waiting-pulse 2.2s ease-in-out infinite;
}

.candidate-card.lifecycle-prz-reacting,
.candidate-card.lifecycle-reached-382,
.candidate-card.lifecycle-reached-50 {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18), 0 10px 30px rgba(37, 99, 235, 0.12), var(--shadow);
}

.candidate-card.lifecycle-waiting,
.candidate-card.lifecycle-pulled-back {
  border-color: rgba(100, 116, 139, 0.20);
  opacity: 0.68;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.04), 0 10px 24px rgba(15, 23, 42, 0.05);
}

@keyframes prz-near-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(216, 90, 48, 0.10), var(--shadow);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(216, 90, 48, 0.22), 0 0 0 6px rgba(216, 90, 48, 0.10), var(--shadow);
  }
}

@keyframes prz-waiting-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(216, 90, 48, 0.12), var(--shadow);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(216, 90, 48, 0.28), 0 0 0 7px rgba(216, 90, 48, 0.12), var(--shadow);
  }
}

.candidate-card:hover {
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
}

.symbol {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.badge-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
  max-width: 66%;
}

.badge {
  min-height: 27px;
  padding: 6px 9px;
  border: 0;
  background: var(--card-soft);
  color: var(--text);
  font-size: 11px;
}

.pattern-badge {
  padding: 5px 12px;
  border: 0.5px solid var(--pat-border, transparent);
  border-radius: 999px;
  background: var(--pat-bg, var(--bg-tag));
  color: var(--pat-fg, var(--text-tag));
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
  box-shadow: none;
}

.killzone-badge {
  border-radius: 999px;
  background: #f2f2f0;
  color: #667085;
  font-size: 11px;
  font-weight: 400;
}

.pattern-ab-cd {
  --pat-bg: #f2f2f0;
  --pat-border: #d1d5db;
  --pat-fg: #4b5563;
}

.pattern-gartley,
.pattern-deep-gartley {
  --pat-bg: #dbeafe;
  --pat-border: #93c5fd;
  --pat-fg: #1e3a8a;
}

.pattern-bat,
.pattern-alternate-bat {
  --pat-bg: #e8d5f5;
  --pat-border: #c4b5fd;
  --pat-fg: #4c1d95;
}

.pattern-butterfly {
  --pat-bg: #fef3c7;
  --pat-border: #fcd34d;
  --pat-fg: #92400e;
}

.pattern-crab,
.pattern-deep-crab {
  --pat-bg: #dbeafe;
  --pat-border: #93c5fd;
  --pat-fg: #1e3a8a;
}

.pattern-cypher {
  --pat-bg: #ccfbf1;
  --pat-border: #0d9488;
  --pat-fg: #0d9488;
}

.pattern-shark {
  --pat-bg: #e2e8f0;
  --pat-border: #475569;
  --pat-fg: #475569;
}

.badge.long,
.badge.bullish {
  background: #cfe2c4;
  color: #1f5f3a;
  font-weight: 700;
}

.badge.short,
.badge.bearish {
  background: #efc0bc;
  color: #8d2f31;
  font-weight: 700;
}

.near {
  background: #d6e5c6;
  color: #315842;
}

.watch {
  background: #ffe39a;
  color: #6f5817;
}

.far {
  background: #efc0bc;
  color: #703a3a;
}

.ratio-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

@media (max-width: 720px) {
  .killzone-grid {
    grid-template-columns: 1fr;
  }
}

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

.killzone-card {
  min-height: auto;
  margin-bottom: 0;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 8px;
  min-width: 0;
}

.card-subline,
.price-prz-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.card-subline {
  margin: 8px 0 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.price-prz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.price-prz-box {
  min-width: 0;
  padding: 12px 14px;
  border: 0.5px solid var(--bg-box-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.price-prz-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tag);
  font-size: 11px;
  font-weight: 600;
}

.price-prz-value {
  display: block;
  color: #374151;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pool-summary-card small {
  display: block;
  margin-top: 6px;
  color: #ADAA9C;
  font-size: 12px;
  font-weight: 700;
}

.pool-summary-card.tone-ok {
  border-left-color: var(--status-ok-text);
}

.pool-summary-card.tone-running {
  border-left-color: var(--status-run-text);
}

.pool-summary-card.tone-warning {
  border-left-color: var(--status-warn-text);
}

.pool-summary-card.tone-error {
  border-left-color: var(--status-err-text);
}

.pool-summary-card.scanner-status-card {
  border-left-width: 0;
}

.pool-summary-card.scanner-status-card.tone-ok {
  background: var(--status-ok-bg);
}

.pool-summary-card.scanner-status-card.tone-running {
  background: var(--status-run-bg);
}

.pool-summary-card.scanner-status-card.tone-warning {
  background: var(--status-warn-bg);
}

.pool-summary-card.scanner-status-card.tone-error {
  background: var(--status-err-bg);
}

.pool-summary-card.scanner-status-card span {
  color: #5E7E9E;
}

.pool-summary-card.scanner-status-card strong {
  align-items: center;
  color: #134273;
}

.pool-summary-card.scanner-status-card strong::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.pool-summary-card.scanner-status-card.tone-ok strong::before {
  background: var(--status-ok-text);
}

.pool-summary-card.scanner-status-card.tone-running strong::before {
  background: var(--status-run-text);
}

.pool-summary-card.scanner-status-card.tone-warning strong::before {
  background: var(--status-warn-text);
}

.pool-summary-card.scanner-status-card.tone-error strong::before {
  background: var(--status-err-text);
}

.pool-summary-card.scanner-status-card small {
  color: var(--status-run-text);
}

.pool-summary-card.scanner-status-card.tone-ok small {
  color: var(--status-ok-text);
}

.pool-summary-card.scanner-status-card.tone-warning small {
  color: var(--status-warn-text);
}

.pool-summary-card.scanner-status-card.tone-error small {
  color: var(--status-err-text);
}

.card-top .sym {
  margin-right: 4px;
  color: var(--text);
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 120ms ease;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-top a.sym:hover,
.card-top a.sym:focus-visible {
  opacity: 0.65;
  outline: none;
}

.harmonic-card .card-top,
.killzone-card .card-top {
  margin-bottom: 8px;
}

.killzone-zones {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.killzone-zones .prz-box {
  margin-bottom: 0;
}

.card-top .meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dir {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.dir.long {
  background: #eaf3de;
  color: #27500a;
}

.dir.short {
  background: #f9d0d0;
  color: #7f1d1d;
}

.tf {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 0.5px solid var(--bg-box-border);
  border-radius: 999px;
  background: var(--bg-tag);
  color: var(--text-tag);
  font-size: 12px;
  font-weight: 600;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.tag-row .dir {
  margin-left: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 0.5px solid var(--bg-box-border);
  border-radius: 999px;
  background: var(--bg-tag);
  color: var(--text-tag);
  font-size: 12px;
  font-weight: 600;
}

.tag.score {
  background: #e5e7eb;
  color: #1a1a1a;
  border-color: transparent;
  font-weight: 700;
}

.harmonic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 12px;
}

.harmonic-tag {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.harmonic-tag[data-raw="PRZ_EXCEEDED"] {
  border-color: rgba(185, 28, 28, 0.28);
  background: #fee2e2;
  color: #991b1b;
}

.harmonic-tag.tag-low-confidence {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fef3c7;
  color: #92400e;
}

.fake-breakout-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.fake-breakout-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  max-width: 118px;
  padding: 3px 7px;
  border: 1px solid rgba(120, 113, 108, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #57534e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: help;
}

.fake-breakout-tag:focus-visible {
  outline: 2px solid rgba(120, 113, 108, 0.42);
  outline-offset: 2px;
}

.fake-breakout-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(270px, 78vw);
  padding: 12px 12px 10px;
  border: 1px solid rgba(120, 113, 108, 0.22);
  border-radius: 8px;
  background: #fffaf0;
  color: #292524;
  box-shadow: 0 14px 34px rgba(41, 37, 36, 0.18);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.fake-breakout-popover strong,
.fake-breakout-popover span,
.fake-breakout-popover em {
  display: block;
}

.fake-breakout-popover strong {
  margin-right: 22px;
  margin-bottom: 5px;
  font-size: 13px;
}

.fake-breakout-popover em {
  margin-top: 7px;
  color: #57534e;
  font-style: normal;
  font-weight: 700;
}

.fake-breakout-popover svg {
  display: block;
  width: 100%;
  height: 66px;
  margin-top: 8px;
}

.fake-breakout-popover path {
  fill: none;
  stroke: #78716c;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 5;
}

.fake-breakout-popover .breakout-arrow {
  stroke: #a16207;
  stroke-dasharray: none;
}

.fake-breakout-popover .reversal-arrow {
  stroke: #3f6212;
  stroke-dasharray: none;
}

.fake-breakout-wrap:hover .fake-breakout-popover,
.fake-breakout-tag:focus + .fake-breakout-popover,
.fake-breakout-wrap.is-open .fake-breakout-popover {
  display: block;
}

.fake-breakout-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(120, 113, 108, 0.12);
  color: #57534e;
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
}

.killzone-group-empty {
  grid-column: 1 / -1;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e2d8;
  color: var(--text);
  font-size: 14px;
  transition: background 120ms ease;
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-list li:hover {
  background: rgba(0, 0, 0, 0.03);
}

.rank-list strong {
  color: var(--text);
}

.rank-list .liq-rank {
  flex: 0 0 auto;
  min-width: 18px;
  color: #999999;
  font-size: 13px;
  font-weight: 400;
}

.rank-list .liq-symbol {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.rank-list .liq-value {
  flex: 0 0 auto;
  color: #333333;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state {
  display: none;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: var(--card);
}

.empty-state.show {
  display: block;
}

/* Phase 7: 라이프사이클 뱃지 */
.lifecycle-badge {
  position: static;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 0 0 auto;
  padding: 4px 9px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}
.lifecycle-active {
  background: #f1f5f9;
  border-color: rgba(100, 116, 139, 0.18);
  color: #475569;
}
.lifecycle-confirmed {
  background: #ccfbf1;
  border-color: rgba(20, 184, 166, 0.34);
  color: #0f766e;
}
.lifecycle-win {
  background: #D1FAE5;
  color: #065F46;
}
.lifecycle-loss {
  background: #FECACA;
  color: #7F1D1D;
}
/* v3 Phase 2.5: 구조 무효 (X 침범) — 보라 */
.lifecycle-invalid {
  background: #EDE9FE;
  color: #5B21B6;
}
/* v3 Phase 2.6: 풀 탈락 — 회색 (외부 컨텍스트 변화, 패턴 자체 결함 아님) */
.lifecycle-dropped {
  background: #F1F5F9;
  color: #475569;
}
.lifecycle-dormant {
  background: #eef2ff;
  color: #3730a3;
}

.lifecycle-badge.lifecycle-near {
  background: #f1f5f9;
  border-color: rgba(100, 116, 139, 0.18);
  color: #334155;
}

.lifecycle-badge.lifecycle-prz-waiting,
.lifecycle-badge.lifecycle-prz-touched,
.lifecycle-badge.lifecycle-prz-exceeded {
  background: #fee2e2;
  border-color: rgba(216, 90, 48, 0.42);
  color: #991b1b;
}

.lifecycle-badge.lifecycle-reached-382,
.lifecycle-badge.lifecycle-reached-50,
.lifecycle-badge.lifecycle-reached-618 {
  background: #ccfbf1;
  border-color: rgba(20, 184, 166, 0.42);
  color: #0f766e;
}

.lifecycle-badge.lifecycle-prz-reacting {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.30);
  color: #1d4ed8;
}

.lifecycle-badge.lifecycle-waiting,
.lifecycle-badge.lifecycle-pulled-back {
  background: #f1f5f9;
  border-color: rgba(100, 116, 139, 0.14);
  color: #64748b;
}
.harmonic-card.dormant {
  opacity: 0.62;
}
/* v3 Phase 3.0: TF 배지 (카드 헤더에서 1H/4H 구분) */
.tag.tf-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 4px;
}
.tag.tf-1h { background: #DBEAFE; color: #1E40AF; }  /* 파랑 */
.tag.tf-4h { background: #FEF3C7; color: #92400E; }  /* 주황 */
/* v3 Phase 3.1: 통계 대시보드 */
.analytics-container {
  display: flex; flex-direction: column; gap: 24px; padding: 0 8px;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.kpi-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px;
  text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.kpi-label { font-size: 11px; color: #64748b; margin-bottom: 6px; }
.kpi-value { font-size: 18px; font-weight: 700; color: #0f172a; }
.kpi-value.win { color: #059669; }
.kpi-value.loss { color: #DC2626; }
.kpi-value.invalid { color: #7C3AED; }
.kpi-value.highlight { color: #2563EB; font-size: 18px; }
.analytics-section {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
}
.analytics-section h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #334155; }
.chart-wrap { position: relative; height: 280px; }
.empty-state { padding: 40px; text-align: center; color: #94a3b8; font-size: 13px; }
.symbol-table-wrap { overflow-x: auto; }
.symbol-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.symbol-table th { background: #f1f5f9; padding: 8px; text-align: left; font-weight: 600; color: #475569; }
.symbol-table td { padding: 8px; border-bottom: 1px solid #f1f5f9; }
.symbol-table td.good { color: #059669; font-weight: 700; }
.symbol-table td.bad { color: #DC2626; font-weight: 700; }
.symbol-table td.low-sample { color: #94a3b8; font-style: italic; }
.tf-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; text-align: center; }
.tf-card-label { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.tf-card-row { font-size: 12px; color: #475569; margin-bottom: 4px; }
.tf-card-row.big { font-size: 18px; font-weight: 700; color: #2563EB; margin-top: 6px; }

.lifecycle-chip {
  border-color: #c7d2fe;
}
.lifecycle-chip.active {
  background: #4338CA;
  color: #fff;
  border-color: #4338CA;
}

.layout-chip {
  border-color: #cbd5e1;
  color: #334155;
}

.layout-chip.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.archive-toggle-chip {
  border-color: rgba(15, 23, 42, 0.24);
  background: transparent;
  color: #334155;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}
.archive-toggle-chip:hover,
.archive-toggle-chip.active {
  border-color: #334155;
  background: #f8fafc;
  color: #0f172a;
}
.archive-toggle-chip.is-disabled,
.archive-toggle-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* v9: 완료 카드 통합 섹션 */
.expired-section {
  margin: 0 0 18px;
}
.expired-section[hidden] {
  display: none;
}
.expired-drawer {
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
}
.expired-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.expired-drawer-head p {
  margin-top: 4px;
  color: var(--muted, #98A2B3);
  font-size: 12px;
}
.archive-controls {
  display: flex;
  gap: 8px;
  margin: 0;
  align-items: center;
}
.archive-select,
.archive-button {
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
}
.archive-button {
  background: transparent;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.24);
}
.archive-button:hover {
  background: #1a1a1a;
  color: #fff;
}
.expired-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 4px 16px;
}
.expired-divider::before,
.expired-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}
.expired-label {
  font-size: 12px;
  color: var(--muted, #98A2B3);
  font-weight: 400;
  letter-spacing: 0;
}
.expired-grid {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.expired-grid:hover {
  opacity: 0.85;
}
.expired-grid .candidate-card:hover {
  opacity: 1;
}
.expired-empty {
  font-size: 13px;
  color: var(--muted, #98A2B3);
  text-align: center;
  padding: 24px 0;
}
@media (prefers-color-scheme: dark) {
  .expired-divider::before,
  .expired-divider::after {
    background: rgba(255, 255, 255, 0.1);
  }
  .expired-grid {
    opacity: 0.4;
  }
}

/* Phase 7: 더보기 4섹션 */
.detail-block--plan {
  margin-bottom: 12px;
}
.detail-block--plan .kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-size: 13px;
}
.detail-block--plan .kv span:nth-child(2n-1) {
  color: var(--muted);
}
.detail-block--plan .kv span:nth-child(2n) {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
.detail-block--plan .kv small {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.detail-block--plan .kv .kv-total {
  font-weight: 700;
  border-top: 0.5px solid rgba(0,0,0,0.08);
  padding-top: 6px;
  margin-top: 4px;
}
.detail-block--plan .warn-flag {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 8px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 10px;
  align-items: start;
}

.calculator-card,
.result-card {
  padding: 20px;
  border: none;
  border-radius: 24px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field input {
  min-height: 46px;
  padding: 12px 13px;
  font-weight: 700;
}

.calculator-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--short);
  font-size: 13px;
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.result-item {
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-soft);
}

.result-item.highlight {
  border-color: rgba(247, 214, 111, 0.84);
  background: #ffdf73;
  color: var(--black);
}

.coin-result {
  grid-column: 1 / -1;
  min-height: 118px;
}

.result-item.highlight span,
.result-item.highlight strong {
  color: var(--black);
}

.result-item strong {
  display: block;
  margin-top: 11px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.05;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .title-row,
  .brand {
    align-items: center;
  }

  .title-row {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .title-row::-webkit-scrollbar {
    display: none;
  }

  h1 {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-strip {
    margin-left: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .top-action-button {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .expired-drawer-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .candidate-grid,
  .candidate-grid.candidate-grid--three,
  .killzone-grid-inner {
    grid-template-columns: 1fr;
  }

  .price-prz-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  /* 현재가/PRZ까지 박스와 바로 아래 하모닉 패턴/PRZ 박스의 여백을 동일하게 통일. */
  .price-prz-box,
  .pattern-box,
  .prz-box {
    padding: 11px 13px;
  }

  .price-prz-value {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 8px 10px 24px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .brand {
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .title-block {
    flex: 1;
    min-width: 0;
  }

  .title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .title-row::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: 16px;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-action-button {
    height: 30px;
    min-height: 30px;
    width: auto !important;
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 0 10px;
    font-size: 11px;
  }

  .top-action-button:hover,
  .top-action-button.active {
    height: 30px;
    padding: 0 10px;
    transform: none;
  }

  .status-strip {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 3px;
    margin-left: auto;
    font-size: 10px;
    text-align: right;
  }

  .status-label {
    font-size: 9px;
  }

  .pill {
    min-height: 23px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .archive-controls {
    width: 100%;
  }

  .archive-select {
    min-width: 0;
    flex: 1;
  }

  .tab-menu {
    gap: 6px;
    margin-bottom: 12px;
  }

  .tab-button {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 16px;
  }

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

  .nebula-mini-list {
    gap: 6px;
  }

  .filter-bar {
    padding: 6px 10px;
    margin-bottom: 8px;
    border-width: 4px;
  }

  .chip {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 11px;
  }

  .pattern-filter-chip {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search span {
    font-size: 10px;
  }

  .calculator-card,
  .result-card {
    padding: 12px;
  }

  .input-grid,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .field {
    gap: 5px;
  }

  .field input {
    min-height: 40px;
    padding: 9px 10px;
  }

  .result-item {
    min-height: 82px;
    padding: 10px;
  }

  .coin-result {
    min-height: 94px;
  }

  .result-item strong {
    font-size: 18px;
    margin-top: 8px;
  }

  .candidate-card {
    min-height: 0;
  }
}

@media (max-width: 390px) {
  .shell {
    padding: 8px 8px 20px;
  }

  h1 {
    font-size: 14px;
  }

  .title-row {
    gap: 5px;
  }

  .top-action-button {
    padding: 0 8px;
    font-size: 10px;
  }

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

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

  .badge-row {
    max-width: 100%;
  }
}

.trendline-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
}

.trendline-badge.broken {
  background: #fcebeb;
  color: #791f1f;
  border: 0.5px solid #f09595;
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: grid;
  gap: 10px;
}

.skeleton-line,
.skeleton-block {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line--lg {
  width: 55%;
  height: 18px;
}

.skeleton-line--md {
  width: 80%;
}

.skeleton-line--sm {
  width: 40%;
}

.skeleton-block {
  height: 56px;
  margin-top: 6px;
  border-radius: 14px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.harmonic-detail-loading {
  padding: 14px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== E.2 시작 — PDC 4단계 시각화 (V3: Gray → Coral) ===== */

/* postDumpTag chip — 4단계 (card-top) */
.tag.pdc-stage-entering {
  background: #F1EFE8;
  color: #5F5E5A;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 400;
}
.tag.pdc-stage-compressing {
  background: #D3D1C7;
  color: #444441;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 400;
}
.tag.pdc-stage-mature {
  background: #FAECE7;
  color: #993C1D;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 400;
}
.tag.pdc-stage-imminent {
  background: #F5C4B3;
  color: #4A1B0C;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;  /* 임박만 강조 */
}

/* cardDetailBox 프로그레스 바 영역 */
.detail-pdc-row {
  align-items: flex-start;
}

.detail-pdc-row .detail-label {
  padding-top: 2px;  /* 프로그레스 바와 시각 정렬 */
}

.pdc-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pdc-seg-bar {
  display: flex;
  gap: 3px;
}

.pdc-seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #E8EAED;
  overflow: hidden;
}

.pdc-seg-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.pdc-seg-fill.pdc-seg-entering    { background: #B4B2A9; }
.pdc-seg-fill.pdc-seg-compressing { background: #888780; }
.pdc-seg-fill.pdc-seg-mature      { background: #F0997B; }
.pdc-seg-fill.pdc-seg-imminent    { background: #D85A30; }

.pdc-seg-labels {
  display: flex;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted, #9E9E9E);
}

.pdc-seg-label {
  flex: 1;
  text-align: center;
}

.pdc-seg-label.active {
  color: var(--text-primary, #212121);
  font-weight: 400;
}

/* 메타 행 (h째 · 변동폭 · 낙폭) */
.detail-pdc-meta {
  margin-top: -2px;
}

.detail-pdc-text {
  color: var(--text-muted, #607D8B);
  font-size: 11px;
}

/* 모바일 */
@media (max-width: 600px) {
  .pdc-seg { height: 5px; }
  .pdc-seg-labels { font-size: 9px; }
}

/* ===== E.2 끝 ===== */


/* ===== FOUC 방지 — 인라인 스크립트 attribute 기반 초기 표시 ===== */

/* attribute 있을 때만 기본 active 무시 (없으면 기존 동작 유지) */
html[data-initial-tab] .tab-panel.active { display: none; }

/* 저장된 탭만 강제 표시 */
html[data-initial-tab="harmonics"]  #harmonicsPanel,
html[data-initial-tab="calculator"] #calculatorPanel,
html[data-initial-tab="pool"]       #poolStatusPanel,
html[data-initial-tab="analytics"]  #analyticsPanel { display: block; }

/* 탭 버튼 active 시각도 동기화 */
html[data-initial-tab] .tab-button.active {
  background: transparent;
  color: inherit;
}
html[data-initial-tab="harmonics"]  [data-tab="harmonics"],
html[data-initial-tab="calculator"] [data-tab="calculator"],
html[data-initial-tab="pool"]       #poolStatusToggle,
html[data-initial-tab="analytics"]  [data-tab="analytics"] {
  background: #1a1a1a;
  color: #ffffff;
}

/* ===== FOUC 방지 끝 ===== */

.archive-loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary, #888);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.loading-dot {
  opacity: 0;
  animation: dot-blink 1.4s infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.3s; }
.loading-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dot-blink {
  0%, 80%, 100% { opacity: 0; }
  40%            { opacity: 1; }
}

.archive-loading-error {
  color: var(--color-danger, #EF4444);
}
