:root {
  --panel-soft: #faf7f1;
  --panel-soft-strong: #f7f3eb;
  --panel-soft-accent: #eef6f2;
  --panel-border: rgba(148, 163, 184, 0.18);
}

body {
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at left center, rgba(194, 65, 12, 0.08), transparent 24%),
    #f6f2ea;
  color: #1f2937;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(15, 118, 110, 0.14), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(8, 145, 178, 0.1), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 242, 234, 0.98));
}

.login-shell {
  min-height: 100vh;
  width: min(100%, 980px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.9rem;
  padding: 2.4rem 1.25rem;
  text-align: center;
}

.login-hero {
  max-width: 920px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  padding: 0.58rem 1.45rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.38em;
}

.login-hero h1 {
  margin: 0 0 0.95rem;
  font-size: clamp(2.25rem, 4.9vw, 3.7rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.login-copy {
  max-width: 48rem;
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.9;
  color: #475569;
}

.login-card {
  width: min(100%, 440px);
  border: 1px solid var(--panel-border);
  border-radius: 34px;
  box-shadow: 0 28px 66px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.login-card .card-body {
  padding: 2.1rem 1.8rem 1.8rem;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.99), rgba(247, 243, 235, 0.97)),
    var(--panel-soft);
}

.login-card-header {
  margin-bottom: 1.05rem;
}

.login-card-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f172a;
}

.login-card-subtitle {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.98rem;
}

.login-feedback {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  font-size: 0.98rem;
  line-height: 1.7;
  border: 1px solid transparent;
}

.login-feedback.error {
  color: #b42318;
  background: rgba(254, 242, 242, 0.96);
  border-color: rgba(248, 113, 113, 0.24);
}

.login-feedback.info {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.98);
  border-color: rgba(45, 212, 191, 0.24);
}

.login-feedback.success {
  color: #166534;
  background: rgba(240, 253, 244, 0.98);
  border-color: rgba(74, 222, 128, 0.24);
}

.login-submit-btn {
  width: 100%;
  min-height: 60px;
  margin-top: 0.2rem;
  font-size: 1.04rem;
}

.login-card .shiny-input-container,
.login-card .shiny-input-container > div,
.login-card .form-control {
  width: 100% !important;
}

.login-card .form-control {
  box-sizing: border-box;
}

.app-page-shell {
  padding: 1.5rem 1rem 2rem;
}

.app-top-card {
  width: min(100%, 1920px);
  margin: 0 auto 1.35rem;
  padding: 1.5rem 1.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(251, 248, 242, 0.98), rgba(245, 241, 233, 0.95)),
    var(--panel-soft);
  border: 1px solid var(--panel-border);
  box-shadow: 0 22px 52px rgba(148, 163, 184, 0.16);
}

.app-top-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.top-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  padding: 0.72rem 1.4rem 0.76rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(8, 145, 178, 0.08));
  border: 1px solid rgba(15, 118, 110, 0.13);
  color: #0f766e;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.42em;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
}

.top-divider,
.top-user-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(148, 163, 184, 0.28);
}

.top-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-title-main {
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #0f172a;
  white-space: nowrap;
}

.top-nav-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.app-nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 56px;
  padding: 0.78rem 1.15rem;
  border: none;
  border-radius: 18px;
  background: transparent;
  color: #64748b;
  font-size: 1.02rem;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.app-nav-button:hover,
.app-nav-button:focus {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.72);
}

.app-nav-button.is-active {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.96);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.08);
}

.app-nav-button.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -14px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #19a6a2);
}

.top-user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(239, 248, 245, 0.96), rgba(248, 244, 236, 0.96));
  border: 1px solid rgba(15, 118, 110, 0.1);
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.12);
}

.top-user-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e, #1493a0);
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

.top-user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.top-user-name {
  font-size: 0.98rem;
  font-weight: 900;
  color: #0f172a;
}

.top-user-expiry {
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
}

.logout-button {
  min-height: 56px;
  padding: 0.85rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  background: rgba(250, 247, 241, 0.96);
  color: #0f766e;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.1);
}

.logout-button:hover,
.logout-button:focus {
  background: rgba(240, 253, 250, 0.98);
  color: #0b5f59;
}

.app-content-shell {
  width: min(100%, 1920px);
  margin: 0 auto;
}

.card.bslib-card {
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.97), rgba(246, 242, 234, 0.95)),
    var(--panel-soft);
  border: 1px solid var(--panel-border);
}

#main_nav > .tab-content > .tab-pane {
  display: none;
}

#main_nav > .tab-content > .active {
  display: block;
}

.section-card,
.placeholder-card {
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.16);
  overflow: hidden;
  min-height: 220px;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.97), rgba(246, 242, 234, 0.96)),
    var(--panel-soft);
}

.section-card.bslib-card,
.placeholder-card.bslib-card {
  height: auto !important;
}

.section-card .card-body,
.placeholder-card .card-body {
  padding: 1.35rem 1.4rem 1.6rem;
  overflow: visible !important;
  background: transparent;
}

.summary-table-wrap {
  margin-top: 0.35rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.compact-grid {
  margin-top: 0.35rem;
}

.metric-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 245, 238, 0.97), rgba(244, 239, 231, 0.94));
  border: 1px solid rgba(203, 213, 225, 0.75);
}

.metric-label {
  font-size: 0.83rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.subtle-note {
  color: #475569;
  font-size: 1rem;
  margin: 0.3rem 0 0.9rem;
}

.step-guidance-text,
.upload-section-card .card-lead,
.mapping-section-card .card-lead,
.upload-section-card .control-label,
.mapping-section-card .control-label,
.overview-filter-card > .card-body > .shiny-input-radiogroup > .control-label,
.upload-section-card .subtle-note {
  font-size: 1rem;
  font-weight: 800;
  color: #475569;
  line-height: 1.65;
}

.upload-section-card .card-lead,
.mapping-section-card .card-lead {
  margin: 0 0 0.8rem;
}

.upload-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.upload-card-topline .card-lead {
  flex: 1 1 auto;
  margin-bottom: 0.8rem;
}

.sample-download-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.64rem;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #c96a22, #b85b1a);
  border: 1px solid rgba(146, 64, 14, 0.24);
  box-shadow:
    0 12px 24px rgba(180, 83, 9, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sample-download-link .fa {
  font-size: 0.94rem;
  line-height: 1;
}

.sample-download-link:hover,
.sample-download-link:focus {
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #b85b1a, #9f4d16);
  box-shadow:
    0 14px 28px rgba(146, 64, 14, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.upload-section-card .control-label,
.mapping-section-card .control-label,
.overview-filter-card > .card-body > .shiny-input-radiogroup > .control-label {
  display: inline-block;
  margin-bottom: 0.45rem;
}

.upload-section-card .subtle-note {
  margin: 0.35rem 0 0.95rem;
}

.filter-rule-note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5b6472;
  margin-top: 0.1rem;
}

.overview-help-details {
  margin: 0.05rem 0 0.95rem;
}

.overview-help-details > summary {
  list-style: none;
}

.overview-help-details > summary::-webkit-details-marker {
  display: none;
}

.overview-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  cursor: pointer;
  user-select: none;
}

.overview-help-label {
  font-size: 1rem;
  font-weight: 800;
  color: #475569;
  line-height: 1.65;
}

.overview-help-badge {
  width: 1.38rem;
  height: 1.38rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: #0f766e;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.overview-help-details[open] .overview-help-badge,
.overview-help-trigger:hover .overview-help-badge,
.overview-help-trigger:focus .overview-help-badge {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.overview-help-panel {
  margin-top: 0.62rem;
  padding: 0.88rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(186, 214, 218, 0.68);
  background: linear-gradient(180deg, rgba(242, 249, 248, 0.68), rgba(236, 246, 245, 0.62));
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.06);
  color: #58657a;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.8;
}

.model-combination-note-line + .model-combination-note-line {
  margin-top: 0.18rem;
}

.model-note-card {
  margin: 0.55rem 0 1rem;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  border: 1px solid rgba(186, 214, 218, 0.68);
  background: linear-gradient(180deg, rgba(242, 249, 248, 0.72), rgba(236, 246, 245, 0.66));
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.06);
}

.model-note-card-tip {
  margin-top: 0.4rem;
}

.model-note-card-info {
  background: linear-gradient(180deg, rgba(245, 250, 249, 0.7), rgba(239, 247, 246, 0.64));
}

.model-note-card-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f8b84;
}

.model-note-card-title .fa,
.model-note-inline .fa {
  color: #2f89ff;
}

.model-note-list {
  margin: 0;
  padding-left: 1.35rem;
  color: #58657a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.9;
}

.model-note-list li + li {
  margin-top: 0.2rem;
}

.model-note-list strong {
  color: #15928d;
  font-weight: 800;
}

.model-note-text {
  color: #58657a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.82;
}

.model-note-inline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #58657a;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.75;
}

.model-note-inline .fa {
  flex: 0 0 auto;
  font-size: 1.12rem;
  line-height: 1;
}

.overview-filter-note {
  margin-top: 0.75rem;
  margin-bottom: 0.7rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.status-badge.ok {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
}

.status-badge.warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.16);
}

.status-badge.danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
}

.btn-run,
.download-panel .btn {
  background: linear-gradient(135deg, #0f766e, #0b948a);
  border: none;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 25px rgba(15, 118, 110, 0.25);
}

.btn-run:hover,
.download-panel .btn:hover {
  background: linear-gradient(135deg, #0b5f59, #0b7f77);
  color: #fff;
}

.download-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0.5rem 0 0.2rem;
}

#results-comparison_card,
#results-selector_card,
#results-details_tabs {
  display: block;
  margin-bottom: 0.55rem;
}

#results-selector_card,
.selector-card,
.selector-card.bslib-card {
  overflow: hidden !important;
  position: relative;
  z-index: 30;
}

#results-details_tabs,
.comparison-card {
  position: relative;
  z-index: 1;
}

#results-selector_card {
  margin-bottom: 0.28rem;
}

.comparison-card,
.comparison-card.bslib-card {
  overflow: hidden !important;
  min-height: 0;
}

.selector-card,
.selector-card.bslib-card {
  min-height: 0;
  border-radius: 22px !important;
}

.comparison-card .card-body,
.selector-card .card-body {
  padding-top: 1rem;
}

.comparison-card .card-body {
  padding-bottom: 1.1rem;
  overflow: hidden !important;
}

.selector-card .card-body {
  padding-bottom: 0.75rem;
}

#results-details_tabs > .card,
#results-details_tabs > .bslib-card,
#results-details_tabs .tab-content,
#results-details_tabs .nav-tabs {
  border-radius: 22px;
}

#results-details_tabs > .card,
#results-details_tabs > .bslib-card {
  overflow: hidden !important;
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.97), rgba(246, 242, 234, 0.96)),
    var(--panel-soft);
}

#results-details_tabs .tab-content {
  overflow: hidden;
}

.comparison-table-shell {
  max-height: 620px;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 14px;
}

.comparison-table-shell .dataTables_wrapper {
  margin-bottom: 0;
}

.selector-card {
  box-shadow: 0 14px 28px rgba(148, 163, 184, 0.11);
}

#results-details_tabs > .card,
#results-details_tabs .nav.nav-tabs {
  margin-top: 0;
}

.selector-card .shiny-input-container {
  margin-bottom: 0;
}

.results-selector-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.results-selector-field {
  min-width: 0;
}

.results-selector-field .shiny-input-container,
.results-selector-field .form-group,
.results-selector-field .form-select {
  width: 100%;
  max-width: 100%;
}

.results-selector-label {
  display: inline-block;
  margin-bottom: 0.7rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.results-selector-required {
  color: #ef4444;
}

.results-selector-tip {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.15rem;
}

.results-selector-tip .model-note-card-title {
  margin-bottom: 0.45rem;
}

.results-selector-tip-text {
  color: #5b6472;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.75;
}

.card.bslib-card .card-header {
  font-weight: 800;
  color: #0f172a;
  font-size: 1.1rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(180deg, rgba(249, 245, 238, 0.98), rgba(244, 239, 231, 0.94));
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-tabs .nav-link.active {
  color: #0f766e;
  font-weight: 700;
}

.nav-tabs .nav-link {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f766e;
  padding: 0.95rem 1.05rem;
}

.shiny-input-container {
  margin-bottom: 1.15rem;
}

.form-control,
.form-select,
.selectize-input,
.selectize-control.single .selectize-input {
  min-height: 58px;
  border-radius: 18px;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.72);
  background: rgba(250, 247, 241, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.selector-card .form-select {
  min-height: 72px;
  font-size: 1.18rem;
  padding-inline: 1.2rem 3.1rem;
  border-radius: 26px;
}

.results-selector-field .form-select {
  border-color: rgba(45, 188, 179, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 0 1px rgba(45, 188, 179, 0.12);
}

.results-selector-field .form-select:focus {
  border-color: rgba(45, 188, 179, 0.82);
  box-shadow:
    0 0 0 0.18rem rgba(45, 188, 179, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

@media (max-width: 1080px) {
  .results-selector-grid {
    grid-template-columns: 1fr;
  }
}

.selectize-control,
.selectize-control.single,
.selectize-control.multi,
.shiny-input-container > div {
  width: 100%;
}

.selectize-control.multi .selectize-input {
  padding: 0.7rem 0.95rem 0.5rem;
}

.mapping-multi-select .selectize-control.multi {
  position: relative;
}

.mapping-multi-select .selectize-control.multi::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  margin-top: -4px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #556070;
  pointer-events: none;
}

.mapping-multi-select .selectize-control.multi .selectize-input {
  min-height: 58px;
  border-radius: 18px;
  padding: 0.75rem 3rem 0.55rem 0.95rem !important;
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.72);
  background: rgba(250, 247, 241, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mapping-multi-select .selectize-control.multi .selectize-input > input {
  min-width: 7rem !important;
  flex: 1 0 7rem;
  margin: 0 !important;
  line-height: 1.4;
}

.mapping-multi-select .selectize-control.multi .selectize-input.has-items > input {
  min-width: 5rem !important;
}

.mapping-multi-select .selectize-control.multi .selectize-input > div,
.mapping-multi-select .selectize-control.multi .selectize-input .item {
  margin: 0 !important;
  padding: 0.34rem 0.72rem;
  border-radius: 12px;
  background: rgba(241, 236, 227, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.92);
  color: #334155;
  line-height: 1.35;
}

.mapping-multi-select .selectize-control.plugin-remove_button .item .remove {
  border-left: 1px solid rgba(148, 163, 184, 0.42);
  color: #64748b;
  padding-left: 0.55rem;
  margin-left: 0.45rem;
}

.control-label,
.radio label,
.checkbox label {
  font-size: 0.98rem;
}

.overview-filter-card .shiny-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.overview-filter-card .radio {
  margin: 0;
  width: 100%;
}

.overview-filter-card .radio label {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: flex-start;
  gap: 0.85rem;
  white-space: normal;
  line-height: 1.6;
  width: 100%;
}

.overview-filter-card .radio input[type="radio"] {
  margin-top: 0.18rem;
  flex: 0 0 auto;
}

.upload-input-shell .input-group {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(248, 244, 236, 0.98);
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.1);
}

.upload-input-shell .input-group-btn,
.upload-input-shell .form-control {
  width: 100% !important;
}

.upload-input-shell .input-group-btn {
  flex: none !important;
  min-width: 0;
  max-width: none !important;
  display: flex !important;
}

.upload-input-shell .btn,
.upload-input-shell .form-control {
  min-height: 68px;
  height: 68px;
  font-size: 1.08rem;
}

.upload-input-shell .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(248, 244, 236, 0.98), rgba(243, 238, 229, 0.98));
  border: none;
  border-right: 1px solid rgba(100, 116, 139, 0.36);
  color: #c2410c;
  font-weight: 700;
}

.upload-input-shell .btn-file {
  min-height: 68px !important;
  height: 68px !important;
}

.upload-input-shell .form-control {
  flex: none !important;
  min-width: 0;
  max-width: none !important;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  color: #64748b;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  text-overflow: ellipsis;
}

.model-primary-label {
  font-size: 1rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 0.8rem;
}

.model-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.05rem;
  align-items: start;
  margin-bottom: 1rem;
}

.model-primary-grid .shiny-input-container {
  margin-bottom: 0;
}

.model-primary-grid .control-label,
.input-stack .control-label {
  display: inline-block;
  min-height: 1.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #334155;
}

.model-primary-grid .selectize-control {
  margin-bottom: 0;
}

.irs--shiny {
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
}

.irs--shiny .irs-line,
.irs--shiny .irs-bar {
  height: 10px;
}

.irs--shiny .irs-handle {
  width: 20px;
  height: 20px;
  top: 19px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  min-height: 42px;
  border-radius: 12px;
  background: rgba(250, 247, 241, 0.96);
}

.dataTables_wrapper {
  font-size: 0.98rem;
  color: #334155;
}

.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable thead td {
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
  background: rgba(246, 241, 232, 0.98);
}

.dataTables_wrapper table.dataTable tbody td {
  vertical-align: middle;
  line-height: 1.55;
  background: transparent;
}

.dataTables_wrapper table.dataTable,
.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollBody {
  background: transparent !important;
}

.dataTables_wrapper table.dataTable.stripe tbody tr.odd,
.dataTables_wrapper table.dataTable.display tbody tr.odd,
.dataTables_wrapper table.dataTable tbody tr.odd {
  background: rgba(248, 244, 236, 0.92);
}

.dataTables_wrapper table.dataTable.stripe tbody tr.even,
.dataTables_wrapper table.dataTable.display tbody tr.even,
.dataTables_wrapper table.dataTable tbody tr.even {
  background: rgba(244, 239, 231, 0.82);
}

.dataTables_wrapper .dataTables_scroll {
  overflow: auto;
}

.comparison-card .dataTables_wrapper .dataTables_scrollBody {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.modal-content {
  border: none;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
}

.fit-success-modal-card {
  padding: 2rem 2rem 1.65rem;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.96)),
    #fff;
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.fit-success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.11);
  color: #0f766e;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.fit-success-title {
  margin: 0 0 0.65rem;
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
}

.fit-success-text {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 1.1rem;
  line-height: 1.75;
  color: #334155;
}

.fit-success-actions {
  margin-top: 1.4rem;
}

.fit-success-btn {
  min-width: 144px;
  padding-inline: 1.4rem;
}

#shiny-notification-fit_progress.shiny-notification,
#shiny-notification-fit_progress.shiny-notification.shiny-notification-message {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: min(540px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  z-index: 2500 !important;
}

#shiny-notification-fit_progress .shiny-notification-content,
#shiny-notification-fit_progress .shiny-notification-content-text {
  width: 100%;
}

#shiny-notification-fit_progress .shiny-notification-content-action {
  display: none;
}

.fit-progress-card {
  width: 100%;
  min-width: 0;
  padding: 1.25rem 1.35rem 1.15rem;
  border-radius: 24px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.98), rgba(245, 241, 233, 0.96)),
    #fff;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
}

.fit-progress-track {
  width: 100%;
  height: 22px;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.68);
  overflow: hidden;
}

.fit-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #19a6a2);
  transition: width 0.25s ease;
}

.fit-progress-body {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

.fit-progress-heading {
  font-size: 1.04rem;
  font-weight: 900;
  color: #1f2937;
  line-height: 1.35;
}

.fit-progress-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  color: #475569;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
}

.fit-progress-count {
  color: #0f766e;
}

.fit-progress-cancel {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #c2410c;
  font-weight: 800;
  padding: 0.6rem 1rem;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.fit-progress-cancel:hover,
.fit-progress-cancel:focus {
  background: rgba(255, 247, 237, 0.98);
  color: #9a3412;
  border-color: rgba(251, 191, 36, 0.42);
}

.fit-progress-cancelling {
  color: #b45309;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 1400px) {
  .app-top-card {
    flex-direction: column;
    align-items: stretch;
  }

  .top-user-card {
    align-self: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 1200px) {
  .model-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #shiny-notification-fit_progress.shiny-notification,
  #shiny-notification-fit_progress.shiny-notification.shiny-notification-message {
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .fit-progress-card {
    padding: 1rem 1rem 0.95rem;
  }

  .login-shell {
    padding: 1.4rem 1rem 1.8rem;
    gap: 1.3rem;
  }

  .login-hero h1 {
    font-size: 2.35rem;
  }

  .login-copy {
    font-size: 1rem;
  }

  .login-card .card-body {
    padding: 1.5rem 1.1rem 1.2rem;
  }

  .app-page-shell {
    padding: 1rem 0.75rem 1.6rem;
  }

  .app-top-card {
    padding: 1.15rem 1rem;
    border-radius: 26px;
  }

  .app-top-main {
    gap: 0.95rem;
  }

  .top-logo-pill {
    min-width: 0;
    width: 100%;
    letter-spacing: 0.3em;
  }

  .top-divider,
  .top-user-divider {
    display: none;
  }

  .top-title-main {
    font-size: 2rem;
  }

  .top-nav-group {
    width: 100%;
    justify-content: space-between;
  }

  .app-nav-button {
    flex: 1 1 calc(50% - 0.3rem);
    justify-content: center;
  }

  .app-nav-button.is-active::after {
    bottom: -10px;
  }

  .top-user-card {
    flex-wrap: wrap;
  }

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

  .upload-card-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .sample-download-link {
    width: 100%;
    justify-content: center;
    padding-top: 0.45rem;
  }

  .upload-input-shell .input-group {
    grid-template-columns: 1fr;
  }

  .upload-input-shell .input-group-btn {
    flex: none !important;
    min-width: 0;
  }

  .upload-input-shell .btn,
  .upload-input-shell .form-control {
    border-radius: 0;
  }

  .upload-input-shell .form-control {
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
  }

  .model-primary-grid {
    grid-template-columns: 1fr;
  }

  .fit-success-modal-card {
    padding: 1.35rem 1.1rem 1.2rem;
  }

  .fit-success-title {
    font-size: 1.55rem;
  }

  .fit-success-text {
    font-size: 1rem;
  }
}
