/* Shared layout, controls, tables, status, and feedback. */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-topbar);
  color: var(--text);
  padding: var(--space-4) var(--space-5) 0;
}

.topbar > .brand-row,
.topbar > .main-menu {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-left: auto;
  margin-right: auto;
}

.problem-layout.topbar-max-1400 .topbar {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-left: 0;
  margin-right: auto;
}

body.problem-layout:not(.verification-compact) {
  min-width: 846px;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.top-event-slot {
  flex: 1 1 auto;
  align-self: center;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.top-event-slot:empty {
  display: none;
}

.top-event-notice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  max-width: min(620px, 100%);
  border: 1px solid var(--tone-border, var(--line));
  background: var(--tone-bg, var(--surface-alt));
  color: var(--tone-fg, var(--text));
  font-size: var(--font-size-ui-sm);
  line-height: 1.3;
  padding: var(--space-1) var(--space-3);
}

.top-event-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.top-event-dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: var(--font-size-ui-xs);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.top-event-dismiss:hover {
  background: transparent;
  color: inherit;
  text-decoration: underline;
}

.top-event-dismiss:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.top-event-payload {
  display: none !important;
}

.logo {
  display: inline-block;
  font-size: var(--font-size-brand);
  line-height: 1.04;
  color: var(--text);
}

.logo:hover {
  color: var(--text);
  text-decoration: none;
}

.logo-gradient-text {
  display: inline-block;
  line-height: 1.04;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  overflow: visible;
}

.tagline {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--font-size-body);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-ui-sm);
  margin-left: auto;
  color: var(--text-secondary);
}

.top-actions a {
  color: var(--text-secondary);
}

.top-actions a:hover {
  color: var(--text);
}

.session-user {
  color: var(--text);
  font-weight: 700;
}

.main-menu {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.main-menu a {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding: var(--space-2) 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.1;
}

.main-menu a:hover {
  text-decoration: none;
  background: transparent;
  color: var(--text);
}

.main-menu a.active {
  background: transparent;
  color: var(--accent);
}

.main-menu a.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.workbench-context-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  margin: 0;
  color: var(--text);
  flex-wrap: wrap;
}

.problem-context-main {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  flex-wrap: wrap;
}

.contest-context-identity {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
}

.contest-context-name {
  font-size: var(--font-size-ui-xl);
  line-height: 1.2;
}

.contest-context-slug {
  color: var(--muted);
  font-size: var(--font-size-ui-sm);
}

.contest-context-slug-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.section-tabs {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-ui-sm);
  font-weight: 700;
  white-space: nowrap;
}

.section-tab:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.section-tab.active {
  position: relative;
  top: 1px;
  border-color: var(--line);
  border-bottom-color: var(--surface);
  background: var(--surface);
  color: var(--accent);
}

.problem-section-tabs {
  align-items: flex-end;
  gap: var(--space-1);
}

.problem-section-tab {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  column-gap: 2px;
  row-gap: 1px;
  min-width: 92px;
  overflow: hidden;
}

.problem-section-tab-title {
  color: inherit;
  font-size: var(--font-size-ui-sm);
  font-weight: 700;
  line-height: 1.2;
}

.problem-section-tab-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: var(--font-size-ui-xs);
  font-weight: 400;
  line-height: 1.2;
}

.section-tab-status-danger {
  color: var(--danger);
}

.section-tab-status-warn {
  color: var(--warn);
}

.compact-fact-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.15rem;
  line-height: 1.3;
}

.compact-fact-row {
  display: contents;
}

.compact-fact-label {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.compact-fact-label::after {
  content: ":";
}

.compact-fact-value {
  min-width: 0;
  margin-left: var(--space-2);
}

.compact-fact-meta {
  margin-left: var(--space-2);
  color: var(--muted);
  font-weight: 400;
}

.compact-fact-meta.warn,
.compact-fact-meta.danger {
  font-weight: 700;
}

.compact-fact-meta.warn {
  color: var(--warn);
}

.compact-fact-meta.danger {
  color: var(--danger);
}

.revision-pair-value {
  display: inline-flex;
  gap: var(--space-2);
  align-items: baseline;
}

.revision-pair-values-only .revision-pair-value {
  grid-column: 1 / -1;
  margin-left: 0;
}

.revision-pair-alert {
  color: var(--danger);
  font-weight: 700;
}

.revision-pair-separator {
  color: var(--muted);
  font-weight: 400;
}

.problem-section-tab.active .problem-section-tab-status:not(.section-tab-status-danger):not(.section-tab-status-warn) {
  color: var(--accent-hover);
}

.problem-section-action-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: var(--space-1);
  row-gap: 1px;
  flex: 0 0 auto;
  min-width: 92px;
  padding-right: var(--space-3);
  padding-left: var(--space-3);
}

.problem-section-tab-action-form {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.problem-section-tab-action-control {
  appearance: none;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: auto;
  height: auto;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: var(--font-size-ui-xs);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.problem-section-tab-title-link {
  position: static;
  color: inherit;
  text-decoration: none;
}

.problem-section-tab-title-link::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
}

.problem-section-tab-title-link:hover {
  text-decoration: none;
}

.problem-section-tab-title-link:focus-visible::before {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.problem-section-tab-action-control:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.problem-section-tab-action-control:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.problem-section-tab-action-control:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.problem-section-action-tab > .problem-section-tab-status {
  grid-column: 1 / -1;
  justify-self: center;
}

.problem-section-action-tab-single > .problem-section-tab-title-link {
  grid-column: 1 / -1;
  justify-self: center;
}

.problem-section-action-tab.active {
  position: relative;
  top: 1px;
}

.problem-context-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.problem-slug-link {
  color: var(--text-secondary);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}

.problem-slug-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.problem-context-title {
  margin: 0;
  font-size: var(--font-size-ui-lg);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}

.problem-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
  cursor: pointer;
  transition:
    color 120ms ease,
    opacity 120ms ease;
}

.problem-copy-button svg {
  width: 16px;
  height: 16px;
  display: block;
}

.problem-copy-button:hover:not(:disabled) {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.75;
}

.problem-copy-button:active:not(:disabled) {
  opacity: 0.55;
}

.problem-copy-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.problem-copy-button[data-copy-state="copied"] {
  color: var(--muted);
  opacity: 0.75;
}

.problem-context-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
  margin-left: var(--space-2);
}

.problem-context-meta-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  min-width: 0;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  background: var(--btn-bg);
  padding: 3px var(--space-3);
}

.problem-context-meta-pill-action {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.problem-context-meta-pill-action:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border);
  text-decoration: none;
}

.problem-context-meta-pill-action:active {
  transform: translateY(0.5px);
}

.problem-context-meta-pill-action:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.problem-context-meta-pill-item {
  color: var(--text-secondary);
  font-size: var(--font-size-ui-xs);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.problem-context-meta-pill-item.warn {
  color: var(--warn);
  font-weight: 700;
}

.problem-context-meta-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--muted);
}

.accent-gradient-text {
  font-weight: 700;
  color: var(--brand-gradient-start);
  background-image: linear-gradient(
    90deg,
    var(--brand-gradient-start) 0%,
    var(--brand-gradient-middle) 52%,
    var(--brand-gradient-end) 100%
  );
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.workbench-frame {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.problem-context-bar + .problem-section-tabs {
  margin-top: calc(-1 * var(--space-2));
}

.workbench-frame.page-frame-wide {
  max-width: var(--layout-max-width);
}

.workbench-frame-readable {
  max-width: 1120px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-5);
  min-width: 0;
}

.root-layout .page-grid {
  padding: var(--space-5);
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.page-grid.page-grid-wide {
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: start;
}

.page-grid.page-grid-wide .content-shell {
  min-width: 0;
}

.page-grid.page-grid-wide .side-panel {
  min-width: 0;
  width: 240px;
}

body.verification-compact .page-grid.page-grid-wide {
  max-width: none;
  grid-template-columns: max-content 240px;
}

body.verification-compact .workbench-frame.page-frame-wide {
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0;
}

body.verification-compact .workbench-frame.page-frame-wide > .workbench-context-bar,
body.verification-compact .workbench-frame.page-frame-wide > .problem-section-tabs {
  width: 100%;
  max-width: var(--layout-max-width);
  justify-self: start;
}

body.verification-compact .page-grid.page-grid-wide .content-shell {
  overflow-x: visible;
}

body.verification-compact .page-grid.page-grid-wide .container {
  width: auto;
  min-width: 0;
}

@media (max-width: 960px) {
  body.problem-layout:not(.verification-compact) .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.problem-layout:not(.verification-compact) .side-panel {
    width: auto;
  }
}

.page-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.page-grid.single-column .side-panel {
  display: none;
}

.page-grid.contest-page-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
}

.page-grid.contest-page-grid .contest-side-panel {
  width: 280px;
}

@media (max-width: 960px) {
  .page-grid.contest-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-grid.contest-page-grid .contest-side-panel {
    width: auto;
  }
}

.content-shell,
.info-card,
.action-card,
.content-section,
.login-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

.content-shell {
  min-width: 0;
  overflow-x: visible;
}

body.problem-layout:not(.verification-compact) .content-shell {
  container-name: problem-content;
  container-type: inline-size;
}

.container {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  min-width: 0;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

.workspace-side-link {
  font-size: var(--font-size-ui-sm);
  line-height: 1.35;
  white-space: nowrap;
}

.workspace-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}

.workspace-card-head > h3 {
  margin: 0;
}

.workspace-card-head .workspace-side-link {
  font-size: var(--font-size-ui-sm);
  font-weight: 600;
}

.contest-workspace-card {
  display: grid;
  gap: var(--space-3);
}

.contest-workspace-card > .workspace-card-head {
  margin: 0;
}

.contest-workspace-card > .workspace-card-head > h3 {
  margin: 0;
  min-width: 0;
  font-size: var(--font-size-ui-sm);
  line-height: 1.3;
}

.contest-workspace-card > .workspace-card-head > h3 a {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.contest-workspace-count {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-ui-xs);
}

.contest-problem-nav {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 5px;
  max-height: 108px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.contest-problem-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  max-width: 100%;
  min-height: 24px;
  overflow: hidden;
  padding: 1px 5px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: var(--font-size-ui-xs);
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contest-problem-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  text-decoration: none;
}

.contest-problem-link.active {
  border-color: var(--accent-ring);
  background: var(--surface-selected);
  color: var(--accent);
}

.contest-problem-link.disabled {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.info-card,
.action-card,
.content-section {
  padding: var(--space-4);
  min-width: 0;
}

.content-section-plain {
  border: 0;
  padding: 0;
}

form {
  margin: 0;
}

.form-stack {
  display: grid;
  gap: var(--space-3);
}

.form-stack > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.form-stack > select,
.form-stack > textarea {
  width: 100%;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.form-row:not(.form-row-column) > label {
  flex: 0 0 150px;
}

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

.form-row:not(.form-row-column) > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.form-row:not(.form-row-column) > select,
.form-row:not(.form-row-column) > textarea {
  flex: 1 1 260px;
  min-width: 0;
}

.form-row:not(.form-row-column) > .form-input-with-action {
  flex: 1 1 260px;
  min-width: 0;
}

.form-row-inline-distribute {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: var(--space-7);
  width: 100%;
}

.form-field-stack {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  flex: 1 1 0;
}

.form-row-inline-distribute > .form-field-stack:last-of-type {
  flex: 1.15 1 0;
}

.form-field-stack > label {
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
}

.form-field-stack > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.form-field-stack > select,
.form-field-stack > textarea {
  width: 100%;
  min-width: 0;
}

.form-row-inline-distribute > button {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 96px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .form-row-inline-distribute {
    flex-wrap: wrap;
    gap: var(--space-5);
  }

  .form-field-stack {
    flex: 1 1 220px;
  }

  .form-row-inline-distribute > .form-field-stack:last-of-type {
    flex: 1 1 220px;
  }

  .form-row-inline-distribute > button {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .form-field-stack {
    flex: 1 1 100%;
  }

  .form-row-inline-distribute > button {
    width: 100%;
  }
}

.form-input-with-action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.form-input-with-action > input {
  flex: 1 1 auto;
  min-width: 0;
}

.form-input-with-action > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.form-row-hint-offset {
  flex: 1 1 100%;
  margin: 0 0 0 158px;
}

@media (max-width: 800px) {
  .form-row-hint-offset {
    margin-left: 0;
  }
}

.form-row-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex: 0 0 auto;
}

.form-row-actions > button {
  white-space: nowrap;
}

.form-submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* A content title and its single contextual action share one alignment contract. */
.content-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.content-heading-row > :first-child {
  min-width: 0;
}

.content-heading-action {
  flex: 0 0 auto;
  width: fit-content;
  white-space: nowrap;
  font-size: var(--font-size-ui-sm);
  font-weight: 400;
  line-height: 1.3;
}

.metadata-system-limits {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.metadata-system-limits h3,
.metadata-system-limits p,
.metadata-system-limit-list {
  margin: 0;
}

.metadata-system-limit-list {
  display: grid;
  gap: var(--space-1);
  overflow-x: auto;
}

.metadata-system-limit-row {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: max-content;
  white-space: nowrap;
}

.metadata-system-limit-row dt {
  font-weight: 600;
  white-space: nowrap;
}

.metadata-system-limit-row dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}


.form-block {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  padding: var(--space-3);
}

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

input,
select,
textarea {
  border: 1px solid var(--field-border);
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

textarea.textarea-sm {
  min-height: 96px;
}

textarea.textarea-md {
  min-height: 180px;
}

.component-editor-error {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Button tiers: use .btn/.button-link for default actions, add .primary-action for primary actions, and use .linkish/.danger-link for ghost or destructive links. */
.btn,
.button-link {
  font: inherit;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  line-height: 1.2;
  padding: var(--space-2) var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover:not(:disabled),
.button-link:hover:not([aria-disabled="true"]) {
  background: var(--btn-bg-hover);
  text-decoration: none;
}

.btn:focus-visible,
.button-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.btn:disabled,
.button-link[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-action {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.primary-action:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}

.button-link:hover {
  text-decoration: none;
}

.linkish,
.linkish-button {
  border: 0;
  background: transparent;
  color: var(--link);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.linkish-button {
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.linkish:hover,
.linkish-button:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
}

.verification-actions > a,
.workspace-side-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.linkish[aria-disabled="true"],
.linkish-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
  pointer-events: none;
}

.text-nowrap {
  white-space: nowrap;
}

.table-base {
  width: 100%;
  border-collapse: collapse;
}

.table-base th,
.table-base td {
  border: 1px solid var(--line);
  padding: var(--space-2);
  text-align: left;
  vertical-align: middle;
  font-size: var(--font-size-ui-sm);
  overflow-wrap: normal;
  word-break: normal;
}

.table-cell-nowrap,
.table-cell-actions {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.table-cell-break {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table-base th {
  background: var(--surface);
  border-bottom-color: var(--line-strong);
}

.table-base.table-rows {
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.table-base.table-rows th,
.table-base.table-rows td {
  border: 0;
  padding: var(--space-3) var(--space-4);
}

.table-base.table-rows tr:first-child th {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line-strong);
}

.table-base.table-rows tr + tr td {
  border-top: 1px solid var(--line);
}

.table-base.table-compact th,
.table-base.table-compact td {
  padding: 4px 8px;
}

.table-base.table-compact th {
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 600;
}

.problem-list-table .problem-list-head {
  color: var(--text);
  font-weight: 700;
}

.problem-list-table .problem-list-cell {
  font-size: var(--font-size-body);
}

.problem-list-table .problem-list-slug-link {
  color: var(--text);
  font-weight: 400;
  display: inline;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.problem-list-table .problem-list-slug-link:hover {
  color: var(--link);
}

.problem-list-table .problem-list-slug-owner {
  display: inline-block;
  width: calc(var(--problem-owner-prefix-ch, 0) * 1ch);
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.problem-list-table .problem-list-slug-leaf {
  display: inline-block;
  max-width: 100%;
  color: inherit;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.problem-list-table .problem-list-slug-disabled,
.problem-list-table .problem-list-slug-disabled:hover {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.table-base tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

.table-base tbody tr:nth-child(odd) td {
  background: var(--surface);
}

.table-base tbody tr.table-row-selected > td {
  background: var(--surface-selected);
  border-color: var(--accent-ring);
}

tr.table-row-dirty > td,
tr.verification-row-failed > td {
  background: var(--surface-danger);
}

.problem-list-table tbody tr.table-row-dirty > td {
  background: var(--surface-danger);
  border-color: var(--tag-fail-border);
}

.ui-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: min(520px, calc(100vw - 16px));
  border: 1px solid var(--bg-topbar);
  background: var(--text);
  color: var(--surface-alt);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-ui-sm);
  line-height: 1.35;
  border-radius: 4px;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 80ms ease-out, transform 80ms ease-out;
}

.ui-tooltip.ui-tooltip-visible {
  opacity: 1;
  transform: translateY(0);
}

.danger-link {
  margin-left: auto;
  color: var(--danger-link-color);
  font-weight: var(--danger-link-weight);
}

.linkish.danger-link,
.linkish-button.danger-link {
  color: var(--danger-link-color);
  font-weight: var(--danger-link-weight);
}

.danger-link:hover {
  color: var(--danger-link-hover-color);
}

.linkish.danger-link:hover,
.linkish-button.danger-link:hover:not(:disabled) {
  color: var(--danger-link-hover-color);
}

.btn.danger-link,
.button-link.danger-link {
  border-color: var(--danger-link-color);
  color: var(--danger-link-color);
  font-weight: var(--danger-link-weight);
}

.btn.danger-link:hover:not(:disabled),
.button-link.danger-link:hover:not([aria-disabled="true"]) {
  background: var(--danger-link-hover-bg);
  color: var(--danger-link-hover-color);
}

.danger-link:focus-visible {
  outline: 2px solid var(--danger-link-focus);
  outline-offset: 1px;
}


.pdf-preview {
  width: 100%;
  height: 74vh;
  min-height: 680px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.preview-log {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.flash {
  border: 1px solid var(--tone-border, var(--warn-line));
  background: var(--tone-bg, var(--warn-bg));
  color: var(--tone-fg, var(--warn-text));
  padding: var(--space-3);
}

.flash-inline {
  margin: 0 0 var(--space-4);
  white-space: normal;
  overflow-wrap: anywhere;
}
