/* CPE OJ design system: minimal editorial interface. */
:root {
  --oj-bg: #f7f7f5;
  --oj-panel: #ffffff;
  --oj-panel-muted: #f3f3f0;
  --oj-border: #dfdfda;
  --oj-border-strong: #c7c7c1;
  --oj-text: #1c1c1a;
  --oj-heading: #111110;
  --oj-muted: #686864;
  --oj-primary: #2563eb;
  --oj-primary-dark: #1d4ed8;
  --oj-primary-soft: #f3f6ff;
  --oj-accent: #2563eb;
  --oj-accent-dark: #1d4ed8;
  --oj-accent-soft: #f3f6ff;
  --oj-success: #168a4a;
  --oj-success-soft: #eaf8ef;
  --oj-warning: #a16207;
  --oj-warning-soft: #fff7dd;
  --oj-danger: #c2413c;
  --oj-danger-soft: #fff0ef;
  --oj-info: #0369a1;
  --oj-info-soft: #eaf7ff;
  --oj-radius: 4px;
  --oj-control-radius: 4px;
  --oj-shadow-sm: none;
  --oj-shadow-md: 0 8px 22px rgba(17, 17, 16, 0.08);
  --oj-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

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

html {
  min-height: 100%;
}

body {
  background: var(--oj-bg);
  color: var(--oj-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--oj-heading);
  letter-spacing: -0.012em;
}

a {
  color: var(--oj-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--oj-primary-dark);
}

:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--oj-primary);
  outline-offset: 2px;
}

.text-muted {
  color: var(--oj-muted) !important;
}

.min-w-0 {
  min-width: 0 !important;
}

.oj-page {
  max-width: 1240px;
}

.oj-main {
  padding-bottom: 48px;
  padding-top: 32px;
}

/* Navigation */
.oj-navbar {
  background: rgba(247, 247, 245, 0.96);
  border-bottom: 1px solid var(--oj-border);
  min-height: 68px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand {
  align-items: center;
  color: var(--oj-heading);
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: 0;
  letter-spacing: -0.02em;
}

.navbar-brand:hover {
  color: var(--oj-heading);
}

.oj-brand-dot {
  color: var(--oj-primary);
}

.oj-primary-nav {
  gap: 4px;
  margin-left: 22px;
}

.nav-link {
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px !important;
}

.nav-link:hover,
.nav-link:focus {
  background: transparent;
  color: var(--oj-primary-dark);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  background: transparent;
  border-bottom-color: currentColor;
  color: var(--oj-primary-dark);
}

.oj-account-nav {
  align-items: center;
  gap: 6px;
}

.oj-nav-cta {
  align-items: center;
  display: inline-flex;
  min-height: 44px !important;
  padding: 8px 16px;
}

.oj-user-menu-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 9px;
  max-width: 240px;
}

.oj-user-avatar {
  color: var(--oj-heading);
  display: inline;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  height: auto;
  width: auto;
}

.oj-user-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oj-user-menu {
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-radius);
  box-shadow: var(--oj-shadow-md);
  min-width: 190px;
  padding: 7px;
}

.oj-user-menu .dropdown-item {
  border-radius: 2px;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 11px;
}

.oj-user-menu .dropdown-item:hover,
.oj-user-menu .dropdown-item:focus,
.oj-user-menu .dropdown-item.active,
.oj-user-menu .dropdown-item[aria-current="page"] {
  background: var(--oj-primary-soft);
  color: var(--oj-primary-dark);
}

/* Surfaces and headings */
.oj-panel {
  background: var(--oj-panel);
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-radius);
  box-shadow: var(--oj-shadow-sm);
  min-width: 0;
}

.oj-panel-interactive {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.oj-panel-interactive:hover {
  border-color: var(--oj-border-strong);
  box-shadow: none;
  transform: none;
}

.oj-page-heading {
  align-items: flex-end;
  border-bottom: 1px solid var(--oj-border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.oj-page-heading h1 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800 !important;
  line-height: 1.18;
  margin-bottom: 5px !important;
}

.oj-page-heading-subtitle {
  color: var(--oj-muted);
  max-width: 720px;
}

.oj-section-heading {
  align-items: flex-end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.oj-section-heading h2 {
  margin-bottom: 3px;
}

.oj-section-title {
  color: var(--oj-heading);
  font-size: 19px;
  font-weight: 750;
  margin-bottom: 12px;
}

.oj-eyebrow {
  color: var(--oj-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.oj-empty-state {
  color: var(--oj-muted);
  padding: 38px 24px;
  text-align: center;
}

.oj-empty-state .fw-semibold {
  color: var(--oj-heading);
  font-size: 16px;
}

/* Buttons and forms */
.btn {
  align-items: center;
  border-radius: var(--oj-control-radius);
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
}

.btn-sm {
  min-height: 44px;
}

.btn-primary {
  --bs-btn-bg: var(--oj-primary);
  --bs-btn-border-color: var(--oj-primary);
  --bs-btn-hover-bg: var(--oj-primary-dark);
  --bs-btn-hover-border-color: var(--oj-primary-dark);
  --bs-btn-active-bg: var(--oj-primary-dark);
  --bs-btn-active-border-color: var(--oj-primary-dark);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-color: #ffffff;
  box-shadow: none;
}

.btn-outline-secondary {
  --bs-btn-color: #344054;
  --bs-btn-border-color: #c7d2e0;
  --bs-btn-hover-bg: #f2f4f7;
  --bs-btn-hover-border-color: #98a2b3;
  --bs-btn-hover-color: var(--oj-heading);
}

.btn-outline-danger {
  --bs-btn-color: var(--oj-danger);
  --bs-btn-border-color: #f0b8b5;
  --bs-btn-hover-bg: var(--oj-danger);
  --bs-btn-hover-border-color: var(--oj-danger);
}

.form-label {
  color: #344054;
  display: block;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 7px;
}

.form-text {
  color: var(--oj-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 7px;
}

.form-text ul {
  margin: 0;
  padding-left: 18px;
}

input[type="text"],
input:not([type]),
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  background: #ffffff;
  border: 1px solid #c7d2e0;
  border-radius: var(--oj-control-radius);
  color: var(--oj-text);
  min-height: 44px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

textarea {
  min-height: 120px;
}

input[type="text"]:focus,
input:not([type]):focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--oj-primary);
  box-shadow: var(--oj-focus);
  outline: 0;
}

.form-check {
  align-items: flex-start;
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  min-height: 24px;
  padding-left: 0;
}

.form-check input[type="checkbox"] {
  flex: 0 0 auto;
  height: 17px;
  margin: 3px 0 0;
  min-height: 0;
  width: 17px;
}

.form-check .form-check-label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  margin: 0;
}

.oj-form-grid {
  display: grid;
  gap: 17px;
}

.oj-form-actions {
  align-items: center;
  border-top: 1px solid var(--oj-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 18px;
}

.oj-combobox {
  position: relative;
}

.oj-combobox-menu {
  background: #ffffff;
  border: 1px solid var(--oj-border-strong);
  border-radius: var(--oj-control-radius);
  box-shadow: var(--oj-shadow-md);
  display: none;
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 1060;
}

.oj-combobox.open .oj-combobox-menu {
  display: block;
}

.oj-combobox-option {
  cursor: pointer;
  padding: 10px 12px;
}

.oj-combobox-option:hover,
.oj-combobox-option.active {
  background: var(--oj-primary-soft);
  color: var(--oj-primary-dark);
}

.oj-combobox-empty {
  color: var(--oj-muted);
  padding: 10px 12px;
}

.alert {
  border-radius: var(--oj-radius);
}

/* Authentication */
.oj-auth-shell {
  align-items: start;
  display: grid;
  justify-items: center;
  min-height: calc(100vh - 150px);
  padding: 30px 0;
}

.oj-auth-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 30px 32px;
  width: min(480px, 100%);
}

.oj-auth-title {
  color: var(--oj-heading);
  font-size: 27px;
  font-weight: 820;
  line-height: 1.2;
  margin-bottom: 8px;
}

.oj-auth-subtitle {
  color: var(--oj-muted);
  margin-bottom: 24px;
}

.oj-auth-card .mb-3 {
  margin-bottom: 16px !important;
}

/* Badges and states */
.oj-badge {
  align-items: center;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  color: var(--oj-text) !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.2;
  padding: 0;
  white-space: nowrap;
}

.oj-badge-success,
.oj-badge-easy,
.oj-badge-difficulty-easy {
  background: var(--oj-success-soft);
  color: #146c3a;
}

.oj-badge-warning,
.oj-badge-difficulty-medium {
  background: var(--oj-warning-soft);
  color: #854d0e;
}

.oj-badge-danger,
.oj-badge-difficulty-hard {
  background: var(--oj-danger-soft);
  color: #a43531;
}

.oj-badge-info {
  background: var(--oj-info-soft);
  color: var(--oj-info);
}

.oj-badge-neutral {
  background: transparent;
  color: var(--oj-text);
}

.oj-badge-button {
  border: 0;
  cursor: pointer;
  min-height: 44px;
}

.oj-badge-button:hover,
.oj-badge-button:focus {
  filter: brightness(0.96);
}

/* Statistics */
.oj-stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.oj-stat {
  background: #ffffff;
  min-height: 104px;
  padding: 18px;
}

.oj-stat-label {
  color: var(--oj-muted);
  font-size: 13px;
  font-weight: 680;
}

.oj-stat-value {
  color: var(--oj-heading);
  display: block;
  font-size: 28px;
  font-weight: 830;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 7px;
}

.oj-metric-strip {
  border-bottom: 1px solid var(--oj-border);
  border-top: 1px solid var(--oj-border);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.oj-metric-strip-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.oj-metric {
  min-width: 0;
  padding: 20px;
}

.oj-metric + .oj-metric {
  border-left: 1px solid var(--oj-border);
}

.oj-stat-value-text {
  font-size: 16px;
  line-height: 1.4;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

/* Tables */
.oj-table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f4f4f1;
  color: var(--oj-text);
  font-size: 14px;
}

.oj-table thead th {
  background: var(--oj-bg);
  border-bottom: 1px solid var(--oj-border);
  color: #667085;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-transform: uppercase;
  vertical-align: middle;
}

.oj-table tbody td {
  border-color: var(--oj-border);
  padding: 14px 16px;
  vertical-align: middle;
}

.oj-table tbody tr:hover > td {
  background: #f4f4f1;
}

.oj-table td {
  overflow-wrap: anywhere;
}

.oj-front-table .oj-table-align-center {
  text-align: center;
}

.oj-table-scroll {
  max-height: 560px;
  overflow: auto;
}

.oj-table-scroll-sm {
  max-height: 320px;
}

.oj-table-scroll-lg {
  max-height: 680px;
}

.oj-table-scroll .oj-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.oj-table-fixed {
  table-layout: fixed;
}

.oj-table-roomy {
  table-layout: auto;
}

.oj-cell-primary,
.oj-cell-secondary {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.oj-cell-primary {
  color: var(--oj-heading);
  font-weight: 740;
}

.oj-cell-secondary {
  color: var(--oj-muted);
  font-size: 12px;
  margin-top: 2px;
}

.oj-line-clamp-2,
.oj-line-clamp-3 {
  -webkit-box-orient: vertical;
  display: -webkit-box !important;
  overflow: hidden;
}

.oj-line-clamp-2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.oj-line-clamp-3 {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.oj-table-actions {
  max-width: 100%;
  white-space: normal;
}

td.oj-table-actions {
  min-width: 164px;
  padding-right: 18px !important;
  text-align: right;
  width: 1%;
}

.oj-table-actions-wide {
  min-width: 240px;
  width: 1%;
}

.oj-table-actions > .btn,
.oj-table-actions > form {
  margin: 4px 0 4px 7px;
  vertical-align: middle;
}

.oj-table-actions form {
  display: inline-flex;
}

.oj-table-card-label {
  color: var(--oj-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.oj-tag-list {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.oj-table .oj-tag-list {
  max-height: 64px;
  max-width: 290px;
  overflow: hidden;
}

.oj-table .oj-tag-list .oj-badge {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.oj-data-surface {
  border-bottom: 1px solid var(--oj-border);
  border-top: 1px solid var(--oj-border);
  min-width: 0;
  overflow: hidden;
}

.oj-filter-bar {
  background: transparent;
  border-bottom: 1px solid var(--oj-border);
  border-top: 1px solid var(--oj-border);
}

.oj-editorial-document {
  margin: 0 auto;
  max-width: 760px;
  padding: 30px 0;
}

.oj-editorial-document h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.045em;
}

.oj-editorial-document p {
  line-height: 1.8;
}

.oj-meta-text,
.oj-meta-status {
  color: var(--oj-text);
  font-size: 13px;
  font-weight: 700;
}

.oj-meta-link,
.oj-inline-meta a {
  color: var(--oj-text);
  text-decoration: underline;
  text-decoration-color: transparent;
}

.oj-meta-link:hover,
.oj-inline-meta a:hover {
  color: var(--oj-primary);
  text-decoration-color: currentColor;
}

.oj-inline-meta {
  align-items: baseline;
  color: var(--oj-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
}

.oj-completion-mark {
  color: var(--oj-success);
  font-size: 17px;
  font-weight: 800;
}

.oj-tabular-number {
  color: var(--oj-heading);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.oj-status-code {
  align-items: center;
  color: var(--oj-heading);
  display: inline-flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.oj-status-code:hover,
.oj-status-code:focus {
  color: var(--oj-heading);
  text-decoration-color: currentColor;
}

.oj-reference-link {
  color: var(--oj-heading);
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Pagination */
.pagination {
  flex-wrap: wrap;
  gap: 4px;
}

.pagination .page-link {
  align-items: center;
  border-color: var(--oj-border);
  border-radius: var(--oj-radius) !important;
  color: #344054;
  display: inline-flex;
  font-weight: 650;
  justify-content: center;
  min-height: 44px;
  min-width: 36px;
  text-align: center;
}

.pagination .page-link:hover {
  background: var(--oj-primary-soft);
  color: var(--oj-primary-dark);
}

.pagination .disabled .page-link {
  background: transparent;
  color: #98a2b3;
}

/* Tabs and compact lists */
.oj-tabs {
  border-bottom-color: var(--oj-border);
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.oj-tabs .nav-link {
  border-radius: 0;
  color: var(--oj-muted);
  font-weight: 720;
  white-space: nowrap;
}

.oj-tabs .nav-link.active {
  background: transparent;
  border-color: transparent transparent currentColor;
  color: var(--oj-primary-dark);
}

.oj-compact-list {
  display: grid;
  gap: 0;
}

.oj-compact-list-item {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
  padding: 13px 0;
}

.oj-compact-list-item:last-child {
  border-bottom: 0;
}

.oj-compact-list-main {
  min-width: 0;
}

.oj-compact-list-title {
  color: var(--oj-heading);
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oj-compact-list-item:hover {
  background: transparent;
}

.oj-solved-grid {
  display: grid;
  gap: 0;
}

.oj-solved-item {
  align-items: center;
  border-bottom: 1px solid var(--oj-border);
  color: inherit;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 15px 0;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.oj-solved-item:hover {
  background: transparent;
  border-color: var(--oj-border-strong);
  color: inherit;
}

.oj-solved-main {
  min-width: 0;
}

.oj-solved-title {
  color: var(--oj-heading);
  font-weight: 740;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oj-solved-metrics {
  color: var(--oj-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 9px;
  justify-content: flex-end;
  white-space: nowrap;
}

/* Profile */
.oj-profile-shell {
  display: grid;
  gap: 22px;
}

.oj-profile-hero {
  align-items: center;
  background: transparent;
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 1px solid var(--oj-border);
  box-shadow: none;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 8px 0 24px;
}

.oj-profile-identity {
  align-items: center;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.oj-profile-avatar {
  color: var(--oj-heading);
  display: block;
  flex: 0 0 auto;
  font-size: 42px;
  font-weight: 850;
  height: auto;
  line-height: 1;
  width: auto;
}

.oj-profile-name {
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 830;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.oj-profile-meta {
  color: var(--oj-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 5px;
}

.oj-profile-tabs {
  border-bottom: 1px solid var(--oj-border);
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 4px;
  scrollbar-width: thin;
}

.oj-profile-tab {
  border-bottom: 3px solid transparent;
  color: #475467;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 760;
  padding: 11px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.oj-profile-tab:hover {
  color: var(--oj-primary-dark);
}

.oj-profile-tab.active,
.oj-profile-tab[aria-current="page"] {
  border-bottom-color: var(--oj-primary);
  color: var(--oj-primary-dark);
}

.oj-profile-content-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.oj-profile-actions {
  display: grid;
  gap: 10px;
}

.oj-profile-actions .btn {
  justify-content: flex-start;
}

.oj-profile-activity-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
}

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

.oj-settings-stack {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 820px;
  width: 100%;
}

.oj-settings-section {
  border: 0;
  border-bottom: 1px solid var(--oj-border);
  border-radius: 0;
  box-shadow: none;
  padding: 24px 0 30px;
}

.oj-settings-section-header {
  border-bottom: 1px solid var(--oj-border);
  margin: -2px 0 20px;
  padding-bottom: 15px;
}

.oj-settings-section-header h2 {
  font-size: 19px;
  font-weight: 780;
  margin-bottom: 4px;
}

.oj-verification-callout {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 6px 0;
}

.oj-verification-callout.is-verified {
  background: transparent;
  border: 0;
}

.oj-login-method {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 0;
}

.oj-login-method:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.oj-danger-zone {
  background: transparent;
  border-color: #efc2bf;
}

/* Rich content and code */
.oj-pre {
  background: #f8fafc;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-control-radius);
  color: #344054;
  font-size: 13px;
  margin: 0;
  padding: 15px;
  white-space: pre-wrap;
}

.oj-code-pre {
  background: #101828;
  border-color: #1d2939;
  color: #e4e7ec;
  overflow-x: auto;
  white-space: pre;
}

.oj-rich-content {
  color: #344054;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.oj-rich-content > :last-child {
  margin-bottom: 0;
}

.oj-rich-content img {
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-radius);
  display: block;
  height: auto;
  margin: 18px 0;
  max-width: 100%;
}

.oj-rich-content table {
  border-collapse: collapse;
  display: block;
  margin: 18px 0;
  max-width: 100%;
  overflow-x: auto;
  width: max-content;
}

.oj-rich-content th,
.oj-rich-content td {
  border: 1px solid var(--oj-border);
  padding: 9px 11px;
}

.oj-rich-content th {
  background: #f8fafc;
  color: var(--oj-heading);
  font-weight: 720;
}

.oj-rich-content code {
  background: #f2f4f7;
  border-radius: var(--oj-radius);
  color: var(--oj-heading);
  font-size: 0.92em;
  padding: 2px 5px;
}

.oj-rich-content pre {
  background: #f8fafc;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-control-radius);
  overflow-x: auto;
  padding: 15px;
}

.oj-rich-content pre code {
  background: transparent;
  padding: 0;
}

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

.oj-image-item {
  align-items: center;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-radius);
  display: grid;
  gap: 14px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  padding: 13px;
}

.oj-image-item img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-radius);
  height: auto;
  object-fit: contain;
  width: 96px;
}

.oj-image-meta {
  min-width: 0;
}

/* Problem and submission helpers */
.oj-problem-detail-shell {
  align-items: flex-start;
}

.oj-problem-detail-main,
.oj-problem-detail-side {
  min-width: 0;
}

.oj-problem-title {
  color: var(--oj-heading);
  line-height: 1.16;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.oj-problem-tabs {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.oj-problem-tabs .nav-link {
  white-space: nowrap;
}

.oj-problem-user-panels {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.oj-performance-stack {
  display: grid;
  gap: 18px;
}

.oj-performance-progress {
  background: #e8edf3;
  height: 8px;
}

.oj-performance-progress .progress-bar {
  background: var(--oj-primary);
}

.oj-submission-source textarea {
  background: #101828;
  border-color: #1d2939;
  color: #e4e7ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  min-height: 300px;
  overflow: auto;
  resize: vertical;
  tab-size: 4;
  white-space: pre;
}

.oj-submission-link {
  color: inherit;
  text-decoration: none;
}

.oj-submission-link:hover {
  color: inherit;
}

.oj-submission-detail-row > td {
  background: #f8fafc;
  border-bottom: 1px solid #edf1f5;
}

.oj-submission-inline-detail {
  padding: 18px;
}

.oj-submission-inline-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
}

.oj-submission-inline-heading {
  color: var(--oj-heading);
  font-size: 13px;
  font-weight: 780;
  margin-bottom: 8px;
}

.oj-inline-toggle {
  color: var(--oj-primary);
  font-size: 12px;
  font-weight: 750;
  margin-left: -8px;
  padding-bottom: 0;
  padding-top: 2px;
  text-decoration: none;
}

.oj-filter-actions {
  align-self: end;
  display: flex;
  gap: 8px;
}

.oj-filter-actions .btn {
  min-height: 44px;
}

/* Responsive */
@media (max-width: 991.98px) {
  .oj-navbar {
    min-height: 64px;
  }

  .oj-navbar .navbar-toggler {
    background: #ffffff;
    border-color: var(--oj-border-strong);
    border-radius: var(--oj-radius);
    box-shadow: none;
    margin-left: auto;
    min-height: 44px;
    padding: 8px 10px;
  }

  .oj-navbar .navbar-toggler:focus {
    box-shadow: var(--oj-focus);
  }

  .oj-navbar .navbar-collapse {
    background: #ffffff;
    border: 1px solid var(--oj-border);
    border-radius: var(--oj-radius);
    box-shadow: 0 8px 22px rgba(17, 17, 16, 0.08);
    flex-basis: 100%;
    margin-bottom: 12px;
    padding: 10px;
    width: 100%;
  }

  .oj-navbar .navbar-nav {
    gap: 5px;
    margin-left: 0;
    width: 100%;
  }

  .oj-navbar .nav-item,
  .oj-navbar .nav-link,
  .oj-navbar .navbar-nav form,
  .oj-navbar .navbar-nav .btn {
    width: 100%;
  }

  .oj-navbar .nav-link {
    min-height: 44px;
    padding: 10px 12px !important;
  }

  .oj-account-nav {
    border-top: 1px solid var(--oj-border);
    margin-top: 8px;
    padding-top: 8px;
  }

  .oj-user-menu-toggle {
    max-width: none;
  }

  .oj-user-menu {
    border: 0;
    box-shadow: none;
    margin-top: 2px;
    width: 100%;
  }

  .oj-profile-content-grid,
  .oj-profile-activity-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 767.98px) {
  body {
    font-size: 14px;
  }

  .oj-main {
    padding-bottom: 34px;
    padding-top: 22px;
  }

  .oj-page-heading,
  .oj-page > .d-flex.justify-content-between.align-items-end.mb-3,
  .oj-manage-content > .d-flex.justify-content-between.align-items-end.mb-3 {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .oj-page-heading .btn {
    width: 100%;
  }

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

  .oj-stat-grid,
  .oj-home-stat-grid,
  .oj-problem-grid {
    grid-template-columns: 1fr;
  }

  .oj-profile-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 0 0 20px;
  }

  .oj-profile-avatar {
    font-size: 36px;
    height: auto;
    width: auto;
  }

  .oj-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oj-metric:nth-child(3) {
    border-left: 0;
  }

  .oj-metric:nth-child(n + 3) {
    border-top: 1px solid var(--oj-border);
  }

  .oj-metric-strip-compact .oj-metric:nth-child(n + 3) {
    border-top: 0;
  }

  .oj-profile-tabs {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .oj-search-row {
    grid-template-columns: 1fr;
  }

  .oj-search-row .btn {
    width: 100%;
  }

  .oj-settings-section {
    padding: 20px 0 26px;
  }

  .oj-verification-callout,
  .oj-login-method {
    align-items: stretch;
    flex-direction: column;
  }

  .oj-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .oj-form-actions .btn {
    width: 100%;
  }

  .oj-home-hero {
    padding: 22px;
  }

  .oj-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .oj-filter-actions .btn {
    width: 100%;
  }

  form.oj-panel > .row {
    --bs-gutter-x: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .oj-table-cards {
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 0;
  }

  .oj-table-cards thead {
    display: none;
  }

  .oj-table-cards tbody,
  .oj-table-cards tr,
  .oj-table-cards td {
    display: block;
    width: 100%;
  }

  .oj-table-cards tbody tr {
    background: transparent;
    border-bottom: 1px solid var(--oj-border);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow: visible;
    padding: 10px 0;
  }

  .oj-table-cards tbody tr.oj-submission-detail-row {
    border: 0;
    box-shadow: none;
    margin-top: 0;
  }

  .oj-table-cards td {
    border-bottom: 0;
    padding: 8px 0;
  }

  .oj-table-cards td:last-child {
    border-bottom: 0;
  }

  .oj-front-table.oj-table-cards td[data-label] {
    align-items: center;
  }

  .oj-table-cards td[data-label] {
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr);
  }

  .oj-front-table.oj-table-cards td.oj-table-align-center {
    text-align: left;
  }

  .oj-table-cards .oj-completion-cell:not(.is-complete) {
    display: none;
  }

  .oj-table-cards .oj-status-code {
    justify-content: flex-start;
  }

  .oj-front-table.oj-table-cards .oj-submission-submitted-actions {
    align-items: flex-start;
    justify-self: start;
  }

  .oj-table-cards td[data-label]::before {
    color: var(--oj-muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .oj-table-cards td.oj-table-actions,
  .oj-table-cards td[data-label].oj-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

  .oj-table-cards td.oj-table-actions::before {
    flex: 0 0 100%;
  }

  .oj-table-cards .oj-table-actions .btn,
  .oj-table-cards .oj-table-actions form {
    flex: 1 1 auto;
    margin: 0;
  }

  .oj-table-scroll {
    max-height: none;
  }

  .oj-compact-list-item {
    align-items: flex-start;
  }

  .oj-solved-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .oj-solved-metrics {
    justify-content: flex-start;
  }

  .oj-problem-detail-shell {
    display: block;
    margin-left: 0;
    margin-right: 0;
  }

  .oj-problem-detail-main,
  .oj-problem-detail-side {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .oj-problem-detail-side {
    margin-top: 22px;
  }

  .oj-problem-title {
    font-size: 25px;
  }

  .oj-problem-user-panels,
  .oj-submission-inline-grid {
    grid-template-columns: 1fr;
  }

  .oj-submission-source textarea {
    min-height: 240px;
  }

  .oj-image-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .oj-image-item img {
    width: 100%;
  }

  .pagination {
    justify-content: center !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
