:root {
  --bg: #08060f;
  --bg-2: #0d0a1a;
  --surface: #15102a;
  --surface-2: #1c1638;
  --border: #2a2150;
  --border-hover: #7c3aed;
  --text: #ede9fe;
  --text-muted: #a599c9;
  --text-dim: #7a6d9e;
  --primary: #a855f7;
  --primary-2: #7c3aed;
  --primary-glow: rgba(168, 85, 247, 0.35);
  --success: #c084fc;
  --danger: #ff5cb0;
  --free: #c084fc;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.25);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body {
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(168, 85, 247, 0.12), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(124, 58, 237, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body.center { display: flex; align-items: center; justify-content: center; padding: 20px; }

a { color: #c084fc; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #e9d5ff; text-decoration: underline; }
.muted { color: var(--text-muted); font-size: 14px; }

.card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow), 0 0 0 1px rgba(168, 85, 247, 0.04) inset;
}
.card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e9d5ff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card h2 { margin: 16px 0 8px; font-size: 18px; font-weight: 600; word-break: break-all; color: #fff; }
.filename { color: #fff; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { background: #251a45; border-color: var(--border-hover); text-decoration: none; color: #fff; }
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border: 1px solid transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn.primary:hover { background: linear-gradient(135deg, #b866ff 0%, #8b43ff 100%); box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-1px); }
.btn.danger { background: transparent; border-color: #4a1d3a; color: #ff8ac6; }
.btn.danger:hover { background: rgba(255, 92, 176, 0.08); border-color: #ff5cb0; }

input[type=text], input[type=email], input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15); }
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; margin-top: 14px; font-weight: 500; }

.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 48px 20px; text-align: center; cursor: pointer; transition: all 0.2s ease; background: rgba(168, 85, 247, 0.02); }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: rgba(168, 85, 247, 0.08); }
.dropzone p { margin: 6px 0; }
.dropzone strong { color: #fff; }

.progress { height: 10px; background: var(--surface); border-radius: 6px; overflow: hidden; margin-top: 14px; border: 1px solid var(--border); }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); width: 0%; transition: width 0.25s ease; box-shadow: 0 0 10px var(--primary-glow); }
.upload-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.upload-stats #speed-text { color: #c4b5fd; font-weight: 600; }

.file-list { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s ease; }
.file-row:hover { border-color: var(--primary); }
.file-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #fff; }
.file-row .meta { font-size: 12px; color: var(--text-muted); }
.file-row .actions { display: flex; gap: 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }

.err { color: #ff6b9f; font-size: 13px; margin-top: 10px; min-height: 18px; }
.ok { color: #c084fc; font-size: 13px; margin-top: 10px; min-height: 18px; }
.copy-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); color: #c4b5fd; }

@media (max-width: 600px) {
  .file-row { flex-wrap: wrap; }
  .file-row .name { flex-basis: 100%; }
  .card { padding: 24px; }
}

.site-header { border-bottom: 1px solid var(--border); background: rgba(8, 6, 15, 0.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.site-header-inner { max-width: 1080px; margin: 0 auto; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; position: relative; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-toggle:hover { border-color: var(--primary); background: rgba(168, 85, 247, 0.08); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.brand:hover { text-decoration: none; transform: translateY(-1px); }
.brand-icon {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 4px 14px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.brand-icon svg { width: 18px; height: 18px; color: #fff; }
.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: inherit;
  line-height: 1;
}
.brand-text .bw {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 70%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text .bm {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color 0.15s ease; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.btn { color: var(--text); padding: 8px 16px; }

.hero { padding: 96px 20px 48px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 300px at 50% 0%, rgba(168, 85, 247, 0.25), transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 720px; margin: 0 auto; position: relative; }
.hero h1 {
  margin: 0 0 16px;
  font-size: 54px;
  letter-spacing: -0.035em;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  padding-bottom: 4px;
}
.hero .lead { margin: 0; font-size: 19px; color: var(--text-muted); line-height: 1.55; }

.section-title {
  margin: 48px 0 24px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 80px; }
.product-card {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
}
.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 50%, rgba(168, 85, 247, 0.4));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-glow); text-decoration: none; }
.product-card:hover::after { opacity: 1; }
.product-img { width: 100%; aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: var(--surface-2); }
.product-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; font-weight: 800;
  background: linear-gradient(135deg, #2a1150 0%, #0d0a1a 100%);
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}
.product-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-title { font-weight: 700; font-size: 17px; color: #fff; letter-spacing: -0.01em; }
.product-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: inline-block; font-weight: 700; font-size: 15px; color: #c4b5fd; }
.price.free { color: var(--free); }
.product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.downloads { font-size: 12px; color: var(--text-dim); }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 80px; background: var(--bg-2); }
.site-footer .muted { text-align: center; margin: 0; }

.product-detail { max-width: 780px; margin: 40px auto; padding: 0 20px; }
.product-detail .back { display: inline-block; margin-bottom: 18px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.product-detail .back:hover { color: var(--primary); text-decoration: none; }
.product-detail h1 { margin: 8px 0 12px; font-size: 34px; letter-spacing: -0.03em; color: #fff; }
.product-detail .price-row { display: flex; align-items: center; gap: 16px; margin: 18px 0 28px; }
.product-detail .price-row .price { font-size: 22px; }
.product-detail .desc {
  color: #d4cfe6;
  line-height: 1.7;
  white-space: pre-wrap;
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  font-size: 15px;
}
.product-detail .buy-box { background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; margin-top: 18px; }
.buy-box h3 { margin: 0 0 12px; font-size: 17px; color: #fff; }
.buy-box p { margin: 8px 0; color: var(--text-muted); font-size: 13px; }
.paypal-btn input[type=image] { max-width: 200px; }

.share-row { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s ease;
}
.share-btn:hover { background: var(--surface-2); border-color: var(--primary); text-decoration: none; }
.share-btn.fb { color: #93c5fd; }
.share-btn.fb:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.share-btn.tw { color: #d4cfe6; }

.account-page { max-width: 960px; margin: 40px auto; padding: 0 20px; }
.auth-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: 40px auto; }
.auth-forms .card { max-width: none; padding: 28px; }
.purchase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 24px; }
.purchase-card { background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s ease; }
.purchase-card:hover { border-color: var(--primary); }
.purchase-img { aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: var(--surface-2); }
.purchase-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; color: var(--primary); background: linear-gradient(135deg, #2a1150 0%, #0d0a1a 100%); }
.purchase-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.purchase-title { font-weight: 700; font-size: 16px; color: #fff; }
.purchase-meta { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0 8px; }
.tab { padding: 12px 18px; background: transparent; border: none; color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; transition: all 0.15s ease; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--primary); }

@media (max-width: 720px) {
  .hero h1 { font-size: 36px; }
  .hero .lead { font-size: 16px; }
  .auth-forms { grid-template-columns: 1fr; }
  .product-detail h1 { font-size: 26px; }

  .nav-toggle { display: flex; }
  .site-header .nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    min-width: 180px;
    background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(168, 85, 247, 0.06) inset;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .site-header .nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .site-header .nav a {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: background 0.12s ease, color 0.12s ease;
  }
  .site-header .nav a:hover { background: var(--surface-2); color: #fff; }
}

.ad-slot {
  display: block;
  margin: 28px auto;
  max-width: 1080px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px 16px;
  min-height: 110px;
  overflow: hidden;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
}
.ad-slot ins.adsbygoogle { display: block; min-height: 90px; }
.ad-slot.ad-narrow { max-width: 760px; }

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-cta { margin-top: 28px; display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-cta .btn { padding: 12px 22px; font-size: 15px; }

.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding-bottom: 24px; }
.tier-card {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}
.tier-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.tier-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(165deg, #211642 0%, #0d0a1a 100%);
  box-shadow: 0 0 0 1px var(--primary-glow), var(--shadow-glow);
}
.tier-badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 999px;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.tier-name {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}
.tier-price {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
  margin-bottom: 12px;
}
.tier-price .cur { font-size: 28px; font-weight: 600; color: var(--text-muted); vertical-align: top; margin-right: 2px; }
.tier-price .plus { color: var(--primary); font-size: 32px; vertical-align: top; }
.tier-blurb { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.tier-features { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.tier-features li {
  padding-left: 24px;
  position: relative;
  font-size: 13.5px;
  color: #d4cfe6;
  line-height: 1.4;
}
.tier-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 700;
}
.tier-card .btn { margin-top: auto; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding-bottom: 16px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  transition: border-color 0.15s ease;
}
.feature:hover { border-color: var(--primary); }
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-title { font-weight: 700; font-size: 16px; color: #fff; margin-bottom: 4px; }
.feature-body { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding-bottom: 16px; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.step-title { font-weight: 700; color: #fff; margin-bottom: 4px; font-size: 15px; }
.step-desc { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.contact-box {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-bottom: 60px;
  box-shadow: var(--shadow-glow);
}
.contact-box .btn.primary { font-size: 15px; padding: 13px 24px; }
.email-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 4px 4px 18px;
  margin-bottom: 18px;
  max-width: 100%;
}
.email-pill-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  color: #fff;
  user-select: all;
  margin-right: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-pill-copy {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease;
}
.email-pill-copy:hover { filter: brightness(1.1); }
.contact-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.55;
  transition: all 0.15s ease;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15); }

.composer {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px 22px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.composer-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.composer-foot { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.composer-foot input { flex: 1; min-width: 120px; }
.composer-foot.composer-foot-grid { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 8px; align-items: center; }
.composer-foot.composer-foot-grid input { min-width: 0; }
@media (max-width: 600px) {
  .composer-foot.composer-foot-grid { grid-template-columns: 1fr 1fr; }
}

.diary-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 60px; }
.diary-day {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 18px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.diary-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  transition: border-color 0.15s ease;
}
.diary-entry:hover { border-color: var(--primary); }
.diary-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.diary-time { font-size: 12px; color: var(--text-dim); }
.diary-edited { color: var(--text-dim); font-style: italic; }
.diary-mood {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
  text-transform: lowercase;
}
.diary-title { font-weight: 700; font-size: 17px; color: #fff; margin-bottom: 6px; }
.diary-content { color: #d4cfe6; line-height: 1.65; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.diary-actions { display: flex; gap: 8px; margin-top: 14px; }

.diary-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.diary-main { min-width: 0; }
.calendar {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  position: sticky;
  top: 88px;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.calendar-header span {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.01em;
}
.cal-nav {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s ease;
}
.cal-nav:hover { background: var(--surface-2); border-color: var(--primary); color: #fff; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: all 0.12s ease;
  padding: 0;
}
.cal-day:hover { background: var(--surface-2); color: #fff; }
.cal-day.empty { cursor: default; visibility: hidden; }
.cal-day.has-entries { color: #fff; font-weight: 700; cursor: pointer; }
.cal-day.has-entries:not(.selected)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary-glow);
}
.cal-day:not(.has-entries) { opacity: 0.55; }
.cal-day:not(.has-entries):hover { background: var(--surface-2); color: #fff; opacity: 0.85; }
.cal-day.today { border-color: rgba(168, 85, 247, 0.5); }
.cal-day.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff !important;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.calendar-actions { display: flex; gap: 8px; margin-top: 14px; }
.calendar-actions .btn { flex: 1; padding: 8px 12px; font-size: 13px; }

.calendar-toggle { display: none; }

.ptabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  padding: 5px;
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  position: relative;
}
.ptabs::-webkit-scrollbar { height: 4px; }
.ptabs::-webkit-scrollbar-track { background: transparent; }
.ptabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ptab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 9px;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.ptab:hover { color: #fff; background: rgba(168, 85, 247, 0.07); }
.ptab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 2px 10px var(--primary-glow);
}
.ptab svg { color: currentColor; flex-shrink: 0; pointer-events: none; }
.ptab svg * { pointer-events: none; }

@media (max-width: 720px) {
  .ptabs { padding: 4px; gap: 3px; border-radius: 12px; margin-bottom: 18px; }
  .ptab { padding: 9px 13px; font-size: 12.5px; gap: 6px; }
  .ptab svg { width: 14px; height: 14px; }
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding-bottom: 60px;
}
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.note-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.note-card.pinned {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(165deg, rgba(168, 85, 247, 0.06) 0%, var(--bg-2) 100%);
}
.note-pin { position: absolute; top: 12px; right: 14px; font-size: 14px; }
.note-meta { font-size: 11px; color: var(--text-dim); }
.note-title { font-weight: 700; font-size: 15px; color: #fff; }
.note-content { color: #d4cfe6; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow: auto; }
.note-actions { display: flex; gap: 6px; margin-top: 8px; }
.note-actions .btn { padding: 6px 10px; font-size: 12px; flex: 1; }

.todo-add {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.todo-add input {
  flex: 1;
  padding: 14px 16px;
  font-size: 15px;
}
.todo-add .btn { padding: 0 22px; font-weight: 600; }

.todo-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.todo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.12s ease;
}
.todo-row:hover { border-color: var(--primary); }
.todo-row.done { opacity: 0.55; }
.todo-row.done .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: all 0.12s ease;
  padding: 0;
}
.todo-check:hover { border-color: var(--primary); }
.todo-row.done .todo-check {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}
.todo-text {
  flex: 1;
  font-size: 14.5px;
  color: var(--text);
  word-break: break-word;
}
.todo-del {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.12s ease;
  font-family: inherit;
  padding: 0;
}
.todo-del:hover { background: rgba(255, 92, 176, 0.12); color: #ff8ac6; }
.todo-done-header { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.todo-done-header .btn { padding: 6px 14px; font-size: 12px; }

.author-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Trades + Watchlist ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-tile {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 700; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.pos { color: #6ee7a3; }
.stat-value.neg { color: #ff7ab0; }

.trade-row-2 { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.trade-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.trade-row-2 select, .trade-row-3 select { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer; }
.trade-row-2 input, .trade-row-3 input { padding: 12px 14px; }
input[type=date], input[type=number] { font-family: inherit; }

.trade-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; }
.trade-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 12px; transition: border-color 0.15s ease; }
.trade-card:hover { border-color: var(--primary); }
.trade-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.trade-ticker { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -0.01em; }
.trade-side { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700; letter-spacing: 0.05em; }
.trade-side.long { background: rgba(110, 231, 163, 0.12); color: #6ee7a3; border: 1px solid rgba(110, 231, 163, 0.3); }
.trade-side.short { background: rgba(255, 122, 176, 0.12); color: #ff7ab0; border: 1px solid rgba(255, 122, 176, 0.3); }
.trade-pl { margin-left: auto; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.trade-pl.pos { color: #6ee7a3; }
.trade-pl.neg { color: #ff7ab0; }
.trade-meta { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.trade-notes { color: #d4cfe6; font-size: 13px; margin-top: 8px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.trade-actions { display: flex; gap: 6px; margin-top: 10px; }
.trade-actions .btn { padding: 6px 12px; font-size: 12px; }

.watchlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding-bottom: 60px; }
.watch-card { background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 14px; transition: border-color 0.15s ease; }
.watch-card:hover { border-color: var(--primary); }
.watch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.watch-ticker { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: -0.01em; }
.watch-price { font-weight: 700; font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.watch-price.pos { color: #6ee7a3; } .watch-price.neg { color: #ff7ab0; }
.watch-chg { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; text-align: right; color: var(--text-dim); }
.watch-chg.pos { color: #6ee7a3; } .watch-chg.neg { color: #ff7ab0; }
.watch-meta { margin-top: 10px; font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.watch-meta strong { color: #fff; font-variant-numeric: tabular-nums; }
.watch-notes { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.watch-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.watch-actions .btn { padding: 5px 10px; font-size: 11px; }

/* ===== Attachments ===== */
.att-pick { display: inline-flex !important; align-items: center; gap: 6px; cursor: pointer; padding: 9px 12px !important; }
.att-pick svg { color: var(--primary); }
.att-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.att-strip:empty { display: none; }
.att-thumb {
  display: block;
  width: 70px; height: 70px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb.pending { border-style: dashed; border-color: var(--primary); }
.att-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.att-rm:hover { background: rgba(255, 92, 176, 0.9); }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ===== Popular markets strip ===== */
.market-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.market-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}
.market-tile:hover { border-color: var(--primary); }
.market-tile .market-ticker { font-size: 12px; color: var(--text-dim); font-weight: 700; letter-spacing: 0.04em; }
.market-tile .market-price { font-size: 16px; color: #fff; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.market-tile .market-price.pos { color: #6ee7a3; } .market-tile .market-price.neg { color: #ff7ab0; }
.market-tile .market-chg { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim); margin-top: 1px; }
.market-tile .market-chg.pos { color: #6ee7a3; } .market-tile .market-chg.neg { color: #ff7ab0; }

/* ===== News ===== */
.news-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.news-bar-info { font-size: 13px; color: var(--text-muted); flex: 1; min-width: 0; }
.news-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 60px; }
.news-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
  color: inherit;
}
.news-card:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.news-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg-2);
}
.news-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.news-title { font-weight: 600; color: #fff; font-size: 15px; line-height: 1.35; }
.news-meta { font-size: 12px; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.news-tags { display: inline-flex; gap: 4px; margin-left: 4px; flex-wrap: wrap; }
.news-tag {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
}

/* ===== Finance ===== */
.fin-type-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 2px;
  align-self: flex-start;
}
.fin-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  font-family: inherit;
  transition: all 0.15s ease;
}
.fin-type-btn:hover { color: #fff; }
.fin-type-btn svg, .fin-type-btn svg * { pointer-events: none; }
.fin-type-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fin-filter-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fin-type-btn.active[data-type="expense"] {
  background: rgba(255, 122, 176, 0.18);
  color: #ff8ac6;
}
.fin-type-btn.active[data-type="income"] {
  background: rgba(110, 231, 163, 0.18);
  color: #6ee7a3;
}

.fin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fin-row select, .fin-row input { padding: 12px 14px; }
.fin-amount-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.fin-currency-prefix {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 16px;
}
.fin-amount-wrap input { padding-left: 30px; font-size: 16px; font-weight: 600; }

.fin-filter { display: flex; gap: 6px; margin: 8px 0 16px; flex-wrap: wrap; }
.fin-filter-btn {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.fin-filter-btn:hover { color: #fff; border-color: var(--primary); }
.fin-filter-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }

.fin-list { display: flex; flex-direction: column; gap: 6px; }
.fin-month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 18px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.fin-month-head .fin-month-net { font-variant-numeric: tabular-nums; font-size: 13px; }
.fin-month-net.pos { color: #6ee7a3; }
.fin-month-net.neg { color: #ff7ab0; }

.fin-entry {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--text-dim);
  transition: border-color 0.12s ease;
}
.fin-entry:hover { border-color: var(--primary); }
.fin-entry.income { border-left-color: #6ee7a3; }
.fin-entry.expense { border-left-color: #ff7ab0; }
.fin-entry-main { flex: 1; min-width: 0; }
.fin-entry-amt {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.fin-entry.income .fin-entry-amt { color: #6ee7a3; }
.fin-entry.expense .fin-entry-amt { color: #ff7ab0; }
.fin-entry-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.fin-entry-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.fin-recur { font-size: 11px; color: var(--text-muted); }
.fin-entry-desc { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; word-break: break-word; }
.fin-entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.fin-entry-date { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.fin-entry-actions { display: flex; gap: 4px; }
.fin-entry-actions .btn { padding: 5px 10px; font-size: 11px; }
.fin-entry-actions .btn.danger { padding: 5px 9px; font-size: 14px; line-height: 1; }

.fin-cats-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 60px; }
.fin-cat-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.fin-cat-label { color: var(--text); font-weight: 600; }
.fin-cat-bar { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.fin-cat-fill { height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 4px; }
.fin-cat-value { text-align: right; font-variant-numeric: tabular-nums; color: #ff8ac6; font-weight: 700; }

@media (max-width: 720px) {
  .fin-row { grid-template-columns: 1fr; }
  .fin-entry { gap: 10px; padding: 12px; }
  .fin-entry-amt { font-size: 16px; }
  .fin-cat-row { grid-template-columns: 90px 1fr 70px; gap: 8px; font-size: 12px; }
}

/* ===== Chat ===== */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff5cb0;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  height: calc(100vh - 280px);
  min-height: 480px;
}
.chat-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-side-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 8px;
}
.chat-channels, .chat-new-dm { display: flex; flex-direction: column; gap: 4px; }
.chat-channel, .chat-dm-target {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}
.chat-channel:hover, .chat-dm-target:hover { background: var(--surface-2); }
.chat-channel.active { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.4); }
.chat-channel-icon, .chat-avatar {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.chat-channel-icon svg { color: #fff; }
.chat-channel-body { flex: 1; min-width: 0; }
.chat-channel-name { color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-channel-preview { color: var(--text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.chat-unread {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: #ff5cb0;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.chat-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--bg-2) 100%);
}
.chat-active-title { font-weight: 700; color: #fff; font-size: 16px; }
.chat-active-sub { font-size: 12px; margin-top: 2px; }
.chat-messages {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-day-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin: 14px 0 6px;
  padding: 4px 0;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.chat-msg {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  margin-top: 10px;
}
.chat-msg.grouped { margin-top: 2px; }
.chat-msg.mine { align-self: flex-end; }
.chat-msg-head { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; padding: 0 4px; }
.chat-msg-author { color: #c4b5fd; font-weight: 700; margin-right: 4px; }
.chat-msg-body {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.mine .chat-msg-body {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border-color: transparent;
}
.chat-msg.grouped .chat-msg-body { border-top-left-radius: 6px; }
.chat-msg.mine.grouped .chat-msg-body { border-top-left-radius: 14px; border-top-right-radius: 6px; }
.chat-msg-del {
  position: absolute;
  top: 4px; right: 6px;
  width: 18px; height: 18px;
  background: rgba(0,0,0,0.25);
  border: none;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: inherit;
}
.chat-msg.mine:hover .chat-msg-del { opacity: 1; }

.chat-send {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.chat-send textarea {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  line-height: 1.4;
  max-height: 140px;
}
.chat-send textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15); }
.chat-send .btn { padding: 0 22px; font-weight: 600; align-self: flex-end; }

@media (max-width: 800px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat-sidebar { max-height: 280px; }
  .chat-messages { max-height: 50vh; min-height: 320px; }
  .chat-msg { max-width: 88%; }
}

/* ===== Research ===== */
.research-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.research-tools input {
  padding: 12px 16px;
  font-size: 14px;
}
.research-ticker-wrap { position: relative; }
.research-cats {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.research-cat {
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.research-cat:hover { color: #fff; border-color: var(--primary); }
.research-cat.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.research-feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; margin-top: 24px; }
.research-feed-head .btn { padding: 7px 14px; font-size: 12px; }

.research-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: stretch;
}
.research-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.research-card-link {
  flex: 1;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.research-card-link:hover { text-decoration: none; }
.research-card-title { font-weight: 600; color: #fff; font-size: 15px; line-height: 1.4; }
.research-card-snippet {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.research-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.research-save {
  flex-shrink: 0;
  width: 44px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.research-save:hover { color: #c4b5fd; background: rgba(168, 85, 247, 0.08); }
.research-save.saved { color: #fbbf24; }

@media (max-width: 720px) {
  .research-tools { grid-template-columns: 1fr; }
  .research-card-link { padding: 12px 14px; }
  .research-card-title { font-size: 14px; }
  .research-card-snippet { font-size: 12.5px; }
}

/* ===== Bot tab ===== */
.bot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bot-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bot-pulse {
  width: 14px; height: 14px; border-radius: 50%; background: var(--text-dim);
  box-shadow: 0 0 0 0 var(--text-dim);
  flex-shrink: 0;
}
.bot-pulse.running { background: #6ee7a3; animation: botPulse 1.6s infinite; }
.bot-pulse.stopped { background: #ff7ab0; }
@keyframes botPulse { 0% { box-shadow: 0 0 0 0 rgba(110,231,163,0.55); } 70% { box-shadow: 0 0 0 10px rgba(110,231,163,0); } 100% { box-shadow: 0 0 0 0 rgba(110,231,163,0); } }
.bot-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.bot-status { font-size: 12px; margin-top: 2px; }
.bot-controls { display: flex; gap: 8px; }
.bot-controls .btn { padding: 10px 20px; font-weight: 600; }

.bot-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.bot-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.bot-tile-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 700; margin-bottom: 4px; }
.bot-tile-value { font-size: 14px; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.bot-tile-value .pos { color: #6ee7a3; } .bot-tile-value .neg { color: #ff7ab0; }

.bot-console {
  background: #050308;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  max-height: 360px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.bot-line { color: #c4b5fd; padding: 2px 0; word-break: break-all; }
.bot-line.err { color: #ff7ab0; }
.bot-line.sys { color: #6ee7a3; font-style: italic; }
.bot-time { color: var(--text-dim); margin-right: 8px; }

.bot-logs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.bot-log-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.bot-log-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.bot-log-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #c4b5fd; word-break: break-all; }
.bot-log-tail {
  margin: 0;
  background: #050308;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #d4cfe6;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.bot-note {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 60px;
}
.bot-note strong { color: #c4b5fd; }

/* ===== Ticker search dropdown ===== */
.ticker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.ticker-opt {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(42, 33, 80, 0.4);
  transition: background 0.1s ease;
}
.ticker-opt:last-child { border-bottom: none; }
.ticker-opt:hover, .ticker-opt.active { background: var(--surface-2); }
.opt-sym { font-weight: 700; color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.opt-name { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-price {
  text-align: right;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.opt-price.pos { color: #6ee7a3; } .opt-price.neg { color: #ff7ab0; }
.opt-chg { font-size: 10px; font-weight: 600; opacity: 0.85; }

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-tile { padding: 12px 14px; }
  .stat-value { font-size: 18px; }
  .trade-row-2, .trade-row-3 { grid-template-columns: 1fr; }
  .trade-pl { margin-left: 0; }
  .trade-head { flex-wrap: wrap; }
  .watchlist-grid { grid-template-columns: 1fr; }
  .watch-price { font-size: 16px; }
  .market-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .news-thumb { width: 80px; height: 60px; }
  .news-title { font-size: 14px; }
  .ticker-opt { grid-template-columns: 70px 1fr; }
  .opt-ex { display: none; }
}

@media (max-width: 800px) {
  .diary-layout { grid-template-columns: 1fr; gap: 12px; }
  .calendar {
    position: static;
    display: none;
    margin-bottom: 4px;
  }
  .calendar.open { display: block; animation: calFade 0.2s ease; }
  @keyframes calFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .calendar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 10px;
    background: linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 6px;
    transition: border-color 0.15s ease;
  }
  .calendar-toggle:hover { border-color: var(--primary); }
  .calendar-toggle svg { color: var(--primary); flex-shrink: 0; }
  .calendar-toggle span:first-of-type { flex: 1; text-align: left; }
  .calendar-toggle .cal-toggle-pill {
    display: none;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-radius: 999px;
  }
  .calendar-toggle[aria-expanded="true"] svg { transform: rotate(180deg); transition: transform 0.2s ease; }

  /* Tighter calendar inside collapsible panel */
  .calendar { padding: 14px 14px 12px; }
  .cal-day { font-size: 14px; }
  .calendar-header span { font-size: 15px; }

  /* Topbar slimmer */
  .container .topbar { padding: 14px 0 12px; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
  .container .topbar .brand-text .bw { font-size: 18px; }
  .container .topbar .brand-text .bm { font-size: 13px; }
  .container .topbar > div > span.muted { display: none; }
  .container .topbar #who { display: none; }
  .container .topbar #logout { padding: 7px 12px; font-size: 13px; }

  /* Composer denser */
  .composer { padding: 14px 14px 16px; gap: 8px; border-radius: 12px; }
  .composer-head { font-size: 11px; }
  .composer textarea { font-size: 15px; padding: 12px 14px; }
  .composer-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .composer-foot .btn { width: 100%; padding: 12px; font-size: 14px; }

  /* Entry cards tighter */
  .diary-entry { padding: 14px 14px 12px; border-radius: 12px; }
  .diary-meta { margin-bottom: 6px; font-size: 12px; }
  .diary-title { font-size: 15.5px; }
  .diary-content { font-size: 14px; }
  .diary-actions { margin-top: 10px; gap: 6px; }
  .diary-actions .btn { flex: 1; padding: 8px 10px; font-size: 13px; }
  .diary-day { margin: 14px 0 2px; font-size: 11px; }

  /* Container padding */
  #app.container { padding: 0 14px; }
}
@media (max-width: 480px) {
  .email-pill { display: flex; }
  .email-pill-text { flex: 1; min-width: 0; }
}

@media (max-width: 720px) {
  .tier-price { font-size: 42px; }
  .contact-box { padding: 24px 20px; }
}
