:root {
  --win-gray: #c0c0c0;
  --win-light: #ffffff;
  --win-mid: #dfdfdf;
  --win-dark: #808080;
  --win-black: #101010;
  --win-blue: #000080;
  --win-teal: #008080;
  --buy-green: #006b43;
  --sell-red: #9d1b1b;
  --font-ui: "MS Sans Serif", Tahoma, "Malgun Gothic", sans-serif;
}

:root[data-theme="mint"] {
  --win-gray: #c8e7d7;
  --win-light: #f7fffb;
  --win-mid: #e3f6ec;
  --win-dark: #659987;
  --win-blue: #166b5b;
  --win-teal: #5eab97;
}
:root[data-theme="lavender"] {
  --win-gray: #ddd3ed;
  --win-light: #fbf8ff;
  --win-mid: #eee8f8;
  --win-dark: #8a7aa3;
  --win-blue: #58427d;
  --win-teal: #8573ad;
}
:root[data-theme="peach"] {
  --win-gray: #f0d5c5;
  --win-light: #fff9f4;
  --win-mid: #fae7db;
  --win-dark: #a67563;
  --win-blue: #8a4a3b;
  --win-teal: #bf806a;
}
:root[data-theme="sky"] {
  --win-gray: #cbe3f2;
  --win-light: #f7fcff;
  --win-mid: #e3f2fb;
  --win-dark: #668fa8;
  --win-blue: #285f87;
  --win-teal: #5793b4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--win-black);
  background-color: var(--win-teal);
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 4px 4px;
  font-family: var(--font-ui);
  font-size: 13px;
}

button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.auth-desktop {
  min-height: 100vh;
  padding: 20px;
  display: grid;
  place-items: center;
}
.auth-window {
  width: min(460px, 100%);
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
  box-shadow: 1px 1px 0 var(--win-dark), 8px 10px 0 rgba(0, 0, 0, .24);
}
.auth-body { min-height: 138px; padding: 26px 28px 18px; display: flex; gap: 18px; align-items: center; }
.auth-body strong { font-size: 16px; }
.auth-body p { margin: 9px 0 0; color: #444; line-height: 1.55; }
.auth-icon { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); font-size: 29px; }
.auth-actions { padding: 0 28px 22px; text-align: center; }
.chatgpt-login { display: inline-block; min-width: 180px; color: #000; font-weight: 700; text-decoration: none; }
.auth-note { margin: 0 5px 5px; padding: 6px 8px; color: #555; border: 1px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); font-size: 11px; }

.desktop {
  width: 100%;
  min-height: 100vh;
  padding: 22px;
  display: grid;
  place-items: center;
}

.app-window {
  width: min(1180px, 100%);
  min-height: 720px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
  box-shadow: 1px 1px 0 var(--win-dark), 8px 10px 0 rgba(0, 0, 0, .24);
}

.title-bar, .panel-title, .dialog-title {
  color: white;
  background: var(--win-blue);
  font-weight: 700;
}

.title-bar {
  height: 30px;
  margin: 3px;
  padding: 3px 3px 3px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-text { display: flex; align-items: center; gap: 7px; }
.app-icon { color: #ffe44e; font-size: 17px; text-shadow: 1px 1px #000; }
.window-controls { display: flex; gap: 3px; }
.window-controls button {
  width: 23px;
  height: 22px;
  padding: 0;
  line-height: 16px;
  font-weight: 900;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
}

.menu-bar { display: flex; gap: 2px; padding: 0 6px 3px; }
.menu-item { position: relative; }
.menu-bar button { padding: 3px 9px; border: 0; background: transparent; }
.menu-bar button:focus-visible, .menu-bar button:hover { outline: 1px dotted #000; background: #d4d4d4; }
.file-dropdown { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 172px; padding: 2px; background: var(--win-gray); border: 2px solid; border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light); box-shadow: 2px 2px #000; }
.file-dropdown button { display: block; width: 100%; padding: 5px 8px; text-align: left; white-space: nowrap; }
.theme-menu-wrap { position: relative; }
.theme-menu-wrap > button { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.theme-dropdown { position: absolute; z-index: 21; top: -2px; left: calc(100% + 2px); min-width: 130px; padding: 2px; background: var(--win-gray); border: 2px solid; border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light); box-shadow: 2px 2px #000; }
.theme-menu-title { padding: 4px 7px; color: #fff; background: var(--win-blue); font-size: 11px; font-weight: 700; }
.theme-dropdown button { display: block; width: 100%; }

.toolbar {
  min-height: 36px;
  margin: 0 5px 5px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}
.toolbar-brand { padding: 3px 7px; color: #fff; background: #101060; font-weight: 700; letter-spacing: .8px; }
.toolbar-separator { align-self: stretch; width: 2px; border-left: 1px solid var(--win-dark); border-right: 1px solid white; }
.toolbar-date { margin-left: auto; color: #444; }
.account-area { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-area > span { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; font-size: 11px; }
.account-area a { padding: 2px 5px; color: #000; background: var(--win-gray); border: 1px solid; border-color: white #444 #444 white; font-size: 11px; text-decoration: none; }
.account-area + .toolbar-date { margin-left: 0; }
.status-led, .legend-dot { display: inline-block; width: 8px; height: 8px; background: #00a854; border: 1px solid #004d25; }

.workspace {
  padding: 0 7px 7px;
  display: grid;
  grid-template-columns: 338px minmax(0, 1fr);
  gap: 8px;
}
.left-column, .right-column { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.panel {
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
}
.panel-title { min-height: 26px; margin: 2px; padding: 5px 7px; }
.title-with-count { display: flex; justify-content: space-between; gap: 10px; }
.title-with-count span:last-child { font-weight: 400; color: #ddd; }
.holding-meta { display: flex; gap: 10px; }

.calendar-panel { min-height: 296px; }
.calendar-nav { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 8px; padding: 10px 12px 8px; text-align: center; }
.calendar-nav strong { font-size: 14px; }
.win-button {
  min-height: 26px;
  padding: 4px 13px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
  box-shadow: 1px 1px 0 var(--win-dark);
  cursor: pointer;
}
.win-button:hover { background: #d2d2d2; }
.win-button:active { padding-top: 5px; padding-left: 14px; border-color: var(--win-black) var(--win-light) var(--win-light) var(--win-black); box-shadow: none; }
.win-button:focus-visible, .calendar-day:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.win-button.square { width: 28px; min-height: 25px; padding: 0; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); margin: 0 10px; }
.weekdays { color: #333; border-bottom: 1px solid var(--win-dark); text-align: center; font-size: 11px; }
.weekdays span { padding: 4px 0; }
.weekdays span:first-child { color: #b20000; }
.weekdays span:last-child { color: #0000a0; }
.days { padding-top: 3px; }
.calendar-day {
  position: relative;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.calendar-day:hover { border-color: var(--win-dark); background: #d7d7d7; }
.calendar-day.other-month { color: #8a8a8a; }
.calendar-day.today { font-weight: 700; text-decoration: underline; }
.calendar-day.selected { color: white; background: var(--win-blue); border: 1px dotted white; }
.calendar-day.has-trade::after { content: ""; position: absolute; width: 5px; height: 5px; left: calc(50% - 2px); bottom: 1px; background: #00a854; border: 1px solid #004d25; }
.calendar-day.selected.has-trade::after { background: #61ff9f; }
.calendar-hint { display: flex; justify-content: space-between; align-items: center; margin: 6px 12px 10px; color: #505050; font-size: 11px; }
.today-button { min-height: 21px; padding: 1px 8px; font-size: 10px; }
.legend-dot { width: 7px; height: 7px; margin-right: 4px; }

.entry-panel { flex: 0 0 auto; }
#tradeForm { padding: 10px; }
.form-row { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 7px; margin-bottom: 8px; }
.form-row label, .input-pair label { font-size: 12px; }
.win-input {
  min-width: 0;
  height: 28px;
  padding: 4px 6px;
  color: #111;
  background: #fff;
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
  border-right-color: #e9e9e9;
  border-bottom-color: #e9e9e9;
  outline: none;
}
.win-input:focus { outline: 1px dotted #000; outline-offset: -4px; }
.ticker-input { text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.trade-group { margin: 12px 0 0; padding: 10px; border: 2px groove #eee; }
.trade-group legend { padding: 0 5px; font-weight: 700; }
.buy-group legend { color: #b00000; }
.sell-group legend { color: #004db8; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.primary-action { width: 100%; margin-top: 9px; font-weight: 700; }
.form-message { min-height: 17px; margin: 8px 2px 0; font-size: 11px; color: var(--buy-green); }
.form-message.error { color: #b00000; }

.holdings-panel { height: 465px; min-height: 0; display: flex; flex-direction: column; }
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
}
.summary-strip > div {
  min-width: 0;
  padding: 8px 10px;
  background: #d5d5d5;
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}
.summary-strip span { display: block; margin-bottom: 5px; color: #4a4a4a; font-size: 11px; }
.summary-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
.summary-strip small { display: block; margin-top: 4px; overflow: hidden; color: #555; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.refresh-rate { float: right; padding: 0 3px; border: 1px solid #777; background: var(--win-gray); font-size: 9px; cursor: pointer; }
.refresh-rate:active { border-color: #222 #fff #fff #222; }
.refresh-rate:disabled { color: #777; cursor: wait; }
.table-shell {
  position: relative;
  min-height: 285px;
  max-height: 330px;
  overflow-y: auto;
  margin: 0 8px 8px;
  overflow: auto;
  background: white;
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 7px;
  background: var(--win-gray);
  border: 1px solid;
  border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
  text-align: left;
  white-space: nowrap;
}
th:nth-child(n+2):nth-child(-n+7), td:nth-child(n+2):nth-child(-n+7) { text-align: right; }
th:last-child { width: 34px; }
td { padding: 8px 9px; border-bottom: 1px dotted #aaa; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #e8e8ff; }
.holding-row { cursor: pointer; }
.holding-row:focus-visible { outline: 1px dotted #000; outline-offset: -2px; }
.ticker-cell { white-space: nowrap; }
.ticker-symbol { font-weight: 700; color: var(--win-blue); }
.return-rate { margin-left: 6px; font-size: 11px; font-weight: 700; }
.profit { color: #d00000; }
.loss { color: #004db8; }
.flat { color: #555; }
.delete-row { width: 22px; height: 21px; padding: 0; border: 1px solid #777; background: #ddd; cursor: pointer; }
.bulk-delete { width: 22px; height: 21px; padding: 0; color: #b00000; border: 1px solid #777; background: #ddd; font-size: 16px; line-height: 17px; font-weight: 700; cursor: pointer; }
.bulk-delete:hover { background: #f0cccc; }
.empty-state { min-height: 245px; display: grid; place-content: center; gap: 6px; text-align: center; color: #565656; }
.empty-state.hidden { display: none; }
.empty-icon { color: var(--win-blue); font-size: 35px; }
.empty-state span { font-size: 11px; }

.history-dashboard { display: grid; grid-template-columns: 1.15fr 1.05fr .8fr; gap: 8px; }
.history-panel, .realized-panel, .cumulative-panel { min-width: 0; height: 285px; min-height: 285px; }
.history-panel, .realized-panel { display: flex; flex-direction: column; }
.history-list, .realized-list { min-height: 170px; max-height: 240px; margin: 7px; overflow-y: auto; background: white; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.history-list { flex: 1; }
.history-item { display: grid; grid-template-columns: 48px 58px 1fr; gap: 6px; align-items: center; padding: 7px 8px; border-bottom: 1px dotted #aaa; }
.history-type { width: 42px; padding: 2px; color: white; text-align: center; font-size: 11px; font-weight: 700; }
.history-type.buy { background: var(--sell-red); }
.history-type.sell { background: #004db8; }
.history-detail { grid-column: 2 / -1; color: #444; font-variant-numeric: tabular-nums; }
.history-total { grid-column: 2 / -1; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-pnl { grid-column: 2 / -1; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-basis { grid-column: 2 / -1; color: #666; font-size: 10px; font-variant-numeric: tabular-nums; }
.no-history { padding: 30px 10px; text-align: center; color: #666; }
.compact-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 7px 7px 0; }
.compact-summary > div { padding: 5px 7px; background: #d5d5d5; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.compact-summary span { display: block; color: #555; font-size: 10px; }
.compact-summary strong { display: block; margin-top: 3px; font-size: 13px; }
.realized-list { min-height: 122px; max-height: 150px; }
.panel-delete { margin: auto 7px 7px; color: #710000; font-size: 11px; font-weight: 700; }
.panel-delete:disabled { color: #777; cursor: default; }
.realized-item { display: grid; grid-template-columns: 54px 44px 1fr; gap: 5px; align-items: center; padding: 7px 8px; border-bottom: 1px dotted #aaa; }
.realized-badge { padding: 2px 3px; color: white; text-align: center; font-size: 10px; font-weight: 700; }
.realized-badge.profit { background: #b90000; }
.realized-badge.loss { background: #004db8; }
.realized-badge.flat { background: #666; }
.realized-money { text-align: right; font-variant-numeric: tabular-nums; }
.realized-money strong, .realized-money small { display: block; }
.realized-money small { margin-top: 2px; font-size: 10px; }
.realized-formula { grid-column: 1 / -1; color: #666; text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
.cumulative-body { display: grid; gap: 8px; padding: 10px; }
.range-picker { display: grid; grid-template-columns: 32px 1fr; gap: 4px 5px; align-items: center; padding: 7px 7px 0; }
.range-picker label { color: #555; font-size: 10px; }
.range-date { width: 100%; height: 24px; padding: 2px 4px; font-size: 10px; cursor: pointer; }
.range-picker strong { grid-column: 1 / -1; padding: 4px 5px; color: var(--win-blue); background: #fff; border: 1px solid var(--win-dark); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.cumulative-card { min-height: 76px; padding: 10px; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.cumulative-card span, .cumulative-card strong, .cumulative-card small { display: block; }
.cumulative-card span { color: #555; font-size: 11px; }
.cumulative-card strong { margin-top: 6px; font-size: 17px; }
.cumulative-card small { margin-top: 3px; font-size: 11px; font-weight: 700; }

.status-bar { display: grid; grid-template-columns: 1fr 220px 16px; gap: 3px; padding: 0 5px 5px; }
.status-cell { min-height: 22px; padding: 4px 7px; border: 1px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.status-grip { align-self: end; color: #777; }

.win-dialog { width: min(380px, calc(100% - 32px)); padding: 3px; background: var(--win-gray); border: 2px solid; border-color: white #111 #111 white; box-shadow: 4px 5px 0 rgba(0,0,0,.4); }
.win-dialog::backdrop { background: rgba(0,0,0,.35); }
.dialog-title { padding: 5px 7px; }
.dialog-body { display: flex; gap: 14px; align-items: center; padding: 20px 18px 12px; }
.warning-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: white; background: var(--win-blue); border-radius: 50%; font-size: 24px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: center; gap: 8px; padding: 8px 0 13px; }
.dialog-actions .win-button { min-width: 84px; }
.holding-dialog { width: min(760px, calc(100% - 32px)); }
.holding-dialog-body { margin: 8px; padding: 8px; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.holding-trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.holding-trade-panel { min-width: 0; background: #f4f4f4; border: 1px solid #999; }
.holding-trade-panel h2 { display: flex; justify-content: space-between; margin: 0; padding: 5px 6px; color: #fff; background: #101060; font-size: 12px; }
.holding-trade-panel h2 span { font-size: 10px; font-weight: 400; }
.holding-detail-list { display: grid; gap: 0; }
.holding-detail-row { display: grid; grid-template-columns: 1fr 70px 85px; gap: 8px; padding: 7px 4px; background: #fff; border-bottom: 1px dotted #aaa; font-size: 12px; font-variant-numeric: tabular-nums; }
.holding-detail-row:last-child { border-bottom: 0; }
.holding-detail-row span { text-align: right; }
.holding-date-link { padding: 0; border: 0; background: transparent; color: var(--win-blue); text-align: left; font-size: 12px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.holding-date-link:hover { color: #b00000; }
.holding-trade-panel .no-history { min-height: 250px; margin: 0; padding-top: 112px; color: #666; background: #fff; text-align: center; font-size: 12px; }
.holding-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 5px; border-top: 1px solid #999; font-size: 11px; }
.holding-pagination .win-button { min-width: 28px; padding: 2px 4px; }
.trade-history-dialog { width: min(620px, calc(100% - 28px)); }
.trade-history-body { max-height: min(62vh, 520px); margin: 8px; padding: 10px; overflow-y: auto; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.trade-history-note { margin: 0 0 8px; color: #555; font-size: 12px; }
.trade-history-tickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.trade-history-ticker { padding: 7px 8px; color: var(--win-blue); font-weight: 700; }
.trade-history-back { margin: 0 0 8px; padding: 3px 6px; }
.trade-history-realized { display: grid; grid-template-columns: 80px 48px 1fr; gap: 7px; align-items: start; padding: 7px 4px; border-bottom: 1px dotted #aaa; font-size: 12px; font-variant-numeric: tabular-nums; }
.trade-history-realized:last-child { border-bottom: 0; }
.trade-history-date { color: var(--win-blue); font-weight: 700; }
.trade-history-money { text-align: right; font-weight: 700; }
.trade-history-money small, .trade-history-realized > small { display: block; }
.trade-history-money small { margin-top: 2px; font-size: 10px; }
.trade-history-realized > small { grid-column: 1 / -1; color: #666; text-align: right; font-size: 10px; }
.help-dialog { width: min(640px, calc(100% - 28px)); }
.help-content { max-height: min(66vh, 560px); margin: 8px; padding: 4px 14px 10px; overflow-y: auto; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); line-height: 1.55; }
.help-content section { padding: 10px 0; border-bottom: 1px dotted #888; }
.help-content section:last-child { border-bottom: 0; }
.help-content h2 { margin: 0 0 5px; color: var(--win-blue); font-size: 14px; }
.help-content p { margin: 0; }
.help-content ol { margin: 5px 0 0; padding-left: 22px; }
.help-content li { margin: 3px 0; }
.help-note { color: #333; }
.help-content a { display: inline-block; margin-top: 6px; color: var(--win-blue); }
.help-watermark { padding: 10px 0 2px; color: #777; font-size: 11px; text-align: right; }
.backup-dialog { width: min(470px, calc(100% - 28px)); }
.backup-body { margin: 8px; padding: 8px; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); }
.backup-description { margin: 0 0 8px; font-size: 12px; }
.backup-slots { display: grid; gap: 6px; }
.backup-slot { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 6px; background: #e8e8e8; border: 1px solid #999; }
.backup-slot-label { font-size: 12px; font-weight: 700; }
.backup-slot-date { display: block; margin-top: 2px; color: #555; font-size: 11px; font-weight: 400; }
.backup-slot button { min-width: 52px; padding: 3px 5px; }
.update-dialog { width: min(540px, calc(100% - 28px)); }
.update-body { margin: 8px; padding: 12px 14px; background: #fff; border: 2px solid; border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark); line-height: 1.55; }
.update-date { margin: 0 0 8px; color: var(--win-blue); font-weight: 700; }
.update-body ul { margin: 0; padding-left: 21px; }
.update-body li { margin: 7px 0; }

@media (max-width: 820px) {
  .desktop { padding: 8px; place-items: start center; }
  .app-window { min-height: 0; }
  .workspace { grid-template-columns: 1fr; }
  .left-column { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .calendar-panel, .entry-panel { min-width: 0; }
  .toolbar-date { display: none; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  /* Mobile only: keep a long holdings list inside its own scroll area. */
  .holdings-panel { height: 465px; min-height: 0; overflow: hidden; }
  .holdings-panel .table-shell { flex: 1 1 auto; min-height: 0; max-height: none; }
  .history-dashboard { grid-template-columns: 1fr 1fr; }
  .cumulative-panel { grid-column: 1 / -1; }
  .cumulative-body { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 570px) {
  .desktop { padding: 0; }
  .app-window { border-width: 1px; box-shadow: none; }
  .left-column { display: flex; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip > div { display: flex; align-items: center; justify-content: space-between; }
  .summary-strip span { margin: 0; }
  .table-shell { overflow-x: auto; }
  table { min-width: 850px; }
  .history-dashboard { grid-template-columns: 1fr; }
  .cumulative-panel { grid-column: auto; }
  .cumulative-body { grid-template-columns: 1fr 1fr; }
  .status-bar { grid-template-columns: 1fr 16px; }
  .status-cell:nth-child(2) { display: none; }
  .holding-trade-grid { grid-template-columns: 1fr; }
  .trade-history-tickers { grid-template-columns: repeat(2, 1fr); }
  .trade-history-realized { grid-template-columns: 70px 45px 1fr; }
}
