:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(255, 255, 255, 0.46);
  --panel: rgba(255, 255, 255, 0.22);
  --panel-strong: rgba(255, 255, 255, 0.38);
  --glass: rgba(255, 255, 255, 0.18);
  --glass-soft: rgba(255, 255, 255, 0.12);
  --glass-dark: rgba(17, 20, 30, 0.54);
  --canvas: #f5f7fb;
  --teal: #007aff;
  --blue: #0a84ff;
  --amber: #bf5b00;
  --red: #d70015;
  --green: #248a3d;
  --panel-shadow: 0 1px 1px rgba(255, 255, 255, 0.82) inset, 0 -1px 1px rgba(0, 0, 0, 0.07) inset, 0 24px 70px rgba(29, 29, 31, 0.11);
  --lift-shadow: 0 1px 1px rgba(255, 255, 255, 0.86) inset, 0 -1px 1px rgba(0, 0, 0, 0.1) inset, 0 34px 90px rgba(29, 29, 31, 0.2);
  --soft-fill: rgba(255, 255, 255, 0.22);
  --control-fill: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(38px) saturate(230%);
  --sticky-tabs-top: 92px;
  --side-holdings-top: 115px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(245, 247, 251, 0.62) 38%, rgba(232, 238, 247, 0.72)),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  font-feature-settings: "tnum";
}

body.variant-hybrid {
  color-scheme: dark;
  --ink: #f5f8ff;
  --muted: rgba(210, 220, 235, 0.72);
  --line: rgba(120, 170, 255, 0.2);
  --panel: rgba(12, 19, 32, 0.5);
  --panel-strong: rgba(20, 31, 50, 0.72);
  --glass: rgba(10, 17, 30, 0.56);
  --glass-soft: rgba(255, 255, 255, 0.075);
  --glass-dark: rgba(0, 0, 0, 0.48);
  --canvas: #050915;
  --teal: #58a6ff;
  --blue: #0a84ff;
  --amber: #f4b942;
  --red: #ff453a;
  --green: #30d158;
  --panel-shadow: 0 1px 1px rgba(255, 255, 255, 0.13) inset, 0 -1px 1px rgba(0, 0, 0, 0.44) inset, 0 28px 90px rgba(0, 8, 22, 0.42);
  --lift-shadow: 0 1px 1px rgba(255, 255, 255, 0.18) inset, 0 -1px 1px rgba(0, 0, 0, 0.5) inset, 0 36px 120px rgba(0, 8, 22, 0.62);
  --soft-fill: rgba(255, 255, 255, 0.07);
  --control-fill: rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 16% -10%, rgba(14, 165, 233, 0.22), transparent 34%),
    radial-gradient(circle at 78% 8%, rgba(244, 185, 66, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(5, 9, 21, 0.98), rgba(9, 14, 28, 0.95) 44%, rgba(7, 11, 20, 0.98)),
    var(--canvas);
}

body.variant-hybrid .topbar,
body.variant-hybrid .sticky-controls,
body.variant-hybrid .control-strip,
body.variant-hybrid .section-tabs,
body.variant-hybrid .metric,
body.variant-hybrid .beginner-card,
body.variant-hybrid .portfolio-panel,
body.variant-hybrid .experiment-card,
body.variant-hybrid .side-us-holdings,
body.variant-hybrid .ticket,
body.variant-hybrid .position {
  border-color: rgba(118, 166, 255, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
}

body.variant-hybrid .brand-logo {
  filter: drop-shadow(0 0 16px rgba(10, 132, 255, 0.36)) drop-shadow(0 18px 36px rgba(0, 0, 0, 0.34));
}

body.variant-hybrid input,
body.variant-hybrid select,
body.variant-hybrid textarea {
  color: var(--ink);
  border-color: rgba(120, 170, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

body.variant-hybrid table,
body.variant-hybrid tbody tr,
body.variant-hybrid .table-wrap,
body.variant-hybrid .experiment-stats > div {
  border-color: rgba(120, 170, 255, 0.16);
}

body.variant-hybrid .pill {
  color: #9fd0ff;
  background: rgba(10, 132, 255, 0.14);
}

body.is-refreshing .control-strip {
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: var(--panel-shadow), 0 0 0 1px rgba(0, 122, 255, 0.08), 0 18px 42px rgba(0, 122, 255, 0.08);
}

body.is-refreshing .metric,
body.is-refreshing .beginner-card,
body.is-refreshing .portfolio-panel,
body.is-refreshing .side-us-holdings {
  transition: opacity 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

body.is-refreshing .metric,
body.is-refreshing .beginner-card,
body.is-refreshing .portfolio-panel {
  opacity: 0.94;
  filter: saturate(0.98);
}

body,
button,
input,
select {
  -webkit-text-size-adjust: 100%;
}

.pull-refresh {
  --pull-offset: 0px;
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-64px + var(--pull-offset)));
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.pull-refresh.visible {
  opacity: 1;
}

.pull-refresh.ready,
.pull-refresh.refreshing {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.35);
}

.pull-refresh strong {
  font-size: 12px;
  white-space: nowrap;
}

.pull-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d8e1e8;
  border-top-color: currentColor;
  border-radius: 999px;
}

.pull-refresh.refreshing .pull-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 1px 0 rgba(210, 210, 215, 0.52);
  backdrop-filter: var(--glass-blur);
}

.topbar h1,
.login-panel h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 760;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.variant-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  color: #f4b942;
  border: 1px solid rgba(244, 185, 66, 0.34);
  border-radius: 999px;
  background: rgba(244, 185, 66, 0.12);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.variant-badge[hidden] {
  display: none;
}

.brand-lockup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-width: 0;
}

.brand-logo {
  grid-row: span 2;
  width: 64px;
  max-width: 18vw;
  height: 48px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 12px 24px rgba(7, 17, 29, 0.12));
}

.creator-credit {
  margin: 1px 0 0;
  color: rgba(110, 110, 115, 0.82);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-control-strip {
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 56px;
  padding: 6px;
  border-radius: 12px;
}

.topbar-control-strip .icon-toggle {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}

.topbar-control-strip span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 260px;
}

.logout-link {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
}

.topbar-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
nav a {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--soft-fill);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

button {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

button:hover,
nav a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 36px 32px 40px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  grid-column: 1 / -1;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.settings-actions button {
  min-width: 132px;
}

.settings-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.settings-status.applied {
  color: var(--green);
}

.settings-status.dirty,
.settings-status.pending {
  color: var(--amber);
}

.settings-status.error {
  color: var(--red);
}

.sticky-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.sticky-controls > .control-strip {
  display: none;
}

.control-strip {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 72px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
}

.control-strip span {
  flex: 1 1 auto;
  min-width: 160px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.toggle-button {
  color: var(--muted);
  border-color: transparent;
  background: var(--control-fill);
}

.icon-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-width: 1px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.78) inset, 0 -1px 1px rgba(0, 0, 0, 0.08) inset, 0 12px 28px rgba(29, 29, 31, 0.1);
  backdrop-filter: var(--glass-blur);
  line-height: 1;
}

.control-icon {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-toggle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #98a2b3;
}

.toggle-button.on {
  color: #ffffff;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.18);
}

.toggle-button.on::after {
  background: #22c55e;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(210, 210, 215, 0.88);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible,
nav a:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.18);
  outline-offset: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-rows: minmax(40px, auto);
  grid-auto-flow: dense;
  gap: 8px;
}

.overview-only[hidden] {
  display: none !important;
}

.metric,
.panel,
.login-panel {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
}

.metric {
  display: grid;
  gap: 6px;
  padding: 17px;
}

.metric.accent {
  border-color: rgba(0, 122, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(210, 235, 255, 0.2));
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 27px;
  line-height: 1;
  font-weight: 760;
}

.metric strong.asset-lines {
  display: grid;
  gap: 5px;
  font-size: 22px;
  line-height: 1.12;
}

.metric strong.asset-lines span {
  display: block;
  overflow-wrap: anywhere;
}

.dashboard-module {
  position: relative;
  min-width: 0;
  overflow: hidden;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    grid-column 0.12s ease,
    grid-row 0.12s ease;
  will-change: transform;
}

.module-live-arranging > .dashboard-module:not(.module-moving):not(.module-drop-placeholder) {
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease,
    grid-column 0.1s ease,
    grid-row 0.1s ease;
}

.layout-editing .dashboard-module {
  outline: 2px dashed rgba(0, 122, 255, 0.36);
  outline-offset: 3px;
}

.layout-editing .summary-grid,
.layout-editing .beginner-grid,
.layout-editing .dashboard-panel {
  min-height: 220px;
  border-radius: 8px;
  background-image:
    linear-gradient(rgba(0, 122, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 255, 0.11) 1px, transparent 1px);
  background-size: calc((100% - 184px) / 24 + 8px) 48px;
  background-position: 0 0;
}

.layout-editing .summary-grid,
.layout-editing .beginner-grid {
  padding: 1px;
}

.layout-action-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 45;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 50px rgba(29, 29, 31, 0.16), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: var(--glass-blur);
  transform: translateX(-50%);
}

.layout-action-bar[hidden] {
  display: none !important;
}

.layout-action-bar button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
}

.module-resize-handle,
.module-move-handle {
  position: absolute;
  z-index: 6;
  display: none;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(0, 122, 255, 0.28);
  border-radius: 8px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset, 0 -1px 1px rgba(0, 0, 0, 0.08) inset, 0 10px 26px rgba(24, 33, 47, 0.14);
  backdrop-filter: var(--glass-blur);
  touch-action: none;
}

.module-resize-handle {
  right: 8px;
  bottom: 8px;
  cursor: nwse-resize;
}

.module-move-handle {
  top: 8px;
  left: 8px;
  cursor: grab;
}

.module-move-handle:active {
  cursor: grabbing;
}

.module-resize-handle::before {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 13px;
  height: 13px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}

.module-resize-handle::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.55;
}

.module-move-handle::before,
.module-move-handle::after {
  content: "";
  position: absolute;
  left: 9px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.module-move-handle::before {
  top: 10px;
}

.module-move-handle::after {
  top: 22px;
  box-shadow: none;
  opacity: 0.58;
}

.layout-editing .dashboard-module > .module-resize-handle,
.layout-editing .dashboard-module > .module-move-handle {
  display: block;
}

.layout-editing .dashboard-module .grid-stack-item-content > .module-move-handle {
  display: block;
}

.module-resizing,
.module-moving {
  user-select: none;
  transition: none;
}

.module-moving {
  position: fixed !important;
  left: var(--module-drag-left);
  top: var(--module-drag-top);
  z-index: 80;
  width: var(--module-drag-width);
  height: var(--module-drag-height);
  opacity: 0.9;
  pointer-events: none;
  transform: scale(0.985);
  box-shadow: var(--lift-shadow);
  transition: none;
}

.module-drop-placeholder {
  min-height: 64px;
  border: 2px dashed rgba(0, 122, 255, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 122, 255, 0.16), rgba(90, 200, 250, 0.08)),
    rgba(0, 122, 255, 0.08);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 18px 44px rgba(0, 122, 255, 0.13);
  opacity: 0.82;
  transition: grid-column 0.1s ease, grid-row 0.1s ease, opacity 0.1s ease, transform 0.1s ease;
}

.module-drop-placeholder-active {
  opacity: 1;
  transform: scale(1.01);
}

.dashboard-gridstack {
  display: block;
  min-height: 220px;
  border-radius: 8px;
}

.dashboard-gridstack.grid-stack > .grid-stack-item {
  min-width: 0;
  min-height: 0;
}

.dashboard-gridstack.grid-stack > .grid-stack-item > .grid-stack-item-content {
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-radius: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dashboard-gridstack .metric,
.dashboard-gridstack .beginner-card,
.dashboard-gridstack .panel,
.dashboard-gridstack .toolbar,
.dashboard-gridstack .table-wrap,
.dashboard-gridstack .portfolio-bars,
.dashboard-gridstack .experiment-grid,
.dashboard-gridstack .ticket-list,
.dashboard-gridstack .position-list,
.dashboard-gridstack .notice,
.dashboard-gridstack .experiment-detail,
.dashboard-gridstack .section-head {
  margin: 0;
  padding: 0;
}

.dashboard-gridstack .metric > .grid-stack-item-content {
  display: grid;
  gap: 6px;
  padding: 17px;
}

.dashboard-gridstack .beginner-card > .grid-stack-item-content {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.dashboard-gridstack .section-head > .grid-stack-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  overflow: hidden;
}

.dashboard-gridstack .toolbar > .grid-stack-item-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 2px;
}

.dashboard-gridstack .table-wrap > .grid-stack-item-content,
.dashboard-gridstack .portfolio-bars > .grid-stack-item-content,
.dashboard-gridstack .experiment-grid > .grid-stack-item-content,
.dashboard-gridstack .ticket-list > .grid-stack-item-content,
.dashboard-gridstack .position-list > .grid-stack-item-content,
.dashboard-gridstack .notice > .grid-stack-item-content,
.dashboard-gridstack .experiment-detail > .grid-stack-item-content {
  padding: 12px;
}

.dashboard-gridstack .portfolio-bars > .grid-stack-item-content,
.dashboard-gridstack .experiment-grid > .grid-stack-item-content {
  display: grid;
  grid-template-columns: inherit;
  gap: inherit;
  align-content: start;
}

.dashboard-gridstack .ticket-list > .grid-stack-item-content,
.dashboard-gridstack .position-list > .grid-stack-item-content,
.dashboard-gridstack .experiment-detail > .grid-stack-item-content {
  display: grid;
  gap: 12px;
  align-content: start;
}

.dashboard-gridstack .table-wrap > .grid-stack-item-content {
  overflow: auto;
}

.layout-editing .dashboard-gridstack {
  background-image:
    linear-gradient(rgba(0, 122, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 255, 0.12) 1px, transparent 1px);
  background-size: calc(100% / 24) 64px;
  background-position: 0 0;
}

.layout-editing .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content,
.layout-editing .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content {
  box-shadow: var(--lift-shadow);
  transform: scale(0.992);
}

.grid-stack > .grid-stack-placeholder > .placeholder-content {
  border: 1px dashed rgba(0, 122, 255, 0.55);
  border-radius: 8px;
  background: rgba(0, 122, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.dashboard-gridstack .ui-resizable-se {
  right: 8px !important;
  bottom: 8px !important;
  z-index: 7 !important;
  display: none !important;
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(0, 122, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset, 0 -1px 1px rgba(0, 0, 0, 0.08) inset, 0 10px 26px rgba(24, 33, 47, 0.14);
  backdrop-filter: var(--glass-blur);
  cursor: nwse-resize;
}

.dashboard-gridstack .ui-resizable-se::before {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 13px;
  height: 13px;
  border-right: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
}

.dashboard-gridstack .ui-resizable-se::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  opacity: 0.55;
}

.layout-editing .dashboard-gridstack .ui-resizable-se {
  display: block !important;
}

.beginner-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-rows: minmax(40px, auto);
  grid-auto-flow: dense;
  gap: 8px;
  margin-top: 14px;
}

.beginner-card {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
}

.beginner-card.primary {
  border-color: rgba(0, 122, 255, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(212, 236, 255, 0.2));
}

.beginner-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.beginner-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 760;
}

.beginner-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.currency-switch {
  display: inline-flex;
  width: max-content;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: var(--control-fill);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
  backdrop-filter: var(--glass-blur);
}

.metric-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.metric-market-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: var(--control-fill);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
  backdrop-filter: var(--glass-blur);
}

.metric-market-switch .mini-toggle {
  min-width: 34px;
  min-height: 28px;
  padding: 3px 7px;
}

.mini-toggle {
  min-width: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  cursor: pointer;
}

.mini-toggle.active {
  background: rgba(255, 255, 255, 0.32);
  color: var(--teal);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.converted-total {
  margin-top: 2px;
  font-size: 20px !important;
}

.portfolio-total-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.portfolio-total-control .converted-total {
  margin: 0;
  color: var(--ink);
  font-size: 18px !important;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.portfolio-panel {
  margin-top: 14px;
}

.dashboard-panel {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-rows: minmax(40px, auto);
  grid-auto-flow: dense;
  gap: 8px;
}

.dashboard-panel > .section-head {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0;
}

.dashboard-panel > .toolbar {
  grid-column: 1 / -1;
}

.dashboard-panel > .notice {
  margin: 0;
}

.section-tabs {
  display: flex;
  gap: 4px;
  margin-top: 0;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-overflow-scrolling: touch;
}

.side-us-holdings {
  display: none;
}

@media (max-width: 1679px) {
  .side-us-holdings,
  .side-holdings-resize-handle {
    display: none !important;
  }

  .side-holdings-resizing {
    cursor: auto;
  }
}

@media (min-width: 1680px) {
  .layout {
    width: min(1760px, calc(100vw - var(--side-holdings-reserved, 766px)));
    margin-left: 24px;
    margin-right: 0;
  }

  .side-us-holdings {
    position: fixed;
    top: var(--side-holdings-top);
    right: 22px;
    bottom: 48px;
    z-index: 4;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    width: var(--side-holdings-width, 720px);
    min-width: 540px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: var(--panel-shadow);
    backdrop-filter: var(--glass-blur);
  }

  .side-holdings-resize-handle {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -11px;
    z-index: 8;
    display: block;
    width: 22px;
    min-width: 22px;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: rgba(0, 122, 255, 0.72);
    background: transparent;
    box-shadow: none;
    cursor: ew-resize;
    touch-action: none;
  }

  .side-holdings-resize-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 9px;
    width: 4px;
    height: 78px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.18;
    transform: translateY(-50%);
    transition: opacity 0.14s ease, width 0.14s ease;
  }

  .side-us-holdings:hover .side-holdings-resize-handle::before,
  .side-holdings-resizing .side-holdings-resize-handle::before {
    width: 5px;
    opacity: 0.58;
  }

  .side-holdings-resizing {
    user-select: none;
    cursor: ew-resize;
  }

  .side-holdings-resizing .side-us-holdings {
    transition: none;
  }

  .side-us-holdings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .side-holdings-switch {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    backdrop-filter: var(--glass-blur);
  }

  .side-holdings-switch .mini-toggle {
    min-width: 42px;
    min-height: 30px;
    padding: 0 8px;
  }

  .side-us-holdings h2 {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.2;
  }

  .side-us-holdings-body {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .side-us-summary,
  .side-us-position {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.78) inset, 0 12px 28px rgba(29, 29, 31, 0.08);
    backdrop-filter: var(--glass-blur);
  }

  .side-us-summary {
    display: grid;
    gap: 7px;
  }

  .side-us-summary span,
  .side-us-position span,
  .side-us-position small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
  }

  .side-us-summary strong {
    color: var(--ink);
    font-size: 20px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .side-us-mini-stats {
    display: grid;
    gap: 4px;
    margin: 0;
  }

  .side-us-mini-stats div,
  .side-us-position-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .side-us-mini-stats dt,
  .side-us-position-row span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

.side-us-mini-stats dd,
  .side-us-position-row strong {
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .side-us-mini-stats dd.up,
  .side-us-position-row strong.up {
    color: var(--green);
  }

  .side-us-mini-stats dd.down,
  .side-us-position-row strong.down {
    color: var(--red);
  }

  .side-us-mini-stats dd.flat,
  .side-us-position-row strong.flat {
    color: var(--muted);
  }

  .side-us-position {
    display: grid;
    gap: 8px;
  }

  .side-us-position h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

.tab-button {
  flex: 1 0 auto;
  min-height: 36px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}

.tab-button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 18px rgba(29, 29, 31, 0.08);
}

.dashboard-panel[hidden] {
  display: none;
}

.portfolio-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  margin-bottom: 0;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  margin-top: 0;
}

@media (min-width: 981px) {
  .summary-grid > .dashboard-module,
  .beginner-grid > .dashboard-module,
  .dashboard-panel > .dashboard-module {
    grid-column: span var(--module-span, 1);
  }

  .dashboard-panel > .toolbar.dashboard-module {
    display: grid;
  }

  .dashboard-module.module-custom-size {
    overflow: auto;
  }

}

.experiment-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--glass-blur);
}

.experiment-detail {
  display: grid;
  gap: 12px;
}

.dashboard-panel[data-panel="hk-stock"] > .experiment-detail,
.dashboard-panel[data-panel="us-stock"] > .experiment-detail {
  grid-column: 1 / -1 !important;
  min-height: 440px;
  overflow: visible;
}

body:not(.layout-editing) .dashboard-panel[data-panel="hk-stock"] > .experiment-detail,
body:not(.layout-editing) .dashboard-panel[data-panel="us-stock"] > .experiment-detail {
  height: auto !important;
  grid-row: auto !important;
}

.experiment-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.experiment-stats > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--glass-soft);
}

.experiment-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.experiment-stats dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.experiment-detail .notice p,
.experiment-card .notice p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.portfolio-bars span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portfolio-bars strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 18px;
}

.portfolio-bars strong.asset-lines {
  display: grid;
  gap: 4px;
  line-height: 1.18;
}

.portfolio-bars strong.asset-lines span {
  display: block;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e5ea;
}

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.bar-fill.muted {
  background: var(--blue);
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.pill {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--teal);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(223, 245, 240, 0.74);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(14px) saturate(150%);
}

.pill.danger {
  color: var(--red);
  background: rgba(254, 228, 226, 0.76);
}

.market-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #0f766e;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(204, 251, 241, 0.72);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

.notice {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--glass-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: var(--glass-blur);
}

.notice strong {
  font-size: 12px;
}

.notice p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.notice p:last-child {
  margin-bottom: 0;
}

.ticket-list,
.position-list {
  display: grid;
  gap: 10px;
}

.ticket,
.position {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: var(--glass);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 10px 28px rgba(29, 29, 31, 0.055);
  backdrop-filter: var(--glass-blur);
}

.ticket h3,
.position h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.ticket dl,
.position dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.ticket dt,
.position dt {
  color: var(--muted);
  font-size: 12px;
}

.ticket dd,
.position dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.entry-reason {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  line-height: 1.55;
}

.ticket-actions,
.close-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

button.small {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.24);
}

button.danger {
  border-color: var(--red);
  background: var(--red);
}

.empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  border: 1px dashed rgba(110, 110, 115, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: var(--glass-blur);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: var(--glass-blur);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(210, 210, 215, 0.58);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.18);
}

td:first-child,
th:first-child {
  width: 28%;
}

td:nth-child(2),
th:nth-child(2),
td:nth-child(3),
th:nth-child(3),
td:nth-child(4),
th:nth-child(4) {
  width: 12%;
}

.journal-table {
  min-width: 1180px;
}

.journal-table th:first-child,
.journal-table td:first-child {
  width: 14%;
}

.journal-table th:nth-child(2),
.journal-table td:nth-child(2) {
  width: 8%;
}

.journal-table th:nth-child(3),
.journal-table td:nth-child(3),
.journal-table th:nth-child(4),
.journal-table td:nth-child(4),
.journal-table th:nth-child(5),
.journal-table td:nth-child(5),
.journal-table th:nth-child(6),
.journal-table td:nth-child(6),
.journal-table th:nth-child(7),
.journal-table td:nth-child(7) {
  width: 10%;
}

.journal-table th:nth-child(8),
.journal-table td:nth-child(8) {
  width: 28%;
}

.reason-cell p {
  margin: 0;
  line-height: 1.5;
}

.source-list {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 16px;
  color: var(--muted);
}

.source-list a {
  color: var(--blue);
}

.long-term-table {
  min-width: 1280px;
}

.long-term-table th:first-child,
.long-term-table td:first-child {
  width: 6%;
}

.long-term-table th:nth-child(2),
.long-term-table td:nth-child(2) {
  width: 13%;
}

.long-term-table th:nth-child(3),
.long-term-table td:nth-child(3),
.long-term-table th:nth-child(4),
.long-term-table td:nth-child(4) {
  width: 10%;
}

.long-term-table th:nth-child(5),
.long-term-table td:nth-child(5) {
  width: 29%;
}

.long-term-table th:nth-child(6),
.long-term-table td:nth-child(6) {
  width: 16%;
}

.long-term-table th:nth-child(7),
.long-term-table td:nth-child(7) {
  width: 16%;
}

.compact-list {
  display: grid;
  gap: 6px;
}

.compact-list p {
  margin: 0;
  line-height: 1.45;
}

.compact-list a {
  color: var(--blue);
}

.symbol {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.symbol strong,
td {
  overflow-wrap: anywhere;
}

.up {
  color: var(--green);
  font-weight: 800;
}

.down {
  color: var(--red);
  font-weight: 800;
}

.flat {
  color: var(--muted);
  font-weight: 800;
}

.temperature-high {
  color: var(--red);
}

.temperature-mid {
  color: var(--amber);
}

.temperature-low {
  color: var(--green);
}

.watch {
  color: var(--amber);
  font-weight: 800;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.login-logo {
  display: block;
  width: 96px;
  height: auto;
  margin: 0 0 18px;
  filter: drop-shadow(0 16px 28px rgba(7, 17, 29, 0.14));
}

.login-credit {
  margin-top: 6px;
  margin-bottom: 10px;
}

.login-panel p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .toolbar,
  .split,
  .portfolio-bars,
  .experiment-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .beginner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-panel,
  .experiment-grid,
  .position-list,
  .ticket-list {
    gap: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-module {
    height: auto !important;
    resize: none;
    grid-column: auto !important;
    overflow: visible;
  }

  .table-wrap.dashboard-module {
    overflow-x: auto;
  }

  .metric,
  .beginner-card,
  .experiment-card,
  .position,
  .ticket {
    border-radius: 8px;
  }

  .metric strong,
  .beginner-card strong,
  .experiment-stats dd,
  .position dd,
  .ticket dd {
    overflow-wrap: anywhere;
  }

  .module-resize-handle,
  .module-move-handle {
    display: none !important;
  }

  .topbar > div {
    min-width: 0;
    padding-right: 58px;
  }

  .control-strip {
    flex-wrap: wrap;
    min-height: auto;
  }

  .control-strip span {
    flex-basis: 100%;
    min-width: 0;
  }

  nav {
    position: static;
    width: 100%;
    display: flex;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-control-strip {
    flex: 0 0 auto;
  }

  nav button,
  nav a {
    display: grid;
    place-items: center;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--canvas);
    overflow-x: hidden;
  }

  .topbar,
  .layout {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 1.12;
  }

  .brand-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .variant-badge {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 9px;
    max-width: 100%;
    white-space: normal;
  }

  .brand-lockup {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
  }

  .brand-logo {
    width: 50px;
    max-width: 18vw;
    height: 34px;
  }

  .creator-credit {
    font-size: 9px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .topbar > div {
    padding-right: 0;
  }

  nav button,
  nav a,
  input,
  select {
    min-height: 44px;
  }

  .topbar-actions {
    width: 100%;
    gap: 6px;
  }

  .logout-link {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  button,
  nav a {
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .layout {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 28px;
  }

  .sticky-controls {
    position: sticky;
    top: var(--sticky-tabs-top);
    z-index: 9;
    gap: 0;
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: 12px;
    padding: 7px 12px 9px;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 245, 247, 0.88);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(18px);
  }

  .toolbar {
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions button {
    width: 100%;
  }

  .control-strip {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px;
  }

  .topbar-control-strip {
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 0;
    padding: 5px;
    min-height: 48px;
    overflow: visible;
  }

  .topbar-control-strip span {
    display: none;
  }

  .topbar-control-strip .icon-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .topbar-control-strip .control-icon {
    width: 23px;
    height: 23px;
  }

  .control-strip span {
    line-height: 1.35;
  }

  .summary-grid,
  .beginner-grid,
  .dashboard-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
  }

  .summary-grid > .dashboard-module,
  .beginner-grid > .dashboard-module,
  .dashboard-panel > .dashboard-module,
  .dashboard-panel > .toolbar.dashboard-module {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100%;
    height: auto !important;
  }

  .beginner-grid {
    margin-top: 10px;
  }

  .beginner-card {
    min-height: 108px;
    padding: 12px;
  }

  .metric {
    min-height: 108px;
    padding: 12px;
    align-content: center;
  }

  .metric strong {
    font-size: 20px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .metric span,
  .metric small,
  .beginner-card span,
  .beginner-card p {
    font-size: 12px;
    line-height: 1.35;
  }

  .experiment-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .experiment-stats > div {
    padding: 8px;
  }

  .panel {
    padding: 14px;
  }

  .portfolio-panel,
  .split {
    margin-top: 10px;
  }

  .side-us-holdings,
  .side-holdings-resize-handle {
    display: none !important;
  }

  .metric-headline,
  .section-head,
  .side-us-holdings-head {
    min-width: 0;
  }

  .metric-market-switch,
  .side-holdings-switch {
    flex: 0 0 auto;
  }

  .portfolio-total-control .converted-total,
  .metric strong.asset-lines,
  .position strong,
  .ticket strong {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .section-tabs {
    position: static;
    z-index: auto;
    margin-left: 0;
    margin-right: 0;
    padding: 7px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: 0 8px 18px rgba(24, 33, 47, 0.08);
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 38px;
    padding: 0 11px;
    border-color: var(--line);
    border-radius: 999px;
    background: #ffffff;
    white-space: nowrap;
  }

  .tab-button.active {
    border-color: rgba(0, 122, 255, 0.22);
    background: var(--teal);
    color: #ffffff;
  }

  .section-head {
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .portfolio-total-control {
    width: 100%;
    justify-content: flex-start;
  }

  .section-head h2 {
    font-size: 16px;
  }

  .pill {
    flex: 0 0 auto;
  }

  .portfolio-bars {
    gap: 10px;
  }

  .portfolio-bar {
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  table,
  .journal-table,
  .long-term-table {
    min-width: 0;
  }

  tr {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
  }

  td,
  td:first-child,
  td:nth-child(2),
  td:nth-child(3),
  td:nth-child(4),
  th:first-child,
  th:nth-child(2),
  th:nth-child(3),
  th:nth-child(4),
  .journal-table td,
  .journal-table td:first-child,
  .journal-table td:nth-child(2),
  .journal-table td:nth-child(3),
  .journal-table td:nth-child(4),
  .journal-table td:nth-child(5),
  .journal-table td:nth-child(6),
  .journal-table td:nth-child(7),
  .journal-table td:nth-child(8),
  .long-term-table td,
  .long-term-table td:first-child,
  .long-term-table td:nth-child(2),
  .long-term-table td:nth-child(3),
  .long-term-table td:nth-child(4),
  .long-term-table td:nth-child(5),
  .long-term-table td:nth-child(6),
  .long-term-table td:nth-child(7) {
    width: 100%;
  }

  td {
    display: grid;
    grid-template-columns: minmax(72px, 30%) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e7edf2;
    font-size: 13px;
    line-height: 1.45;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: "";
    display: none;
  }

  .symbol {
    gap: 2px;
  }

  .compact-list,
  .source-list {
    gap: 5px;
    min-width: 0;
  }

  .ticket dl,
  .position dl,
  .ticket-actions,
  .close-row {
    grid-template-columns: 1fr;
  }

  .ticket,
  .position {
    padding: 12px;
  }

  .ticket-list,
  .position-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ticket-actions button,
  .close-row button {
    width: 100%;
  }

  .settings-status {
    overflow-wrap: anywhere;
  }

  .layout-action-bar {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    justify-content: center;
    padding: 8px;
  }

  .layout-action-bar button {
    flex: 1 1 0;
    min-width: 0;
  }

  .entry-reason {
    font-size: 12px;
  }

  .notice {
    padding: 10px;
  }

  .notice p {
    font-size: 12px;
  }
}

@media (max-width: 340px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
