:root {
  color-scheme: light;
  --ink: #24211f;
  --muted: #6c6864;
  --cream: #f3ebe3;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(36, 33, 31, 0.12);
  --blue: #6d88ed;
  --blue-deep: #4e68d5;
  --green: #198754;
  --red: #bc3d4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 6% 4%, rgba(109, 136, 237, .45), transparent 31rem),
    radial-gradient(circle at 98% 8%, rgba(255, 231, 223, .9), transparent 34rem),
    var(--cream);
}

button, input { font: inherit; }

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

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.brand img { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }

.hero { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; padding: 58px 0 34px; }
.hero h1, .settings-intro h1 { margin: 6px 0 10px; font-size: clamp(40px, 7vw, 74px); line-height: .96; letter-spacing: -.065em; }
.hero p, .settings-intro p { margin: 0; color: var(--muted); max-width: 660px; font-size: 17px; line-height: 1.55; }
.eyebrow { color: var(--blue-deep); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }

.status { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.62); white-space: nowrap; font-size: 13px; font-weight: 700; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: #b58b22; box-shadow: 0 0 0 5px rgba(181,139,34,.12); }
.status.ready span { background: var(--green); box-shadow: 0 0 0 5px rgba(25,135,84,.12); }
.channel-statuses { display: flex; flex-wrap: wrap; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stats-grid article, .panel, .settings-card { border: 1px solid var(--line); background: var(--card); box-shadow: 0 20px 70px rgba(59, 54, 49, .08); backdrop-filter: blur(18px); }
.stats-grid article { min-height: 122px; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.stats-grid span { color: var(--muted); font-size: 13px; font-weight: 650; }
.stats-grid strong { font-size: 31px; letter-spacing: -.045em; }
.stats-grid .profit { background: var(--ink); color: white; }
.stats-grid .profit span { color: rgba(255,255,255,.62); }
.channel-stats-block { margin-bottom: 20px; }
.channel-stats-title { display: flex; align-items: center; gap: 11px; margin: 0 0 10px 4px; }
.channel-stats-title > span, .channel-badge { display: inline-flex; border-radius: 999px; padding: 6px 9px; background: rgba(109,136,237,.14); color: var(--blue-deep); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.channel-stats-title h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.channel-stats-block.vip .channel-stats-title > span, .channel-badge.vip { color: white; background: var(--ink); }

.panel { border-radius: 28px; overflow: hidden; }
.panel-head { padding: 26px 28px 16px; }
.panel h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.035em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 28px; border-top: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.badge { display: inline-flex; border-radius: 999px; padding: 6px 9px; background: rgba(108,104,100,.1); font-weight: 750; font-size: 12px; }
.badge.win { color: var(--green); background: rgba(25,135,84,.1); }
.badge.loss { color: var(--red); background: rgba(188,61,74,.1); }
.empty { padding: 48px 28px; border-top: 1px solid var(--line); color: var(--muted); }

label { display: block; margin: 24px 0 8px; font-size: 13px; font-weight: 750; }
input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(109,136,237,.14); }
button { border: 0; border-radius: 14px; padding: 13px 18px; background: var(--ink); color: white; cursor: pointer; font-weight: 800; }
.ghost { background: rgba(255,255,255,.58); border: 1px solid var(--line); color: var(--ink); }
.button-link { display: inline-flex; text-decoration: none; border-radius: 14px; padding: 11px 16px; font-size: 13px; font-weight: 800; }

.settings-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(420px, .72fr); gap: 64px; align-items: start; padding: 72px 0 40px; }
.settings-intro { position: sticky; top: 28px; padding-top: 22px; }
.settings-intro h1 { font-size: clamp(48px, 7vw, 78px); max-width: 720px; }
.privacy-note { display: grid; gap: 6px; max-width: 620px; margin-top: 30px; padding: 18px 20px; border-left: 3px solid var(--blue); background: rgba(255,255,255,.44); border-radius: 0 16px 16px 0; }
.privacy-note span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.settings-card { padding: 30px; border-radius: 30px; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.settings-card h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.04em; }
.settings-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.primary-action, .secondary-action { width: 100%; margin-top: 24px; }
.secondary-action { margin-top: 10px; color: var(--ink); background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.notice { margin: 18px 0 8px; padding: 13px 15px; border-radius: 13px; font-size: 13px; font-weight: 750; }
.notice.success { color: var(--green); background: rgba(25,135,84,.1); }
.notice.error { color: var(--red); background: rgba(188,61,74,.1); }
.connection-result { display: grid; gap: 7px; margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.45); font-size: 13px; }
.channel-field { margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.36); }
.channel-field label, .channel-field input { margin-top: 0; }
.channel-field.vip-field { background: rgba(36,33,31,.045); }
.channel-label { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.channel-label span { display: inline-flex; min-width: 27px; height: 27px; align-items: center; justify-content: center; padding: 0 8px; border-radius: 999px; color: white; background: var(--ink); font-size: 10px; font-weight: 850; letter-spacing: .05em; }
.test-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.test-actions .secondary-action { margin-top: 10px; }
.vip-action { background: var(--ink); color: white; }
.detect-action { width: 100%; margin-top: 10px; color: var(--blue-deep); background: rgba(109,136,237,.12); border: 1px solid rgba(109,136,237,.2); }
.detected-channels { display: grid; gap: 8px; margin-top: 14px; }
.detected-channels button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; }
.detected-channels button small { margin: 0; color: rgba(255,255,255,.62); }
.vip-avatar-download { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center; margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.48); }
.vip-avatar-download img { width: 104px; height: 104px; border-radius: 26px; object-fit: cover; }
.vip-avatar-download strong { display: block; }
.vip-avatar-download .button-link { margin-top: 10px; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid .profit { grid-column: span 2; }
  .hero { align-items: flex-start; flex-direction: column; }
  .settings-layout { grid-template-columns: 1fr; gap: 30px; padding-top: 34px; }
  .settings-intro { position: static; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1180px); }
  .hero { padding-top: 34px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid article { min-height: 105px; padding: 16px; }
  .stats-grid strong { font-size: 26px; }
  th, td { padding: 14px 18px; }
  .settings-card { padding: 24px 18px; }
  .settings-card-head { align-items: flex-start; flex-direction: column; }
  .test-actions { grid-template-columns: 1fr; gap: 0; }
  .vip-avatar-download { grid-template-columns: 82px 1fr; }
  .vip-avatar-download img { width: 82px; height: 82px; border-radius: 22px; }
}

