:root {
  font-family:
    "Space Grotesk",
    "IBM Plex Sans",
    "Segoe UI",
    sans-serif;
  color: #172033;
  background: #edf0ea;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --text-main: #172033;
  --text-muted: rgba(23, 32, 51, 0.66);
  --accent-teal: #0f766e;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  min-width: 1024px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:hover,
a:hover {
  transform: translateY(-1px);
}

a {
  color: inherit;
}
.loading-state,
.empty-state,
.device-warning-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.loading-state,
.empty-state p {
  color: var(--text-muted);
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  background: linear-gradient(180deg, #eff3ef 0%, #e3e7e2 100%);
}

.nav-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(250, 250, 248, 0.9);
  backdrop-filter: blur(12px);
  padding: 0.62rem 0.76rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.nav-panel {
  width: 300px;
  padding: 3.5rem 0.8rem 0.8rem;
  background: rgba(246, 247, 243, 0.92);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  overflow-y: auto;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    width 180ms ease;
}

.nav-panel.collapsed {
  width: 0;
  transform: translateX(-100%);
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
}

.nav-brand {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.nav-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.35rem;
}

.eyebrow {
  margin: 0 0 0.1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-teal);
}

.nav-brand h1,
.workspace-header h2,
.auth-branding h1 {
  margin: 0;
  line-height: 1.05;
}

.panel-section,
.workspace-card-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 0.7rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.panel-section + .panel-section {
  margin-top: 0.65rem;
}

.panel-section h2,
.workspace-card-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.section-helper,
.meta-line,
.legend-block span,
.workspace-load span {
  color: var(--text-muted);
}

.filter-select,
.auth-form,
.auth-help,
.reset-panel,
.profile-grid,
.workspace-body,
.workspace-list {
  display: grid;
  gap: 0.55rem;
}

.filter-select span {
  font-size: 0.8rem;
  font-weight: 600;
}

.text-input {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(252, 252, 250, 0.96);
  color: var(--text-main);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font: inherit;
}

.text-input.narrow {
  width: 120px;
}

.text-input.tiny {
  width: 64px;
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
}

.custom-gradient-edit {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button,
.upload-button,
.oauth-button,
.workspace-load {
  border: none;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.primary-button,
.secondary-button,
.ghost-button,
.upload-button {
  padding: 0.55rem 0.7rem;
}

.primary-button {
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #f7faf9;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

.secondary-button,
.upload-button {
  background: #f1efe7;
  color: #172033;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ghost-button,
.chip-button {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.chip-button.active {
  background: rgba(15, 118, 110, 0.12);
  color: #0b4f49;
  border-color: rgba(15, 118, 110, 0.35);
}

.status-banner.compact {
  margin-top: 1rem;
}

.well-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

.well-checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  position: relative;
}

.well-checkbox-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  cursor: pointer;
  background: rgba(247, 248, 244, 0.6);
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  transition: background 140ms ease;
  min-width: 0;
}

.well-delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 1.1rem;
  padding: 0 0.2rem;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 140ms ease;
}

.well-checkbox-container:hover .well-delete-btn {
  opacity: 1;
}

.well-checkbox-item:hover {
  background: rgba(15, 118, 110, 0.08);
}

.well-checkbox-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-weight: 500;
}

.well-checkbox-item input[type="checkbox"] {
  accent-color: var(--accent-teal);
  cursor: pointer;
}

.workspace-shell {
  height: 100vh;
  overflow: hidden;
  padding: 0.25rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workspace-shell > :last-child {
  flex: 1;
  min-height: 0;
}

.workspace-header,
.card-header,
.header-actions,
.inline-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.workspace-body {
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.9fr);
  align-items: stretch;
}

.workspace-body.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-header h2 {
  font-size: 1.05rem;
}

.plot-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.status-banner.success {
  background: rgba(15, 118, 110, 0.08);
}

.status-banner.error {
  background: rgba(185, 28, 28, 0.08);
}

.workspace-card {
  background: rgba(247, 248, 244, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 0.56rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}

.workspace-load {
  text-align: left;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.ghost-button.small {
  padding: 0.55rem 0.7rem;
}

.full-width {
  width: 100%;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-button input {
  display: none;
}

.plot-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  gap: 0.45rem;
}

.plot-shell > svg,
.plot-shell > .plotly-frame,
.plot-shell > .crossplot-container {
  flex: 1;
  min-height: 0;
}

.plot-legend {
  display: grid;
  gap: 0.45rem;
  flex-shrink: 0;
}

.plot-svg {
  width: 100%;
  height: 100%;
}

.plotly-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #fbfcf8;
}

.plotly-plot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.plotly-plot .modebar {
  right: 0.45rem !important;
  top: 0.35rem !important;
}

.plot-background {
  fill: #fbfcf8;
}

.plot-grid-line {
  stroke: rgba(15, 23, 42, 0.08);
  stroke-width: 1;
}

.plot-grid-line.minor {
  stroke: rgba(15, 23, 42, 0.045);
  stroke-width: 0.8;
}

.plot-grid-line.major {
  stroke: rgba(15, 23, 42, 0.2);
}

.pressure-point,
.mobility-point {
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.pressure-pan-hitbox {
  fill: transparent;
  cursor: grab;
  pointer-events: all;
}

.gradient-line {
  cursor: grab;
}

.gradient-line-hit {
  stroke: transparent;
  stroke-width: 18;
  cursor: grab;
  pointer-events: stroke;
}

.gradient-anchor {
  cursor: move;
}

/* Hide Plotly shape handles to prevent rotation/resizing of gradient lines */
.shapelayer .dot,
.shapelayer .rot-handle,
.shapelayer .rot-line {
  display: none !important;
}

/* Ensure gradient lines are easily draggable for translation */
.shapelayer .line {
  cursor: move !important;
  pointer-events: all !important;
}

.mobility-unavailable {
  display: grid;
  gap: 0.18rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.84);
  color: #172033;
}

.mobility-unavailable span {
  color: var(--text-muted);
}

.font-bold {
  font-weight: 700;
}

.plot-axis-label,
.track-scale-label,
.curve-label {
  font-size: 12px;
  fill: rgba(23, 32, 51, 0.68);
}

.plot-title,
.track-title {
  font-size: 14px;
  font-weight: 700;
  fill: #172033;
}

.align-end {
  text-anchor: end;
}

.align-middle {
  text-anchor: middle;
}

.track-frame {
  fill: none;
  stroke: rgba(15, 23, 42, 0.12);
}

.formation-svg .plot-grid-line.major {
  stroke: rgba(15, 23, 42, 0.22);
  stroke-width: 1.1;
}

.formation-svg .plot-grid-line.minor {
  stroke: rgba(15, 23, 42, 0.08);
  stroke-width: 0.7;
}

.formation-curve {
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.track-scale-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  fill: #64748b;
}

.curve-label {
  font-weight: 600;
  font-size: 11px;
}

.track-title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 800;
}

.track-header-scales {
  pointer-events: none;
}

.legend-block {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.legend-block.highlight {
  background: rgba(217, 119, 6, 0.1);
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

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

.plot-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0.75rem;
  row-gap: 0.4rem;
  font-size: 0.7rem;
  position: relative;
  z-index: 1;
  padding-top: 0.2rem;
  flex-shrink: 0;
}

.pressure-plot-legend {
  max-height: 120px;
  overflow-y: auto;
}

.legend-section h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.legend-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem;
  background: rgba(15, 23, 42, 0.035);
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.clickable {
  cursor: pointer;
}

.log-metadata-pill {
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.05);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.logs-scroll-container {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.logs-section svg {
  height: 100%;
}

.plot-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  min-height: 24px;
  flex-shrink: 0;
}

.auth-shell {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
}

.auth-top-nav {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.top-nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 180ms ease;
  background: rgba(23, 32, 51, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.02em;
}

.top-nav-link:hover {
  color: white;
  background: rgba(23, 32, 51, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .auth-top-nav {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    top: 1rem;
  }
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(8, 16, 24, 0.75), rgba(11, 79, 73, 0.72)),
    url("/background.png") center / cover no-repeat;
  transform: scale(1.03);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(251, 252, 248, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 45px 100px rgba(8, 16, 24, 0.3);
}

.auth-branding,
.auth-panel {
  padding: 3rem;
}

.auth-branding {
  background: linear-gradient(180deg, rgba(232, 239, 234, 0.95), rgba(242, 244, 239, 0.9));
  display: grid;
  align-content: center;
  gap: 1.2rem;
}

.auth-panel {
  background: rgba(255, 255, 255, 0.82);
}

.auth-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  padding: 1rem;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.35rem;
  background: rgba(23, 32, 51, 0.05);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.auth-mode-switch button {
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.85rem;
  font: inherit;
  font-weight: 600;
}

.auth-mode-switch button.active {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.oauth-button {
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.device-warning-card {
  max-width: 420px;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.95);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.device-warning-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.account-menu {
  position: relative;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
  cursor: pointer;
}

.button-icon {
  width: 21px;
  height: 21px;
}

.account-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 4;
  min-width: 190px;
  display: grid;
  gap: 0.45rem;
  padding: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent-teal);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.compact-help {
  margin-top: 0.8rem;
}

.curve-menu,
.gradient-menu {
  position: relative;
}

.curve-menu summary,
.gradient-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 0.62rem 0.76rem;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.curve-menu summary::-webkit-details-marker,
.gradient-menu summary::-webkit-details-marker {
  display: none;
}

.curve-menu-panel,
.gradient-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 3;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.gradient-menu-panel {
  width: 230px;
}

.curve-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.custom-toggle {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  margin-top: 0.25rem;
  padding-top: 0.55rem;
}

.compact-label {
  gap: 0.35rem;
}

.ghost-button.active {
  border-color: rgba(217, 119, 6, 0.42);
  background: rgba(217, 119, 6, 0.12);
}

.workspace-fab-container {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(15, 118, 110, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.fab-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(15, 118, 110, 0.4);
}

.fab-button.active {
  transform: rotate(90deg);
}

.workspace-fab-menu {
  width: 320px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fab-menu-header {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.03);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fab-menu-content {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.fab-save-form {
  display: flex;
  gap: 0.5rem;
}

.fab-workspace-list {
  display: grid;
  gap: 0.65rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.well-checkbox-item.active {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.25);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-main);
}

.preview-notice {
  border-left: 4px solid var(--accent-teal);
}

.modal-dialog h3 {
  margin: 0 0 0.75rem;
  color: #172033;
}

.modal-dialog p {
  margin: 0 0 2rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-actions button {
  width: 100%;
  justify-content: center;
}

.workspace-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.tab-button {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--text-main);
}

.tab-button.active {
  color: var(--accent-teal);
  border-bottom-color: var(--accent-teal);
}

.plot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem;
  background: rgba(248, 250, 252, 0.5);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0 0 8px 8px;
}

.legend-section h4 {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.legend-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: var(--text-main);
}

.legend-block.highlight {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.15);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.workspace-body.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

.dashboard-content {
  flex: 1;
  overflow: hidden;
  padding: 0.5rem;
}

.side-by-side-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0.75rem;
  height: 100%;
  align-items: stretch;
}

.side-by-side-grid.single-column {
  grid-template-columns: 1fr;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: rgba(15, 23, 42, 0.12);
  margin: 0 0.5rem;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: all 0.2s;
}

.toggle-switch:hover {
  background: #f1f5f9;
}

.toggle-switch input {
  cursor: pointer;
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.side-by-side-grid > section {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pressure-section, .pressure-section > div, .pressure-section .plot-shell {
  flex: 1;
  height: 100%;
  min-height: 0;
}

.logs-section svg {
  max-width: 100%;
  height: auto;
}

.report-container {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-teal);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.report-section {
  margin-bottom: 3rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.report-section h3 {
  color: var(--accent-teal);
  margin-bottom: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  background: var(--bg-gray);
  padding: 1rem;
  border-radius: 6px;
}

.recommendation-box {
  background: rgba(15, 118, 110, 0.05);
  border: 1px solid rgba(15, 118, 110, 0.2);
  padding: 1rem;
  border-radius: 6px;
  line-height: 1.6;
}

.crossplot-container {
  padding: 1rem;
}

.coords-edit {
  display: flex;
  gap: 0.25rem;
}

.coords-edit input {
  width: 80px;
}

.input-data-view .actions {
  display: flex;
  gap: 0.5rem;
}

@media print {
  .nav-sidebar, .workspace-tabs, .header-actions, .account-trigger, .workspace-fab-container, .chip-button {
    display: none !important;
  }
  .workspace-shell {
    padding: 0 !important;
  }
}

/* Admin Dashboard */
.admin-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
}

.admin-stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-card h2 {
  font-size: 2.4rem;
  margin: 0.5rem 0;
  color: var(--accent-teal);
}

.stat-card span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.advanced-stats .meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.meta-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.meta-item p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  font-size: 0.9rem;
}

.badge {
  background: rgba(15, 23, 42, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-dot.active { background: #10b981; }
.status-dot.inactive { background: #64748b; }

.actions {
  display: flex;
  gap: 0.5rem;
}

.ghost-button.tiny.danger {
  color: #ef4444;
}

.ghost-button.tiny.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 1360px) {
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }
}

/* ── Conflict Resolution Modal ── */
.conflict-modal-dialog {
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.25);
  position: relative;
  animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.conflict-modal-dialog h3 {
  margin: 0 0 0.5rem;
  color: #172033;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.conflict-modal-dialog h3 .conflict-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.conflict-modal-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.conflict-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.conflict-item {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.conflict-item:hover {
  border-color: rgba(15, 23, 42, 0.15);
}

.conflict-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.conflict-well-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.conflict-file-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.conflict-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.conflict-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: white;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.conflict-option:hover {
  border-color: var(--accent-teal);
  color: var(--text-main);
}

.conflict-option.selected {
  border-color: var(--accent-teal);
  background: rgba(14, 165, 143, 0.08);
  color: var(--accent-teal);
  font-weight: 600;
}

.conflict-option .option-icon {
  font-size: 0.9rem;
}

.conflict-modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.conflict-modal-footer button {
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.conflict-btn-cancel {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
}

.conflict-btn-cancel:hover {
  background: rgba(15, 23, 42, 0.1);
  color: var(--text-main);
}

.conflict-btn-confirm {
  background: linear-gradient(135deg, var(--accent-teal), #0f766e);
  color: white;
  box-shadow: 0 2px 8px rgba(14, 165, 143, 0.3);
}

.conflict-btn-confirm:hover {
  box-shadow: 0 4px 16px rgba(14, 165, 143, 0.4);
  transform: translateY(-1px);
}

.conflict-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.new-files-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(14, 165, 143, 0.06);
  border-radius: 6px;
  color: var(--accent-teal);
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.new-files-summary .check-icon {
  font-size: 1rem;
}
