* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-muted: #f7f8fa;
  --border: #e7e9ee;
  --text: #2d2f33;
  --text-soft: #6d7178;
  --accent: #ffdd2d;
  --accent-hover: #f5d115;
  --danger: #ef5350;
  --danger-soft: #fff2f1;
  --link: #3873ff;
  --shadow: 0 10px 30px rgba(18, 24, 40, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: radial-gradient(circle at top, #fafbfc 0%, var(--bg) 55%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: var(--panel);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: inset 0 0 0 1px var(--border);
}

button:hover {
  transform: translateY(-1px);
  background: #fafafa;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

button.primary {
  background: var(--accent);
  box-shadow: none;
}

button.primary:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: var(--panel);
}

button.danger {
  background: var(--danger-soft);
  color: #c62828;
  box-shadow: none;
}

button.danger:hover {
  background: #ffe6e4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f5f8;
  color: #9aa0aa;
  border-color: #e5e8ee;
  cursor: not-allowed;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 221, 45, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 221, 45, 0.22);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 233, 238, 0.8);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
}

.brand-logo {
  width: 29px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
}

.brand-title {
  display: inline-block;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.topbar-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(248, 249, 251, 0.9);
  box-shadow: inset 0 0 0 1px var(--border);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-bottom: 28px;
}

.landing-intro {
  text-align: center;
  max-width: 760px;
  margin: 48px auto 32px;
  padding: 0 16px;
}

.landing-intro h1 {
  margin-bottom: 14px;
}

.landing-text {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.55;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.hero-card,
.section,
.card,
.table-shell {
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
}

.hero-card-wide {
  grid-column: 1 / -1;
}

.hero-card.muted {
  background: linear-gradient(180deg, #f8f9fb 0%, #f1f3f6 100%);
}

.hero-card-action {
  display: block;
  color: inherit;
  background: linear-gradient(135deg, #ffe97a 0%, #ffdd2d 52%, #f4c800 100%);
  box-shadow: 0 18px 40px rgba(255, 221, 45, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-card-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(255, 221, 45, 0.36);
}

.hero-card-action .hero-meta {
  background: rgba(255, 255, 255, 0.48);
  color: rgba(45, 47, 51, 0.82);
}

.hero-card-action .hero-text {
  color: rgba(45, 47, 51, 0.82);
}

.hero-action-link {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(45, 47, 51, 0.08);
  font-weight: 700;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-text {
  margin-top: 14px;
  max-width: 680px;
  color: var(--text-soft);
  font-size: 15px;
}

.status-panel {
  margin-top: 18px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.hero-stat {
  background: var(--panel-muted);
  border-radius: 18px;
  padding: 16px;
}

.hero-stat strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.hero-stat span {
  color: var(--text-soft);
  font-size: 12px;
}

.section {
  padding: 26px;
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-header p {
  color: var(--text-soft);
  margin-top: 6px;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.contest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.contest-link {
  display: block;
  color: inherit;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.select-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.contest-card {
  padding: 22px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contest-link:hover .contest-card {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(18, 24, 40, 0.1);
}

.contest-card h3 {
  margin-bottom: 8px;
}

.muted {
  color: var(--text-soft);
}

.field {
  margin-bottom: 16px;
}

.select-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.select-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.select-card-body {
  height: 100%;
  min-height: 180px;
  padding: 22px;
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-card-body.select-card-body-compact {
  min-height: 120px;
  padding: 16px;
}

.select-card-body.select-card-body-compact .hero-meta {
  margin-bottom: 10px;
}

.select-card-body.select-card-body-compact h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.select-card-body.select-card-body-compact .hero-text {
  margin-top: 0;
  font-size: 13px;
}

.select-card:hover .select-card-body {
  transform: translateY(-1px);
}

.select-card input:checked + .select-card-body {
  border-color: rgba(255, 221, 45, 0.95);
  box-shadow: 0 18px 34px rgba(18, 24, 40, 0.1);
}

.marker-row {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.toggle-card {
  margin-bottom: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.groups-toggle-btn {
  align-self: flex-start;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #dde2ea;
  transition: background 0.15s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(18, 24, 40, 0.14);
  transition: transform 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 4px rgba(255, 221, 45, 0.22);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 22px;
}

.question-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.question-main {
  flex: 1;
  min-width: 0;
}

.question-title {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
}

.question-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.question-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-muted);
  color: var(--text-soft);
}

.tag.EXACTLY {
  background: #edf7ef;
  color: #1f7a35;
}

.tag.CHOOSING {
  background: #edf4ff;
  color: #356bd8;
}

.tag.SMART {
  background: #fff6da;
  color: #9a6d00;
}

.tag.status-tag.RUNNING {
  background: #fff4cf;
  color: #9b6a00;
}

.tag.status-tag.FINISHED {
  background: #edf7ef;
  color: #1f7a35;
}

.tag.status-tag.PARTIAL {
  background: #edf4ff;
  color: #356bd8;
}

.tag.score-tag {
  background: #fff8cf;
  color: #6d5900;
}

.detail-list {
  margin-top: 14px;
  color: var(--text-soft);
}

.detail-list strong {
  color: var(--text);
}

.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-muted);
  font-size: 12px;
  font-weight: 600;
}

.chip.CORRECT {
  background: #edf7ef;
  color: #1f7a35;
}

.chip.INCORRECT {
  background: #fff1f0;
  color: #c43d37;
}

.chip.OPTIONAL {
  background: #f3f4f6;
  color: #646b75;
}

.table-shell {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  text-align: left;
  padding: 18px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: #fbfbfc;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.score-null {
  color: #9aa1aa;
}

.score-low {
  background: #fff2f1;
}

.score-mid {
  background: #fff8df;
}

.score-high {
  background: #eef9ef;
}

.comment-cell {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-soft);
  font-size: 12px;
}

.answer-cell {
  position: relative;
  padding-top: 34px;
}

.edit-cell-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.edit-cell-btn:hover {
  background: rgba(255, 255, 255, 0.92);
}

.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mini-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.mini-action-btn.danger {
  background: var(--danger-soft);
  color: #c62828;
}

.warning-text {
  color: #d32f2f;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.sig {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.merge-members-cell {
  min-width: 260px;
}

.merge-member-line + .merge-member-line {
  margin-top: 8px;
}

.merge-members-list {
  margin-top: 12px;
}

.merge-user-cell {
  min-width: 280px;
  text-align: center;
}

.merge-total-cell,
.merge-task-cell,
.merge-grand-total {
  min-width: 92px;
  text-align: center;
}

.merge-total-cell,
.merge-grand-total {
  font-weight: 700;
}

.merge-task-cell {
  text-align: center;
}

.merge-subtext {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-soft);
}

.merge-raw-score {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.merge-task-max {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-soft);
}

.merge-table thead th {
  white-space: nowrap;
  text-align: center;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

.merge-table td.score-null,
.merge-table td.score-low,
.merge-table td.score-mid,
.merge-table td.score-high {
  background-clip: padding-box;
}

.merge-sum-head,
.merge-sum-cell {
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
}

.merge-contest-head,
.merge-contest-separator {
  border-right: 2px solid var(--border);
}

.modal-wide {
  width: calc(100vw - 48px);
  max-width: none;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.compact-table-shell {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.table-scroll-compact table {
  font-size: 12px;
}

.table-scroll-compact th,
.table-scroll-compact td {
  padding: 10px 8px;
}

.table-scroll-compact .merge-user-cell {
  min-width: 220px;
}

.table-scroll-compact .merge-total-cell,
.table-scroll-compact .merge-task-cell,
.table-scroll-compact .merge-grand-total {
  min-width: 72px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 33, 42, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--panel);
  border-radius: 30px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
  padding: 28px;
}

.modal-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header p {
  margin-top: 8px;
  color: var(--text-soft);
}

.modal-wide .modal-header {
  margin-bottom: 16px;
  padding: 0 4px;
}

.modal .actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.modal-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: rgba(248, 249, 251, 0.95);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}

.scoring-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 44px;
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}

.scoring-row textarea {
  min-height: 96px;
}

.hidden {
  display: none !important;
}

.notice {
  color: var(--text-soft);
  font-style: normal;
}

.error {
  color: #d32f2f;
  font-weight: 500;
}

#mergeError {
  white-space: normal;
  line-height: 1.5;
}

.success {
  color: #2e7d32;
  font-weight: 500;
}

.status-line {
  min-height: 24px;
}

.progress-shell {
  margin-top: 14px;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffdd2d 0%, #f5d115 100%);
  transition: width 0.2s ease;
}

.progress-bar.finished {
  background: linear-gradient(90deg, #6bd78a 0%, #3ea960 100%);
}

.tag.CLEAN {
  background: #edf7ef;
  color: #1f7a35;
}

.tag.SUSPECT {
  background: #fff6da;
  color: #9a6d00;
}

.tag.CHEATING {
  background: #fff1f0;
  color: #c43d37;
}

.cheating-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, auto) minmax(220px, auto);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.cheating-row:last-child {
  border-bottom: 0;
}

.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 44px;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.group-row:last-child {
  border-bottom: 0;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.login-row:last-child {
  border-bottom: 0;
}

.login-row .login-name {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  font-size: 13px;
}

input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  border: 0;
  background: var(--accent);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  margin-right: 12px;
  transition: background 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent-hover);
}

.cheating-row:hover {
  background: rgba(248, 249, 251, 0.6);
}

.cheating-row-main strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.cheating-row-main .muted {
  font-size: 12px;
}

.cheating-progress-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.cheating-progress-cell .progress-shell {
  margin-top: 0;
}

.cheating-progress-cell .muted {
  font-size: 12px;
}

.cheating-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.person-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 14px;
}

.person-card > summary.person-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-align: left;
  color: var(--text);
  font-size: 14px;
  margin-top: 0;
  list-style: none;
}

.person-card > summary.person-summary::-webkit-details-marker {
  display: none;
}

.person-summary:hover {
  background: rgba(248, 249, 251, 0.9);
  transform: none;
}

.person-summary strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.person-summary .muted {
  font-size: 12px;
}

.person-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-soft);
}

.person-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.person-runs {
  border-top: 1px solid var(--border);
  background: var(--panel-muted);
}

.run-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 500;
}

.run-row:last-child {
  border-bottom: 0;
}

.run-row:hover {
  background: #fff;
  transform: none;
}

.run-row .run-title {
  font-weight: 700;
}

.run-row .run-comment {
  color: var(--text-soft);
  font-size: 12px;
  margin-top: 4px;
  white-space: pre-wrap;
}

.code-modal {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.code-block {
  margin-top: 14px;
  background: #101217;
  color: #f6f8fa;
  border-radius: 20px;
  padding: 20px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre;
  max-height: 62vh;
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form .field {
  margin-bottom: 0;
  flex: 1;
  min-width: 220px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--panel-muted);
  border-radius: 20px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 6px;
}

.back-row {
  margin-bottom: 18px;
}

.empty-state {
  padding: 26px;
  border-radius: 22px;
  background: var(--panel-muted);
  color: var(--text-soft);
}

details summary {
  cursor: pointer;
  color: var(--link);
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .hero,
  .hero-actions,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .modal {
    width: min(680px, 100%);
  }
}

@media (max-width: 720px) {
  .page {
    padding: 20px 16px 32px;
  }

  .topbar-inner {
    padding: 12px 16px;
  }

  .hero-card,
  .section,
  .question-card,
  .contest-card {
    padding: 20px;
  }

  .modal {
    padding: 22px 18px;
    border-radius: 24px;
  }

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