﻿:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #54d2d7;
  --primary-dim: #80d4d7;
  --on-primary: #003738;
  --primary-container: #004f51;
  --bg: #0c1416;
  --surface: #161f21;
  --surface-low: #1c2628;
  --surface-container: #222d2f;
  --on-surface: #e4eceb;
  --muted: #93a0a0;
  --outline: #4a5656;
  --up: #089981;
  --down: #f23645;
  --warn: #fbbf24;
  --glass: rgba(20, 30, 32, 0.55);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --hero-text: #f0f6f5;
  --card-price: #f5fafa;
  --tile-bg: rgba(255, 255, 255, 0.07);
  --day-bg: rgba(32, 42, 44, 0.7);
  --bg-gradient:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(84, 210, 215, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 55% at 88% 92%, rgba(0, 79, 81, 0.28), transparent 50%),
    radial-gradient(ellipse 55% 45% at 70% 18%, rgba(47, 182, 187, 0.07), transparent 60%),
    linear-gradient(165deg, #0e181a 0%, #121c1e 42%, #0a1214 100%);
  --font: "Vazirmatn", "Outfit", sans-serif;
  --mono: "Outfit", "Vazirmatn", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --primary: #0f7c80;
  --primary-dim: #0b5f62;
  --on-primary: #ffffff;
  --primary-container: #c7f3f4;
  --bg: #e8f2f3;
  --surface: #f7fbfb;
  --surface-low: #ffffff;
  --surface-container: #e4eff0;
  --on-surface: #152022;
  --muted: #5a6a6a;
  --outline: #c2d0d1;
  --up: #078672;
  --down: #d92b3a;
  --warn: #c98500;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(15, 60, 64, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --hero-text: #122022;
  --card-price: #122022;
  --tile-bg: #ffffff;
  --day-bg: rgba(255, 255, 255, 0.72);
  --bg-gradient:
    radial-gradient(ellipse 85% 65% at 10% 5%, rgba(84, 210, 215, 0.22), transparent 55%),
    radial-gradient(ellipse 65% 50% at 92% 95%, rgba(15, 124, 128, 0.12), transparent 52%),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(199, 243, 244, 0.55), transparent 65%),
    linear-gradient(165deg, #f2f8f9 0%, #e6f1f2 45%, #dfecee 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html {
  height: 100%;
  background: var(--bg);
  color-scheme: dark;
}
html[data-theme="light"] {
  color-scheme: light;
}

html,
body {
  height: 100%;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--on-surface);
  overscroll-behavior: none;
}

.atmosphere {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-gradient);
}
.bg-photo {
  display: none;
}
.bg-veil {
  display: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}
.orb-a {
  width: 420px; height: 420px; top: -8%; right: -4%;
  background: rgba(84, 210, 215, 0.18);
}
.orb-b {
  width: 480px; height: 480px; bottom: -12%; left: -6%;
  background: rgba(0, 79, 81, 0.32);
  animation-delay: -6s;
}
html[data-theme="light"] .orb-a {
  background: rgba(84, 210, 215, 0.28);
  opacity: 0.55;
}
html[data-theme="light"] .orb-b {
  background: rgba(15, 124, 128, 0.16);
  opacity: 0.5;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -22px) scale(1.04); }
}

.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1560px, calc(100% - 28px));
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 0 6px;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: rise 0.55s ease both;
}
.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex-shrink: 0;
  min-height: 0;
  gap: 10px;
}
.top-bar > .tc-account { grid-column: 1; justify-self: start; }
.top-bar > .theme-switch { grid-column: 2; justify-self: center; }
.top-bar > .top-bar-spacer { grid-column: 3; min-width: 0; }
.tc-account {
  position: relative;
  z-index: 5;
}
.tc-account.hidden { display: none !important; }
.tc-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--on-surface);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(14px);
}
.tc-account-btn:hover { border-color: rgba(84, 210, 215, 0.45); }
.tc-account-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 28%, transparent);
}
.tc-account-phone { font-family: var(--mono); letter-spacing: 0.02em; }
.tc-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tc-account-menu.hidden { display: none !important; }
.tc-account-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dim);
}
.tc-account-phone-full {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--hero-text);
}
.tc-logout {
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  color: var(--down);
  border-color: color-mix(in srgb, var(--down) 35%, transparent);
}
html[data-theme="light"] .tc-account-btn {
  background: rgba(255, 255, 255, 0.85);
}
.theme-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.theme-opt {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.theme-opt:hover { color: var(--on-surface); }
.theme-opt.active {
  background: linear-gradient(135deg, #54d2d7, #2fb6bb);
  color: #003738;
  box-shadow: 0 6px 16px rgba(84, 210, 215, 0.28);
}
html[data-theme="light"] .theme-opt.active {
  background: linear-gradient(135deg, #0f7c80, #0b5f62);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 124, 128, 0.25);
}
.today-note-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(0, 79, 81, 0.18));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.4s ease both;
}
.today-note-banner.hidden { display: none !important; }
.today-note-banner-main { min-width: 0; flex: 1; }
.today-note-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}
.today-note-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.today-note-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(84, 210, 215, 0.4);
  background:
    linear-gradient(135deg, rgba(84, 210, 215, 0.16), rgba(0, 79, 81, 0.22));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.4s ease both;
}
.update-banner.hidden { display: none !important; }
.update-banner-main { min-width: 0; flex: 1; }
.update-banner-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.update-banner-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.45;
}
.update-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chart-head-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
  max-width: 360px;
}
.chart-head-actions .chart-tf-modes,
.chart-head-actions .chart-cal-modes {
  width: 100%;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
}
.chart-head-actions .chart-cal-modes {
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.chart-head-actions .chart-cal-modes .dw-mode {
  padding: 6px 12px;
}

.backup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(242, 54, 69, 0.72);
  background: linear-gradient(135deg, rgba(242, 54, 69, 0.28), rgba(90, 12, 18, 0.55));
  box-shadow: 0 10px 28px rgba(120, 16, 24, 0.22);
}
.backup-banner.hidden { display: none !important; }
.backup-banner p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  color: #ffe4e6;
}
.backup-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.backup-connect {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #e11d2e;
  border-radius: 10px;
  padding: 8px 12px;
  white-space: nowrap;
}
.backup-connect:hover { background: #c41626; }
html[data-theme="light"] .backup-banner {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: rgba(217, 43, 58, 0.45);
}
html[data-theme="light"] .backup-banner p { color: #9f1239; }
.tc-link-panel { width: min(440px, 100%); }
.tc-link-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.tc-link-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tc-link-form > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tc-link-form label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.tc-link-error {
  margin: 0;
  color: var(--down);
  font-size: 13px;
  font-weight: 700;
}
.tc-link-form .primary-btn { margin-top: 6px; }
.tc-auth-modes {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}
.tc-auth-modes .dw-mode { flex: 1 1 auto; text-align: center; }
.tc-otp-row { display: flex; gap: 8px; align-items: stretch; }
.tc-otp-row .search { flex: 1; min-width: 0; }
.tc-otp-row .secondary-btn { white-space: nowrap; cursor: pointer; font-family: inherit; }

.update-banner-actions .primary-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 999px;
}
html[data-theme="light"] .update-banner {
  border-color: rgba(15, 124, 128, 0.28);
  background: linear-gradient(135deg, rgba(84, 210, 215, 0.18), rgba(255, 255, 255, 0.85));
}
html[data-theme="light"] .update-banner-eyebrow {
  color: #0f7c80;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-block { display: flex; align-items: center; gap: 14px; min-width: 0; flex-shrink: 0; }
.brand-link { display: inline-flex; align-items: center; text-decoration: none; }
.logo {
  height: 48px;
  width: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(84, 210, 215, 0.28));
}
html[data-theme="light"] .logo {
  filter: drop-shadow(0 8px 18px rgba(15, 124, 128, 0.18));
}
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.hero-brand .logo {
  height: clamp(52px, 7vw, 72px);
}
.home-update-btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: 999px;
  color: #003738;
  background: linear-gradient(135deg, #54d2d7, #2fb6bb);
  box-shadow: 0 10px 24px rgba(84, 210, 215, 0.32);
}
.home-update-btn.hidden { display: none !important; }
.home-update-btn:disabled { opacity: 0.7; cursor: wait; }
html[data-theme="light"] .home-update-btn {
  color: #fff;
  background: linear-gradient(135deg, #0f7c80, #0b5f62);
  box-shadow: 0 10px 24px rgba(15, 124, 128, 0.28);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 96px;
  min-width: 96px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(26, 33, 33, 0.88);
  border: 1px solid var(--outline);
  font-size: 12px;
  color: var(--muted);
  box-sizing: border-box;
  flex-shrink: 0;
}
.live-label {
  display: inline-block;
  width: 52px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.socket-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.socket-dot.connecting { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.22); }
.socket-dot.live { background: var(--up); box-shadow: 0 0 0 3px rgba(8,153,129,.28); animation: pulse 1.6s ease infinite; }
.socket-dot.error { background: var(--down); }
@keyframes pulse { 50% { transform: scale(1.25); } }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.icon-btn, .ghost-btn, .primary-btn, .secondary-btn, .toggle-btn, .linkish {
  border: 0; cursor: pointer; font-family: inherit;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px;
  display: inline-grid; place-items: center;
  background: var(--surface-container);
  color: var(--on-surface);
  border: 1px solid var(--outline);
}
.icon-btn:hover { border-color: rgba(84,210,215,.45); color: var(--primary); }
.ghost-btn { background: transparent; color: var(--muted); padding: 8px 10px; font-size: 13px; }
.ghost-btn:hover { color: var(--on-surface); }

.status {
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
}
.status.error { background: rgba(242,54,69,.12); border: 1px solid rgba(242,54,69,.28); color: #ffb4ab; }
.status.success { background: rgba(8,153,129,.12); border: 1px solid rgba(8,153,129,.28); color: #9cf1f3; }
.status.info { background: rgba(84,210,215,.08); border: 1px solid rgba(84,210,215,.22); color: #cce8e8; }
.loading {
  text-align: center;
  color: var(--muted);
  padding: 8px 4px 2px;
  font-size: 13px;
}
.hidden { display: none !important; }

/* ---------- Skeleton loaders ---------- */
@keyframes skShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.sk {
  background: linear-gradient(
    90deg,
    rgba(38, 48, 48, 0.9) 0%,
    rgba(58, 72, 72, 0.95) 45%,
    rgba(38, 48, 48, 0.9) 90%
  );
  background-size: 200% 100%;
  animation: skShimmer 1.25s ease-in-out infinite;
  border-radius: 10px;
}
.sk-block { display: none; }
body.is-loading .sk-block,
body.is-loading-calendar .sk-cal {
  display: grid;
}
body.is-loading #watchlist,
body.is-loading #calendar-list,
body.is-loading #calendar-empty,
body.is-loading #fav-links,
body.is-loading .add-link-form {
  display: none !important;
}
body.is-loading-calendar #calendar-list,
body.is-loading-calendar #calendar-empty {
  display: none !important;
}

.sk-watch {
  grid-template-columns: 1fr;
  grid-auto-rows: 52px;
  gap: 6px;
  flex: 1;
  min-height: 0;
  height: 100%;
  align-content: start;
  overflow: auto;
  scrollbar-width: none;
}
.sk-watch::-webkit-scrollbar { display: none; }
.sk-card {
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}
.sk-card .sk-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.sk-card .sk-line { height: 10px; width: 42%; }
.sk-card .sk-line.sm { width: 22%; height: 8px; margin-right: auto; }

.sk-news,
.sk-cal-rows {
  gap: 8px;
  min-height: 220px;
  align-content: start;
}
.sk-news-row,
.sk-cal-row {
  display: grid;
  grid-template-columns: 56px 36px 1fr 70px 70px 70px;
  gap: 10px;
  align-items: center;
  height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(26, 33, 33, 0.4);
  border: 1px solid rgba(63, 73, 73, 0.45);
  box-sizing: border-box;
}
html[data-theme="light"] .sk-news-row,
html[data-theme="light"] .sk-cal-row,
html[data-theme="light"] .sk-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 60, 64, 0.1);
}
.sk-news-row { grid-template-columns: 56px 36px 1fr; height: 56px; }
.sk-news-row .sk,
.sk-cal-row .sk { height: 12px; width: 100%; }
.sk-news-row .sk.avatar,
.sk-cal-row .sk.avatar { width: 28px; height: 28px; border-radius: 50%; justify-self: center; }

.sk-links {
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-content: start;
}
.sk-link-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(26, 33, 33, 0.4);
  box-sizing: border-box;
}
.sk-link-row .sk.avatar { width: 28px; height: 28px; border-radius: 10px; }
.sk-link-row .sk.line { height: 12px; width: 70%; }

@media (max-width: 860px) {
  .sk-cal-row { grid-template-columns: 56px 1fr; }
  .sk-cal-row .sk:nth-child(n+3) { display: none; }
}

.search {
  width: 100%; border: 1px solid var(--outline); background: var(--surface-low);
  color: var(--on-surface); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; outline: none;
}
.search:focus { border-color: rgba(84,210,215,.55); }

.primary-btn {
  background: linear-gradient(135deg, #54d2d7, #2fb6bb);
  color: var(--on-primary);
  border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 28px rgba(84,210,215,.22);
}
.secondary-btn {
  background: var(--surface-container); color: var(--on-surface);
  border: 1px solid var(--outline); border-radius: 12px;
  padding: 12px 14px; font-weight: 600; font-size: 13px;
}
.secondary-btn.tiny { padding: 8px 12px; font-size: 12px; border-radius: 999px; }
.primary-btn:disabled, .secondary-btn:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 12px; }

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.section-head h2 { font-size: 20px; font-weight: 800; }
.section-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.section-tools { display: flex; align-items: center; gap: 8px; }
.count-chip {
  font-size: 12px; color: var(--primary-dim);
  background: rgba(84, 210, 215, 0.12);
  border: 1px solid rgba(84, 210, 215, 0.22);
  border-radius: 999px; padding: 7px 11px;
}
html[data-theme="light"] .count-chip {
  background: rgba(15, 124, 128, 0.1);
  border-color: rgba(15, 124, 128, 0.2);
  color: #0b5f62;
}

.market-board {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.watch-cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  height: 100%;
  align-content: start;
  overflow: auto;
  padding: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.watch-cards::-webkit-scrollbar { width: 0; height: 0; display: none; }
.watch-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 26px auto;
  align-items: center;
  gap: 10px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  padding: 0 10px 0 8px;
  border-radius: 14px;
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  cursor: grab;
  user-select: none;
  box-sizing: border-box;
  transition:
    border-color .22s ease,
    transform .22s ease,
    background .22s ease,
    box-shadow .22s ease,
    padding .22s ease;
  overflow: hidden;
}
.watch-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%);
  pointer-events: none;
}
.watch-card::after {
  content: "";
  position: absolute;
  inset-block: 18%;
  right: 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background .22s ease;
}
.watch-card.trend-up::after {
  background: linear-gradient(180deg, transparent, rgba(8, 153, 129, 0.85), transparent);
}
.watch-card.trend-down::after {
  background: linear-gradient(180deg, transparent, rgba(242, 54, 69, 0.8), transparent);
}
.watch-card.trend-up {
  border-color: rgba(8, 153, 129, 0.28);
}
.watch-card.trend-down {
  border-color: rgba(242, 54, 69, 0.26);
}
.watch-card:hover {
  border-color: rgba(84, 210, 215, 0.42);
  background: var(--glass-strong);
  transform: translateY(-1px);
  padding-left: 38px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 24px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(84, 210, 215, 0.08);
}
.watch-card:focus-within {
  padding-left: 38px;
}
.watch-card:active { cursor: grabbing; }
.watch-card.dragging {
  opacity: 0.45;
  transform: scale(0.99);
}
.watch-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(84, 210, 215, 0.28);
}

.watch-card.add-card {
  display: flex;
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(84, 210, 215, 0.35);
  background: rgba(84, 210, 215, 0.06);
  box-shadow: inset 0 1px 0 rgba(84, 210, 215, 0.08);
  justify-content: center;
  gap: 10px;
}
.watch-card.add-card::after { display: none; }
.watch-card.add-card:hover {
  border-color: rgba(84, 210, 215, 0.72);
  background: rgba(84, 210, 215, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}
.watch-card.add-card:active { cursor: pointer; }
.add-card-plus {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  color: var(--primary);
  background: rgba(84, 210, 215, 0.12);
  border: 1px solid rgba(84, 210, 215, 0.3);
  flex-shrink: 0;
}
.add-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dim);
  letter-spacing: 0.01em;
}

.card-remove {
  position: absolute;
  z-index: 3;
  left: 6px;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 8px;
  background: rgba(242, 54, 69, 0.22);
  color: #ffb4ab;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-110%, -50%);
  transition:
    opacity .2s ease,
    transform .22s cubic-bezier(0.22, 1, 0.36, 1),
    background .15s ease;
  font-family: inherit;
  flex-shrink: 0;
}
.watch-card:hover .card-remove,
.watch-card:focus-within .card-remove {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}
.card-remove:hover { background: rgba(242, 54, 69, 0.42); }

.card-chart {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: rgba(84, 210, 215, 0.12);
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.card-chart svg { display: block; pointer-events: none; }
.card-chart:hover { background: rgba(84, 210, 215, 0.24); }

.symbol-chart-modal { padding: 22px 28px; }
.symbol-chart-modal .symbol-chart-panel {
  width: min(1280px, 100%);
  height: calc(100dvh - 44px);
  max-height: none;
  padding: 18px 20px 14px;
  gap: 12px;
}
.chart-heading { min-width: 0; }
.chart-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.chart-title-row h2 { line-height: 1.2; }
.chart-last {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--hero-text);
  font-variant-numeric: tabular-nums;
}
.chart-change {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.chart-change.up {
  color: var(--up);
  background: color-mix(in srgb, var(--up) 16%, transparent);
}
.chart-change.down {
  color: var(--down);
  background: color-mix(in srgb, var(--down) 16%, transparent);
}
.chart-change.flat {
  color: var(--muted);
  background: var(--glass-strong);
}
.symbol-chart-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  direction: ltr;
  border: 1px solid var(--glass-border);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(84, 210, 215, 0.09), transparent 58%),
    rgba(0, 0, 0, 0.28);
}
.symbol-chart {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  touch-action: none;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  min-width: 156px;
  padding: 8px 10px 9px;
  border-radius: 12px;
  background: rgba(10, 16, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e7f1f0;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  direction: rtl;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.chart-tip-date {
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--primary);
}
.chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.chart-tip-row b {
  font-family: var(--mono);
  font-weight: 650;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.chart-credit {
  align-self: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.chart-credit strong {
  color: var(--primary);
  font-weight: 800;
}
.chart-credit:hover strong { text-decoration: underline; }
html[data-theme="light"] .symbol-chart-stage {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(15, 124, 128, 0.08), transparent 58%),
    #f4fafa;
  border-color: rgba(15, 60, 64, 0.1);
}
html[data-theme="light"] .chart-tip {
  background: rgba(255, 255, 255, 0.96);
  color: #152022;
  border-color: rgba(15, 60, 64, 0.12);
  box-shadow: 0 10px 24px rgba(20, 40, 42, 0.12);
}
@media (max-width: 860px) {
  .symbol-chart-modal { padding: 0; align-items: end; }
  .symbol-chart-modal .symbol-chart-panel {
    width: 100%;
    height: min(94dvh, 920px);
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .chart-last { font-size: 22px; }
}
html[data-theme="light"] .card-chart {
  background: rgba(15, 124, 128, 0.1);
  color: #0f7c80;
}

html[data-theme="light"] .watch-card {
  background: #ffffff;
  border-color: rgba(15, 60, 64, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(15, 40, 44, 0.06);
}
html[data-theme="light"] .watch-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 50%);
}
html[data-theme="light"] .watch-card:hover {
  background: #ffffff;
  border-color: rgba(15, 124, 128, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 8px 20px rgba(15, 40, 44, 0.1),
    0 0 0 1px rgba(15, 124, 128, 0.08);
}
html[data-theme="light"] .watch-card.trend-up {
  border-color: rgba(7, 134, 114, 0.28);
  background: #ffffff;
}
html[data-theme="light"] .watch-card.trend-down {
  border-color: rgba(217, 43, 58, 0.24);
  background: #ffffff;
}
html[data-theme="light"] .watch-card.add-card {
  background: rgba(15, 124, 128, 0.05);
  border-color: rgba(15, 124, 128, 0.28);
}
html[data-theme="light"] .watch-card.add-card:hover {
  background: rgba(15, 124, 128, 0.1);
  border-color: rgba(15, 124, 128, 0.45);
}
html[data-theme="light"] .card-remove {
  background: rgba(217, 43, 58, 0.12);
  color: #c62828;
  box-shadow: 0 1px 4px rgba(198, 40, 40, 0.12);
}
html[data-theme="light"] .card-remove:hover {
  background: rgba(217, 43, 58, 0.22);
  color: #b71c1c;
}
html[data-theme="light"] .card-logo {
  background: #eef5f5;
  box-shadow:
    0 0 0 1px rgba(15, 124, 128, 0.12),
    0 2px 8px rgba(15, 40, 44, 0.08);
}
html[data-theme="light"] .card-logo.fallback {
  color: #0f7c80;
  background: linear-gradient(145deg, #d8f3f4, #eef8f8);
}

.card-logo {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #0b1112;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 1px rgba(84, 210, 215, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}
.card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card-logo.fallback {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--primary-dim);
  background: linear-gradient(145deg, rgba(0, 79, 81, 0.55), rgba(15, 22, 23, 0.95));
}
.card-meta {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.card-ticker {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--on-surface);
  direction: ltr;
  text-align: right;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-broker {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="light"] .card-ticker {
  color: #0f1718;
}
html[data-theme="light"] .card-broker {
  color: #4a5a5b;
}
html[data-theme="light"] .card-price {
  color: #0f1718;
}
.card-quote {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 0;
  flex-shrink: 0;
}
.card-price {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: var(--card-price);
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.card-price.flash-up { animation: price-flash-up 0.45s ease; }
.card-price.flash-down { animation: price-flash-down 0.45s ease; }
@keyframes price-flash-up {
  0% { color: var(--up); }
  100% { color: #f2f7f6; }
}
@keyframes price-flash-down {
  0% { color: var(--down); }
  100% { color: #f2f7f6; }
}
.card-change {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
}
.card-change.up {
  color: #3dd6b5;
  background: rgba(8, 153, 129, 0.18);
}
.card-change.down {
  color: #ff8f86;
  background: rgba(242, 54, 69, 0.18);
}
.card-change.flat {
  color: var(--muted);
  background: rgba(137, 147, 147, 0.12);
}
html[data-theme="light"] .card-change.up {
  color: #056b5b;
  background: rgba(7, 134, 114, 0.28);
}
html[data-theme="light"] .card-change.down {
  color: #b71c1c;
  background: rgba(217, 43, 58, 0.26);
}
html[data-theme="light"] .card-change.flat {
  color: #4a5a5b;
  background: rgba(90, 106, 106, 0.18);
}

/* Empty / package */
/* Drawer search rows (list) */
.watch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(26,33,33,.78);
  border: 1px solid rgba(63,73,73,.75);
}
.watch-row-compact {
  padding: 0 10px;
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  border-radius: 11px;
  gap: 8px;
}
.watch-row-compact .sym-main { gap: 8px; }
.watch-row-compact .sym-main img {
  width: 26px;
  height: 26px;
}
.watch-row-compact .sym-text .ticker {
  font-size: 12px;
  line-height: 1.2;
}
.watch-row-compact .sym-text .desc {
  font-size: 9px;
  line-height: 1.2;
}
.watch-row-compact .toggle-btn {
  padding: 5px 8px;
  font-size: 10px;
  border-radius: 8px;
}
.sym-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sym-main img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: #0b1112; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(84,210,215,.12);
}
.sym-text { min-width: 0; }
.sym-text .ticker {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  direction: ltr; text-align: right;
}
.sym-text .desc {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price-cell, .change-cell { display: none; }

.toggle-btn {
  border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 700;
}
.toggle-btn.remove { background: rgba(242,54,69,.12); color: #ffb4ab; }
.toggle-btn.add { background: rgba(8,153,129,.14); color: #9cf1f3; }
html[data-theme="light"] .watch-row {
  background: #f4fafa;
  border-color: rgba(15, 60, 64, 0.1);
}
html[data-theme="light"] .sym-main img {
  background: #e4eff0;
  box-shadow: 0 0 0 1px rgba(15, 60, 64, 0.12);
}
html[data-theme="light"] .toggle-btn.remove {
  background: rgba(217, 43, 58, 0.12);
  color: #c62828;
}
html[data-theme="light"] .toggle-btn.add {
  background: rgba(7, 134, 114, 0.14);
  color: #056b5b;
}

.empty {
  text-align: center; color: var(--muted); padding: 34px 12px;
  border: 1px dashed var(--outline); border-radius: 16px; margin: 8px;
}
.linkish {
  display: inline; background: none; color: var(--primary);
  font-size: inherit; text-decoration: underline; margin-right: 6px;
}

.package-link {
  display: block; text-align: center; color: var(--warn); text-decoration: none;
  padding: 12px; border-radius: 14px;
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
  font-size: 13px;
}

/* Google search */
.google-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(640px, 100%);
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 55px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.google-icon {
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}
.google-search input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  color: var(--on-surface); font-family: inherit; font-size: 15px;
  padding: 6px 2px;
}
.google-search input::placeholder { color: var(--muted); }
.google-go {
  border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #54d2d7, #2fb6bb);
  color: var(--on-primary);
  border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 13px;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.left-col,
.market-sidebar {
  min-width: 0;
  border-radius: 24px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.left-col {
  /* سایه داخل aside بماند؛ نه کات شود نه به ستون وسط نریزد */
  overflow: hidden;
  padding: 4px 8px 18px;
  box-sizing: border-box;
}
.center-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.center-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 8px 10px;
}
.calendar-panel {
  --cal-cols: 68px 78px minmax(0, 1.8fr) 78px 88px 78px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  overflow: hidden;
}
.market-sidebar-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  overflow: hidden;
}
.market-sidebar-head {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.market-sidebar-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: #ecf2f1;
  margin: 0;
  width: 100%;
  text-align: center;
}
.side-col {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
  .side-card {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 22px;
  padding: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.side-card.date-widget {
  padding: 14px;
  border-radius: 24px;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] .side-card.date-widget.glass-panel {
  border-radius: 24px;
  background:
    linear-gradient(165deg, rgba(84, 210, 215, 0.08), transparent 48%),
    #ffffff;
  border-color: rgba(15, 60, 64, 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: none;
  box-shadow: 0 6px 18px rgba(15, 40, 44, 0.1);
}
.weather-strip {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(84, 210, 215, 0.08);
  border: 1px solid rgba(84, 210, 215, 0.16);
  flex-shrink: 0;
  z-index: 4;
}
html[data-theme="light"] .weather-strip {
  background: rgba(15, 124, 128, 0.07);
  border-color: rgba(15, 124, 128, 0.14);
}
.weather-city-wrap {
  position: relative;
}
.weather-city {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dim);
  background: transparent;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.weather-city::after {
  content: "▾";
  font-size: 9px;
  opacity: 0.7;
}
.weather-city:hover,
.weather-city[aria-expanded="true"] {
  background: rgba(84, 210, 215, 0.12);
  color: var(--primary);
}
html[data-theme="light"] .weather-city {
  color: #0b5f62;
}
.weather-city-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  z-index: 20;
}
html[data-theme="light"] .weather-city-menu {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 40, 44, 0.14);
}
.weather-city-menu.hidden { display: none !important; }
.weather-city-option {
  display: block;
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--on-surface);
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
}
.weather-city-option:hover {
  background: rgba(84, 210, 215, 0.12);
  color: var(--primary);
}
.weather-city-option.active {
  background: rgba(84, 210, 215, 0.18);
  color: var(--primary-dim);
}
html[data-theme="light"] .weather-city-option.active {
  background: rgba(15, 124, 128, 0.12);
  color: #0b5f62;
}
.weather-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  justify-content: center;
}
.weather-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.weather-temp {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--hero-text);
  direction: ltr;
  white-space: nowrap;
}
.weather-desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-meta {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  direction: ltr;
  white-space: nowrap;
}
.weather-strip.is-loading .weather-temp,
.weather-strip.is-loading .weather-desc,
.weather-strip.is-loading .weather-meta {
  opacity: 0.45;
}
.panel-tab.calendar-launch,
.calendar-launch {
  margin-top: 0;
  width: 100%;
  border: 1px solid rgba(84, 210, 215, 0.28);
  background: rgba(84, 210, 215, 0.1);
  color: var(--primary-dim);
  border-radius: 999px;
  padding: 5px 8px;
  min-height: 0;
  line-height: 1.2;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.side-launch-row {
  margin: 0;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  z-index: 2;
  position: relative;
}
.center-launch-row {
  display: none;
  max-width: 440px;
  width: 100%;
  margin-top: 4px;
}
.journal-launch {
  width: 100%;
  border: 1px solid rgba(66, 133, 244, 0.35);
  background: rgba(66, 133, 244, 0.12);
  color: #8ab4f8;
  border-radius: 999px;
  padding: 5px 8px;
  min-height: 0;
  line-height: 1.2;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.journal-launch:hover,
.journal-launch.active,
body.journal-mode .journal-launch {
  border-color: rgba(66, 133, 244, 0.6);
  background: rgba(66, 133, 244, 0.2);
  color: var(--hero-text);
}
html[data-theme="light"] .journal-launch {
  border-color: #1557b0;
  background: linear-gradient(165deg, #1a73e8 0%, #1967d2 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(26, 115, 232, 0.28);
  font-weight: 800;
}
html[data-theme="light"] .journal-launch:hover,
html[data-theme="light"] body.journal-mode .journal-launch,
html[data-theme="light"] .journal-launch.active {
  border-color: #0b57d0;
  background: linear-gradient(165deg, #1967d2 0%, #174ea6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.34);
}
.panel-tab.calendar-launch:hover,
.panel-tab.calendar-launch.active,
.calendar-launch:hover,
.calendar-launch.active {
  border-color: rgba(84, 210, 215, 0.55);
  background: rgba(84, 210, 215, 0.16);
  color: var(--hero-text);
  box-shadow: none;
}
html[data-theme="light"] .panel-tab.calendar-launch,
html[data-theme="light"] .calendar-launch {
  border-color: rgba(15, 60, 64, 0.14);
  background: #ffffff;
  color: #3d5254;
  box-shadow: 0 2px 8px rgba(15, 40, 44, 0.05);
}
html[data-theme="light"] .panel-tab.calendar-launch:hover,
html[data-theme="light"] .calendar-launch:hover {
  border-color: rgba(15, 124, 128, 0.28);
  background: #ffffff;
  color: #0f7c80;
}
html[data-theme="light"] .panel-tab.calendar-launch.active,
html[data-theme="light"] .calendar-launch.active {
  border-color: rgba(15, 124, 128, 0.35);
  background: #e8f6f6;
  color: #0f7c80;
  box-shadow: inset 0 0 0 1px rgba(15, 124, 128, 0.08);
}

.sessions-widget {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 32px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  max-height: min(48vh, 360px);
}
html[data-theme="light"] .sessions-widget {
  border-color: rgba(15, 60, 64, 0.12);
  background:
    linear-gradient(165deg, rgba(84, 210, 215, 0.1), transparent 50%),
    #ffffff;
  box-shadow: 0 6px 16px rgba(15, 40, 44, 0.08);
}
html[data-theme="light"] .sessions-meta-item {
  background: #f3fafb;
  border-color: rgba(15, 60, 64, 0.12);
}
html[data-theme="light"] .sessions-meta-item.next {
  background: rgba(15, 124, 128, 0.12);
  border-color: rgba(15, 124, 128, 0.28);
}
html[data-theme="light"] .sessions-meta-item strong {
  color: #16363a;
}
html[data-theme="light"] .session-row {
  background: color-mix(in srgb, var(--session-color) 10%, #fff);
  border-color: color-mix(in srgb, var(--session-color) 22%, transparent);
}
html[data-theme="light"] .session-rail {
  opacity: 1;
  box-shadow: 0 0 10px color-mix(in srgb, var(--session-color) 45%, transparent);
}
html[data-theme="light"] .session-name {
  color: #16363a;
}
html[data-theme="light"] .session-badge {
  color: color-mix(in srgb, var(--session-color) 55%, #062628);
  background: color-mix(in srgb, var(--session-color) 22%, #fff);
  border-color: color-mix(in srgb, var(--session-color) 42%, transparent);
}
html[data-theme="light"] .session-row.is-active {
  background: color-mix(in srgb, var(--session-color) 18%, #fff);
  border-color: color-mix(in srgb, var(--session-color) 48%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--session-color) 22%, transparent),
    0 8px 18px color-mix(in srgb, var(--session-color) 22%, transparent);
}
html[data-theme="light"] .session-row.is-active::before {
  opacity: 1;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--session-color) 34%, transparent) 0%,
    color-mix(in srgb, var(--session-color) 14%, transparent) var(--session-progress),
    transparent var(--session-progress)
  );
}
html[data-theme="light"] .session-row.is-active .session-badge,
html[data-theme="light"] .session-row.is-upcoming.is-next .session-badge {
  color: #fff;
  background: color-mix(in srgb, var(--session-color) 72%, #0b5f62);
  border-color: transparent;
}
html[data-theme="light"] .session-row.is-upcoming {
  opacity: 0.92;
  background: color-mix(in srgb, var(--session-color) 8%, #fff);
}
html[data-theme="light"] .session-row.is-upcoming .session-badge {
  color: color-mix(in srgb, var(--session-color) 45%, #3d5254);
  background: color-mix(in srgb, var(--session-color) 14%, #fff);
  border-color: color-mix(in srgb, var(--session-color) 28%, transparent);
}
html[data-theme="light"] .session-row.is-upcoming.is-next {
  background: color-mix(in srgb, var(--session-color) 16%, #fff);
  border-color: color-mix(in srgb, var(--session-color) 40%, transparent);
}
html[data-theme="light"] .session-row.is-upcoming.is-next .session-eta {
  color: color-mix(in srgb, var(--session-color) 55%, #0b5f62);
}
html[data-theme="light"] .session-row.is-past {
  opacity: 0.55;
  filter: grayscale(0.35);
  background: rgba(15, 40, 44, 0.04);
  border-color: rgba(15, 40, 44, 0.08);
}
html[data-theme="light"] .session-row.is-past .session-badge {
  color: #6b7f82;
  background: rgba(15, 40, 44, 0.06);
  border-color: rgba(15, 40, 44, 0.1);
}
html[data-theme="light"] .sessions-widget.is-weekend .sessions-meta-item:first-child strong {
  color: #dc2626;
}
.sessions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sessions-head .side-label { margin: 0; }
.sessions-clock {
  font-family: var(--mono, "Outfit", monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  direction: ltr;
  letter-spacing: 0.04em;
}
.sessions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow: auto;
}
.session-row {
  --session-color: #54d2d7;
  --session-progress: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 5px 6px 5px 10px;
  border-radius: 9px;
  overflow: hidden;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: opacity 0.25s ease, filter 0.25s ease, border-color 0.25s ease;
}
.session-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--session-color) 28%, transparent) 0%,
    color-mix(in srgb, var(--session-color) 10%, transparent) var(--session-progress),
    transparent var(--session-progress)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}
.session-rail {
  align-self: stretch;
  border-radius: 99px;
  background: var(--session-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--session-color) 55%, transparent);
  opacity: 0.85;
}
.session-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
}
.session-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--on-surface);
}
.session-badge {
  flex-shrink: 0;
  align-self: center;
  margin-left: 2px;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: color-mix(in srgb, var(--session-color) 90%, #fff);
  background: color-mix(in srgb, var(--session-color) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--session-color) 35%, transparent);
}
.session-hours {
  font-family: var(--mono, "Outfit", monospace);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  line-height: 1.25;
}
.session-eta {
  font-size: 9px;
  font-weight: 700;
  color: color-mix(in srgb, var(--session-color) 80%, #fff);
  line-height: 1.25;
}
.session-row.is-active {
  border-color: color-mix(in srgb, var(--session-color) 45%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--session-color) 18%, transparent),
    0 6px 16px color-mix(in srgb, var(--session-color) 16%, transparent);
  animation: session-pulse 2.4s ease-in-out infinite;
}
.session-row.is-active::before { opacity: 1; }
.session-row.is-active .session-rail {
  opacity: 1;
  box-shadow: 0 0 12px var(--session-color);
}
.session-row.is-active .session-badge {
  color: #041414;
  background: var(--session-color);
  border-color: transparent;
}
.session-row.is-upcoming { opacity: 0.72; }
.session-row.is-upcoming .session-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.session-row.is-upcoming.is-next {
  opacity: 1;
  border-color: color-mix(in srgb, var(--session-color) 28%, transparent);
  background: color-mix(in srgb, var(--session-color) 8%, transparent);
}
.session-row.is-upcoming.is-next .session-badge {
  color: #041414;
  background: var(--session-color);
  border-color: transparent;
}
.session-row.is-upcoming.is-next .session-hours {
  color: var(--muted);
  font-weight: 600;
}
.session-row.is-past {
  opacity: 0.38;
  filter: grayscale(0.85);
}
.session-row.is-past .session-rail {
  opacity: 0.35;
  box-shadow: none;
}
.session-row.is-past .session-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}
@keyframes session-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--session-color) 16%, transparent),
      0 6px 16px color-mix(in srgb, var(--session-color) 12%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--session-color) 34%, transparent),
      0 8px 20px color-mix(in srgb, var(--session-color) 26%, transparent);
  }
}
.sessions-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.sessions-meta-item {
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sessions-meta-item.next {
  border-color: rgba(84, 210, 215, 0.22);
  background: rgba(84, 210, 215, 0.08);
}
.sessions-meta-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.sessions-meta-item strong {
  font-size: 11px;
  font-weight: 800;
  color: var(--on-surface);
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sessions-widget.is-weekend .sessions-meta-item:first-child strong {
  color: #f87171;
}

.side-label {
  font-size: 11px;
  color: var(--primary-dim);
  font-weight: 700;
  margin-bottom: 2px;
}
.side-card h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ecf2f1;
  min-height: 0;
}
.links-head { margin-bottom: 6px; flex-shrink: 0; }
.links-head h3 { line-height: 1.3; }
.side-card h3,
.market-sidebar-head h3 {
  color: var(--hero-text);
}
.date-widget-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 0;
}
.date-widget .dw-cal-modes {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
}
.date-widget .dw-cal-modes .dw-mode {
  padding: 6px 12px;
}
.eco-cal-panel .date-widget.calendar-month {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.eco-cal-panel .date-widget-head {
  margin-bottom: 10px;
}
.dw-title { font-size: 15px; font-weight: 800; line-height: 1.25; min-height: 19px; }
.dw-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  font-family: var(--mono);
  min-height: 16px;
}
.dw-modes {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-container);
  border: 1px solid var(--outline);
  flex-shrink: 0;
}
.dw-mode {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  padding: 5px 8px;
  transition: background .15s ease, color .15s ease;
}
.dw-mode:hover {
  color: var(--on-surface);
}
.dw-mode.active {
  background: rgba(84, 210, 215, 0.22);
  color: var(--primary-dim);
}
html[data-theme="light"] .dw-mode.active {
  background: rgba(15, 124, 128, 0.16);
  color: #0b5f62;
}
html[data-theme="light"] .dw-title {
  color: #0f1718;
}
html[data-theme="light"] .dw-subtitle {
  color: #4a5a5b;
}
.dw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.date-widget .dw-nav .icon-btn.tiny-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}
.date-widget .dw-nav .secondary-btn.tiny {
  padding: 5px 10px;
  font-size: 11px;
}
.dw-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  min-height: 18px;
}
.dw-weekdays span {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  padding: 2px 0;
}
.dw-weekdays span.holiday,
.dw-weekdays span.holiday-col {
  color: #ff7b72;
}
.dw-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex: 0 0 auto;
  min-height: 178px;
  align-content: start;
}
.dw-day {
  position: relative;
  height: 28px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 8px;
  background: var(--day-bg);
  color: var(--on-surface);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dw-day:hover:not(:disabled) {
  background: rgba(84, 210, 215, 0.14);
  color: var(--primary-dim);
}
.dw-day:disabled { opacity: 0.28; cursor: default; }
.dw-day.today {
  background: linear-gradient(145deg, rgba(84, 210, 215, 0.4), rgba(0, 79, 81, 0.55));
  color: #f4fbfa;
  box-shadow: 0 0 0 1px rgba(84, 210, 215, 0.35);
}
html[data-theme="light"] .dw-day.today {
  color: #fff;
}
.dw-day.selected:not(.today) {
  outline: 1px solid rgba(84, 210, 215, 0.55);
  background: rgba(0, 79, 81, 0.22);
}
html[data-theme="light"] .dw-day.selected:not(.today) {
  background: rgba(15, 124, 128, 0.12);
}
.dw-day.holiday {
  color: #f07178;
}
.dw-day.holiday:hover:not(:disabled) {
  color: #ff9a9f;
  background: rgba(242, 54, 69, 0.12);
}
.dw-day.holiday.today {
  color: #ffd2d0;
  background: linear-gradient(145deg, rgba(242, 54, 69, 0.38), rgba(0, 79, 81, 0.45));
  box-shadow: 0 0 0 1px rgba(242, 54, 69, 0.4);
}
.dw-day.holiday.selected:not(.today) {
  outline-color: rgba(242, 54, 69, 0.55);
  background: rgba(242, 54, 69, 0.14);
}
.dw-day.has-note::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}
.dw-day.has-note.today::after {
  background: #fff8e7;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.dw-day.has-events::before {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #54d2d7;
  box-shadow: 0 0 0 1px rgba(84, 210, 215, 0.35);
}
.dw-day.has-events.has-note::before {
  right: 5px;
}
.dw-day.has-events.has-note::after {
  left: calc(50% - 3px);
}
.dw-day.has-events.today::before {
  background: #e8fffe;
}
.shortcuts-widget {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.fav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.fav-link {
  position: relative;
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: transform .15s ease;
}
.fav-link:hover { transform: translateY(-2px); }
.fav-tile {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.fav-link:hover .fav-tile {
  border-color: rgba(84, 210, 215, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}
.fav-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  background: transparent;
}
.fav-ico.fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dim);
  font-family: var(--mono);
  background: rgba(84, 210, 215, 0.14);
}
.fav-name {
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.fav-add .fav-tile {
  border-style: dashed;
  background: rgba(84, 210, 215, 0.1);
}
.fav-add-plus {
  font-size: 22px;
  font-weight: 300;
  color: var(--primary);
  line-height: 1;
}
.fav-remove {
  position: absolute;
  top: -2px;
  left: 6px;
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(242, 54, 69, 0.9);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  z-index: 2;
}
.fav-link:hover .fav-remove {
  opacity: 1;
  pointer-events: auto;
}
.add-link-form {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(420px, 100%);
  padding: 8px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  box-sizing: border-box;
}
.add-link-form.hidden { display: none !important; }
.add-link-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--outline);
  background: var(--surface-low);
  color: var(--on-surface);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.add-link-form input:focus { border-color: rgba(84, 210, 215, 0.55); }
.add-link-form .tiny-save {
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.sk-links {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  width: 100%;
}
body.is-loading .sk-links { display: flex; }
.sk-shortcut {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.sk-shortcut.sk,
.sk-links .sk-shortcut {
  background: linear-gradient(
    90deg,
    rgba(38, 48, 48, 0.9) 0%,
    rgba(58, 72, 72, 0.95) 45%,
    rgba(38, 48, 48, 0.9) 90%
  );
  background-size: 200% 100%;
  animation: skShimmer 1.25s ease-in-out infinite;
}
.link-step-back {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--outline);
  border-radius: 9px;
  background: var(--surface-container);
  color: var(--on-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
}
.link-step-back:hover {
  border-color: rgba(84, 210, 215, 0.45);
  color: var(--primary);
}

/* Panel tabs */
.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(22, 29, 29, 0.9);
  border: 1px solid var(--outline);
}
.panel-tab {
  border: 0; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--muted);
  padding: 12px 14px; border-radius: 11px; font-size: 14px; font-weight: 700;
}
.panel-tab.active {
  background: rgba(0, 79, 81, 0.55);
  color: var(--primary-dim);
  box-shadow: inset 0 0 0 1px rgba(84, 210, 215, 0.18);
}
.panel-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.panel-view.hidden { display: none !important; }
#panel-calendar.panel-view {
  overflow: hidden;
}

/* News */
.news-panel { display: flex; flex-direction: column; gap: 12px; }
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 248px;
}
.news-item {
  display: grid;
  grid-template-columns: 72px 48px 1fr auto;
  gap: 12px;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(26, 33, 33, 0.78);
  border: 1px solid rgba(63, 73, 73, 0.75);
  box-sizing: border-box;
}
.news-item .time {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  direction: ltr; text-align: right; color: var(--primary-dim);
}
.news-item .flag {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; background: #0b1112;
  box-shadow: 0 0 0 1px rgba(84, 210, 215, 0.12);
}
.news-item .title {
  font-size: 14px; font-weight: 700; color: #ecf2f1;
  line-height: 1.45;
}
.news-item .meta {
  margin-top: 4px; font-size: 11px; color: var(--muted);
}
.news-values {
  display: flex; gap: 10px; direction: ltr;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.news-values b { color: var(--on-surface); font-weight: 700; }
.impact-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 999px;
}
.impact-badge.high { background: rgba(242,54,69,.14); color: #ffb4ab; }
.impact-badge.medium { background: rgba(251,191,36,.12); color: #fbbf24; }
.impact-badge.low { background: rgba(137,147,147,.16); color: var(--muted); }
html[data-theme="light"] .impact-badge.high {
  background: rgba(217, 43, 58, 0.12);
  color: #c62828;
}
html[data-theme="light"] .impact-badge.medium {
  background: rgba(201, 133, 0, 0.14);
  color: #9a6800;
}
html[data-theme="light"] .impact-badge.low {
  background: rgba(90, 106, 106, 0.12);
  color: #5a6a6a;
}

/* Calendar */
.calendar-tools { gap: 6px; }
.tiny-icon { width: 36px; height: 36px; border-radius: 12px; font-size: 18px; }
.impact-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.filter-chip {
  border: 1px solid var(--outline);
  background: var(--tile-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.filter-chip.active {
  border-color: rgba(84, 210, 215, 0.45);
  color: var(--primary-dim);
  background: rgba(84, 210, 215, 0.14);
}
html[data-theme="light"] .filter-chip {
  background: #ffffff;
  border-color: rgba(15, 60, 64, 0.14);
  color: #5a6a6a;
  box-shadow: 0 2px 8px rgba(15, 40, 44, 0.04);
}
html[data-theme="light"] .filter-chip.active {
  border-color: rgba(15, 124, 128, 0.35);
  background: rgba(15, 124, 128, 0.1);
  color: #0b5f62;
}
.filter-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.filter-chip .dot.high { background: var(--down); }
.filter-chip .dot.medium { background: var(--warn); }
.filter-chip .dot.low { background: #64748b; }

html[data-theme="light"] .calendar-panel {
  background: rgba(255, 255, 255, 0.78);
}
html[data-theme="light"] .calendar-panel .section-head h2 {
  color: #0f1718;
}
html[data-theme="light"] .cal-row {
  background: #ffffff;
  border-color: rgba(15, 60, 64, 0.1);
  box-shadow: 0 2px 10px rgba(15, 40, 44, 0.05);
}
html[data-theme="light"] .cal-row .time {
  color: #0f7c80;
}
html[data-theme="light"] .cal-title {
  color: #152022;
}
html[data-theme="light"] .cal-num {
  color: #5a6a6a;
}
html[data-theme="light"] .cal-num.actual {
  color: #0f1718;
}
html[data-theme="light"] .dw-weekdays span.holiday,
html[data-theme="light"] .dw-weekdays span.holiday-col,
html[data-theme="light"] .dw-day.holiday {
  color: #d92b3a;
}
html[data-theme="light"] .dw-day.holiday:hover:not(:disabled) {
  color: #b71c1c;
  background: rgba(217, 43, 58, 0.1);
}
html[data-theme="light"] .dw-day.holiday.today {
  color: #ffffff;
}
.calendar-head,
.cal-row {
  display: grid;
  grid-template-columns: var(--cal-cols);
  column-gap: 10px;
  align-items: center;
  padding-inline: 14px;
  box-sizing: border-box;
}
.calendar-head {
  padding-block: 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  flex-shrink: 0;
}
.calendar-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-head span:nth-child(1),
.calendar-head span:nth-child(2),
.calendar-head span:nth-child(4),
.calendar-head span:nth-child(5),
.calendar-head span:nth-child(6) {
  direction: ltr;
  text-align: center;
}
.calendar-head span:nth-child(3) {
  text-align: right;
}
.calendar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.cal-row {
  height: 64px;
  border-radius: 16px;
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  color: var(--on-surface);
  row-gap: 0;
}
.cal-row > * {
  min-width: 0;
}
.cal-row .time {
  font-family: var(--mono);
  direction: ltr;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.cal-currency {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  direction: ltr;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}
.cal-currency img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cal-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-title .impact-inline,
.note-event-title .impact-inline {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-left: 6px; vertical-align: middle;
}
.cal-title .impact-inline.high,
.note-event-title .impact-inline.high { background: var(--down); }
.cal-title .impact-inline.medium,
.note-event-title .impact-inline.medium { background: var(--warn); }
.cal-title .impact-inline.low,
.note-event-title .impact-inline.low { background: #64748b; }
.cal-num {
  font-family: var(--mono);
  direction: ltr;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-num.actual { color: var(--on-surface); font-weight: 700; }
.cal-num.better { color: var(--up); }
.cal-num.worse { color: var(--down); }
.cal-vals { display: none; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.62); backdrop-filter: blur(5px);
}
.modal-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(82vh, 640px);
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
  animation: modalIn .24s ease both;
}
@keyframes modalIn {
  from { transform: translateY(12px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
html[data-theme="light"] .modal-panel {
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(20, 40, 42, 0.18);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--on-surface);
}
.symbol-cats-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  flex-shrink: 0;
}
.symbol-cats-title {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.symbol-cats {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  height: 30px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent);
}
.symbol-cats::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.symbol-cat-chip {
  flex: 0 0 auto;
  height: 28px;
  border: 0;
  background: rgba(38, 48, 48, 0.9);
  color: var(--muted);
  border-radius: 8px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: background .15s ease, color .15s ease;
}
.symbol-cat-chip:hover {
  background: rgba(0, 79, 81, 0.4);
  color: var(--primary-dim);
}
.symbol-cat-chip.active {
  background: rgba(84, 210, 215, 0.18);
  color: var(--primary);
}
.symbol-results .results-label {
  list-style: none;
  padding: 4px 2px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dim);
}
.symbol-results .results-empty {
  list-style: none;
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.symbol-results .results-more {
  list-style: none;
  padding: 10px 8px 14px;
  display: flex;
  justify-content: center;
}
.symbol-results .results-more-btn {
  width: 100%;
}
.note-modal-panel {
  width: min(520px, 100%);
  max-height: min(84vh, 680px);
  overflow: hidden;
}
.note-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
}
.note-modal-footer {
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
  background: var(--surface);
}
html[data-theme="light"] .note-modal-footer {
  background: #ffffff;
}
.note-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.note-holiday {
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(242, 54, 69, 0.12);
  border: 1px solid rgba(242, 54, 69, 0.3);
  color: #ffb4ab;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  flex-shrink: 0;
}
html[data-theme="light"] .note-holiday {
  background: rgba(217, 43, 58, 0.1);
  border-color: rgba(217, 43, 58, 0.28);
  color: #b4232f;
}
.note-events-wrap {
  margin-bottom: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.note-events {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow: visible;
  margin: 0 0 6px;
  padding: 0;
}
.note-events-empty {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.note-event-row {
  display: grid;
  grid-template-columns: 46px 56px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  color: var(--on-surface);
  box-sizing: border-box;
}
html[data-theme="light"] .note-event-row {
  background: #f4fafa;
  border-color: rgba(15, 60, 64, 0.1);
}
html[data-theme="light"] .symbol-cat-chip {
  background: #eef5f5;
  color: #5a6a6a;
}
html[data-theme="light"] .symbol-cat-chip:hover,
html[data-theme="light"] .symbol-cat-chip.active {
  background: rgba(15, 124, 128, 0.14);
  color: #0b5f62;
}
html[data-theme="light"] .status.error {
  color: #c62828;
  background: rgba(217, 43, 58, 0.1);
  border-color: rgba(217, 43, 58, 0.22);
}
html[data-theme="light"] .status.success {
  color: #078672;
  background: rgba(7, 134, 114, 0.1);
  border-color: rgba(7, 134, 114, 0.22);
}
html[data-theme="light"] .status.info {
  color: #0b5f62;
  background: rgba(15, 124, 128, 0.08);
  border-color: rgba(15, 124, 128, 0.2);
}
.note-event-time {
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dim);
  direction: ltr;
  text-align: center;
}
.note-event-currency {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  direction: ltr;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--on-surface);
}
.note-event-currency img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.note-event-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.note-event-vals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  direction: ltr;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.note-event-vals .actual {
  color: var(--on-surface);
  font-weight: 700;
}
.note-event-vals .actual.better { color: var(--up); }
.note-event-vals .actual.worse { color: var(--down); }
.note-modal-input {
  width: 100%;
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--outline);
  background: var(--surface-low);
  color: var(--on-surface);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 10px;
}
html[data-theme="light"] .note-modal-input {
  background: #f4f8f8;
}
.note-modal-input:focus {
  border-color: rgba(84, 210, 215, 0.55);
}
.note-modal-input::placeholder { color: var(--muted); }
.note-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.note-delete-btn {
  margin-left: auto;
  margin-right: 0;
  color: #ffb4ab;
  border-color: rgba(242, 54, 69, 0.35);
  background: rgba(242, 54, 69, 0.1);
}
.note-delete-btn:hover {
  border-color: rgba(242, 54, 69, 0.55);
  background: rgba(242, 54, 69, 0.18);
}
.symbol-results {
  list-style: none; overflow: auto; flex: 1; min-height: 120px;
  display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px;
}
.symbol-results .watch-row { grid-template-columns: 1fr auto; }

.logo-mark { display: none; }
.news-item .body { min-width: 0; }


/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr) 250px;
    gap: 12px;
  }
}

@media (max-width: 1024px) {
  .shell {
    width: min(1200px, calc(100% - 24px));
    gap: 12px;
    padding: 12px 0 14px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
  }
  .left-col { display: none; }
  .center-launch-row { display: grid; }
}

@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .shell {
    width: calc(100% - 24px);
    gap: 14px;
    padding: 14px 0 max(28px, env(safe-area-inset-bottom));
    height: auto;
    max-height: none;
    overflow: visible;
    flex: none;
  }

  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
    height: auto;
    min-height: 0;
    flex: none;
    align-items: start;
  }
  .left-col,
  .center-col,
  .market-sidebar {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .left-col {
    display: flex;
    order: 3;
  }
  .center-col { order: 1; }
  .market-sidebar {
    order: 2;
    min-height: 0;
  }
  .market-sidebar-inner,
  .date-widget,
  .calendar-panel,
  .panel-view,
  .main-panel,
  .market-board {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    flex: none;
  }
  .center-home {
    justify-content: flex-start;
    padding-top: 24px;
    flex: none;
    min-height: 0;
    overflow: visible;
  }
  .shortcuts-widget {
    width: 100%;
  }
  .fav-links {
    gap: 6px 2px;
  }
  .fav-link { width: 64px; }
  .fav-tile { width: 44px; height: 44px; }
  .sk-links {
    gap: 6px 2px;
  }
  .watch-cards {
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    flex: none;
  }
  .sk-watch {
    grid-auto-rows: 52px;
    height: auto;
    overflow: visible;
    flex: none;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .section-tools,
  .calendar-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .calendar-head { display: none; }
  .cal-row {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "time currency"
      "title title"
      "vals vals";
    gap: 8px 10px;
    height: auto;
    min-height: 72px;
    padding: 10px 12px;
  }
  .cal-row .time { grid-area: time; }
  .cal-currency { grid-area: currency; justify-content: flex-end; }
  .cal-title { grid-area: title; }
  .cal-num { display: none; }
  .cal-row .cal-vals {
    grid-area: vals;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    direction: ltr;
  }

  .news-item {
    grid-template-columns: 56px 36px 1fr;
    grid-template-areas:
      "time flag body"
      "vals vals vals";
    gap: 10px;
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
  }
  .news-item .time { grid-area: time; }
  .news-item .flag { grid-area: flag; }
  .news-item .body { grid-area: body; }
  .news-values {
    grid-area: vals;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .modal { padding: 0; align-items: end; }
  .modal-panel {
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    animation: modalUp .28s ease both;
  }
  @keyframes modalUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 20px);
    gap: 14px;
    padding-top: 14px;
  }
  .side-col { grid-template-columns: 1fr; }
  .hero-brand .logo { height: 44px; }
  .theme-opt { padding: 7px 12px; font-size: 11px; }
  .ghost-btn { padding: 6px 8px; font-size: 12px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .google-search { padding: 5px 12px 5px 8px; border-radius: 999px; gap: 6px; }
  .google-icon { width: 26px; height: 26px; border-radius: 999px; }
  .google-search input { font-size: 14px; padding: 5px 2px; }
  .google-go { padding: 9px 12px; font-size: 12px; }
  .section-head h2 { font-size: 18px; }
  .market-board { border-radius: 18px; padding: 8px; }
  .watch-card { padding: 0 10px 0 38px; }
  .card-price { font-size: 13px; }
  .card-remove {
    opacity: 0.9;
    pointer-events: auto;
    transform: translate(0, -50%);
  }
  .news-item {
    grid-template-columns: 52px 1fr;
    grid-template-areas:
      "time body"
      "vals vals";
  }
  .news-item .flag { display: none; }
  .news-item .title { font-size: 13px; }
  .news-values { font-size: 11px; gap: 8px; }
  .impact-filters { gap: 6px; }
  .filter-chip { padding: 7px 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .shell {
    width: calc(100% - 16px);
    gap: 12px;
    padding-top: 12px;
  }
  .brand-block { gap: 8px; }
  .google-go { display: none; }
  .google-search { padding: 7px 8px; }
  .panel-tabs { gap: 4px; padding: 4px; }
  .panel-tab { padding: 10px 8px; font-size: 12px; }
  .count-chip { font-size: 11px; padding: 6px 9px; }
  .secondary-btn.tiny { padding: 7px 10px; font-size: 11px; }
  .watch-cards {
    gap: 5px;
  }
  .watch-card { border-radius: 12px; }
  .card-logo { width: 28px; height: 28px; }
  .card-ticker { font-size: 12px; }
  .card-price { font-size: 12px; }
  .card-change { font-size: 10px; }
  .cal-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "time currency"
      "title title"
      "vals vals";
    padding: 11px 12px;
  }
  .cal-row .time { text-align: right; }
  .cal-vals { width: 100%; }
  .cal-vals .cal-num { font-size: 12px; }
  .empty { padding: 24px 10px; margin: 4px; font-size: 13px; }
  .orb-a, .orb-b { opacity: 0.28; filter: blur(28px); }
}

@media (max-width: 360px) {
  .fav-links {
    gap: 6px 2px;
  }
  .fav-link { width: 60px; }
  .fav-tile { width: 42px; height: 42px; }
  .sk-links {
    gap: 6px 2px;
  }
  .theme-opt { padding: 7px 12px; font-size: 11px; }
}

@media (hover: none) {
  .watch-card:hover { transform: none; }
  .watch-card {
    padding-left: 38px;
  }
  .card-remove {
    opacity: 0.9;
    pointer-events: auto;
    transform: translate(0, -50%);
  }
}

@supports (padding: max(0px)) {
  .shell {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

/* ========== Trade Journal (fullscreen) ========== */
body.journal-mode .workspace,
body.journal-mode .today-note-banner,
body.journal-mode .update-banner {
  display: none !important;
}
body.journal-mode .status { display: none !important; }
body.journal-mode .shell {
  width: min(1320px, calc(100% - 28px));
  overflow: hidden;
}
body.journal-mode {
  overflow: hidden;
}
.journal-screen {
  position: relative;
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 6px 14px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
body.journal-mode .journal-screen .glass-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.16);
}
html[data-theme="light"] body.journal-mode .journal-screen .glass-panel {
  box-shadow: 0 6px 16px rgba(15, 40, 44, 0.1);
}
body.journal-mode .journal-screen:not(.hidden) {
  display: flex;
}
.journal-screen.hidden { display: none !important; }

.journal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  background: transparent;
}
.journal-top > .journal-date-open {
  flex-shrink: 0;
  text-align: left;
}
.journal-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.journal-back { flex-shrink: 0; }
.journal-top-main { flex: 1; min-width: 120px; text-align: center; }
.journal-title {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 900;
  color: var(--hero-text);
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.journal-day-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.journal-day-nav .secondary-btn,
.journal-day-nav .primary-btn {
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.journal-day-nav .primary-btn.tiny-save {
  box-shadow: 0 6px 16px rgba(84, 210, 215, 0.28);
}
html[data-theme="light"] .journal-day-nav .secondary-btn,
html[data-theme="light"] .journal-day-nav .primary-btn {
  box-shadow: 0 6px 14px rgba(15, 40, 44, 0.12);
}
html[data-theme="light"] .journal-day-nav .primary-btn.tiny-save {
  box-shadow: 0 6px 14px rgba(15, 124, 128, 0.22);
}

.journal-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(14px);
}
.journal-date-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.journal-scope-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  margin-inline: auto;
}
.journal-scope-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.journal-scope-tab.active {
  background: rgba(84, 210, 215, 0.16);
  color: var(--primary-dim);
}
.journal-notes-hint {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
}
.journal-screen .primary-btn,
.journal-screen .secondary-btn,
.journal-screen .primary-btn.tiny-save,
.journal-screen .secondary-btn.tiny,
.journal-screen .journal-back {
  border-radius: 999px;
}
.primary-btn.tiny-save {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 999px;
  box-shadow: none;
}
.journal-date-open {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}
.journal-date-open:hover .journal-date-fa {
  color: var(--primary-dim);
}
.journal-date-fa {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--hero-text);
}
.journal-date-en {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}
.journal-cal-panel {
  max-width: 420px;
  border-radius: 24px !important;
  overflow: hidden;
  filter: none !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32) !important;
}
html[data-theme="light"] .journal-cal-panel {
  filter: none !important;
  box-shadow: 0 12px 28px rgba(15, 40, 44, 0.14) !important;
}
.journal-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.journal-cal-nav strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--hero-text);
}
.journal-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.journal-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.journal-cal-day {
  position: relative;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.journal-cal-day:disabled {
  opacity: 0.25;
  cursor: default;
}
.journal-cal-day:hover:not(:disabled) {
  border-color: var(--glass-border);
  background: rgba(84, 210, 215, 0.08);
}
.journal-cal-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(84, 210, 215, 0.55);
}
.journal-cal-day.is-selected {
  background: rgba(84, 210, 215, 0.18);
  border-color: rgba(84, 210, 215, 0.45);
  color: var(--primary-dim);
}
.journal-cal-day.has-trades::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--up);
}
.journal-cal-day.has-trades.is-loss::after {
  background: var(--down);
}
.journal-cal-day.has-trades.is-mixed::after {
  background: #fbbf24;
}
.journal-date-en {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  direction: ltr;
  text-align: right;
}
.journal-stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(720px, 100%);
}
.journal-stat {
  min-width: 64px;
  padding: 6px 7px;
  border-radius: 12px;
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  text-align: center;
}
.journal-stat span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
  white-space: nowrap;
}
.journal-stat strong {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--hero-text);
  direction: ltr;
}
.journal-stat strong.is-up { color: var(--up); }
.journal-stat strong.is-down { color: var(--down); }

.journal-accounts {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: none;
  overflow: visible;
}
.journal-accounts-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.journal-accounts-active {
  min-width: 0;
  flex: 1 1 auto;
}
.journal-accounts-active .side-label {
  margin: 0 0 2px;
}
.journal-accounts-active strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--hero-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.journal-accounts-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.meta-list-panel {
  max-width: 520px;
}
.meta-accounts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.meta-accounts-empty {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}
.meta-accounts-empty.hidden { display: none; }
.meta-account-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--tile-bg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  align-items: center;
}
.meta-account-card.is-active {
  border-color: rgba(84, 210, 215, 0.5);
  box-shadow: inset 0 0 0 1px rgba(84, 210, 215, 0.12);
}
.meta-account-main { min-width: 0; cursor: pointer; }
.meta-account-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--hero-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-account-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-account-badge {
  justify-self: end;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(84, 210, 215, 0.12);
  color: var(--primary-dim);
}
.meta-account-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.meta-account-name-row .meta-account-name { flex: 1; min-width: 0; }
.meta-account-badge.mt4 { background: rgba(66, 133, 244, 0.14); color: #8ab4f8; }
.meta-account-badge.mt5 { background: rgba(242, 169, 54, 0.16); color: #fbbf24; }
.journal-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--on-surface);
}
.journal-status.hidden { display: none; }
.journal-status.error {
  border-color: rgba(242, 54, 69, 0.35);
  background: rgba(242, 54, 69, 0.1);
  color: var(--down);
}
.journal-status.info {
  border-color: rgba(84, 210, 215, 0.28);
  background: rgba(84, 210, 215, 0.08);
  color: var(--primary-dim);
}
.journal-sync-progress {
  margin-top: 10px;
}
.meta-account-card.is-syncing {
  border-color: rgba(84, 210, 215, 0.45);
}
.meta-account-card.has-error {
  border-color: rgba(242, 54, 69, 0.35);
}
.meta-account-error {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(242, 54, 69, 0.1);
  color: var(--down);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.meta-account-sync-line,
.meta-account-sync-ok {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dim);
}
.meta-account-tools .is-sync {
  border-color: rgba(242, 169, 54, 0.35);
  color: #fbbf24;
}
.meta-mode-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}
.meta-mode-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.meta-mode-tab.active {
  background: rgba(84, 210, 215, 0.16);
  color: var(--primary-dim);
}
.meta-mt5-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.meta-mt5-fields.hidden { display: none; }
.meta-sync-progress {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(84, 210, 215, 0.22);
  background: rgba(84, 210, 215, 0.06);
}
.meta-sync-progress.hidden { display: none; }
.meta-sync-progress.is-error {
  border-color: rgba(242, 54, 69, 0.35);
  background: rgba(242, 54, 69, 0.08);
}
.meta-sync-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.meta-sync-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.meta-sync-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fb6bb, #54d2d7);
  transition: width 0.35s ease;
}
.meta-sync-progress.is-error .meta-sync-bar > i {
  background: linear-gradient(90deg, #f23645, #ff7a84);
}
.meta-account-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta-account-tools button {
  flex: 1;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--on-surface);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.meta-account-tools button:hover {
  border-color: rgba(84, 210, 215, 0.45);
  color: var(--primary-dim);
}
.meta-account-tools button:disabled {
  opacity: 0.55;
  cursor: default;
}
.meta-account-tools .is-danger:hover {
  border-color: rgba(242, 54, 69, 0.45);
  color: var(--down);
}
.meta-account-hint {
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0 0;
  grid-column: 1 / -1;
}
.meta-account-hint b { color: var(--primary-dim); font-weight: 700; }
.journal-field-full { grid-column: 1 / -1; }
.meta-sync-toast {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dim);
  margin: 8px 0 0;
}
.meta-sync-progress.is-error .meta-sync-toast {
  color: var(--down);
}
html[data-theme="light"] .meta-mode-tabs {
  background: rgba(15, 40, 44, 0.04);
}
html[data-theme="light"] .meta-sync-progress {
  background: rgba(15, 40, 44, 0.04);
}

.journal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.8fr);
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.journal-trades,
.journal-report {
  padding: 12px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 210, 215, 0.45) rgba(255, 255, 255, 0.04);
}
.journal-trades::-webkit-scrollbar,
.journal-report::-webkit-scrollbar,
.journal-trade-list::-webkit-scrollbar,
.journal-day-notes::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  display: block;
}
.journal-trades::-webkit-scrollbar-thumb,
.journal-report::-webkit-scrollbar-thumb,
.journal-trade-list::-webkit-scrollbar-thumb,
.journal-day-notes::-webkit-scrollbar-thumb {
  background: rgba(84, 210, 215, 0.4);
  border-radius: 999px;
}
.journal-trades::-webkit-scrollbar-track,
.journal-report::-webkit-scrollbar-track,
.journal-trade-list::-webkit-scrollbar-track,
.journal-day-notes::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.journal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}
.journal-section-head h2 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--hero-text);
}
.journal-save-hint {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 6px;
}
.journal-save-hint.is-saving { color: var(--primary-dim); }
.journal-save-hint.is-saved { color: var(--up); }

.journal-trade-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0 2px 4px 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}
.journal-empty {
  margin: auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 28px 16px;
}
.journal-empty.hidden { display: none; }

.journal-trade-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--tile-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  text-align: right;
  font: inherit;
  color: inherit;
  width: 100%;
  flex-shrink: 0;
}
.journal-trade-card:hover {
  border-color: rgba(84, 210, 215, 0.45);
  transform: translateY(-1px);
}
.journal-trade-side {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.journal-trade-side.long {
  background: rgba(8, 153, 129, 0.16);
  color: var(--up);
}
.journal-trade-side.short {
  background: rgba(242, 54, 69, 0.14);
  color: var(--down);
}
.journal-trade-main { min-width: 0; }
.journal-trade-symbol {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--mono);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  color: var(--hero-text);
}
.journal-trade-date {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dim);
  font-family: var(--font);
  direction: rtl;
  white-space: nowrap;
}
.journal-trade-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  direction: ltr;
  justify-content: flex-end;
}
.journal-trade-result {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}
.journal-trade-result.win { background: rgba(8, 153, 129, 0.16); color: var(--up); }
.journal-trade-result.loss { background: rgba(242, 54, 69, 0.14); color: var(--down); }
.journal-trade-result.be { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.journal-trade-result.open { background: rgba(84, 210, 215, 0.12); color: var(--primary-dim); }
.journal-trade-pnl {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  direction: ltr;
  text-align: left;
}
.journal-trade-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  justify-content: flex-end;
}
.journal-trade-tags span {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(84, 210, 215, 0.1);
  border: 1px solid rgba(84, 210, 215, 0.25);
  color: var(--primary-dim);
}

.journal-analysis {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(84, 210, 215, 0.06);
}
html[data-theme="light"] .journal-analysis {
  background: rgba(15, 124, 128, 0.06);
}
.journal-analysis-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--hero-text);
}
.journal-analysis-text {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 500;
}
.journal-analysis-points {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.journal-analysis-points li {
  position: relative;
  padding-right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.45;
}
.journal-analysis-points li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.journal-charts {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 8px;
  min-height: 0;
}
.journal-chart-card,
.journal-week-chart-card {
  padding: 8px 10px 6px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--tile-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.journal-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.journal-chart-head strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hero-text);
  direction: ltr;
}
.journal-chart-head strong.is-up { color: var(--up); }
.journal-chart-head strong.is-down { color: var(--down); }
.journal-chart-svg {
  width: 100%;
  height: 108px;
  display: block;
  color: var(--on-surface);
}
.journal-chart-svg.is-empty { opacity: 0.25; }
.journal-week-svg { height: 72px; }
.journal-chart-empty {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 8px 4px;
}
.journal-chart-empty.hidden { display: none; }
.journal-donut-wrap {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 96px;
}
.journal-donut-svg {
  width: 96px;
  height: 96px;
  color: var(--on-surface);
}
.journal-donut-svg.is-empty { opacity: 0.25; }
.journal-result-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.journal-result-legend.hidden { display: none; }
.journal-result-legend li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface);
}
.journal-result-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}
.journal-result-legend strong {
  font-family: var(--mono);
  direction: ltr;
  color: var(--muted);
}

.journal-day-notes {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--glass-border);
}
.journal-field-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.journal-field-inline > span { margin: 0; }
.journal-day-notes textarea {
  min-height: 44px !important;
  resize: none;
}

.journal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.journal-field > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.journal-field input,
.journal-field select,
.journal-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--surface-low);
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  outline: none;
  resize: vertical;
}
.journal-field input:focus,
.journal-field select:focus,
.journal-field textarea:focus {
  border-color: rgba(84, 210, 215, 0.55);
  box-shadow: 0 0 0 3px rgba(84, 210, 215, 0.12);
}
.journal-field textarea { min-height: 64px; }
html[data-theme="light"] .journal-field input,
html[data-theme="light"] .journal-field select,
html[data-theme="light"] .journal-field textarea {
  background: #ffffff;
}

.trade-modal-panel {
  width: min(640px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
}
.trade-form { display: flex; flex-direction: column; gap: 12px; }
.trade-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.trade-tags-field { grid-column: 1 / -1; }
.trade-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--surface-low);
}
.trade-tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(84, 210, 215, 0.12);
  border: 1px solid rgba(84, 210, 215, 0.3);
  color: var(--primary-dim);
}
.trade-tag-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.trade-tags-wrap input {
  flex: 1;
  min-width: 120px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 4px 2px !important;
}
.trade-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* Desktop: fixed viewport, no page scroll — only lists scroll inside */
@media (min-width: 981px) {
  body.journal-mode,
  body.journal-mode html {
    overflow: hidden !important;
    height: 100%;
  }
  body.journal-mode .shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .journal-screen {
    overflow: hidden;
  }
}

@media (max-width: 980px) {
  body.journal-mode {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }
  body.journal-mode .shell {
    height: auto;
    max-height: none;
    overflow: visible;
    width: calc(100% - 24px);
  }
  .journal-screen {
    overflow: visible;
    height: auto;
    max-height: none;
    flex: none;
    gap: 12px;
    padding-bottom: 20px;
  }
  .journal-body {
    grid-template-columns: 1fr;
    overflow: visible;
    flex: none;
    min-height: 0;
  }
  .journal-trades,
  .journal-report {
    height: auto;
    max-height: min(70vh, 720px);
    min-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .journal-trade-list {
    max-height: none;
    flex: none;
    overflow: visible;
  }
  .journal-charts {
    grid-template-columns: 1fr;
  }
  .journal-day-notes {
    overflow: visible;
    flex: none;
  }
  .journal-day-notes textarea {
    min-height: 64px !important;
    resize: vertical;
  }
  .journal-title { font-size: 20px; }
  .journal-top,
  .journal-date-row {
    flex-wrap: wrap;
  }
  .journal-accounts-active strong {
    max-width: 100%;
  }
  .side-launch-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .journal-screen { padding: 2px 0 24px; gap: 10px; }
  .trade-form-grid { grid-template-columns: 1fr; }
  .journal-top {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }
  .journal-top-main { text-align: right; }
  .journal-date-row { flex-direction: column; align-items: stretch; }
  .journal-stats { width: 100%; }
  .journal-stat { flex: 1; min-width: 0; }
  .journal-trade-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .journal-trade-card > div:last-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .journal-trade-pnl { text-align: right; margin-top: 0; }
}

/* Circular page/theme wipe (View Transitions) */
html.vt-circle::view-transition-old(root),
html.vt-circle::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.vt-circle::view-transition-old(root) {
  z-index: 1;
}
html.vt-circle::view-transition-new(root) {
  z-index: 2;
}
html.vt-circle.vt-reverse::view-transition-old(root) {
  z-index: 2;
}
html.vt-circle.vt-reverse::view-transition-new(root) {
  z-index: 1;
}

/* ---------- First-run tour ---------- */
body.tour-open {
  overflow: hidden;
}
.tour {
  --tour-accent: #7eebef;
  --tour-accent-deep: #3ec8cd;
  --tour-on-accent: #003738;
  --tour-dim: rgba(4, 10, 12, 0.72);
  --tour-ring: rgba(126, 235, 239, 0.34);
  --tour-halo: rgba(0, 0, 0, 0.55);
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}
html[data-theme="light"] .tour {
  --tour-accent: #0a6569;
  --tour-accent-deep: #084e51;
  --tour-on-accent: #ffffff;
  --tour-dim: rgba(22, 48, 52, 0.46);
  --tour-ring: rgba(10, 101, 105, 0.2);
  --tour-halo: rgba(255, 255, 255, 0.96);
}
.tour.hidden {
  display: none !important;
}
.tour-shade {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
}
.tour-spot {
  position: fixed;
  pointer-events: none;
  border: 2px solid var(--tour-accent);
  box-shadow:
    0 0 0 3px var(--tour-halo),
    0 0 0 7px var(--tour-ring),
    0 0 0 9999px var(--tour-dim);
  animation: tour-pulse 1.8s ease-in-out infinite;
}
.tour-spot.hidden {
  display: none !important;
}
.tour-jump .tour-spot,
.tour-jump .tour-card {
  transition: none;
  animation: none;
}
@keyframes tour-pulse {
  50% {
    box-shadow:
      0 0 0 3px var(--tour-halo),
      0 0 0 14px transparent,
      0 0 0 9999px var(--tour-dim);
  }
}
.tour-arrow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.tour-arrow.hidden {
  display: none !important;
}
.tour-arrow-path {
  fill: none;
  stroke: var(--tour-accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px var(--tour-halo)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.tour-card {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  pointer-events: auto;
  padding: 14px 16px 12px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  user-select: none;
  cursor: pointer;
}
html[data-theme="light"] .tour-card {
  background: #ffffff;
  border-color: rgba(10, 101, 105, 0.28);
  box-shadow: 0 16px 40px rgba(16, 42, 46, 0.18);
}
.tour-progress {
  display: flex;
  justify-content: flex-start;
  height: 3px;
  border-radius: 99px;
  background: var(--outline);
  overflow: hidden;
  margin-bottom: 10px;
}
.tour-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: inherit;
  transition: width 0.3s ease;
}
.tour-step {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.tour-card h2 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}
.tour-body {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.tour-text-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 2px;
}
.tour-text-btn:hover {
  color: var(--on-surface);
}
.tour-text-btn.is-hidden {
  display: none;
}
.tour-next {
  margin-inline-start: auto;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, var(--tour-accent), var(--tour-accent-deep));
  color: var(--tour-on-accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 13px;
}
.tour-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .tour-spot,
  .tour-progress span {
    animation: none;
  }
}
