:root {
  --bg: #f6f7f2;
  --ink: #18201d;
  --muted: #65706b;
  --line: #dfe3d8;
  --panel: #ffffff;
  --panel-soft: #edf3ed;
  --green: #168354;
  --red: #c04444;
  --blue: #2667a8;
  --gold: #a97618;
  --shadow: 0 18px 45px rgba(24, 32, 29, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Noto Sans KR", sans-serif;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(246, 247, 242, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  font-size: 22px;
}

nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
}

nav a:hover {
  background: var(--panel-soft);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 12px;
  padding: 10px 12px 10px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faf7 100%);
  border: 1px solid #d7ddd3;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 32, 29, 0.07);
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.status-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-strip strong {
  font-size: 14px;
  white-space: nowrap;
}

.status-strip span:last-child {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip button {
  min-width: 86px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #cbd4ca;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.status-strip button:not(:disabled):hover {
  border-color: var(--green);
  color: var(--green);
}

.status-strip button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-footer p {
  margin: 3px 0;
}

.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: stretch;
  padding: clamp(28px, 6vw, 64px);
  background:
    linear-gradient(rgba(14, 24, 20, 0.68), rgba(14, 24, 20, 0.48)),
    url("https://images.unsplash.com/photo-1642790106117-e829e14a795f?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.hero-copy {
  max-width: 720px;
  align-self: center;
}

.hero h2 {
  margin: 10px 0 16px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  font-size: 17px;
  line-height: 1.7;
}

.date {
  color: #d8f0df;
  font-weight: 700;
}

.market-panel {
  align-self: end;
  display: grid;
  gap: 12px;
}

.market-panel div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
}

.market-panel strong {
  font-size: 20px;
}

.up {
  color: #ff6b6b;
}

.down {
  color: #4f8cff;
}

.notice {
  margin: 20px 0 34px;
  padding: 14px 16px;
  background: #fff8e8;
  border: 1px solid #ead7a7;
  border-radius: 8px;
  color: #5e4613;
  line-height: 1.6;
}

.ebook-section {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ebook-preview {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f4ef;
}

.ebook-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ebook-fallback {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.ebook-fallback strong {
  color: var(--ink);
  font-size: 24px;
}

.ebook-copy h2 {
  margin: 6px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.ebook-copy p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
}

.ebook-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ebook-login-note {
  display: inline-flex;
  width: fit-content;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
}

.primary-link,
.secondary-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.primary-link {
  background: var(--ink);
  color: #fff;
}

.secondary-link {
  background: var(--panel-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.is-hidden {
  display: none !important;
}

.admin-gate {
  display: grid;
  grid-template-columns: 300px minmax(280px, 520px);
  gap: 22px;
  align-items: start;
}

.admin-console {
  display: grid;
  gap: 20px;
}

.admin-members {
  margin-top: 16px;
}

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

.admin-stats article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 34px;
}

.admin-picks {
  margin-top: 16px;
}

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

.admin-session-bar span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-session-bar button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #cbd4ca;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.user-auth .login-panel {
  grid-column: 1 / -1;
}

.locked-notice {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.locked-notice h2 {
  margin: 6px 0 10px;
  color: var(--red);
  font-size: 26px;
}

.locked-notice p {
  color: var(--muted);
  line-height: 1.6;
}

.guest-news-section {
  width: min(760px, 100%);
  margin: 0 auto;
}

.guest-news-list {
  display: grid;
  gap: 10px;
}

.guest-news-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(8, 24, 20, 0.06);
}

.guest-news-card[href]:hover {
  border-color: rgba(17, 95, 81, 0.32);
  transform: translateY(-1px);
}

.guest-news-card strong {
  font-size: 16px;
  line-height: 1.45;
}

.guest-news-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.member-content {
  display: block;
}

.empty-state {
  margin-top: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.market-map-section {
  display: grid;
  gap: 14px;
}

.market-map-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.map-tab,
.market-map-tools a {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.map-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.market-map-tools a {
  margin-left: auto;
  color: var(--blue);
  background: #f5f8fb;
}

.market-map-frame {
  height: min(680px, 72vh);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.market-map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.tradingview-heatmap {
  width: 100%;
  height: 100%;
}

.tradingview-widget-container,
.tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
}

.tradingview-widget-container {
  position: relative;
}

.tradingview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f7f9f6;
  font-weight: 700;
}

.tradingview-widget-container iframe + .tradingview-loading,
.tradingview-widget-container__widget:not(:empty) + .tradingview-loading {
  display: none;
}

.tradingview-widget-copyright {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  color: var(--muted);
}

.tradingview-widget-copyright a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}


.map-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.market-rank-section {
  margin-top: 28px;
}

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

.market-rank-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.market-rank-card h3 {
  margin: 0 0 12px;
  font-size: 21px;
}

.market-rank-card ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

.market-rank-card li {
  counter-increment: rank;
}

.market-rank-card a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: #f7f9f6;
}

.market-rank-card a::before {
  content: counter(rank);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.market-rank-card a:hover {
  border-color: rgba(17, 95, 81, 0.32);
  transform: translateY(-1px);
}

.market-rank-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.market-rank-card strong {
  font-size: 15px;
}

.investor-flow-section {
  margin-top: 28px;
}

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

.investor-flow-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.investor-flow-card h3 {
  margin: 0 0 12px;
  font-size: 21px;
}

.investor-flow-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.investor-flow-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: center;
}

.investor-flow-row:last-child {
  border-bottom: 0;
}

.investor-flow-row.head {
  background: var(--panel-soft);
  font-weight: 900;
}

.auth-layout {
  display: block;
}

.login-panel {
  width: min(520px, 100%);
  margin: 0 auto;
}

.demo-form,
.member-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.member-head h3 {
  margin: 6px 0 10px;
  font-size: 22px;
}

.privacy-note {
  color: var(--muted);
  line-height: 1.6;
}

.secondary-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.demo-form {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.form-title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
}

.form-helper {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.6;
}

.demo-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.demo-form input {
  min-width: 0;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 400;
  line-height: 1.5;
}

.check-row input {
  width: 18px;
  margin-top: 3px;
}

.demo-form button,
.member-head button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.demo-form button {
  margin-top: 4px;
  background: var(--ink);
  color: #fff;
}

.demo-form .outline-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-message.success {
  color: var(--green);
  font-weight: 700;
}

.form-message.error {
  color: var(--red);
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  background: #e8f6ee;
  color: var(--green);
}

.daily-member-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.member-panel {
  grid-column: 2;
  padding: 18px;
}

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

.member-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.export-date-filter input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e6d5bd;
  border-radius: 8px;
  background: #fffaf3;
  color: var(--ink);
  font: inherit;
}

.member-head button {
  padding: 0 12px;
  background: #f4f0ea;
  color: #6f4b1d;
  border-color: #e6d5bd;
}

.delete-pick-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #efc8c8;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--panel-soft);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

section {
  margin-top: 42px;
}

.section-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
}

.section-heading {
  align-self: start;
}

.section-heading h2 {
  margin: 6px 0 10px;
  font-size: 30px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compact {
  max-width: 700px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.share-form,
.stock-card,
.news-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.share-form {
  grid-column: 2;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.share-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.share-form input,
.share-form select,
.share-form textarea {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.share-form textarea {
  min-height: 112px;
  resize: vertical;
}

.share-form button,
.filter {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.share-form button {
  background: var(--ink);
  color: #fff;
}

.share-form .outline-button {
  background: #f5f8fb;
  color: var(--blue);
  border-color: #cddbea;
  font-weight: 800;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.filter {
  padding: 0 16px;
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.filter.active {
  background: var(--ink);
  color: #fff;
}

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

.stock-card {
  padding: 18px;
}

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

.ticker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stock-card h3 {
  margin: 4px 0 10px;
  font-size: 22px;
}

.stock-price {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.stock-price.up {
  background: #fff0ee;
  color: #d71920;
}

.stock-price.down {
  background: #eef4ff;
  color: #1261c4;
}

.stock-card p {
  color: var(--muted);
  line-height: 1.6;
}

.mini-chart {
  width: 100%;
  height: 118px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfb 0%, #f3f7f4 100%);
}

.mini-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-axis {
  stroke: #d7ddd3;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-fill {
  fill: rgba(22, 131, 84, 0.12);
}

.chart-dot {
  fill: var(--green);
}

.stock-info {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 12px;
  background: #f7f9f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stock-info strong {
  font-size: 13px;
}

.stock-info ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tags span {
  padding: 6px 8px;
  background: #eef3f8;
  color: var(--blue);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.news-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.news-card[href]:hover {
  border-color: rgba(17, 95, 81, 0.32);
  transform: translateY(-1px);
}

.news-card .source {
  color: var(--gold);
  font-weight: 800;
}

.news-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 860px) {
  .topbar,
  .hero,
  .ebook-section,
  .section-grid,
  .admin-stats,
  .market-rank-grid,
  .auth-layout,
  .admin-gate,
  .login-panel,
  .news-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    display: grid;
  }

  .status-strip {
    grid-template-columns: 1fr auto;
  }

  .status-strip button {
    width: auto;
  }

  .share-form {
    grid-column: auto;
  }

  .member-panel {
    grid-column: auto;
  }

  .market-map-tools a {
    width: 100%;
    margin-left: 0;
  }

  .market-map-frame {
    min-height: 520px;
    height: 68vh;
  }

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

  .hero {
    min-height: auto;
  }

  .ebook-preview {
    max-height: 440px;
  }

  .ebook-actions a {
    width: 100%;
  }

  .news-card {
    grid-template-columns: 1fr;
  }
}
