:root {
    --purple: #23133a;
    --purple-light: #7B7FC4;
    --purple-dark: #3D3F7A;
    --blue: #883CF0;
    --teal: #7c3aed;
    --green: #8b5cf6;
    --orange: #b29dce;
    --red: #E63946;
    --bg: #0F0F1A;
    --bg2: #180f26;
    --bg3: #23133a9f;
    --card: #23133a;
    --border: #3a1c63;
    --text: #E8E8F8;
    --text-dim: #d6d6d6;
    --text-bright: #ffffff;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }

  /* NAV */
  nav { background: #180f2665; backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 24px; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; height: 60px; }
  .nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text-bright); }
  .nav-logo svg { width: 28px; height: 28px; }
  .nav-tabs { display: flex; gap: 4px; }
  .nav-tab { padding: 6px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-dim); transition: all 0.2s; border: none; background: none; }
  .nav-tab:hover { color: var(--text); background: var(--bg3); }
  .nav-tab.active { color: var(--text-bright); background: var(--purple); }

  /* HERO */
  .hero { background: linear-gradient(135deg, #23133a 0%, #23133a 50%, #23133a 100%); padding: 64px 24px 48px; text-align: center; position: relative; overflow: hidden; }
  .hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(135, 91, 166, 0.15) 0%, transparent 60%), radial-gradient(ellipse at 70% 30%, rgba(140, 0, 216, 0.1) 0%, transparent 50%); }
  .hero h1 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; line-height: 1.1; position: relative; }
  .hero h1 span { background: linear-gradient(90deg, #883CF0, #b29dce, #883CF0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  .hero p { margin-top: 16px; color: var(--text-dim); font-size: 16px; max-width: 540px; margin-inline: auto; position: relative; }
  .hero-badges { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; position: relative; }
  .badge { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }
  .badge-standard { background: #77b25520; color: #00C49A; border: 1px solid rgba(0,196,154,0.3); }
  .badge-private { background: #dc143c2b; color: #E63946; border: 1px solid rgba(230,57,70,0.3); }
  .badge-shared { background: #1f1232; color: #883CF0; border: 1px solid #3a1c63; }

  /* SECTIONS */
  .section { display: none; padding: 32px 24px; max-width: 1100px; margin: 0 auto; }
  .section.active { display: block; }
  .section-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
  .section-title::before { content: ''; display: block; width: 4px; height: 24px; background: var(--purple); border-radius: 2px; }

  /* CHANNEL CARDS */
  .channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
  .channel-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: all 0.25s; cursor: pointer; }
  .channel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #5e309d; }
  .channel-card.selected { border-color: #5e309d; background: #1f1232; }
  .card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
  .card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
  .card-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }
  .card-features { list-style: none; }
  .card-features li { font-size: 12px; color: var(--text-dim); padding: 4px 0; display: flex; align-items: center; gap: 8px; }
  .card-features li::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 11px; }
  .card-limit { margin-top: 14px; padding: 8px 12px; background: rgba(255,255,255,0.04); border-radius: 8px; font-size: 11px; color: var(--text-dim); }
  .card-limit strong { color: var(--text); }

  /* COMPARISON TABLE */
  .compare-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
  .compare-table th { background: var(--bg3); padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-dim); border-bottom: 1px solid var(--border); }
  .compare-table td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid #3a1c63; }
  .compare-table tr:hover td { background: #1f1232; }
  .check-yes { color: #00C49A; }
  .check-no { color: #E63946; }
  .check-partial { color: #FFB347; }

  /* DEEP LINK GENERATOR */
  .generator-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
  .form-group { margin-bottom: 18px; }
  .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
  .form-input { width: 100%; background: #1f1232; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s; }
  .form-input:focus { border-color: #5e309d; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .gen-btn { background: #883CF0; color: white; border: none; padding: 11px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
  .gen-btn:hover { background: #883cf0e0; transform: translateY(-1px); }
  .output-box { margin-top: 20px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: none; }
  .output-box.show { display: block; }
  .output-label { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; letter-spacing: 0.5px; }
  .output-link { font-size: 13px; color: var(--teal); word-break: break-all; line-height: 1.5; font-family: 'Consolas', monospace; }
  .copy-row { display: flex; gap: 8px; margin-top: 12px; }
  .copy-btn { padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
  .copy-btn-https { background: rgba(130, 0, 216, 0.2); color: var(--teal); border: 1px solid #3a1c63; }
  .copy-btn-msteams { background: #1f1232; color: var(--purple-light); border: 1px solid var(--border); }
  .copy-btn:hover { opacity: 0.8; }
  .copy-toast { font-size: 11px; color: var(--green); padding: 8px 0; display: none; }

  /* BEST PRACTICES */
  .practices-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
  .practice-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
  .practice-num { width: 28px; height: 28px; background: var(--purple); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-bottom: 12px; }
  .practice-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
  .practice-body { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

  /* CHANNEL PLANNER */
  .planner-area { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .planner-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .planner-team-name { font-size: 15px; font-weight: 700; }
  .planner-body { display: grid; grid-template-columns: 220px 1fr; min-height: 380px; }
  .planner-sidebar { border-right: 1px solid var(--border); padding: 12px; }
  .planner-sidebar-title { font-size: 11px; font-weight: 700; color: var(--text-dim); padding: 4px 8px; letter-spacing: 0.5px; margin-bottom: 4px; }
  .channel-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; transition: background 0.15s; position: relative; }
  .channel-item:hover { background: #2a1647; }
  .channel-item.active { background: #2a1647; color: var(--text-bright); }
  .channel-type-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .dot-standard { background: var(--green); }
  .dot-private { background: var(--red); }
  .dot-shared { background: var(--teal); }
  .channel-del { position: absolute; right: 6px; opacity: 0; font-size: 14px; color: var(--text-dim); cursor: pointer; }
  .channel-item:hover .channel-del { opacity: 1; }
  .add-channel-btn { width: 100%; padding: 8px; border-radius: 8px; border: 1px dashed var(--border); background: none; color: var(--text-dim); font-size: 12px; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
  .add-channel-btn:hover { border-color: var(--purple); color: var(--purple-light); }
  .planner-main { padding: 20px; }
  .planner-channel-view h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
  .planner-channel-view p { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
  .planner-tags { display: flex; gap: 8px; flex-wrap: wrap; }
  .ptag { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
  .ptag-std { background: rgba(118, 0, 196, 0.12); color: var(--green); }
  .ptag-priv { background: rgba(230,57,70,0.12); color: var(--red); }
  .ptag-shr { background: rgba(115, 0, 216, 0.12); color: var(--teal); }
  .add-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; align-items: center; justify-content: center; }
  .add-modal.open { display: flex; }
  .modal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 360px; }
  .modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
  .modal-type-row { display: flex; gap: 8px; margin-bottom: 16px; }
  .type-btn { flex: 1; padding: 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
  .type-btn.sel { border-color: var(--purple); background: #2a1647; color: var(--text-bright); }
  .modal-btns { display: flex; gap: 10px; margin-top: 18px; }
  .modal-btn-cancel { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--text-dim); cursor: pointer; font-size: 13px; }
  .modal-btn-add { flex: 1; padding: 10px; border-radius: 8px; border: none; background: var(--purple); color: white; cursor: pointer; font-size: 13px; font-weight: 600; }

  /* SCROLL */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  @media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .planner-body { grid-template-columns: 1fr; }
    .planner-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
    .nav-tabs { gap: 2px; }
    .nav-tab { padding: 6px 10px; font-size: 12px; }
  }