:root {
  --bg-base: #090d16;
  --bg-card: #111827;
  --bg-card-elevated: #172033;
  --border-subtle: #1e293b;
  --border-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --buy-bg: rgba(16, 185, 129, 0.14);
  --buy-border: #10b981;
  --buy-text: #34d399;

  --sell-bg: rgba(244, 63, 94, 0.14);
  --sell-border: #f43f5e;
  --sell-text: #fb7185;

  --sma-color: #38bdf8;
  --ema-color: #f59e0b;

  --target-size: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  scroll-padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  min-block-size: 100dvh;
  background-color: var(--bg-base);
  overflow-wrap: break-word;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}

:where(a, code) {
  overflow-wrap: anywhere;
}

h1, h2, h3 {
  text-wrap: balance;
  margin: 0;
}

p, li {
  text-wrap: pretty;
  margin: 0;
}

/* Input & Control sizing per form-factor-adaptation and mobile-native */
:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

input, textarea, select {
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  inline-size: 100%;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.table-wrapper:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

button, a, [role="button"] {
  touch-action: manipulation;
}

button, [role="button"], .signal-chip, .metric-tag {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* App Header */
.app-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-block-start: calc(env(safe-area-inset-top, 0px) + 0.95rem);
  padding-block-end: 0.85rem;
  padding-inline-start: max(1.15rem, env(safe-area-inset-left, 0px));
  padding-inline-end: max(1.15rem, env(safe-area-inset-right, 0px));
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border-subtle);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  border-radius: 0.65rem;
  flex-shrink: 0;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sma-color);
  text-transform: uppercase;
}

.app-header h1 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 800;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

:where(.toolbar > :not(button, input, select, textarea, a, [role="button"], label)) {
  min-inline-size: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.status-dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-dot.live {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-dot.error {
  background: #f43f5e;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  transition: transform 110ms var(--ease-out), background-color 110ms, border-color 110ms;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-buy-sim {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-sell-sim {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fb7185;
}

.btn-chip {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.btn-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--sma-color);
  color: #e0f2fe;
}

.btn-icon {
  position: relative;
  padding: 0.35rem 0.6rem;
}

.btn-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: #1e293b;
    border-color: #475569;
  }
  .btn-primary:hover {
    background: #0369a1;
  }
  .btn-buy-sim:hover {
    background: rgba(16, 185, 129, 0.26);
  }
  .btn-sell-sim:hover {
    background: rgba(244, 63, 94, 0.26);
  }
}

/* Main Layout & Pull-to-Refresh */
.ptr-indicator {
  position: fixed;
  inset-block-start: calc(5.2rem + env(safe-area-inset-top, 0px));
  inset-inline: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -28px, 0);
  will-change: transform, opacity;
}

.ptr-indicator.is-releasing {
  transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1), opacity 220ms ease-out;
}

.ptr-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--sma-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.65);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.ptr-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  font-size: 0.95rem;
  color: var(--sma-color);
  will-change: transform;
}

.ptr-indicator.is-refreshing .ptr-icon {
  animation: ptr-spin 700ms linear infinite;
}

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

.app-main {
  max-inline-size: 1360px;
  margin-inline: auto;
  padding: 1.25rem max(1.25rem, env(safe-area-inset-right, 0px)) 2rem max(1.25rem, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  will-change: transform;
}

.app-main.is-releasing {
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ptr-indicator.is-releasing,
  .app-main.is-releasing {
    transition-duration: 120ms;
  }
}

/* Signal Banner */
.signal-banner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.35rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  transition: border-color 200ms, background-color 200ms;
}

@media (min-width: 860px) {
  .signal-banner {
    grid-template-columns: 1.65fr 1fr;
    align-items: center;
  }
}

.signal-banner[data-stance="BUY"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(17, 24, 39, 0.96));
  border-color: var(--buy-border);
}

.signal-banner[data-stance="SELL"] {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.16), rgba(17, 24, 39, 0.96));
  border-color: var(--sell-border);
}

.signal-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-block-end: 0.6rem;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #1e293b;
  color: var(--text-primary);
}

.signal-banner[data-stance="BUY"] .signal-chip {
  background: #10b981;
  color: #022c22;
}

.signal-banner[data-stance="SELL"] .signal-chip {
  background: #f43f5e;
  color: #fff1f2;
}

.candle-timer {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.signal-banner h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-block-end: 0.45rem;
}

.signal-banner p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.forming-preview {
  margin-block-start: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.last-crossover-box {
  padding: 1rem 1.15rem;
  border-radius: 0.8rem;
  background: rgba(9, 13, 22, 0.65);
  border: 1px solid var(--border-subtle);
}

.box-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-block-end: 0.35rem;
}

.last-crossover-action {
  font-size: 1.35rem;
  font-weight: 800;
  margin-block-end: 0.25rem;
}

.last-crossover-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.metric-card {
  padding: 1.1rem 1.2rem;
  border-radius: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.metric-card-buy {
  border-inline-start: 4px solid var(--sma-color);
}

.metric-card-sell {
  border-inline-start: 4px solid var(--ema-color);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
}

.tag-buy {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.tag-sell {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.metric-price {
  font-size: 1.7rem;
  font-weight: 800;
}

.metric-change,
.metric-delta {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 0.35rem;
}

.up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
}

.down {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.14);
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Chart Card */
.chart-card,
.history-card {
  padding: 1.25rem;
  border-radius: 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.chart-header,
.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1rem;
}

.chart-header h2,
.history-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.history-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-block-start: 0.2rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-block-start: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  display: inline-block;
  inline-size: 14px;
  block-size: 4px;
  border-radius: 2px;
}

.swatch-price {
  background: #10b981;
  block-size: 10px;
  inline-size: 10px;
}

.swatch-sma {
  background: var(--sma-color);
}

.swatch-ema {
  background: var(--ema-color);
}

.canvas-container {
  position: relative;
  inline-size: 100%;
  block-size: clamp(290px, 46vh, 440px);
  background: #0b101d;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
}

#price-chart {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  touch-action: pan-y;
}

/* Responsive Data Table per modern-web-guidance responsive-table */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(460px, 75vh);
  container-type: inline-size;
  border: 1px solid var(--border-subtle);
  border-radius: 0.7rem;
}

table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: var(--bg-card-elevated);
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--border-subtle);
}

thead th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-primary);
}

.badge-buy {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  font-weight: 800;
  font-size: 0.78rem;
  background: var(--buy-bg);
  color: var(--buy-text);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-sell {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  font-weight: 800;
  font-size: 0.78rem;
  background: var(--sell-bg);
  color: var(--sell-text);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

@container (width < 600px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    /* MANDATORY: Hide column header from layout and screen readers */
    display: none;
  }

  tr {
    margin-block-end: 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.6rem;
    overflow: hidden;
  }

  tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--bg-card-elevated);
  }

  table {
    --label-1: "Time (ET)";
    --label-2: "Signal Action";
    --label-3: "Trigger Rule";
    --label-4: "QQQ 15m Close";
    --label-5: "MA Level";
    --label-6: "TQQQ Ref Price";
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  td::before {
    font-weight: 600;
    color: var(--text-secondary);
  }

  td:nth-child(2)::before {
    content: var(--label-2) ": ";
  }
  td:nth-child(3)::before {
    content: var(--label-3) ": ";
  }
  td:nth-child(4)::before {
    content: var(--label-4) ": ";
  }
  td:nth-child(5)::before {
    content: var(--label-5) ": ";
  }
  td:nth-child(6)::before {
    content: var(--label-6) ": ";
  }
}

/* Native Dialog per modern-web-guidance dialog & light-dismiss-a-dialog */
dialog {
  padding: 0;
  border: 1px solid #334155;
  border-radius: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
  max-inline-size: min(520px, calc(100vw - 2rem));
  inline-size: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

/* MANDATORY scroll containment rules from dialog guide */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-inner {
  padding: 1.35rem;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.15rem;
}

.dialog-header h2 {
  font-size: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block-end: 1rem;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.rule-verification-box {
  padding: 0.95rem 1.1rem;
  border-radius: 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  margin-block-end: 1.2rem;
}

.rule-verification-box h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sma-color);
  margin-block-end: 0.5rem;
}

.rule-verification-box ul {
  margin: 0;
  padding-inline-start: 1.15rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Supabase Auth & Profile Styling (Zen Tamil pattern) */
.btn-auth-signin {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #ecfdf5;
}

.profile-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 26px;
  block-size: 26px;
  border-radius: 50%;
  background: #10b981;
  color: #022c22;
  font-weight: 800;
  font-size: 0.8rem;
}

.profile-name-text {
  font-weight: 700;
  font-size: 0.84rem;
  max-inline-size: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-brand-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 46px;
  block-size: 46px;
  border-radius: 0.85rem;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  font-size: 1.5rem;
}

.auth-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  margin-block-end: 1rem;
}

.auth-tab {
  border: none;
  border-radius: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.auth-alert {
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.83rem;
  font-weight: 600;
  margin-block-end: 1rem;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.btn-auth-submit {
  inline-size: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 800;
  border-radius: 0.7rem;
  background: #10b981;
  border-color: #059669;
  color: #022c22;
  margin-block-start: 0.25rem;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: 1.15rem;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  border-block-start: 1px solid var(--border-subtle);
}

.auth-divider span {
  position: relative;
  background: var(--bg-card);
  padding-inline: 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.btn-google-oauth {
  inline-size: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(16, 185, 129, 0.45);
  margin-block-end: 1rem;
}

.profile-avatar-large {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 56px;
  block-size: 56px;
  border-radius: 50%;
  background: #10b981;
  color: #022c22;
  font-size: 1.45rem;
  font-weight: 900;
  flex-shrink: 0;
}

.profile-hero-info {
  flex: 1;
  min-inline-size: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.profile-name-row h3 {
  font-size: 1.15rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name-edit-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-block-bottom: 0.25rem;
}

.profile-email {
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-block-end: 1.25rem;
}

.profile-stat-card {
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
}

.profile-stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-block-end: 0.25rem;
}

.profile-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
}

.profile-footer-actions {
  border-block-start: 1px solid var(--border-subtle);
  padding-block-start: 1rem;
}

.btn-signout {
  inline-size: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fb7185;
  font-weight: 800;
}
