:root {
  color-scheme: light;
  --page: #eeeeee;
  --panel: #d6d6d6;
  --text: #161616;
  --link: #0000cc;
  --border: #666666;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
    "Apple SD Gothic Neo", "Malgun Gothic", monospace;
  font-size: 16px;
  color: var(--text);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body { margin: 0; }

.page {
  width: min(100% - 48px, 800px);
  margin: 48px auto 80px;
}

.site-header {
  border: 2px dashed var(--border);
  background: var(--panel);
  padding: 24px 28px 25px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -1.5px;
}

.description {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #454545;
}

.account {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.7;
}

.separator {
  margin: 0 7px;
  color: #666;
}


main { padding: 44px 28px 0; }

h2 {
  margin: 0 0 19px;
  font-size: 25px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.problem-list {
  margin: 0;
  padding-left: 23px;
  list-style-type: disc;
}

.problem-list li {
  padding-left: 3px;
  line-height: 1.7;
}

.problem-list li + li { margin-top: 7px; }
.problem-list li::marker { font-size: 11px; }

.solved-marker {
  color: #276039;
  font-size: 14px;
  white-space: nowrap;
}

a,
a:visited {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: #444; }

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 5px;
}

.problem-list a {
  display: inline-block;
  padding: 1px 0;
  overflow-wrap: anywhere;
}

/* Detail pages keep the same narrow document layout. */
.detail-main { padding-top: 30px; }

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
}

.detail-main h2 { margin-bottom: 14px; overflow-wrap: anywhere; }

.page-intro {
  margin: 0 0 28px;
  color: #454545;
  font-size: 14px;
  line-height: 1.8;
}

.account [aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.auth-form { max-width: 360px; }
.form-field + .form-field { margin-top: 20px; }
.form-field label { display: block; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }

input, textarea, button { font: inherit; }

.simple-form input,
.simple-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #888;
  border-radius: 0;
  background: #fafafa;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  appearance: none;
}

.simple-form input::placeholder { color: #777; opacity: 1; }

.submit-button {
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid #777;
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.submit-button:hover { background: #c8c8c8; }
.submit-button:active { background: #bbb; }
.auth-form .submit-button { margin-top: 24px; }

.simple-form input:focus-visible,
.simple-form textarea:focus-visible,
.text-button:focus-visible,
.submit-button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.auth-switch {
  margin: 25px 0 0;
  color: #454545;
  font-size: 14px;
  line-height: 1.8;
}

.form-feedback {
  margin: 14px 0 0;
  color: #454545;
  font-size: 14px;
  line-height: 1.8;
}

.problem-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.problem-description > * { margin: 0; }
.problem-description > * + * { margin-top: 12px; }
.problem-description :is(ul, ol) { padding-inline-start: 1.6em; }
.problem-description li > :is(p, ul, ol) { margin-block: 0; }
.problem-description code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.problem-description :not(pre) > code { padding: 1px 4px; background: #e5e5e5; }
.problem-description pre {
  padding: 10px 12px;
  border: 1px solid #aaa;
  background: #e5e5e5;
  overflow-x: auto;
  overflow-wrap: normal;
  font-size: 14px;
  line-height: 1.6;
}

.problem-section { margin-top: 32px; }

.problem-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.download-link { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.flag-form { max-width: 480px; }
.flag-row { display: flex; align-items: stretch; gap: 10px; }
.flag-row input { flex: 1; width: 0; }
.flag-row .submit-button { flex-shrink: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .page {
    width: calc(100% - 32px);
    margin-top: 24px;
    margin-bottom: 48px;
  }

  .site-header { padding: 21px 20px 22px; }
  .header-row { flex-wrap: wrap; gap: 14px 20px; }
  h1 { font-size: 30px; }
  main { padding: 34px 20px 0; }
  .detail-main { padding-top: 24px; }
  h2 { font-size: 23px; }
}

[hidden] { display: none !important; }

.site-title, .site-title:visited { color: inherit; text-decoration: none; }
.account { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.account-username { max-width: 100%; overflow-wrap: anywhere; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.small-link { font-size: 14px; }
.scoreboard-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.65; }
.scoreboard-table :is(th, td) { padding: 10px clamp(6px, 2vw, 14px); border-bottom: 1px solid #bbb; text-align: left; }
.scoreboard-table thead { background: #d6d6d6; }
.scoreboard-table :is(th, td):first-child { width: 1%; }
.scoreboard-table :is(th, td):last-child { width: 1%; text-align: right; }
.scoreboard-table tbody th { font-weight: 400; overflow-wrap: anywhere; }
.scoreboard-table .scoreboard-self { background: #e0e9df; }
.scoreboard-you { color: #276039; font-size: 12px; white-space: nowrap; }
.scoreboard-player { text-align: left; overflow-wrap: anywhere; }
.scoreboard-player::after { content: '+'; margin-inline-start: 7px; color: #555; display: inline-block; text-decoration: none; }
.scoreboard-player[aria-expanded="true"]::after { content: '−'; }
.scoreboard-table .scoreboard-details td { width: auto; text-align: left; background: #e5e5e5; }
.scoreboard-details ul { margin: 0; padding-inline-start: 22px; overflow-wrap: anywhere; }
.scoreboard-details .field-help { margin: 0; }
.page-heading { margin: 0 0 14px; font-size: 25px; line-height: 1.4; letter-spacing: -0.6px; }
.auth-page .detail-main { padding-top: 0; }
.text-button { padding: 0; border: 0; border-radius: 0; background: none; color: var(--link); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; line-height: inherit; cursor: pointer; }
.text-button:hover { color: #444; }
button:disabled { opacity: .55; cursor: wait; }
.field-help { margin: 7px 0 0; color: #555; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.is-error { color: #a12222; }
.solved-status { margin: 0 0 12px; font-size: 14px; color: #276039; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.instance-details { margin: 14px 0; font-size: 14px; line-height: 1.8; }
.instance-details p { margin: 0 0 8px; overflow-wrap: anywhere; }
.connection-command { display: block; font: inherit; padding: 10px 12px; border: 1px solid #aaa; overflow-wrap: anywhere; white-space: pre-wrap; background: #e5e5e5; }
.instance-details .field-help { margin: 8px 0 0; }
.admin-section { margin-top: 30px; }
.admin-section h3 { margin: 0 0 18px; font-size: 17px; line-height: 1.6; font-weight: 600; }
.invitation-settings { max-width: 400px; }
.invitation-actions { margin-top: 12px; font-size: 14px; }
.admin-problem-list { margin: 0; padding: 0; list-style: none; }
.admin-problem-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dotted #aaa; font-size: 14px; line-height: 1.8; }
.admin-problem-list li > a { min-width: 0; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-shrink: 0; gap: 14px; }
.simple-form textarea { resize: vertical; }
.file-picker { position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 9px; border: 1px solid #888; background: #fafafa; font-size: 13px; line-height: 1.7; }
.file-picker-button { flex-shrink: 0; padding: 3px 7px; border: 1px solid #888; background: #ddd; }
.file-picker-name { min-width: 0; overflow-wrap: anywhere; }
.simple-form .file-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 2px solid var(--link); outline-offset: 3px; }
.simple-form .checkbox-label { display: flex; align-items: flex-start; gap: 10px; }
.simple-form input[type="checkbox"] { appearance: auto; flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; padding: 0; margin: 3px 0 0; accent-color: #444; }
.form-actions { margin-top: 24px; }
.form-actions .text-button { font-size: 14px; }
#problem-editor { scroll-margin-top: 24px; }

@media (max-width: 540px) {
  .account { justify-content: flex-start; }
  .auth-page .detail-main { padding-top: 0; }
  .section-heading { margin-bottom: 19px; }
  .section-heading h2 { margin-bottom: 0; }
  .admin-problem-list li { flex-wrap: wrap; gap: 4px 14px; }
  .admin-actions { margin-left: auto; }
  .flag-row { flex-wrap: wrap; }
  .flag-row input { width: 100%; flex-basis: 180px; }
}
