:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --ink: #152033;
  --muted: #607086;
  --surface: #ffffff;
  --surface-soft: #fff8ed;
  --border: #d9e3f2;
  --accent: #1677ff;
  --accent-strong: #0d4c92;
  --teal: #00a99d;
  --gold: #f59e0b;
  --rose: #e11d48;
  --green: #0f9f6e;
  --pink: #ec4899;
  --violet: #7c3aed;
  --nav: #10213c;
  background: #f6fbff;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -6%, rgba(236, 72, 153, 0.24), transparent 30%),
    radial-gradient(circle at 92% 2%, rgba(245, 158, 11, 0.28), transparent 26%),
    radial-gradient(circle at 18% 42%, rgba(0, 169, 157, 0.16), transparent 25%),
    linear-gradient(180deg, #eff8ff 0, #fff7ec 330px, #f7fbff 100%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 32px auto;
}

.home-shell {
  display: grid;
  gap: 18px;
}

.home-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 150px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.14), rgba(0, 169, 157, 0.12) 46%, rgba(245, 158, 11, 0.14)),
    var(--surface);
  box-shadow: 0 18px 38px rgba(21, 32, 51, 0.14);
  padding: 24px;
}

.home-title {
  min-width: 0;
}

.app-eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 3px solid rgba(236, 72, 153, 0.18);
  padding-bottom: 14px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(90deg, #0b1730 0%, var(--nav) 48%, #173c5f 100%);
  box-shadow: 0 12px 28px rgba(7, 18, 38, 0.32);
}

.top-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: center;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.nav-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f4fbff;
  font-size: 16px;
  font-weight: 900;
  padding: 0 18px;
  text-decoration: none;
}

.nav-link:hover,
.back-link:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -3px 0 var(--gold);
  color: #ffffff;
  text-decoration: none;
}

.nav-link.current {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -3px 0 var(--teal);
  color: #ffffff;
}

.nav-spacer {
  flex: 1 1 auto;
}

.nav-user {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: #cbe7ff;
  font-size: 15px;
  font-weight: 800;
  padding: 0 12px;
}

.nav-logout {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  padding: 0 18px;
}

.nav-logout:hover {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: inset 0 -3px 0 var(--gold);
}

h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(236, 72, 153, 0.32), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(245, 158, 11, 0.34), transparent 28%),
    radial-gradient(circle at 76% 88%, rgba(0, 169, 157, 0.24), transparent 30%),
    linear-gradient(135deg, #eaf6ff 0%, #fff0f7 48%, #fff9df 100%);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.8fr) minmax(280px, 0.8fr);
  gap: 18px;
  width: min(1080px, 100%);
}

.auth-intro,
.auth-form {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 46px rgba(21, 32, 51, 0.17);
  padding: 24px;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 330px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(135deg, #0f69d9 0%, #00a99d 46%, #f59e0b 100%);
  color: #ffffff;
  overflow: hidden;
  position: relative;
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -92px;
  width: 240px;
  height: 240px;
  border: 30px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.auth-intro .app-eyebrow,
.auth-intro h1,
.auth-intro .splash-copy,
.splash-mark,
.splash-stats {
  position: relative;
  z-index: 1;
}

.auth-intro .app-eyebrow {
  color: #fff3c4;
}

.auth-intro h1 {
  font-size: 52px;
}

.splash-copy {
  max-width: 420px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.splash-mark {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  align-items: end;
  gap: 8px;
  min-height: 88px;
}

.splash-mark span {
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 22px rgba(16, 33, 60, 0.18);
}

.splash-mark span:nth-child(1) {
  height: 44px;
}

.splash-mark span:nth-child(2) {
  height: 72px;
  background: #fff3c4;
}

.splash-mark span:nth-child(3) {
  height: 58px;
  background: #fce7f3;
}

.splash-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.splash-stats span {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 11px;
}

.auth-form {
  display: grid;
  align-content: start;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88)),
    var(--surface);
}

.auth-secondary[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  color: var(--ink);
  padding: 8px 10px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.auth-link-button {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0b63ce;
  font-size: 14px;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.auth-link-button:hover {
  color: var(--pink);
  text-decoration: underline;
}

.status,
.empty,
.error {
  margin: 8px 0 0;
  color: var(--muted);
}

.error {
  min-height: 20px;
  color: var(--rose);
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(21, 32, 51, 0.08);
}

.portfolio-panel {
  box-shadow: 0 12px 28px rgba(21, 32, 51, 0.09);
}

.share-search-panel {
  display: grid;
  gap: 14px;
  border-color: rgba(0, 169, 157, 0.25);
  box-shadow: 0 12px 28px rgba(0, 169, 157, 0.09);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.search-form label {
  margin: 0;
}

.share-search-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: start;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border-color: var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f1fbff 100%);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.search-result:hover,
.search-result.selected {
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.14);
}

.search-result span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.search-result strong,
.search-result small {
  overflow-wrap: anywhere;
}

.search-result small {
  color: var(--muted);
  font-weight: 700;
}

.search-result-price {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.share-preview {
  min-width: 0;
  border: 1px solid rgba(22, 119, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 119, 255, 0.08), rgba(255, 255, 255, 0) 42%), #ffffff;
  padding: 12px;
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-header h3 {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.share-description {
  border-top: 1px solid var(--border);
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
  padding-top: 12px;
}

.home-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.summary-metric {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.11), rgba(255, 255, 255, 0) 62%),
    var(--surface);
  padding: 14px;
  box-shadow: 0 6px 18px rgba(29, 39, 51, 0.05);
}

.summary-metric:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(15, 159, 110, 0.12), rgba(255, 255, 255, 0) 62%),
    var(--surface);
}

.summary-metric:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 255, 255, 0) 62%),
    var(--surface);
}

.summary-metric:nth-child(4) {
  background:
    linear-gradient(135deg, rgba(236, 72, 153, 0.13), rgba(255, 255, 255, 0) 62%),
    var(--surface);
}

.summary-metric:nth-child(5) {
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.12), rgba(245, 158, 11, 0.12) 62%),
    var(--surface);
}

.summary-metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-metric strong {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.progress-panel {
  padding-bottom: 12px;
}

.progress-chart-shell {
  position: relative;
  min-height: 260px;
}

.progress-chart-shell canvas {
  display: block;
  width: 100%;
  min-height: 240px;
}

.progress-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 3px;
  min-width: 130px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(21, 32, 51, 0.18);
  color: var(--ink);
  pointer-events: none;
  padding: 8px 10px;
}

.progress-tooltip[hidden] {
  display: none;
}

.progress-tooltip strong,
.progress-tooltip span,
.progress-tooltip small {
  line-height: 1.25;
}

.progress-tooltip strong {
  font-size: 13px;
}

.progress-tooltip span {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 900;
}

.progress-tooltip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.progress-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-legend-swatch {
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.progress-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portfolio-row,
.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 10px;
  border-bottom: 1px solid #e8eef8;
}

.portfolio-row:last-child,
.share-row:last-child {
  border-bottom: 0;
}

.portfolio-link,
.share-title {
  font-weight: 700;
  color: #0b63ce;
  text-decoration: none;
}

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

.portfolio-summary-checkbox {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.portfolio-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.portfolio-total {
  margin: 0;
  font-weight: 700;
}

.portfolio-stat {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 1fr);
  align-items: baseline;
  gap: 12px;
  max-width: 520px;
}

.portfolio-stat span {
  color: var(--muted);
}

.portfolio-stat strong {
  justify-self: start;
  text-align: left;
  overflow-wrap: anywhere;
}

.share-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
}

.shares-accordion {
  border: 1px solid #d9e8ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8ed, #eefcff);
  margin-top: 4px;
  overflow: hidden;
}

.shares-accordion summary {
  cursor: pointer;
  color: #0b63ce;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 11px;
}

.shares-accordion summary::marker {
  color: var(--teal);
}

.accordion-share-list {
  display: grid;
  gap: 0;
  border-top: 1px solid #d9e8ff;
}

.accordion-share-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 9px 11px;
  border-top: 1px solid #e8eef8;
}

.accordion-share-list li:first-child {
  border-top: 0;
}

.accordion-share-list strong {
  color: var(--ink);
  white-space: nowrap;
}

.accordion-share-stats {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr);
  gap: 14px;
  text-align: right;
}

.accordion-share-gains.profit {
  color: var(--green);
}

.accordion-share-gains.loss {
  color: var(--rose);
}

.accordion-share-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.accordion-share-link:hover {
  text-decoration: underline;
}

.share-summary li,
.portfolio-link,
.share-title {
  overflow-wrap: anywhere;
}

.portfolio-link:hover,
.share-title:hover,
.text-link-button:hover {
  text-decoration: underline;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

button {
  min-height: 38px;
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.text-link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 0;
}

.primary-button {
  border-color: var(--accent);
  background: linear-gradient(135deg, #1677ff, #00a99d);
  color: #ffffff;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.22);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 6px;
  background: linear-gradient(135deg, #fff7ed, #fdf2f8);
  color: #be185d;
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
}

.secondary-button:hover {
  border-color: var(--pink);
}

.icon-button,
.icon-only-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-button {
  width: 40px;
  min-height: 38px;
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.icon-only-button {
  width: 44px;
}

.icon-button svg,
.icon-only-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cash-icon {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.danger-button {
  border-color: #d92d20;
  color: var(--rose);
}

dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(29, 39, 51, 0.35);
}

.dialog-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.label-line {
  display: inline;
}

input {
  width: 100%;
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  padding: 9px 10px;
}

select {
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2733;
  font: inherit;
  min-height: 38px;
  padding: 8px 34px 8px 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.share-list {
  display: grid;
  gap: 10px;
}

.list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.sort-control select {
  min-width: 190px;
  border-color: #c8d2dc;
  background-color: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(29, 39, 51, 0.08);
}

.sort-control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 106, 165, 0.16);
  outline: none;
}

.all-sold-section {
  border-top: 1px solid #e7ecf1;
  margin-top: 16px;
  padding-top: 16px;
}

.all-sold-section h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 18px;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #e7ecf1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  padding: 14px;
}

.admin-user-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-user-main h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-user-stats {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-delete-button {
  padding: 0 14px;
}

.share-detail {
  margin-bottom: 16px;
}

.useful-info {
  margin-bottom: 16px;
}

.useful-info h2 {
  margin-top: 0;
}

.share-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) repeat(8, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: start;
}

.summary-grid,
.transaction-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.transaction-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-header h2 {
  margin: 0;
}

.transaction-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.share-chart-panel {
  margin-top: 16px;
}

.range-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.range-tab {
  min-height: 34px;
  border-color: #c8d2dc;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
}

.range-tab.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #1378b8, var(--accent-strong));
  color: #ffffff;
}

.chart-shell {
  position: relative;
  min-height: 260px;
  margin-top: 14px;
}

.chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.chart-key-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-key-item.loss {
  color: var(--rose);
}

.chart-key-line {
  display: inline-block;
  width: 28px;
  border-top: 2px dotted #2563eb;
}

.chart-key-item.loss .average-key-line {
  border-top-color: #b42318;
}

.moving-average-30-key-line {
  border-top: 2px solid #7c3aed;
}

.moving-average-60-key-line {
  border-top: 2px solid #0f766e;
}

.holdings-value-key-line {
  border-top: 2px solid #2563eb;
}

.holdings-spend-key-line {
  border-top: 2px solid #d97706;
}

.holdings-buy-key-line {
  border-top: 2px dotted #15803d;
}

.holdings-sell-key-line {
  border-top: 2px dotted #b42318;
}

.holdings-value-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 3px;
  min-width: 140px;
  border: 2px solid #15803d;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  box-shadow: 0 10px 24px rgba(21, 32, 51, 0.18);
  color: var(--ink);
  pointer-events: none;
  padding: 8px 10px;
}

.holdings-value-tooltip[hidden] {
  display: none;
}

.holdings-value-tooltip.sell {
  border-color: #b42318;
}

.holdings-value-tooltip.value {
  min-width: 250px;
  border-color: #2563eb;
}

.holdings-value-tooltip strong {
  font-size: 13px;
  line-height: 1.25;
}

.holdings-value-tooltip span {
  color: #15803d;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.holdings-value-tooltip.sell span {
  color: #b42318;
}

.holdings-value-tooltip.value .holdings-tooltip-row b.profit {
  color: #15803d;
}

.holdings-value-tooltip.value .holdings-tooltip-row b.loss {
  color: #b42318;
}

.holdings-value-tooltip.value > span {
  color: var(--ink);
}

.holdings-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.holdings-tooltip-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holdings-tooltip-row b {
  text-align: right;
}

.market-performance-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-width: 190px;
  border: 2px solid #15803d;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(21, 32, 51, 0.18);
  color: var(--ink);
  pointer-events: none;
  padding: 8px 10px;
}

.market-performance-tooltip[hidden] {
  display: none;
}

.market-performance-tooltip strong {
  font-size: 13px;
}

.chart-shell canvas {
  display: block;
  max-width: 100%;
}

.chart-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

.rns-list {
  display: grid;
  gap: 12px;
}

.transaction-row,
.rns-row {
  align-items: start;
  border-top: 1px solid #e7ecf1;
  padding-top: 12px;
}

.rns-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.rns-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.rns-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.metric {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.metric span:first-child {
  color: var(--muted);
  font-size: 13px;
}

.metric span,
.metric strong {
  overflow-wrap: anywhere;
}

.profit {
  color: var(--green);
}

.loss {
  color: var(--rose);
}

@media (max-width: 640px) {
  .home-header {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
    padding: 18px;
  }

  .home-header .header-actions {
    justify-content: stretch;
  }

  .home-header .header-actions > * {
    justify-content: center;
    width: 100%;
  }

  h1 {
    font-size: 34px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button:not(.icon-only-button) {
    width: 100%;
  }

  .portfolio-row,
  .share-row {
    grid-template-columns: 1fr;
  }

  .portfolio-stat {
    grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1fr);
    max-width: none;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .share-summary {
    display: grid;
  }

  .accordion-share-list li {
    grid-template-columns: 1fr;
  }

  .accordion-share-stats {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 220px;
  }

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

  .share-search-layout,
  .search-form {
    grid-template-columns: 1fr;
  }

  .preview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .share-grid {
    grid-template-columns: 1fr;
  }

  .transaction-actions {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .range-tabs {
    justify-content: flex-start;
  }

  .share-row {
    border: 1px solid #e7ecf1;
    border-radius: 8px;
  }

  .share-row:last-child {
    border-bottom: 1px solid #e7ecf1;
  }

  .metric {
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
  }

  .metric strong {
    text-align: right;
  }
}

@media (max-width: 420px) {
  .shell {
    width: min(100% - 20px, 1080px);
    margin: 20px auto;
  }

  .home-summary {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 8px;
  }

  .metric {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .metric strong {
    text-align: left;
  }
}
