/* Compact Lottery Website Styles — themed with Lottery Tycoon greens/gold */
body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  padding: 0.5rem;
  max-width: 1600px;
  margin: 4px auto;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* Tab Header */
.tab-header {
  display: flex;
  border-bottom: 1px solid #ccc;
  margin-bottom: 0.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  margin-right: 0.25rem;
  text-decoration: none;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: #333;
  font-weight: bold;
  font-size: 0.85rem;
  transition: background-color 0.2s;
}

.tab:hover {
  background-color: #e0e0e0;
}

.tab.active {
  background-color: #fff;
  border-bottom: 1px solid white;
}

/* Headings */
h1 {
  margin-top: 0;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Form Containers */
.form-container {
  background-color: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

/* Form Elements */
.form-row {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.form-row input,
.form-row select,
.form-row label {
  flex: 1;
  padding: 6px;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-row label {
  border: none;
  padding: 2px 0;
  font-weight: bold;
  color: #333;
  font-size: 0.8rem;
}

.form-row select {
  width: auto;
  white-space: nowrap;
}

.form-row.single {
  display: block;
}

.form-row.single input {
  width: 100%;
}

/* Buttons */
.form-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.form-buttons button {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #2f9e44;
  color: #fff;
}

.form-buttons button:hover {
  background-color: #3db54f;
}

button {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #2f9e44;
  color: #fff;
}

button:hover {
  background-color: #3db54f;
}

/* Categories and Items */
.category {
  margin-top: 1rem;
}

.category h2 {
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
}

.location {
  font-weight: bold;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.item {
  margin-left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.item .editable {
  cursor: pointer;
}

.item a {
  text-decoration: none;
}

.delete-btn {
  color: red;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Totals */
.total {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: bold;
}

.inline {
  display: inline-block;
  margin-right: 0.75rem;
}

/* Modals — shared green dim (matches page popups) */
.modal,
.giveaway-modal,
.portfolio-modal,
.account-start-modal {
  background: rgba(26, 46, 31, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  /* Above portfolio modal (10020) and other base overlays */
  z-index: 10100;
}

.modal.visible {
  display: flex;
}

.modal-content {
  background-color: white;
  padding: 1rem;
  border-radius: 6px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.modal .form-row {
  margin-bottom: 0.75rem;
}

.modal .form-buttons {
  justify-content: flex-end;
}

/* Remaining Cash Box */
.remaining-cash-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
}

/* Sections */
.section {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: #f9f9f9;
}

.section h2 {
  margin-top: 0;
  font-size: 1rem;
}

/* Business List */
.business-list {
  margin-top: 12px;
}

.business-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.business-entry input,
.business-entry select {
  margin-right: 4px;
  font-size: 0.8rem;
}

.edit-btn,
.delete-btn {
  margin-left: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.edit-btn {
  color: #0074d9;
}

.delete-btn {
  color: #b00;
}

/* Tables */
.income-table,
.purchases-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: fixed;
  font-size: 0.75rem;
}

.income-table th,
.income-table td,
.purchases-table th,
.purchases-table td {
  border: 1px solid #ccc;
  padding: 2px 3px;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}

.income-table th,
.purchases-table th {
  background: #f2f2f2;
  font-size: 0.75rem;
}

.total-row {
  font-weight: bold;
  background: #e9e9e9;
}

.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.income-table input[type='text'] {
  box-sizing: border-box;
  font-size: 0.75rem;
  margin: 0;
  padding: 0 1px;
  border: 1px solid #bbb;
  width: 100%;
  max-width: 90px;
  min-width: 50px;
}

/* Financial Summary */
.financial-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.financial-summary-left,
.financial-summary-right {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.75rem;
  min-width: 0; /* Allow content to shrink */
}

.financial-summary-left {
  flex-shrink: 0; /* Prevent left column from shrinking */
}

.financial-summary-right {
  flex-shrink: 0; /* Prevent right column from shrinking */
}

.summary-breakdown {
  font-size: 0.8rem;
  color: #333;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #dcecc8;
  font-size: 0.8rem;
}

/* Expandable Totals accordion on Summary right rail */
.totals-expand-row {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}
.totals-expand-row:hover {
  background: rgba(47, 158, 68, 0.08);
  border-radius: 4px;
}
.totals-caret {
  display: inline-block;
  width: 1em;
  color: #2f9e44;
  font-weight: 700;
}
.summary-totals-detail {
  margin: 0 0 4px 10px;
  padding: 2px 0 4px 8px;
  border-left: 2px solid #b8d49a;
}
.summary-detail-line {
  cursor: pointer;
  padding-left: 2px;
}
.summary-detail-line:hover {
  background: rgba(47, 158, 68, 0.1);
  border-radius: 4px;
  color: #1f7a32;
}
.summary-detail-line span:first-child {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(31, 122, 50, 0.35);
}
.summary-detail-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.summary-detail-card th,
.summary-detail-card td {
  padding: 4px 6px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}
.summary-detail-card th {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f7464;
  background: #f3faf1;
  position: sticky;
  top: 0;
}
.summary-detail-card td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary-detail-col-head,
.summary-detail-cols {
  display: grid !important;
  grid-template-columns: minmax(120px, 1.4fr) minmax(100px, 0.9fr) minmax(100px, 0.9fr);
  gap: 8px;
  align-items: center;
}
.summary-detail-col-head {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f7464;
  border-bottom: 1px solid #c5d9b0;
}
.summary-detail-col-head span:not(:first-child),
.summary-detail-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Insurance breakdown: Name | Price | Rate % | Annual $ */
.summary-detail-ins-head,
.summary-detail-ins-cols {
  display: grid !important;
  grid-template-columns: minmax(140px, 1.6fr) minmax(90px, 0.8fr) minmax(110px, 1fr) minmax(90px, 0.85fr);
  gap: 8px 10px;
  align-items: center;
}
.summary-detail-ins-head {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f7464;
  border-bottom: 1px solid #c5d9b0;
  padding-bottom: 4px;
  margin-bottom: 2px;
}
.summary-detail-ins-cols {
  padding: 5px 0;
  border-bottom: 1px solid #eef2e8;
  font-size: 0.88em;
}
.summary-detail-ins-cols.total {
  border-bottom: none;
  border-top: 1px solid #c5d9b0;
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 700;
}
.summary-detail-ins-head span:not(:first-child),
.summary-detail-ins-cols span:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.summary-detail-ins-cols .ins-name {
  font-weight: 600;
  color: #1a3322;
  line-height: 1.3;
  white-space: normal;
}

/* Input Fields */
input[type="text"],
input[type="number"],
input[type="url"],
select {
  padding: 6px;
  font-size: 0.85rem;
  border: 1px solid #c5d9b0;
  border-radius: 6px;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus {
  outline: none;
  border-color: #2f9e44;
  box-shadow: 0 0 0 2px rgba(47, 158, 68, 0.22);
}

/* Legacy blue accents → green (do not use sky/navy blues in UI) */
a { color: #3db54f; }
a:hover { color: #2f9e44; }

/* Mortgage Calculator */
.mortgage-input {
  padding: 4px 6px;
  font-size: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 80px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.location-card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0.8rem;
  align-items: stretch;
  justify-content: flex-start;
}

/* Monopoly-style: almost square, only slightly taller than wide + paper texture */
.location-card,
.portfolio-card {
  border: 3px solid #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer; /* whole deed card opens portfolio popup */
  /* Deed paper: warm cream + fine grain + faint fibers */
  background-color: #fffcf5;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255,255,255,0.55), transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(120, 90, 40, 0.015) 2px,
      rgba(120, 90, 40, 0.015) 3px
    ),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.15 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 3px 4px 0 rgba(0,0,0,0.14), 0 2px 8px rgba(26, 46, 31, 0.08);
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  min-height: 248px; /* ~1.13× width — near-square, slightly elongated */
  aspect-ratio: 1 / 1.12;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.loc-name {
  /* Tight padding — header band should stay compact like a Monopoly deed title */
  padding: 4px 4px 3px;
  color: white;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  /* deed rail */
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.55),
    inset 0 0 0 5px rgba(0,0,0,0.18);
  border-bottom: 2px solid #1a1a1a;
  overflow: hidden;
}

/* Subtle gloss + grain overlay on the colored deed band */
.loc-name::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22) 0%, transparent 42%, rgba(0,0,0,0.12) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

.loc-name::after {
  content: none;
  display: none;
}

.loc-name > * {
  position: relative;
  z-index: 1;
}

/*
 * Portfolio titles — SVG wordmark (buildPortfolioTitleEl):
 * full width, up to 2 wrapped lines, thick gold/black logo outline.
 */
.loc-name .portfolio-card-title,
.loc-name .portfolio-title-svg-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  line-height: 0;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

/* Any plain text sitting on a colored deed/header band (cards only) */
.loc-name:not(.portfolio-modal-header) {
  text-shadow:
    -1px -1px 0 rgba(10,10,10,0.55),
     1px 1px 0 rgba(10,10,10,0.55);
}

.loc-name .portfolio-title-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  margin: 0 auto;
}

/* ── Portfolio manage modal (game inventory layout) ── */
.portfolio-modal-content {
  background:
    linear-gradient(180deg, rgba(255, 254, 248, 0.97) 0%, rgba(247, 251, 244, 0.98) 100%),
    #fffef8;
  width: min(1080px, 97%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 6px;
  border: 3px solid #1a1a1a;
  box-shadow:
    3px 4px 0 rgba(0, 0, 0, 0.12),
    0 12px 36px rgba(26, 46, 31, 0.28);
  font-family: var(--font-body, "Nunito", system-ui, sans-serif);
  animation: portfolio-modal-in 0.22s ease-out;
}
@keyframes portfolio-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* Manage modal deed header: title left, metric chips right */
.portfolio-modal-header {
  text-align: left;
  padding: 10px 14px 9px;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 0;
  border-bottom: 2px solid #1a1a1a;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    inset 0 0 0 5px rgba(0, 0, 0, 0.18);
}
.portfolio-modal-header .portfolio-title-svg-wrap {
  width: auto;
  max-width: min(640px, 58%);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.portfolio-modal-header .portfolio-title-svg {
  max-height: 72px;
  width: auto;
  height: auto;
  display: block;
  margin: 0;
}

/* High-contrast metric chips — manage modal only (readable on any deed bar color) */
.portfolio-header-metrics {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  text-align: right;
  min-width: 0;
  max-width: 48%;
  padding: 0;
}
.portfolio-metric-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  max-width: 100%;
  padding: 3px 8px 4px;
  border-radius: 999px;
  border: 1.5px solid rgba(26, 26, 26, 0.88);
  background: #fffef8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: #141414;
  white-space: nowrap;
  -webkit-text-stroke: 0;
  text-shadow: none;
  paint-order: normal;
}
.portfolio-metric-chip.portfolio-metric-price {
  background: #fffef8;
  color: #141414;
  font-size: 0.86em;
  padding: 4px 9px 4px;
}
.portfolio-metric-chip.portfolio-metric-cf {
  background: #f3f6f1;
  color: #1f2937;
  gap: 0.35em;
}
.portfolio-metric-chip.portfolio-metric-cf.is-neg {
  background: #faf1f1;
}
.portfolio-metric-cf-label {
  font-weight: 600;
  color: #334155;
  font-size: 0.92em;
}
.portfolio-metric-cf-val {
  font-weight: 800;
  color: #15803d;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.portfolio-metric-chip.portfolio-metric-cf.is-neg .portfolio-metric-cf-val {
  color: #b91c1c;
}

/* Summary card header price — gold + dark rim on the colored deed bar */
.loc-name .portfolio-card-price {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-weight: 700;
  font-size: 1.02em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #f5e6b8;
  opacity: 1;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  border-top: none;
  box-shadow: none;
  -webkit-text-stroke: 0.55px #0a0a0a;
  paint-order: stroke fill;
  text-shadow:
    -1.2px -1.2px 0 #0a0a0a,
     1.2px -1.2px 0 #0a0a0a,
    -1.2px  1.2px 0 #0a0a0a,
     1.2px  1.2px 0 #0a0a0a,
    -1.5px 0 0 #0a0a0a,
     1.5px 0 0 #0a0a0a,
     0 -1.5px 0 #0a0a0a,
     0  1.5px 0 #0a0a0a,
     0  2px 2px rgba(0,0,0,0.35);
}

.portfolio-modal-body {
  padding: 10px 12px 12px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(232, 246, 233, 0.55), transparent 70%),
    #fffef8;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.portfolio-modal-stats {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 5px;
  margin-bottom: 8px;
}
.portfolio-stat-chip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 6px;
  background: linear-gradient(180deg, #f7fbf4 0%, #eef6e6 100%);
  border: 1.5px solid var(--lt-border, #c5d9b0);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 0.68em;
  overflow: hidden;
}
.portfolio-stat-label {
  font-family: var(--font-display, "Poppins", system-ui, sans-serif);
  font-weight: 700;
  color: var(--lt-ink, #243d2c);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portfolio-stat-label em {
  font-style: normal;
  font-weight: 600;
  color: var(--lt-muted, #5f7464);
}
.portfolio-stat-price {
  color: var(--lt-ink-soft, #3a5544);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portfolio-stat-cf {
  color: #1f7a32;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portfolio-stat-cf.is-neg {
  color: #b91c1c;
}
.portfolio-stat-chip.is-zero {
  opacity: 0.55;
}
.portfolio-modal-empty-hint {
  color: var(--lt-muted, #5f7464);
  font-size: 0.85em;
  line-height: 1.35;
  padding: 2px 2px;
  margin: 0 0 8px;
}

.portfolio-modal-toolbar {
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}
.portfolio-modal-toolbar .portfolio-delete-btn {
  margin-left: auto;
}
.portfolio-add-new-btn {
  font-size: 0.8em !important;
  font-weight: 700 !important;
  background: linear-gradient(180deg, #4ec75f 0%, #2f9e44 100%) !important;
  color: #fff !important;
  border: 1.5px solid #1a3322 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 1px 2px 0 rgba(0, 0, 0, 0.12);
}
.portfolio-add-new-btn:hover {
  filter: brightness(1.05);
}
.portfolio-catalog-assign-select {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 340px;
  font-size: 0.8em;
  font-family: var(--font-body, "Nunito", system-ui, sans-serif);
  padding: 5px 8px;
  border: 1.5px solid var(--lt-border, #c5d9b0);
  border-radius: 6px;
  background: #fffef8;
  color: var(--lt-ink, #243d2c);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.portfolio-catalog-assign-select:hover,
.portfolio-catalog-assign-select:focus {
  border-color: var(--lt-green, #3db54f);
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 181, 79, 0.18);
}

.portfolio-modal-inventory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
}
.portfolio-modal-inventory > .portfolio-type-section:only-child {
  grid-column: 1 / -1;
}

.portfolio-type-section {
  background: linear-gradient(180deg, #fffcf5 0%, #f3faf1 100%);
  border: 2px solid #1a3322;
  border-radius: 7px;
  padding: 5px 6px 6px;
  box-shadow: 2px 2px 0 rgba(26, 46, 31, 0.08);
  min-width: 0;
}
.portfolio-type-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--lt-border, #c5d9b0);
}
.portfolio-type-title {
  font-family: var(--font-display, "Poppins", system-ui, sans-serif);
  font-weight: 800;
  font-size: 0.84em;
  color: #1a3322;
  letter-spacing: 0.02em;
}
.portfolio-type-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  padding: 0 5px;
  height: 1.25em;
  border-radius: 999px;
  background: var(--lt-green-soft, #e8f6e9);
  border: 1px solid var(--lt-border, #c5d9b0);
  font-size: 0.7em;
  font-weight: 800;
  color: #1f7a32;
  font-variant-numeric: tabular-nums;
}
.portfolio-type-subtotal {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.74em;
  color: var(--lt-ink-soft, #3a5544);
  font-variant-numeric: tabular-nums;
}

.portfolio-type-units {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding-right: 1px;
}
.portfolio-modal-inventory > .portfolio-type-section:only-child .portfolio-type-units {
  max-height: min(52vh, 460px);
}

/* Game inventory tiles — photo featured on top when present */
.portfolio-unit-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  background: #fffef8;
  border: 1.5px solid var(--lt-border, #c5d9b0);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.portfolio-unit-row:hover {
  border-color: var(--lt-green, #3db54f);
  box-shadow: 0 1px 6px rgba(31, 61, 40, 0.1);
  transform: translateY(-1px);
}
.portfolio-unit-row.has-photo {
  padding: 4px;
}
.portfolio-unit-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid #1a3322;
  background: #f3faf1;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}
.portfolio-unit-thumb.is-loading {
  opacity: 0.35;
}
.portfolio-unit-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 1px 1px;
}
.portfolio-unit-top {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.portfolio-unit-name {
  font-family: var(--font-display, "Poppins", system-ui, sans-serif);
  font-weight: 700;
  font-size: 0.74em;
  color: #1a3322;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.portfolio-unit-link {
  flex-shrink: 0;
}
.portfolio-unit-meta {
  font-size: 0.66em;
  color: var(--lt-muted, #5f7464);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portfolio-unit-cf {
  font-size: 0.66em;
  font-weight: 700;
  color: #1f7a32;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portfolio-unit-cf.is-neg {
  color: #b91c1c;
}

.portfolio-delete-btn {
  background: #c0392b !important;
  color: #fff !important;
  border: 1.5px solid #8e2a20 !important;
  font-size: 0.8em !important;
  font-weight: 700 !important;
}

@media (max-width: 900px) {
  .portfolio-modal-inventory {
    grid-template-columns: 1fr;
  }
  .portfolio-type-units {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portfolio-type-units {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portfolio-catalog-assign-select {
    max-width: none;
    flex-basis: 100%;
  }
}

@media (max-width: 560px) {
  .portfolio-modal-content {
    width: 100%;
    max-height: 94vh;
  }
  .portfolio-modal-header {
    padding: 9px 12px 8px;
    gap: 8px;
  }
  .portfolio-modal-header .portfolio-title-svg-wrap {
    max-width: 50%;
  }
  .portfolio-modal-header .portfolio-title-svg {
    max-height: 58px;
  }
  .portfolio-header-metrics {
    max-width: 52%;
    gap: 4px;
  }
  .portfolio-metric-chip {
    font-size: 0.72em;
    padding: 3px 7px;
    white-space: normal;
  }
  .portfolio-metric-chip.portfolio-metric-price {
    font-size: 0.8em;
  }
  .portfolio-modal-stats {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .portfolio-stat-chip {
    flex: 1 0 80px;
    min-width: 80px;
  }
  .portfolio-type-units {
    grid-template-columns: 1fr 1fr;
    max-height: min(48vh, 320px);
  }
  .portfolio-unit-name {
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .portfolio-type-units {
    grid-template-columns: 1fr;
  }
}

/* Legacy class kept so old markup does not break */
.loc-checkbox {
  position: absolute;
  right: 8px;
  top: 8px;
  transform: none;
  width: 16px;
  height: 16px;
  z-index: 3;
}

/* Portfolio Buy / Purchased toggle (replaces header checkbox) */
.portfolio-buy-btn {
  display: block;
  width: 100%;
  margin: 0;
  border: 2px solid #1a1a1a;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  padding: 4px 8px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  opacity: 1;
  filter: none;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  box-sizing: border-box;
}
.portfolio-buy-btn:hover {
  filter: brightness(1.04);
}
.portfolio-buy-btn:focus-visible {
  outline: 2px solid #1f7a32;
  outline-offset: -2px;
}
/* Buy + Purchased share the same green bar (label differs in JS) */
.portfolio-buy-btn.is-buy,
.portfolio-buy-btn.is-purchased {
  background: linear-gradient(180deg, #4ec75f 0%, #2f9e44 55%, #1f7a32 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.12);
}
.portfolio-buy-btn.is-buy:hover,
.portfolio-buy-btn.is-purchased:hover {
  background: linear-gradient(180deg, #5ed46e 0%, #38a84a 55%, #22863a 100%);
}

/* Not purchased: dim header + body only — Buy bar stays full strength */
.portfolio-card.is-excluded {
  box-shadow: 3px 4px 0 rgba(0,0,0,0.1), 0 2px 8px rgba(26, 46, 31, 0.06);
}
.portfolio-card.is-excluded .loc-name,
.portfolio-card.is-excluded .loc-info {
  opacity: 0.48;
}
.portfolio-card.is-purchased {
  border-style: solid;
  box-shadow:
    3px 4px 0 rgba(0,0,0,0.14),
    0 2px 8px rgba(26, 46, 31, 0.08),
    0 0 0 2px rgba(47, 158, 68, 0.35);
}

.loc-info {
  padding: 8px 10px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  /* Match card paper grain so body isn’t flat white */
  background-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(255, 252, 245, 0.5), rgba(255, 250, 235, 0.15));
  position: relative;
}
.loc-info,
.loc-info * {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  letter-spacing: 0;
}

.summary-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.summary-top-actions .btn-small {
  background: linear-gradient(180deg, #f7fbf2, #e8f6e9);
  color: #1a2e1f;
  border: 1.5px solid #c5d9b0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(47,158,68,0.15);
}
.summary-top-actions .btn-small:hover {
  background: linear-gradient(180deg, #eef8e6, #d4f0d8);
  border-color: #2f9e44;
}


/* Login/Profile Specific */
.form-section {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  background-color: #f9f9f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: 400px;
  margin: auto;
  margin-bottom: 1rem;
}

.form-section label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: bold;
  font-size: 0.8rem;
}

.form-section input,
.form-section select {
  width: 100%;
  padding: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.button-group {
  margin-bottom: 0.75rem;
}

.export-btn {
  background-color: #2f9e44;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 0.5rem;
  font-size: 0.85rem;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.export-btn:hover {
  background-color: #3db54f;
}

.logout {
  background-color: #cc0000;
  margin-top: 0.75rem;
}

.logout:hover {
  background-color: #a30000;
}

#deleteList {
  background-color: #777;
}

#deleteList:hover {
  background-color: #555;
}

/* Investments Page Specific */
.container {
  display: flex;
  gap: 1rem;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.box-content {
  margin-top: 12px;
}

/* Location Sections */
.location-section {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  margin: 1rem 0;
  background-color: #f9f9f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.location-header {
  margin-bottom: 8px;
}

.location-header h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

.category-column {
  margin-left: 8px;
}

.category-column h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  border-top: 1px solid #ddd;
  padding-top: 0.75rem;
}

.category-column {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.4rem;
  background-color: #fafafa;
}

.category-column h3 {
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.2rem;
}

.giveaway-entry {
  margin: 4px 0;
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .financial-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .tab-header {
    flex-wrap: wrap;
  }
  
  .tab {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .container {
    flex-direction: column;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #mainContainer {
    flex-direction: column;
  }
  
  .left-column,
  .right-column {
    width: 100% !important;
  }
}

/* Summary Page Layout */
#mainContainer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
}

.left-column,
.right-column {
  width: 48%;
  padding: 0.5rem;
}

.summary-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-box h2 {
  margin-top: 0;
  font-size: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* Hover tips — hover the label (~1s delay); no "?" marks */
.lt-hover-tip {
  position: relative;
  display: inline;
  max-width: 100%;
  cursor: help;
  outline: none;
}
.lt-tip-label {
  border-bottom: 1px dotted rgba(36, 61, 44, 0.45);
}
.lt-tip-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10050;
  width: min(340px, 85vw);
  padding: 10px 12px;
  background: #243d2c;
  color: #fff;
  font-size: 0.82em;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(31, 61, 40, 0.28);
  white-space: normal;
  pointer-events: none;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px);
  transition: opacity 0.12s ease, visibility 0s linear 0.12s, transform 0.12s ease;
}
.lt-tip-bubble::before {
  content: '';
  position: absolute;
  left: 14px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: #243d2c;
  transform: rotate(45deg);
}
.lt-hover-tip:hover .lt-tip-bubble,
.lt-hover-tip:focus-within .lt-tip-bubble,
.lt-hover-tip:focus .lt-tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  /* ~1s before tip appears; hide quickly on mouse-out */
  transition: opacity 0.15s ease 0.9s, visibility 0s linear 0.9s, transform 0.15s ease 0.9s;
}
/* Instant / near-instant tip (e.g. secondary actions people should notice) */
.lt-hover-tip.lt-tip-quick {
  display: inline-block;
  cursor: pointer;
}
.lt-hover-tip.lt-tip-quick:hover .lt-tip-bubble,
.lt-hover-tip.lt-tip-quick:focus-within .lt-tip-bubble,
.lt-hover-tip.lt-tip-quick:focus .lt-tip-bubble {
  transition: opacity 0.08s ease 0.05s, visibility 0s linear 0.05s, transform 0.08s ease 0.05s;
}

/* Compact per-asset charter crew / payroll rows (Businesses → Charter card) */
.charter-crew-section {
  min-width: 0;
}
.charter-crew-head {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 2px;
  white-space: nowrap;
}
.charter-crew-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 1px 0;
  font-size: 0.88em;
  white-space: nowrap;
  min-width: 0;
  line-height: 1.25;
}
.charter-crew-row .lt-hover-tip,
.charter-crew-row .charter-crew-label {
  flex: 0 0 auto;
}
.charter-crew-row .lt-tip-label,
.charter-crew-row .charter-crew-label {
  white-space: nowrap;
}
.charter-crew-row .charter-crew-count.biz-input,
.charter-crew-row input.charter-crew-count {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px;
  padding: 1px 2px !important;
  font-size: 1em;
  border-radius: 4px;
  flex: 0 0 auto;
}
.charter-crew-row .charter-crew-x,
.charter-crew-row .charter-crew-unit {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 1em;
}
.charter-crew-row .input-group.charter-crew-salary {
  width: 86px;
  flex: 0 0 auto;
  border-radius: 4px;
}
.charter-crew-row .input-group.charter-crew-salary .prefix {
  padding: 1px 4px;
  font-size: 0.9em;
}
.charter-crew-row .input-group.charter-crew-salary input.biz-input,
.charter-crew-row .input-group.charter-crew-salary input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 1px 3px !important;
  font-size: 1em;
}
.charter-crew-total {
  font-weight: 600;
  font-size: 0.82em;
  margin-top: 2px;
  color: #2f9e44;
  white-space: nowrap;
}
/* Tip bubbles open upward so they clear the next crew row */
.charter-crew-row .lt-tip-bubble,
.charter-crew-head .lt-tip-bubble {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  transform: translateY(-2px);
}
.charter-crew-row .lt-tip-bubble::before,
.charter-crew-head .lt-tip-bubble::before {
  top: auto;
  bottom: -5px;
}
.charter-crew-row .lt-hover-tip:hover .lt-tip-bubble,
.charter-crew-row .lt-hover-tip:focus-within .lt-tip-bubble,
.charter-crew-row .lt-hover-tip:focus .lt-tip-bubble,
.charter-crew-head .lt-hover-tip:hover .lt-tip-bubble,
.charter-crew-head .lt-hover-tip:focus-within .lt-tip-bubble,
.charter-crew-head .lt-hover-tip:focus .lt-tip-bubble {
  transform: translateY(0);
}

/* Compact RE / item insurance row (add + edit forms) */
.re-ins-compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #d5e0cc;
  font-size: 0.78rem;
  color: #5f7464;
  background: transparent;
}
.re-ins-compact-label {
  font-weight: 600;
  color: #3a5544;
  white-space: nowrap;
}
.re-ins-risk-toggle {
  display: inline-flex;
  gap: 4px;
  margin: 0;
}
.re-ins-risk-toggle button {
  flex: none;
  margin: 0;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid #c5d9b0;
  background: #f7faf3;
  color: #243d2c;
  box-shadow: none;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.re-ins-risk-toggle button:hover {
  filter: none;
  transform: none;
}
.re-ins-risk-toggle button.active-yes {
  background: linear-gradient(180deg, #4ec75f, #3db54f);
  color: #fff;
  border-color: transparent;
}
.re-ins-risk-toggle button.active-no {
  background: #f7faf3;
  color: #243d2c;
  border: 1.5px solid #c5d9b0;
  box-shadow: none;
}
.re-ins-annual {
  max-width: 120px;
  margin: 0;
}
.re-ins-annual input {
  width: 100%;
  font-size: 0.9em;
  padding: 3px 6px;
}
.re-ins-yr {
  opacity: 0.7;
  font-size: 0.9em;
}
.re-ins-reset {
  font-size: 0.72em !important;
  padding: 2px 8px !important;
  min-height: 0;
  font-weight: 600;
}

/* Inline helper tip (always visible) */
.lt-helper-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #e8f6e9;
  border: 1.5px solid #c5d9b0;
  border-radius: 10px;
  color: #3a5544;
}
.lt-helper-tip p {
  margin: 0;
  font-size: 0.86em;
  font-weight: 500;
  line-height: 1.45;
  color: #3a5544;
}

/* Brief highlight after one-click portfolio assign */
@keyframes portfolio-assign-flash {
  0% { background: #dcfce7; border-color: #86efac; box-shadow: 0 0 0 2px rgba(61, 181, 79, 0.35); }
  70% { background: #f0fdf4; border-color: #86efac; box-shadow: 0 0 0 1px rgba(61, 181, 79, 0.2); }
  100% { background: #fffef8; border-color: var(--lt-border, #c5d9b0); box-shadow: none; }
}
.portfolio-unit-row.portfolio-assign-flash {
  animation: portfolio-assign-flash 1.1s ease-out 1;
}

/* Same RE catalog item counted more than once among checked portfolios */
.portfolio-re-dupe-banner {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.86em;
  font-weight: 600;
  line-height: 1.4;
}

.account-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.account-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-email-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff8e8;
  border: 1.5px solid #e8c96a;
  border-radius: 8px;
  color: #6b5420;
  font-size: 0.86em;
  font-weight: 600;
  line-height: 1.4;
}

/* My Account — bordered columns + compact fields */
.account-col {
  min-width: 0;
  border: 1.5px solid var(--lt-border, #c5d9b0);
  border-radius: 12px;
  padding: 14px 16px 16px;
  background: rgba(255, 252, 245, 0.65);
}
.account-col-title {
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--lt-border-soft, #dcecc8);
  font-family: var(--font-display, inherit);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--lt-ink, #1a2e1f);
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.account-row select,
.account-row input[type="text"],
.account-row input[type="email"],
.account-row input[type="password"] {
  flex: 0 1 320px;
  width: 100%;
  max-width: 320px;
  min-width: 140px;
  padding: 6px 9px;
  font-size: 0.88em;
  box-sizing: border-box;
}

.edit-lists-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid #dcecc8;
}
.edit-lists-row:last-child {
  border-bottom: none;
}
.edit-lists-name {
  font-weight: 600;
  color: #0f172a;
  flex: 1;
  min-width: 140px;
}
.edit-lists-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Giveaways: keep Add Recipient from stretching full column width */
.giveaway-add-recipient-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.giveaway-add-recipient-row #new-recipient {
  flex: 0 1 220px;
  width: 220px;
  max-width: 100%;
  min-width: 140px;
  margin: 0;
}

/* Catalog category header → larger detail popup */
.catalog-type-header-open {
  cursor: pointer;
}
.catalog-type-header-open:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35) inset;
}
.catalog-type-header-open:focus-visible {
  outline: 2px solid #f5d76e;
  outline-offset: 2px;
}

.item-ext-link {
  color: #1f7a32;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block;
  font-size: 1.05em;
  line-height: 1.3;
  padding: 3px 6px;
}
.item-ext-link:hover {
  color: #2f9e44;
}

.edit-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.edit-link-row #edit-link {
  flex: 1;
  min-width: 0;
}
.edit-link-open[hidden] {
  display: none !important;
}

.catalog-category-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.catalog-category-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(80px, 0.9fr) minmax(90px, 0.9fr) minmax(90px, 0.85fr) 56px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9em;
}
.catalog-category-row.catalog-category-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}
.catalog-category-row.catalog-category-item:hover {
  background: #f3faf1;
  border-color: #86efac;
}
.catalog-category-head {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f7464;
  padding-bottom: 2px;
}
.catalog-category-table:has(.catalog-category-head > :nth-child(6)) .catalog-category-row {
  grid-template-columns: minmax(120px, 1.5fr) minmax(70px, 0.85fr) minmax(70px, 0.85fr) minmax(85px, 0.8fr) minmax(85px, 0.8fr) 56px;
}
.catalog-cat-name {
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-cat-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

@media (max-width: 700px) {
  .catalog-category-row,
  .catalog-category-table:has(.catalog-category-head > :nth-child(6)) .catalog-category-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
  }
  .catalog-category-head {
    display: none;
  }
}

/* All Purchases insurance amount (hover tip + click for rate popup) */
.purchases-ins-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1f7a32;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(31, 122, 50, 0.35);
  cursor: pointer;
}
.purchases-ins-btn:hover {
  color: #2f9e44;
  text-decoration-color: rgba(47, 158, 68, 0.7);
}

/* All Purchases header + Estimates guide */
.purchases-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.purchases-page-header h2 {
  margin: 0;
  flex: 1 1 auto;
}
.estimates-guide {
  max-width: 860px;
}
.estimates-guide .estimates-guide-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.estimates-guide .estimates-guide-header h2 {
  margin: 0;
}
.estimates-guide .estimates-intro {
  margin: 0 0 16px;
  color: #3a5544;
  line-height: 1.5;
}
.estimates-guide .estimates-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 10px 12px;
  background: #f3faf1;
  border: 1px solid #c5d9b0;
  border-radius: 8px;
}
.estimates-guide .estimates-toc a {
  color: #1f7a32;
  font-weight: 600;
  font-size: 0.88em;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.estimates-guide .estimates-section {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #fffcf5;
  border: 1px solid #c5d9b0;
  border-radius: 10px;
}
.estimates-guide .estimates-section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #1a3322;
}
.estimates-guide .estimates-section p {
  margin: 0 0 8px;
  color: #3a5544;
  line-height: 1.5;
}
.estimates-guide .estimates-section ul {
  margin: 0 0 8px;
  padding-left: 1.25em;
  color: #3a5544;
  line-height: 1.5;
}
.estimates-guide .estimates-section li {
  margin-bottom: 4px;
}
.estimates-guide table.estimates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 8px 0 4px;
}
.estimates-guide table.estimates-table th,
.estimates-guide table.estimates-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.estimates-guide table.estimates-table th {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f7464;
  font-weight: 700;
}
.estimates-guide .estimates-note {
  font-size: 0.85em;
  color: #5f7464;
  font-style: italic;
  margin: 6px 0 0;
}

/* Compact next-step strip (Catalog / Summary after Start Playing) */
.next-step-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 3px 8px;
  font-size: 0.7rem;
  line-height: 1.25;
  color: #3a5544;
  background: #f3faf1;
  border: 1px solid #c5d9b0;
  border-radius: 4px;
  box-sizing: border-box;
}
.next-step-tip-text {
  flex: 1 1 auto;
  min-width: 0;
}
.next-step-tip strong {
  font-weight: 700;
}
.next-step-tip-link {
  color: #1f7a32;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.next-step-tip-link:hover {
  color: #14532d;
}
.next-step-tip-dismiss {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: #5f7464;
  font-size: 1.05em;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
}
.next-step-tip-dismiss:hover {
  color: #243d2c;
  background: rgba(36, 61, 44, 0.08);
}

/* Catalog portfolio assignment badges + Add/Edit assignment popup */
.catalog-item-text {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  white-space: normal;
}
.catalog-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
.catalog-item-text .catalog-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
#purchases-table th.purchases-photo-col,
#purchases-table td.purchases-photo-cell,
.purchases-table th.purchases-photo-col,
.purchases-table td.purchases-photo-cell {
  width: 52px;
  max-width: 56px;
  padding: 2px 4px;
  text-align: center;
  vertical-align: middle;
}
.purchases-photo-thumb {
  display: block;
  width: 36px;
  height: 27px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #c5d9b0;
  background: #f3faf1;
  cursor: zoom-in;
  margin: 0 auto;
  overflow: hidden;
}
.purchases-photo-empty {
  display: block;
  width: 36px;
  height: 27px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border-radius: 3px;
  border: 1px dashed rgba(95, 116, 100, 0.35);
  background: rgba(243, 250, 241, 0.55);
  box-sizing: border-box;
}
.purchases-photo-preview {
  position: fixed;
  z-index: 20100;
  pointer-events: none;
  padding: 0;
  background: #fffef8;
  border: 2px solid #1a3322;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(26, 46, 31, 0.28);
  width: min(52vmin, 480px);
  height: auto;
  aspect-ratio: 4 / 3;
  max-width: min(52vw, 480px);
  max-height: min(40vh, 360px);
  overflow: hidden;
  box-sizing: border-box;
}
.purchases-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}
/* Name + Price (left ~half) with photo slot on the right */
.item-identity-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 10px;
}
.item-identity-fields {
  flex: 1 1 0;
  min-width: 0;
  max-width: 52%;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.item-identity-fields > label {
  margin-bottom: 0;
}
.item-identity-fields > label:first-child {
  margin-top: 0;
}
.item-photo-slot {
  flex: 0 0 auto;
  width: 168px;
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
}
button.item-photo-preview,
.item-photo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px dashed #b7c9a4;
  background: #f3faf1;
  box-shadow: none;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  color: #5f7464;
  text-shadow: none;
  -webkit-text-stroke: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
button.item-photo-preview:hover,
.item-photo-preview:hover {
  border-color: #7a9a62;
  background: #eef8e6;
  color: #5f7464;
}
.item-photo-preview:focus-visible {
  outline: 2px solid #3db54f;
  outline-offset: 2px;
}
.item-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
button.item-photo-preview:not(.is-empty),
.item-photo-preview:not(.is-empty) {
  border-style: solid;
  border-color: #c5d9b0;
  background: #fff;
  padding: 0;
}
button.item-photo-preview:not(.is-empty):hover,
.item-photo-preview:not(.is-empty):hover {
  border-color: #7a9a62;
  background: #fff;
}
.item-photo-placeholder {
  display: block;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.78em;
  font-weight: 600;
  line-height: 1.3;
  color: #5f7464;
  pointer-events: none;
}
.item-photo-status {
  font-size: 0.72em;
  color: #1f7a32;
  min-height: 0;
  line-height: 1.25;
  text-align: center;
}
.item-photo-status:empty {
  display: none;
}
.item-photo-status.is-error {
  color: #b91c1c;
}
.item-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 46, 31, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-sizing: border-box;
}
.item-photo-lightbox-card {
  background: linear-gradient(180deg, #fffef8, #f7fbf4);
  border: 1px solid #c5d9b0;
  border-radius: 10px;
  padding: 14px;
  max-width: min(92vw, 420px);
  width: 100%;
  box-shadow: 0 12px 40px rgba(26, 46, 31, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-photo-lightbox-img {
  display: block;
  width: 100%;
  max-height: min(60vh, 360px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.item-photo-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
/* 4:3 landscape crop editor (after file pick, before save).
   Above Edit/Add Item (.modal 10100) and nested modals (~10300). */
.item-photo-crop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 46, 31, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-sizing: border-box;
}
.item-photo-crop-card {
  background: linear-gradient(180deg, #fffef8, #f7fbf4);
  border: 1px solid #c5d9b0;
  border-radius: 10px;
  padding: 14px 16px 16px;
  max-width: min(92vw, 380px);
  width: 100%;
  box-shadow: 0 12px 40px rgba(26, 46, 31, 0.28);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item-photo-crop-title {
  margin: 0;
  font-size: 1.05em;
  font-weight: 700;
  color: #1a3322;
}
.item-photo-crop-hint {
  margin: 0;
  font-size: 0.82em;
  color: #5f7464;
  line-height: 1.3;
}
.item-photo-crop-viewport {
  position: relative;
  width: 320px;
  height: auto;
  max-width: 100%;
  max-height: min(50vh, 240px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid #1a3322;
  background: #e8f0e0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}
.item-photo-crop-viewport.is-dragging {
  cursor: grabbing;
}
.item-photo-crop-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  pointer-events: none;
  will-change: transform;
}
.item-photo-crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82em;
  font-weight: 600;
  color: #1f7a32;
  margin: 0;
}
.item-photo-crop-zoom span {
  flex: 0 0 auto;
}
.item-photo-crop-zoom-input {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: #3db54f;
}
.item-photo-crop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
@media (max-width: 520px) {
  .item-identity-row {
    flex-wrap: wrap;
  }
  .item-identity-fields {
    max-width: none;
    flex: 1 1 100%;
  }
  .item-photo-slot {
    margin: 0;
    width: 100%;
    align-items: center;
  }
  .item-photo-preview {
    width: 168px;
    max-width: 168px;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .item-photo-crop-viewport {
    width: min(320px, calc(100vw - 72px));
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
.catalog-assign-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 100%;
}
.catalog-assign-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72em;
  font-weight: 650;
  line-height: 1.2;
  padding: 2px 6px;
  background: #e8f6e9;
  border: 1px solid #c5d9b0;
  border-radius: 4px;
  color: #1a3322;
  white-space: nowrap;
  max-width: 100%;
}
.catalog-assign-badge-del {
  margin: 0;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: #8b2118;
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
}
.catalog-assign-badge-del:hover {
  background: rgba(139, 33, 24, 0.12);
  color: #7f1d1d;
}
.portfolio-assign-optional {
  margin-top: 10px;
}
.portfolio-assign-open-btn {
  width: 100%;
  font-size: 0.9em;
}
.portfolio-assign-optional .catalog-assign-badges,
.portfolio-assign-optional .portfolio-assign-inline.portfolio-assign-rows,
.portfolio-assign-optional .portfolio-assign-inline {
  margin-top: 6px;
}
.portfolio-assign-inline.portfolio-assign-rows {
  margin-top: 6px;
}
.portfolio-assign-inline .portfolio-assign-row {
  padding: 3px 6px;
  border-radius: 5px;
}
.portfolio-new-name-card {
  padding: 16px 18px;
}
.portfolio-new-name-card label {
  display: block;
  margin: 8px 0 4px;
  font-size: 0.9em;
  font-weight: 700;
  color: #3a5544;
}
.portfolio-new-name-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
}
.portfolio-assign-card .portfolio-assign-intro {
  margin: 0 0 12px;
  font-size: 0.84em;
  color: #5f7464;
  line-height: 1.4;
}
.portfolio-assign-rows {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 22px;
}
.portfolio-assign-empty {
  font-size: 0.82em;
  color: #94a3b8;
  font-style: italic;
  padding: 3px 2px;
}
.portfolio-assign-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: #f7faf3;
  border: 1px solid #c5d9b0;
  border-radius: 5px;
  font-size: 0.9em;
}
.portfolio-assign-row-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: #1a3322;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portfolio-assign-row-qty-label {
  color: #5f7464;
  font-size: 0.85em;
  font-weight: 600;
}
.portfolio-assign-qty {
  width: 48px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 1px 4px !important;
  text-align: center;
  box-sizing: border-box;
}
.portfolio-assign-row-del,
.charter-fleet-row-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #8b2118;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.portfolio-assign-row-del:hover,
.charter-fleet-row-del:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}