:root {
  color-scheme: dark;
  --bg: #11151b;
  --surface: #181e26;
  --surface-2: #202833;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f7fb;
  --muted: #9aa5b4;
  --accent: #8b7cff;
  --accent-2: #63e6be;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(139, 124, 255, 0.35);
  outline-offset: 2px;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 72px; padding: 0 5vw;
  background: rgba(17, 21, 27, 0.86); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), #5fcbff); box-shadow: 0 8px 24px rgba(139,124,255,.28); }
.nav { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.nav-link { padding: 9px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.nav-link:hover, .nav-link.active { background: var(--surface-2); color: var(--text); }
.profile-button { justify-self: end; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #304054; font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(99,230,190,.1); }

main { min-height: calc(100vh - 72px); }
.view { display: none; }
.active-view { display: block; animation: enter .26s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero { position: relative; min-height: 370px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 52px 6vw; overflow: hidden; background:
  radial-gradient(circle at 78% 25%, rgba(99,230,190,.25), transparent 23%),
  radial-gradient(circle at 18% 0%, rgba(139,124,255,.42), transparent 35%),
  linear-gradient(130deg, #202b3a, #17252b 58%, #1a1b29);
}
.hero::before { content: ""; position: absolute; width: 480px; height: 480px; right: 9%; top: -170px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.hero-shade { position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, rgba(17,21,27,.68)); }
.hero-content, .hero-actions { position: relative; z-index: 1; }
.eyebrow, .section-label { margin: 0 0 8px; color: #b8adff; font-size: .74rem; font-weight: 800; letter-spacing: .14em; }
.hero h1, .page-title h1, .company-copy h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 4.6rem); line-height: 1.03; letter-spacing: -.045em; }
.hero p:not(.eyebrow), .page-title > p, .company-copy > p:last-child { margin: 14px 0 0; color: #c4ccd7; }
.hero-actions { display: flex; gap: 10px; }

.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 13px; padding: 11px 16px; font-weight: 750; cursor: pointer; }
.primary-button { background: var(--accent); color: white; box-shadow: 0 10px 28px rgba(139,124,255,.22); }
.secondary-button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.11); }
.danger-button { background: rgba(255,100,122,.12); color: #ff8c9d; }
.hidden { display: none !important; }

.content-shell, .page-view { width: min(1180px, 90vw); margin: 0 auto; padding: 50px 0 80px; }
.section-block { margin-bottom: 34px; }
.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; }
h2 { margin: 0; font-size: 1.32rem; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .9rem; }

.deck-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.deck-button { position: relative; min-height: 148px; padding: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; overflow: hidden; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.deck-button:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.23); }
.deck-button:active { transform: translateY(-1px) scale(.985); }
.deck-button .icon { display: block; margin-bottom: 26px; font-size: 1.7rem; }
.deck-button strong { display: block; font-size: .98rem; }
.deck-button small { display: block; margin-top: 6px; color: rgba(255,255,255,.64); }
.deck-button .edit-badge { display: none; position: absolute; top: 10px; right: 10px; padding: 5px 8px; border-radius: 8px; background: rgba(0,0,0,.28); font-size: .7rem; }
.deck-grid.editing .edit-badge { display: block; }
.deck-grid.editing .deck-button { outline: 1px dashed rgba(255,255,255,.3); }
.deck-button.violet { background: linear-gradient(145deg, #5847bb, #332d66); }
.deck-button.blue { background: linear-gradient(145deg, #2876a8, #243f6c); }
.deck-button.mint { background: linear-gradient(145deg, #257b70, #1f4d4c); }
.deck-button.orange { background: linear-gradient(145deg, #9b5c2c, #5d382a); }
.deck-button.rose { background: linear-gradient(145deg, #9a4262, #552d46); }
.deck-button.slate { background: linear-gradient(145deg, #425063, #29333f); }

.overview-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.pill { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: .76rem; }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 17px; border-radius: 16px; background: var(--surface-2); }
.stat strong { display: block; font-size: 1.65rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.activity-list { display: grid; gap: 8px; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border: 0; }
.activity-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); }
.activity-item div { min-width: 0; }
.activity-item strong, .activity-item small { display: block; }
.activity-item small { margin-top: 3px; color: var(--muted); }
.empty-state { padding: 28px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 15px; }

.page-title { margin: 22px 0 36px; }
.page-title h1 { font-size: clamp(2.2rem, 4vw, 3.8rem); }
.split-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.report-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.report-card span { color: var(--muted); font-size: .82rem; }
.report-card strong { display: block; margin-top: 10px; font-size: 2rem; }
.chart-panel { min-height: 330px; }
.bar-chart { height: 230px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 14px; padding-top: 24px; }
.bar-column { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.bar { width: min(48px, 80%); min-height: 6px; border-radius: 10px 10px 4px 4px; background: linear-gradient(#9e92ff, #6254c8); transition: height .3s ease; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.filter-chip.active, .filter-chip:hover { background: var(--surface-2); color: var(--text); }
.community-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.community-card { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.community-cover { min-height: 150px; display: grid; place-items: center; font-size: 3.2rem; background: linear-gradient(135deg, #343c5c, #263a38); }
.community-card:nth-child(2) .community-cover { background: linear-gradient(135deg, #57385d, #2f3552); }
.community-card:nth-child(3) .community-cover { background: linear-gradient(135deg, #5b4930, #263e3e); }
.community-body { padding: 19px; }
.community-body h2 { margin-bottom: 7px; }
.community-body p { min-height: 42px; margin: 0; color: var(--muted); font-size: .88rem; }
.community-meta { display: flex; justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: .78rem; }
.clone-button { width: 100%; margin-top: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); cursor: pointer; }

.company-hero { display: flex; align-items: center; gap: 20px; margin: 22px 0 18px; }
.company-logo { display: grid; place-items: center; flex: 0 0 76px; height: 76px; border-radius: 22px; background: linear-gradient(145deg, #8b7cff, #4c83c8); font-size: 2rem; font-weight: 900; }
.company-copy { flex: 1; }
.company-copy h1 { font-size: 2.3rem; }
.company-copy > p:last-child { font-size: .92rem; }
.live-counter { display: flex; align-items: baseline; gap: 7px; padding: 18px 21px; border-radius: 16px; background: rgba(99,230,190,.08); color: #aef4dd; }
.live-counter strong { font-size: 2rem; }
.pulse { align-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(99,230,190,.4); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(99,230,190,0); } }
.company-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.company-metrics { display: grid; gap: 10px; margin-top: 22px; }
.company-metrics div { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-radius: 13px; background: var(--surface-2); }
.company-metrics strong { font-size: 1.3rem; }
.company-metrics span { color: var(--muted); font-size: .82rem; }
.official-decks { display: grid; gap: 9px; margin-top: 20px; }
.official-decks button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.official-decks button > span { font-size: 1.35rem; }
.official-decks strong, .official-decks small { display: block; }
.official-decks small { margin-top: 3px; color: var(--muted); }
.demo-notice { color: var(--muted); font-size: .78rem; text-align: center; }

.modal { width: min(520px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: #1b222b; color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.modal::backdrop { background: rgba(4,7,10,.72); backdrop-filter: blur(5px); }
.modal form { display: grid; gap: 16px; padding: 24px; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 1.3rem; }
.modal label { display: grid; gap: 8px; color: #d8dfe8; font-size: .86rem; font-weight: 700; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #12171e; color: var(--text); resize: vertical; }
.form-actions { display: flex; gap: 9px; align-items: center; margin-top: 4px; }
.form-spacer { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); padding: 12px 16px; border-radius: 12px; background: #f3f6fa; color: #161b22; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { position: fixed; left: 50%; bottom: 16px; z-index: 40; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); justify-content: space-around; box-shadow: var(--shadow); }
  .nav-link { flex: 1; font-size: .82rem; }
  .profile-name, .status-dot { display: none; }
  .deck-grid { grid-template-columns: repeat(3, 1fr); }
  .community-grid { grid-template-columns: 1fr 1fr; }
  .report-cards { grid-template-columns: 1fr 1fr; }
  main { padding-bottom: 76px; }
}

@media (max-width: 680px) {
  .topbar { height: 62px; padding: 0 18px; }
  .brand { font-size: .94rem; }
  .hero { min-height: 330px; padding: 38px 5vw; align-items: flex-end; flex-direction: column; justify-content: flex-end; }
  .hero h1 { font-size: 2.5rem; }
  .hero-actions { align-self: flex-start; }
  .content-shell, .page-view { width: min(92vw, 560px); padding-top: 32px; }
  .section-heading, .split-title { align-items: flex-start; flex-direction: column; }
  .deck-grid { grid-template-columns: repeat(2, 1fr); }
  .deck-button { min-height: 132px; }
  .overview-grid, .company-grid, .community-grid { grid-template-columns: 1fr; }
  .today-stats { grid-template-columns: 1fr 1fr 1fr; }
  .company-hero { align-items: flex-start; flex-wrap: wrap; }
  .company-copy { flex-basis: calc(100% - 100px); }
  .live-counter { width: 100%; justify-content: center; }
  .report-cards { grid-template-columns: 1fr 1fr; }
  .bar-chart { gap: 6px; }
}
