:root {
  color-scheme: light;
  --ink: #2b211b;
  --muted: #796a60;
  --paper: #fffdf9;
  --canvas: #f6f1e8;
  --cream: #f3ead7;
  --sand: #dfc39d;
  --clay: #995032;
  --clay-dark: #71351f;
  --gold: #cf9146;
  --line: #d9b581;
  --soft-line: #e7dccb;
  --content-rail-width: 310px;
  --shadow: 0 18px 45px rgb(73 43 27 / 12%);
  font-family: "Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 4%, rgb(207 145 70 / 12%), transparent 28rem),
    var(--canvas);
}

a { color: var(--clay-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--clay); }
button, input, select { font: inherit; }

.topbar {
  min-height: 56px;
  color: #fff8eb;
  background: linear-gradient(105deg, #874126, var(--clay) 48%, #7a3a22);
  box-shadow: 0 3px 0 rgb(81 37 21 / 20%);
}

.site-header,
.portal-layout,
footer {
  width: min(1460px, calc(100% - 40px));
  margin-inline: auto;
}

/* Shared tabbed-page components */
.view-tabs { display: flex; align-items: end; overflow-x: auto; border-bottom: 1px solid var(--line); }
.view-tabs > a,
.view-tabs > span { min-width: max-content; min-height: 32px; display: grid; flex: 0 0 auto; margin-bottom: -1px; padding: 0 14px; place-items: center; border: 1px solid var(--line); border-right: 0; color: var(--clay-dark); background: var(--paper); font-size: 13px; font-weight: 800; text-decoration: none; }
.view-tabs > :first-child { border-radius: 10px 0 0; }
.view-tabs > :last-child { border-right: 1px solid var(--line); border-radius: 0 10px 0 0; }
.view-tabs > :only-child { border-radius: 10px 10px 0 0; }
.view-tabs > a[aria-current="page"] { color: #fff8ed; background: var(--clay-dark); }
.view-tabs > span[aria-disabled="true"] { color: #9c8779; cursor: not-allowed; }
.view-surface { background: #fbf8f2; box-shadow: 0 10px 28px rgb(73 43 27 / 10%); }
.panel-card { overflow: hidden; border: 1px solid #dfbc8e; border-radius: 10px; background: var(--paper); box-shadow: 0 6px 18px rgb(73 43 27 / 6%); }
.panel-card > header,
.panel-heading { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; color: var(--clay-dark); background: #f2e5d0; }
.panel-card > header h1,
.panel-card > header h2,
.panel-heading h1,
.panel-heading h2 { margin: 0; font-size: 14px; }
.panel-card > header h1 { flex: 1; }
.panel-card > header > span,
.panel-heading > span { color: #9a6c50; font-size: 10px; font-weight: 850; }

/* Forum */
.forum-main { min-width: 0; min-height: 760px; padding-bottom: 28px; }
.forum-toolbar { min-height: 74px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 28px 32px; align-items: end; column-gap: 16px; row-gap: 6px; padding: 8px 18px 0; border-bottom: 1px solid var(--line); background: transparent; }
.forum-tabs { grid-column: 1; grid-row: 2; }
.forum-search { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 6px; }
.forum-search input { width: min(230px, 30vw); min-height: 28px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: #f7efea; font-size: 12px; }
.forum-search button { min-height: 28px; padding: 0 11px; border: 0; border-radius: 7px; color: white; background: var(--clay-dark); font-size: 12px; font-weight: 850; cursor: pointer; }
.forum-composer button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 8px; color: white; background: var(--clay-dark); font-weight: 850; cursor: pointer; }
.forum-surface { min-height: 696px; padding: 14px 18px 24px; }
.forum-alert { margin-bottom: 16px; padding: 13px 15px; border: 1px solid #df9c8c; border-radius: 10px; color: #7f382b; background: #fff0ed; }
.forum-board-list,
.forum-topic-list,
.forum-post-list { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.forum-board { min-height: 68px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.forum-board:last-child { border-bottom: 0; }
.forum-board:hover { background: #fff9ef; }
.forum-board.unread { background: #fff6e8; }
.forum-bubble { color: #73a3c6; font-size: 28px; line-height: 1; }
.forum-board strong { display: block; color: var(--clay-dark); font-size: 15px; }
.forum-board small { display: block; margin-top: 3px; color: #b17d5b; font-size: 13px; }
.forum-chevron { color: var(--line); font-size: 28px; }
.forum-list-actions,
.forum-post-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.forum-list-actions > a,
.forum-post-actions a { color: var(--clay-dark); font-weight: 800; }
.forum-pagination { display: flex; flex-wrap: wrap; gap: 5px; }
.forum-pagination a { min-width: 28px; min-height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--clay-dark); background: white; font-size: 12px; text-decoration: none; }
.forum-pagination a[aria-current="page"] { color: white; background: var(--clay-dark); }
.forum-topic { min-height: 46px; display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.forum-topic:last-child { border-bottom: 0; }
.forum-topic.unread { background: #fff5e6; }
.forum-topic.deleted,
.forum-post.deleted { opacity: .45; }
.topic-status { color: #d69d39; font-size: 17px; line-height: 1; text-align: center; }
.forum-topic h2 { margin: 0 0 1px; font-size: 13px; line-height: 1.25; }
.forum-topic h2 a { color: var(--clay-dark); text-decoration: none; }
.forum-topic h2 a:hover { text-decoration: underline; }
.forum-topic p { margin: 0; color: #b07e5d; font-size: 11px; line-height: 1.35; }
.forum-topic p strong { color: #883d36; }
.forum-topic-actions { display: flex; align-items: center; gap: 3px; }
.forum-topic-actions a { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; color: var(--clay-dark); font-size: 13px; line-height: 1; text-decoration: none; }
.forum-topic-actions a:hover,
.forum-topic-actions a:focus-visible { border-color: var(--line); background: #fff4df; outline: none; }
.forum-composer { position: relative; }
.forum-composer > summary { width: max-content; min-height: 28px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--clay-dark); background: white; font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; }
.forum-composer[open] > summary { margin-bottom: 10px; }
.forum-composer form { width: min(650px, calc(100vw - 80px)); display: grid; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 16px 45px rgb(61 33 19 / 14%); }
.forum-composer label { display: grid; gap: 5px; color: var(--clay-dark); font-size: 12px; font-weight: 850; }
.forum-composer input,
.forum-composer textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fffcf8; font: inherit; }
.forum-composer textarea { resize: vertical; }
.forum-composer small { color: var(--muted); }
.forum-composer button { width: max-content; }
.forum-topic-heading { align-items: baseline; border: 1px solid var(--line); border-bottom: 0; }
.forum-topic-heading span { text-transform: uppercase; }
.forum-post { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 12px; padding: 13px; border-bottom: 1px solid var(--line); }
.forum-post:last-child { border-bottom: 0; }
.forum-avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #b98462, #71351f); font-family: Georgia, serif; font-size: 24px; font-weight: 900; text-transform: uppercase; box-shadow: inset 0 0 0 3px rgb(255 255 255 / 32%); }
.forum-post-content > header { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #c09a80; font-size: 12px; }
.forum-post-content > header strong { color: var(--clay-dark); font-size: 15px; }
.role-chip { padding: 3px 6px; border-radius: 999px; color: #79541c; background: #fff0b9; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.forum-post-body { padding-top: 7px; color: var(--ink); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.forum-post-body pre { overflow-x: auto; padding: 11px; border-radius: 8px; background: #2c2622; color: #fff8e8; }
.forum-formula {
  min-height: 1.7em;
  margin: 3px 10px;
  overflow-x: auto;
  padding: 3px;
  color: #000;
  text-align: left;
}
.forum-post-body .katex-display { text-align: left; }
.forum-post-body .katex-display > .katex { text-align: left; }
.reply-composer { margin-top: 18px; }
.forum-signin-prompt { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 760px) { .forum-toolbar { min-height: 78px; grid-template-columns: 1fr; grid-template-rows: 28px 32px; row-gap: 8px; padding: 10px 9px 0; } .forum-tabs { grid-column: 1; grid-row: 2; } .forum-search { grid-column: 1; grid-row: 1; } .forum-search input { width: 100%; } .forum-surface { padding: 14px 9px; } .forum-list-actions { align-items: stretch; flex-direction: column; } .forum-post { grid-template-columns: 42px minmax(0,1fr); }.forum-avatar{width:38px;height:38px;font-size:18px;} }

.site-header {
  min-height: 56px;
  display: grid;
  grid-template-columns: 220px auto 1fr;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 9px;
  color: #fff8eb;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(255 248 235 / 35%);
  border-radius: 10px;
  color: #754027;
  background: #f1d9ad;
  box-shadow: 4px 4px 0 rgb(62 27 15 / 24%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  font-weight: 900;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 1px; color: #efd9c5; font-size: 10px; letter-spacing: 0.04em; }
.topbar-home { color: #fff7e8; font-size: 14px; font-weight: 800; text-decoration: none; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.header-link { color: #fff7e8; font-size: 13px; font-weight: 700; }

.language-picker { position: relative; color: var(--ink); }
.language-picker summary {
  display: grid;
  grid-template-columns: 16px minmax(68px, 1fr) 10px;
  align-items: center;
  gap: 8px;
  min-width: 138px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgb(255 248 235 / 40%);
  border-radius: 10px;
  color: #fff8eb;
  background: rgb(80 34 18 / 26%);
  font-size: 12px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary:hover { background: rgb(80 34 18 / 38%); }
.language-picker summary:focus-visible { outline: 3px solid rgb(241 217 173 / 55%); outline-offset: 2px; }
.language-picker img { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgb(37 26 20 / 18%); }
.picker-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}
.language-picker[open] .picker-chevron { transform: translateY(2px) rotate(225deg); }
.language-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  padding: 7px;
  border: 1px solid var(--soft-line);
  border-radius: 13px;
  background: rgb(255 253 249 / 98%);
  box-shadow: var(--shadow);
}
.language-menu a {
  display: grid;
  grid-template-columns: 16px 1fr 16px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.language-menu a:hover,
.language-menu a:focus-visible { color: var(--clay-dark); background: var(--cream); outline: none; }
.language-check { color: var(--clay); font-weight: 900; opacity: 0; }
.language-menu a[aria-current="page"] { color: var(--clay-dark); font-weight: 800; }
.language-menu a[aria-current="page"] .language-check { opacity: 1; }

.portal-layout {
  min-height: calc(100vh - 145px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) var(--content-rail-width);
  align-items: start;
  gap: 14px;
  padding: 16px 0 46px;
}

.left-sidebar,
.content-column,
.right-rail { display: grid; gap: 14px; }

.left-sidebar {
  position: sticky;
  top: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: rgb(255 253 249 / 88%);
  box-shadow: 0 12px 30px rgb(73 43 27 / 7%);
  overflow: hidden;
}

.login-panel { padding: 18px 16px 16px; border-bottom: 2px solid var(--sand); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.login-panel h1 { margin: 0 0 14px; font-size: 24px; }
.login-panel form > label:not(.remember) { display: block; margin: 14px 0 7px; font-size: 13px; font-weight: 800; }
input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus { border-color: var(--clay); box-shadow: 0 0 0 3px rgb(153 80 50 / 13%); }
.remember { display: flex; align-items: center; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.remember input { width: 16px; height: 16px; accent-color: var(--clay); }
.login-panel button {
  min-width: 98px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: #fff9ef;
  background: var(--clay-dark);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 7px 16px rgb(113 53 31 / 18%);
}
.login-panel button:hover { background: var(--clay); }
.login-panel button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 17px; }
.auth-links a { font-size: 12px; font-weight: 700; }
.notice { margin: -7px 0 16px; padding: 10px 11px; border-left: 3px solid var(--gold); background: var(--cream); color: var(--clay-dark); font-size: 12px; line-height: 1.45; }
.notice-error { border-left-color: #a43f32; background: #fff1ed; color: #762b23; }
.button-link {
  display: inline-grid;
  min-height: 42px;
  padding: 0 18px;
  place-items: center;
  border-radius: 9px;
  color: #fff9ef;
  background: var(--clay-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 7px 16px rgb(113 53 31 / 18%);
}
.button-link:hover { color: #fff; background: var(--clay); }

.primary-nav { padding: 7px 10px 10px; }
.primary-nav a {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
  border-bottom: 1px solid var(--soft-line);
  color: #68452f;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}
.primary-nav a:last-child { border-bottom: 0; }
.primary-nav a:hover { color: var(--clay-dark); background: var(--cream); }
.primary-nav a[aria-current="page"] { color: var(--clay-dark); }
.primary-nav a > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  color: #fff8ec;
  background: var(--clay);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
}

.content-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 253 249 / 92%);
  box-shadow: 0 9px 25px rgb(73 43 27 / 6%);
  overflow: hidden;
}
.content-panel > header {
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  color: #774227;
  background: linear-gradient(90deg, var(--cream), #f7f1e5);
  font-size: 15px;
  font-weight: 850;
}
.content-panel > header time { color: var(--muted); font-size: 11px; font-weight: 700; }
.panel-body { padding: 22px; }
.welcome-panel .panel-body { padding: clamp(25px, 4vw, 46px); }
.welcome-panel h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.035em;
}
.lede { max-width: 720px; margin: 22px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.feature-grid article { min-height: 105px; padding: 17px; border: 1px solid var(--soft-line); border-radius: 12px; background: #fff; }
.feature-grid strong,
.feature-grid span { display: block; }
.feature-grid strong { margin-bottom: 8px; color: var(--clay-dark); font-size: 17px; }
.feature-grid span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.update-panel .panel-body { color: var(--muted); font-size: 14px; line-height: 1.65; }
.update-panel p { margin: 0; }

.right-rail { grid-auto-rows: max-content; }
.task-total .panel-body { padding: 28px 24px 24px; }
.task-total strong {
  display: block;
  color: var(--clay-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(58px, 6vw, 86px);
  line-height: 1;
  letter-spacing: -0.09em;
  text-shadow: 3px 3px 0 var(--sand);
}
.task-total p,
.activity-panel p { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.archive-bars { height: 160px; display: flex; align-items: end; gap: 7px; background: linear-gradient(180deg, #fffdf9, #f3e6d1); }
.archive-bars i { flex: 1; height: var(--bar); border-radius: 5px 5px 1px 1px; background: linear-gradient(180deg, var(--gold), var(--clay)); opacity: 0.83; }
.activity-panel .panel-body { min-height: 92px; }

.registration-layout { grid-template-columns: 220px minmax(0, 1fr); }
.registration-sidebar { align-self: start; }
.registration-main { min-width: 0; }
.registration-panel > header { min-height: 48px; padding-inline: 20px; }
.registration-body { padding: clamp(24px, 4vw, 48px); }
.registration-heading { max-width: 760px; margin: 0 auto 28px; }
.registration-heading h1,
.result-message h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}
.registration-heading > p:last-child,
.result-message > p { color: var(--muted); line-height: 1.6; }
.registration-error {
  max-width: 960px;
  margin: 0 auto 28px;
  border-radius: 8px;
}
.registration-error strong,
.registration-error span { display: block; }
.registration-error strong { margin-bottom: 3px; }
.registration-form { max-width: 960px; margin: 0 auto; }
.form-row {
  display: grid;
  grid-template-columns: minmax(145px, 220px) minmax(0, 520px);
  align-items: start;
  gap: 18px;
  margin-bottom: 17px;
  border: 0;
  padding: 0;
}
.form-row > label,
.form-row > legend {
  padding-top: 11px;
  color: var(--clay-dark);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
}
.form-row > label small { color: var(--muted); font-size: 10px; font-weight: 650; }
.form-row input,
.form-row select { width: 100%; }
.form-row small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-divider { max-width: 760px; height: 1px; margin: 25px auto; background: var(--line); }
.activation-note { max-width: 760px; margin: 20px auto; color: var(--muted); font-size: 12px; }
.form-actions { max-width: 760px; margin: 25px auto 0; }
.form-actions button {
  min-width: 130px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  color: #fff9ef;
  background: var(--clay-dark);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 7px 16px rgb(113 53 31 / 18%);
}
.result-message { max-width: 800px; min-height: 420px; padding: clamp(35px, 7vw, 90px); }
.development-activation { margin-top: 30px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }
.development-activation strong { color: var(--clay-dark); }
.development-activation p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.activation-link { display: inline-block; overflow-wrap: anywhere; font-weight: 850; }
.success-message { border-left: 5px solid #557b4d; }
.password-strength { margin-top: 10px; }
.strength-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--soft-line); }
.strength-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #a43f32; transition: width 160ms ease, background 160ms ease; }
.password-strength[data-score="3"] .strength-track i { background: var(--gold); }
.password-strength[data-score="4"] .strength-track i { background: #557b4d; }
.password-strength strong { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.password-strength ul { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin: 7px 0 0; padding: 0; color: var(--muted); font-size: 10px; list-style: none; }
.password-strength li::before { content: "○"; margin-right: 5px; }
.password-strength li.met { color: #466b40; }
.password-strength li.met::before { content: "✓"; }
.field-feedback { min-height: 1.4em; color: #8b3429 !important; }
.field-feedback.valid { color: #466b40 !important; }
input.field-valid { border-color: #668a5f; }
input.field-invalid { border-color: #a43f32; }

.not-found-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.not-found-card { width: min(620px, 100%); padding: clamp(34px, 8vw, 76px); border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.not-found-code { display: block; color: var(--sand); font-family: Georgia, "Times New Roman", serif; font-size: clamp(92px, 22vw, 170px); font-weight: 900; line-height: 0.8; text-shadow: 4px 4px 0 var(--clay-dark); }
.not-found-card h1 { margin: 32px 0 10px; color: var(--clay-dark); font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 5vw, 42px); }
.not-found-card p { margin: 0 auto 28px; color: var(--muted); line-height: 1.6; }

.header-user { color: #f4dfc9; font-size: 12px; font-weight: 700; }
.profile-link { color: inherit; text-decoration-color: rgb(136 61 54 / 42%); text-underline-offset: 0.14em; }
.profile-link:hover { color: var(--clay-dark); text-decoration-color: currentcolor; }
.header-user .profile-link { color: inherit; }
.header-user .profile-link:hover { color: #fff; }
.login-panel h1 .profile-link { text-decoration: none; }
.training-layout { grid-template-columns: 220px minmax(0, 1fr); }
.training-sidebar { align-self: start; }
.training-main { min-width: 0; }
.training-error { margin: 32px 40px 0; }
.training-groups { display: grid; gap: 8px; padding: 20px clamp(8px, 2vw, 28px) 38px; }
.task-group { border-color: var(--soft-line); }
.task-group > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; color: var(--clay-dark); background: linear-gradient(100deg, var(--cream), #f8f1e5); cursor: pointer; list-style: none; }
.task-group > summary::-webkit-details-marker { display: none; }
.task-group > summary:hover { background: #f1e2c8; }
.task-group > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.task-group > summary strong,
.task-group > summary small { display: block; }
.task-group > summary strong { font-size: 14px; }
.task-group > summary small { margin-top: 2px; color: #b1815d; font-size: 12px; font-weight: 750; }
.task-group > summary i { width: 11px; height: 11px; border-right: 2px solid var(--clay); border-bottom: 2px solid var(--clay); transform: rotate(45deg); transition: transform 150ms ease; }
.task-group[open] > summary i { transform: rotate(225deg); }
.task-table-wrap { overflow-x: auto; border-top: 1px solid var(--soft-line); }
.task-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.task-table th { height: 30px; padding: 4px 8px; color: #4c4038; background: #e9e7e3; text-align: center; white-space: nowrap; }
.task-table td { height: 30px; padding: 4px 8px; border-top: 1px solid #ebe5dc; border-right: 1px solid #eee8df; color: #855039; text-align: center; white-space: nowrap; }
.task-table td:last-child { border-right: 0; }
.task-table .task-name { min-width: 220px; color: var(--ink); text-align: left; white-space: normal; }
.task-name a { color: inherit; font-size: 14px; font-weight: 720; line-height: 1.35; text-decoration: none; }
.task-name a:hover { color: var(--clay); text-decoration: underline; }
.task-table tr.task-solved td { background: #E8FFEA; }
.task-table tr.task-attempted td { background: #FFFBD9; }
.task-languages { min-width: 82px; }
.task-languages img { margin: 0 2px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(37 26 20 / 14%); }
.recent-submissions-panel { min-height: 520px; padding: 18px clamp(8px, 2vw, 26px) 38px; }
.recent-submissions-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4px 12px; }
.recent-submissions-heading h1 { margin: 0; color: var(--clay-dark); font-size: 16px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 5px; }
.pagination a,
.pagination span { min-width: 31px; height: 31px; display: grid; padding: 0 7px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--clay-dark); background: var(--paper); font-size: 12px; font-weight: 800; text-decoration: none; }
.pagination a:hover { background: var(--cream); }
.pagination span[aria-current="page"] { color: #fff8ed; background: var(--clay-dark); }
.submission-table-wrap { overflow-x: auto; border: 1px solid var(--soft-line); border-radius: 12px; background: var(--paper); box-shadow: 0 5px 16px rgb(73 43 27 / 5%); }
.submission-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.submission-table th { height: 30px; padding: 4px 8px; border-right: 1px solid #dfc7a5; color: var(--clay-dark); background: #f2e5d0; text-align: center; white-space: nowrap; }
.submission-table th:last-child { border-right: 0; }
.submission-table td { height: 30px; padding: 4px 8px; border-top: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; color: #855039; white-space: nowrap; }
.submission-table td:last-child { border-right: 0; }
.submission-table a { color: inherit; font-weight: 750; text-decoration: none; }
.submission-table a:hover { text-decoration: underline; }
.submission-table tr.submission-solved td { background: #E8FFEA; }
.submission-table tr.submission-failed td { background: #FFE8E8; }
.submission-table tr.submission-queued td { background: #FFFBD9; }
.submission-table tr.submission-processing td { background: #FFE9B8; }
.submission-user { min-width: 155px; color: var(--ink) !important; font-weight: 400; }
.submission-user img { margin-right: 7px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(37 26 20 / 14%); }
.submission-user a,
.submission-task a { font-weight: 400; }
.submission-tests { text-align: center; }
.submission-when,
.submission-id { text-align: center; }
.submission-id button { min-height: 26px; padding: 3px 8px; border: 1px solid #caa272; border-radius: 6px; color: #8b6245; background: #fffaf2; font: inherit; font-size: 12px; font-weight: 750; white-space: nowrap; }
.submission-id button:disabled { opacity: 0.66; cursor: not-allowed; }
.all-tasks-panel { min-height: 520px; padding: 18px clamp(8px, 2vw, 26px) 38px; }
.all-tasks-panel[aria-busy="true"] { opacity: 0.58; pointer-events: none; transition: opacity 120ms ease; }
.task-list-tools { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 3px 10px; }
.task-status-filter { display: flex; align-items: center; gap: 8px; }
.task-filter-field { width: 250px; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; padding: 2px 4px 2px 10px; border: 1px solid #dfbc8e; border-radius: 12px; background: linear-gradient(105deg, #f2e5d0, #fffaf2); box-shadow: 0 4px 12px rgb(73 43 27 / 7%); }
.task-filter-field label { color: var(--clay); font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.task-status-filter select { height: 32px; min-height: 32px; padding: 0 30px 0 9px; border: 0; border-left: 1px solid #e4cba9; border-radius: 0 8px 8px 0; outline: 0; color: var(--ink); background-color: rgb(255 255 255 / 62%); font-size: 13px; font-weight: 720; }
.task-status-filter select:focus-visible { box-shadow: 0 0 0 3px rgb(156 92 57 / 22%); }
.task-status-filter button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff8ed; background: var(--clay-dark); font-weight: 800; cursor: pointer; }
.all-tasks-table-wrap { overflow-x: auto; border: 1px solid var(--soft-line); border-radius: 12px; background: var(--paper); box-shadow: 0 5px 16px rgb(73 43 27 / 5%); }
.all-tasks-table { width: 100%; min-width: 900px; table-layout: fixed; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.task-col-id { width: 7%; }
.task-col-name { width: 23.7%; }
.task-col-year { width: 6%; }
.task-col-time { width: 6.5%; }
.task-col-memory { width: 7%; }
.task-col-tests { width: 6.8%; }
.task-col-solved { width: 7.5%; }
.task-col-rate { width: 7%; }
.task-col-tried { width: 8%; }
.task-col-yours { width: 10%; }
.task-col-languages { width: 10.5%; }
.all-tasks-table th { height: 30px; position: relative; padding: 4px 7px; border-right: 1px solid #dfc7a5; color: var(--clay-dark); background: #f2e5d0; text-align: center; white-space: nowrap; }
.all-tasks-table th:last-child { border-right: 0; }
.all-tasks-table th a { display: flex; align-items: center; justify-content: center; gap: 3px; color: inherit; text-decoration: none; }
.all-tasks-table th:has(a):hover { background: #ead7ba; }
.all-tasks-table th a:hover { color: var(--clay-dark); }
.all-tasks-table th i { width: 11px; height: 16px; position: relative; flex: 0 0 11px; }
.all-tasks-table th i::before,
.all-tasks-table th i::after { width: 0; height: 0; position: absolute; left: 1px; border-right: 5px solid transparent; border-left: 5px solid transparent; content: ""; }
.all-tasks-table th i::before { top: 0; border-bottom: 6px solid var(--clay); opacity: 0.42; }
.all-tasks-table th i::after { bottom: 0; border-top: 6px solid var(--clay); opacity: 0.42; }
.all-tasks-table th[aria-sort] { color: var(--clay-dark); background: var(--sand); box-shadow: inset 0 -3px 0 var(--clay); }
.all-tasks-table th[aria-sort]:hover { background: var(--sand); }
.all-tasks-table th[aria-sort] i::before,
.all-tasks-table th[aria-sort] i::after { border-top-color: var(--clay-dark); border-bottom-color: var(--clay-dark); opacity: 1; }
.all-tasks-table th[aria-sort="ascending"] i::after { display: none; }
.all-tasks-table th[aria-sort="ascending"] i::before { top: 5px; }
.all-tasks-table th[aria-sort="descending"] i::before { display: none; }
.all-tasks-table th[aria-sort="descending"] i::after { bottom: 5px; }
.all-tasks-table td { height: 30px; overflow: hidden; padding: 4px 6px; border-top: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; color: #855039; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.all-tasks-table td:last-child { border-right: 0; }
.all-tasks-table .task-name { color: var(--ink); text-align: left; }
.all-tasks-table .task-name a { color: inherit; font-size: 13px; font-weight: 400; text-decoration: none; }
.all-tasks-table .task-name a:hover { color: var(--clay); text-decoration: underline; }
.all-tasks-table tr.task-solved td { background: #E8FFEA; }
.all-tasks-table tr.task-attempted td { background: #FFFBD9; }
.task-hex-id { color: #765b4b !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 800; letter-spacing: 0.035em; }

@media (max-width: 720px) {
  .task-list-tools { align-items: stretch; flex-direction: column; }
  .task-status-filter { flex-wrap: wrap; }
  .task-filter-field { width: 100%; min-width: 0; }
  .task-list-tools .pagination { justify-content: start; }
}

.task-detail-main { min-width: 0; }
.task-detail-surface { min-height: 650px; padding: 24px clamp(10px, 2.2vw, 32px) 52px; }
.task-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--content-rail-width); align-items: start; gap: 20px; }
.task-primary-column,
.task-facts-column { display: grid; gap: 16px; }
.panel-card > header a { font-size: 11px; font-weight: 800; text-decoration: none; }
.panel-card > header > .task-id-chip { padding: 4px 7px; border-radius: 6px; color: #fff8ed; background: var(--clay); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; }
.task-statement-body { padding: 20px; color: var(--ink); font-size: 15px; line-height: 1.68; }
.task-statement-body p:first-child { margin-top: 0; }
.task-statement-body p:last-child { margin-bottom: 0; }
.task-statement-body pre,
.task-statement-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.task-statement-body pre { overflow-x: auto; padding: 12px; border-radius: 8px; background: #f4efe8; }
.zml-math { padding: 2px 5px; border-radius: 4px; background: #f4efe8; }
.zml-math[data-math-state="source"],
.zml-formula[data-math-state="source"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.zml-math[data-math-state="rendered"] { padding: 0 2px; background: transparent; }
.zml-formula[data-math-state="rendered"] { overflow-y: hidden; }
.zml-mixed-math { overflow-x: auto; }
.zml-mixed-text { white-space: pre-line; }
.task-formula { min-height: 1.7em; margin: 14px 0; overflow-x: auto; text-align: center; }
.task-io,
.task-example { margin: 12px 0; padding: 12px; border-radius: 8px; background: #f5efe6; }
.task-example code { display: block; margin: 7px 0 12px; padding: 10px 12px; border: 1px solid var(--soft-line); border-radius: 7px; background: #fffdf9; line-height: 1.5; }
.task-io b { display: block; margin-bottom: 5px; color: var(--clay-dark); }
.task-io.input { border-left: 4px solid #b9a466; }
.task-io.output { border-left: 4px solid #7697a5; }
.task-image-missing { margin: 12px 0; padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.submission-placeholder > header span { padding: 4px 8px; border-radius: 999px; color: #7b604f; background: #fff8e9; font-size: 10px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.submission-placeholder > p { margin: 0; padding: 18px 18px 4px; color: var(--muted); line-height: 1.55; }
.submission-placeholder fieldset { display: grid; gap: 13px; margin: 0; padding: 16px 18px 20px; border: 0; opacity: 0.66; }
.submission-placeholder label { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 10px; color: var(--clay-dark); font-size: 12px; font-weight: 800; }
.submission-placeholder select,
.submission-placeholder input { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.submission-placeholder button { width: max-content; min-height: 38px; margin-left: 110px; padding: 0 16px; border: 0; border-radius: 8px; color: white; background: var(--clay-dark); font-weight: 800; }
.task-language-options { display: flex; flex-wrap: wrap; gap: 9px; padding: 14px; }
.task-language-options a { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: 8px; color: var(--muted); background: white; font-size: 12px; font-weight: 850; text-decoration: none; text-transform: uppercase; }
.task-language-options a[aria-current="page"] { border-color: var(--clay); color: var(--clay-dark); background: #f7ead7; box-shadow: 0 0 0 2px rgb(153 80 50 / 10%); }
.task-language-options img { width: 24px; height: auto; image-rendering: auto; }
.task-info-list { display: grid; gap: 8px; margin: 0; padding: 14px; }
.task-info-list > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
.task-info-list dt { color: var(--clay-dark); font-size: 14px; font-weight: 850; text-align: right; }
.task-info-list dd { margin: 0; color: var(--muted); font-size: 14px; }
.mini-avatar { width: 22px; height: 22px; display: inline-grid; margin-right: 6px; place-items: center; border-radius: 50%; color: white; background: var(--clay); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.task-ratings { display: grid; gap: 10px; padding: 12px 14px 14px; }
.task-rating { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; column-gap: 8px; margin: 0; }
.task-rating strong { color: var(--clay-dark); font-size: 14px; }
.task-rating small { grid-column: 2; min-height: 16px; color: var(--muted); font-size: 11px; }
.rating-control { position: relative; width: max-content; height: 24px; display: inline-grid; align-items: center; }
.rating-star-visual { --rating-color: #e6b936; position: relative; display: block; font-size: 20px; line-height: 1; letter-spacing: 1px; white-space: nowrap; }
.rating-star { color: #e8dfb1; }
.rating-star.filled { color: var(--rating-color); text-shadow: 0 1px 0 rgb(112 68 38 / 26%); }
.task-rating.is-previewing .rating-star-visual { --rating-color: #b57b45; }
.rating-star-buttons { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.rating-star-buttons button { min-width: 0; padding: 0; border: 0; border-radius: 3px; color: transparent; background: transparent; cursor: pointer; }
.rating-star-buttons button:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 1px; }
.task-rating[aria-busy="true"] .rating-star-buttons { pointer-events: none; opacity: 0.55; }
.rating-control-static { pointer-events: none; }
.acceptance-content { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 10px; padding: 12px 16px 16px; }
.acceptance-content svg { width: 122px; overflow: visible; }
.acceptance-content circle { fill: none; stroke-width: 5; }
.donut-track { stroke: #eadfce; }
.donut-value { stroke: #78b47d; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.acceptance-content text { fill: var(--clay-dark); font-size: 7px; font-weight: 900; text-anchor: middle; }
.acceptance-content dl { display: grid; gap: 9px; margin: 0; }
.acceptance-content dl div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--soft-line); }
.acceptance-content dt { color: var(--muted); font-size: 13px; }
.acceptance-content dd { margin: 0; color: var(--clay-dark); font-size: 14px; font-weight: 850; }
.compact-table-wrap { overflow-x: auto; padding: 10px; }
.compact-task-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.compact-task-table th { padding: 7px; color: var(--clay-dark); background: #f2e5d0; text-align: left; white-space: nowrap; }
.compact-task-table td { padding: 7px; border-top: 1px solid #e5e5e5; color: #855039; white-space: nowrap; }
.compact-task-table tr.result-solved td { background: #E8FFEA; }
.compact-task-table tr.result-failed td { background: #FFE8E8; }
.solved-by-card p { margin: 0; padding: 14px 14px 5px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.solved-by-card > small { display: block; padding: 0 14px 14px; color: var(--muted); font-size: 12px; }
.panel-card > header .panel-action-button { padding: 5px 9px; border: 1px solid #d1a66f; border-radius: 7px; color: var(--clay-dark); background: #fff9ee; font-size: 11px; font-weight: 850; cursor: pointer; }
.panel-card > header .panel-action-button:hover { background: white; }
.panel-card > header .panel-action-button:disabled { cursor: wait; opacity: 0.65; }
.solved-by-card[aria-busy="true"] p { opacity: 0.55; }
.submissions-card[aria-busy="true"] tbody { opacity: 0.55; }
.empty-panel-note { margin: 0; padding: 12px 14px 15px; color: var(--muted); font-size: 12px; }
.submissions-count { display: block; padding: 0 14px 14px; color: var(--muted); font-size: 11px; }

/* Profiles */
.profile-main { min-width: 0; }
.profile-surface { min-height: 700px; padding: 24px clamp(10px, 2.2vw, 32px) 52px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--content-rail-width); align-items: start; gap: 20px; }
.profile-primary,
.profile-rail { display: grid; gap: 16px; }
.profile-summary-card { container-type: inline-size; }
.profile-summary { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 12px; }
.profile-avatar { min-height: 170px; display: grid; align-content: center; justify-items: center; border-radius: 12px; color: #fff8ed; background: radial-gradient(circle at 65% 25%, #d6a265, transparent 22%), linear-gradient(145deg, #a75c39, #71351f); box-shadow: inset 0 0 0 4px rgb(255 255 255 / 20%); }
.profile-avatar > span { font-family: Georgia, "Times New Roman", serif; font-size: 64px; font-weight: 900; text-transform: uppercase; text-shadow: 0 4px 0 rgb(69 28 14 / 28%); }
.profile-avatar > small { min-height: 18px; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.profile-details { display: grid; align-content: center; gap: 10px; }
.profile-facts,
.profile-stats { display: grid; align-content: center; gap: 5px 14px; margin: 0; }
.profile-facts > div,
.profile-stats > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 7px; }
.profile-facts dt,
.profile-stats dt { color: var(--clay-dark); font-size: 12px; font-weight: 850; }
.profile-facts dd,
.profile-stats dd { min-width: 0; margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-facts dd img { margin-right: 7px; vertical-align: -1px; }
.profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 10px; border-top: 1px solid var(--soft-line); }
.profile-stats strong { color: var(--clay-dark); }
.medal-counts { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.medal { width: 16px; height: 19px; display: inline-block; flex: 0 0 auto; border: 1px solid rgb(96 66 44 / 18%); border-radius: 50% 50% 45% 45%; background: #d1d4d1; box-shadow: inset 0 2px 0 rgb(255 255 255 / 55%), 0 1px 2px rgb(72 43 28 / 16%); vertical-align: -4px; }
.medal::before { content: ""; width: 7px; height: 6px; display: block; margin: -5px auto 0; border-radius: 2px 2px 0 0; background: #8dbb78; }
.medal.gold { background: #f2c64d; }
.medal.silver { background: #c9cecd; }
.medal.bronze { background: #df9065; }
.medal.none { filter: grayscale(1); opacity: .65; }
.rating-chart { min-height: 230px; padding: 17px 20px 14px; }
.rating-chart svg { width: 100%; height: 185px; overflow: visible; }
.rating-chart .rating-grid-line { fill: none; stroke: #eadfce; stroke-width: .45; vector-effect: non-scaling-stroke; }
.rating-chart polyline { fill: none; stroke: var(--clay); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rating-chart circle { fill: var(--gold); stroke: #fffaf0; stroke-width: .8; vector-effect: non-scaling-stroke; }
.rating-chart-caption { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.rating-chart-caption strong { color: var(--clay-dark); }
.solved-problem-list { padding: 10px 12px 13px; color: #9b603e; font-size: 12px; line-height: 1.55; }
.solved-problem-list span { color: var(--clay-dark); }
.solved-problem-list a { padding: 1px 2px; border-radius: 2px; color: #9b603e; text-decoration: none; }
.solved-problem-list a:hover,
.solved-problem-list a:focus-visible { color: var(--cream); background: var(--line); outline: none; }
.competition-list { display: grid; gap: 7px; margin: 0; padding: 14px; list-style: none; }
.competition-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.competition-list a { min-width: 0; color: #9b603e; font-size: 12px; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.competition-list a:hover { text-decoration: underline; }
.competition-list strong { color: var(--clay-dark); font-size: 11px; }
.competition-more { border-top: 1px solid var(--line); }
.competition-more > summary { padding: 10px 14px; color: var(--clay-dark); font-size: 11px; font-weight: 850; text-align: right; cursor: pointer; list-style: none; }
.competition-more[open] > summary { border-bottom: 1px solid var(--soft-line); }
.moderator-profile-card dl { display: grid; gap: 8px; margin: 0; padding: 14px; }
.moderator-profile-card dl div { display: grid; grid-template-columns: 105px 1fr; gap: 8px; }
.moderator-profile-card dt { color: var(--clay-dark); font-size: 12px; font-weight: 850; }
.moderator-profile-card dd { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-submission-table-wrap { overflow-x: auto; padding: 10px 10px 4px; }
.profile-submission-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.profile-submission-table-wrap th { padding: 6px; color: var(--clay-dark); background: #f2e5d0; text-align: left; }
.profile-submission-table-wrap td { padding: 6px; border-top: 1px solid #e5e5e5; color: #855039; white-space: nowrap; }
.profile-submission-table-wrap a { padding: 1px 2px; border-radius: 2px; color: inherit; text-decoration: none; }
.profile-submission-table-wrap a:hover,
.profile-submission-table-wrap a:focus-visible { color: var(--cream); background: var(--line); outline: none; }
.profile-submission-table-wrap tr.result-solved td { background: #E8FFEA; }
.profile-submission-table-wrap tr.result-failed td { background: #FFE8E8; }
.profile-card-note { display: block; padding: 9px 14px 12px; color: var(--muted); font-size: 10px; font-weight: 750; text-align: right; }
.profile-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 13px; }
.profile-history-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--content-rail-width); align-items: start; gap: 20px; }
.profile-history-user-body { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px; }
.profile-history-user-body .profile-avatar { min-height: 60px; }
.profile-history-user-body .profile-avatar > span { font-size: 29px; }
.profile-history-user-body .profile-avatar > small { min-height: 11px; font-size: 8px; }
.profile-history-user-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.profile-history-identity,
.profile-history-achievements { display: grid; gap: 4px; }
.profile-history-identity > strong { color: var(--clay-dark); font-size: 16px; }
.profile-history-user-body b { color: var(--clay-dark); }
.profile-history-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 4px; }
.profile-history-toolbar { display: flex; align-items: center; gap: 6px; }
.profile-history-toolbar > span { margin-right: 4px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.profile-history-toolbar a { min-height: 31px; display: grid; padding: 0 11px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--clay-dark); background: var(--paper); font-size: 12px; font-weight: 800; text-decoration: none; }
.profile-history-toolbar a:hover { background: var(--cream); }
.profile-history-toolbar a[aria-current="page"] { color: #fff8ed; background: var(--clay-dark); }
.profile-history-table-wrap { overflow-x: auto; padding: 10px 12px; }
.profile-history-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.profile-history-table-wrap th { padding: 6px 8px; color: var(--clay-dark); background: #f2e5d0; text-align: left; white-space: nowrap; }
.profile-history-table-wrap td { padding: 6px 8px; border-top: 1px solid #e5e5e5; color: #855039; white-space: nowrap; }
.profile-history-table-wrap td:first-child { width: 100%; white-space: normal; }
.profile-history-table-wrap a { padding: 1px 2px; border-radius: 2px; color: inherit; text-decoration: none; }
.profile-history-table-wrap a:hover,
.profile-history-table-wrap a:focus-visible { color: var(--cream); background: var(--line); outline: none; }
.profile-history-table-wrap tr.result-solved td { background: #E8FFEA; }
.profile-history-table-wrap tr.result-failed td { background: #FFE8E8; }
.profile-history-table-wrap tr.result-pending td { background: #FFFACD; }
.profile-history-pagination { padding: 4px 12px 14px; }
.profile-history-topbar .profile-history-pagination { justify-content: end; padding: 0; }
.profile-history-pagination a[aria-current="page"] { color: #fff8ed; background: var(--clay-dark); }

@media (max-width: 680px) {
  .profile-history-topbar { align-items: flex-start; flex-direction: column; }
  .profile-history-topbar .profile-history-pagination { justify-content: start; }
  .profile-history-user-details { grid-template-columns: 1fr; }
}

@container (max-width: 520px) {
  .profile-summary { grid-template-columns: 120px minmax(0, 1fr); }
  .profile-avatar { min-height: 150px; }
  .profile-stats { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-history-grid { grid-template-columns: 1fr; }
  .profile-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-submissions-card { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .profile-surface { padding-right: 8px; padding-left: 8px; }
  .profile-summary { grid-template-columns: 1fr; }
  .profile-avatar { min-height: 150px; }
  .profile-stats { grid-column: auto; grid-template-columns: 1fr; }
  .profile-rail { grid-template-columns: 1fr; }
  .profile-submissions-card { grid-column: auto; }
}

@media (max-width: 1050px) {
  .task-detail-grid { grid-template-columns: 1fr; }
  .task-facts-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .task-detail-surface { padding-right: 8px; padding-left: 8px; }
  .task-facts-column { grid-template-columns: 1fr; }
}

footer {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 12px;
}

.privacy-notice {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  width: min(580px, calc(100% - 44px));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: rgb(255 253 249 / 97%);
  box-shadow: 0 22px 60px rgb(58 32 20 / 24%);
  backdrop-filter: blur(12px);
}
.privacy-notice strong { display: block; margin-bottom: 5px; color: var(--clay-dark); font-size: 13px; }
.privacy-notice p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.privacy-notice button {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  color: #fff8eb;
  background: var(--clay-dark);
  font-weight: 800;
  cursor: pointer;
}
.privacy-notice button:hover { background: var(--clay); }
.privacy-notice button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (max-width: 1120px) {
  .site-header { grid-template-columns: 200px auto 1fr; }
  .portal-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .right-rail { grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-total strong { font-size: 58px; }
  .archive-bars { height: 125px; }
}

@media (max-width: 780px) {
  .site-header, .portal-layout, footer { width: min(100% - 24px, 1460px); }
  .site-header { grid-template-columns: 1fr auto; gap: 12px; }
  .topbar-home, .header-link { display: none; }
  .header-actions { gap: 0; }
  .portal-layout { grid-template-columns: 1fr; padding-top: 14px; }
  .left-sidebar { position: static; }
  .primary-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; }
  .primary-nav a { grid-template-columns: 1fr; justify-items: center; gap: 5px; min-height: 58px; padding: 6px 2px; border: 0; border-radius: 8px; font-size: 10px; }
  .right-rail { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .activity-panel { grid-column: 1 / -1; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: auto; }
  .registration-layout { grid-template-columns: 1fr; }
  .training-layout { grid-template-columns: 1fr; }
  .registration-main { grid-column: 1; }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .form-row > label,
  .form-row > legend { padding-top: 0; text-align: left; }
}

@media (max-width: 520px) {
  .brand small { display: none; }
  .brand strong { font-size: 17px; }
  .brand-mark { width: 39px; height: 39px; }
  .language-picker summary { min-width: 119px; }
  .welcome-panel h2 { font-size: 35px; }
  .lede { font-size: 15px; }
  .right-rail { grid-template-columns: 1fr; }
  .activity-panel { grid-column: auto; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
  .privacy-notice { right: 12px; bottom: 12px; width: calc(100% - 24px); grid-template-columns: 1fr; gap: 12px; }
  .privacy-notice button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .picker-chevron { transition: none; }
}
.submission-archive-label { color: #9a6c50; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.submission-user-summary { position: relative; display: grid; grid-template-columns: 52px minmax(145px, 1fr) minmax(155px, .85fr); align-items: center; gap: 12px; min-height: 76px; padding: 10px 42px 10px 10px; color: var(--muted); font-size: 12px; text-decoration: none; }
.submission-user-summary:hover,
.submission-user-summary:focus-visible { background: #fffaf1; outline: none; }
.submission-user-summary > img { position: absolute; top: 10px; right: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(37 26 20 / 14%); }
.submission-user-avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 9px; color: #fff8ed; background: linear-gradient(145deg, #a75c39, #71351f); font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 900; text-transform: uppercase; }
.submission-user-identity,
.submission-user-achievements { display: grid; gap: 4px; }
.submission-user-identity strong { color: var(--clay-dark); font-size: 15px; }
.submission-user-summary b { color: var(--clay-dark); }
.submission-user-achievements { padding-left: 12px; border-left: 1px solid var(--soft-line); }
.submission-user-achievements .medal-counts { gap: 2px; }
.submission-user-achievements .medal { width: 13px; height: 15px; vertical-align: -3px; }
.submission-result-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px; padding: 8px 10px; border-radius: 7px; color: #71462f; font-size: 12px; }
.submission-result-banner strong { font-size: 14px; }
.submission-result-banner.result-solved { background: #E8FFEA; }
.submission-result-banner.result-failed { background: #FFE8E8; }
.submission-result-banner.result-pending { background: #FFFBD9; }
.submission-results-table-wrap { overflow-x: auto; padding: 0 10px 10px; }
.submission-results-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.submission-results-table th { padding: 5px 7px; color: var(--clay-dark); background: #f2e5d0; text-align: center; white-space: nowrap; }
.submission-results-table th:nth-child(2) { text-align: left; }
.submission-results-table td { padding: 5px 7px; border-top: 1px solid #e5e5e5; color: #855039; text-align: center; }
.submission-results-table td:nth-child(2) { color: var(--ink); text-align: left; }
.submission-results-table tr.result-solved td { background: #E8FFEA; }
.submission-results-table tr.result-failed td { background: #FFE8E8; }
.submission-empty-result { margin: 0 10px 10px; padding: 12px; border-radius: 7px; color: #855039; background: #FFE8E8; font-size: 12px; white-space: pre-wrap; }
.submission-task-info a { color: #9b603e; text-decoration: none; }
.submission-task-info a:hover,
.submission-task-info a:focus-visible { color: var(--cream); background: var(--line); outline: none; }
.submission-task-info { gap: 5px; padding: 10px; }
.submission-task-info > div { grid-template-columns: 78px minmax(0, 1fr); gap: 7px; }
.submission-task-info dt,
.submission-task-info dd { font-size: 12px; }
.submission-regrade-card p { margin: 0; padding: 12px 12px 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.submission-regrade-card button { margin: 5px 12px 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: #907563; background: #f7f1e8; font-size: 11px; font-weight: 800; }
.submission-source-surface { min-width: 0; min-height: 650px; padding: 0 0 52px; overflow: hidden; background: #fff; }
.submission-source-surface .task-detail-grid { display: block; min-width: 0; max-width: 100%; }
.submission-source-surface .task-primary-column { min-width: 0; max-width: 100%; }
.submission-source-view { position: relative; min-width: 0; max-width: 100%; min-height: 598px; overflow: hidden; background: #fff; }
.submission-source-view::after { position: absolute; z-index: 1; top: 0; right: 0; bottom: 13px; width: 22px; content: ""; pointer-events: none; opacity: 0; background: linear-gradient(to left, rgb(126 73 45 / 24%), rgb(126 73 45 / 0%)); transition: opacity 120ms ease-out; }
.submission-source-view[data-source-overflow-right]::after { opacity: 1; }
.source-formatting-status { position: absolute; z-index: 3; top: 8px; right: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; color: #9a6c50; background: rgb(255 249 238 / 92%); font-size: 10px; font-weight: 850; box-shadow: 0 1px 4px rgb(73 43 27 / 12%); }
.source-formatting-status::before { width: 8px; height: 8px; content: ""; border: 2px solid #d4b286; border-top-color: var(--clay-dark); border-radius: 50%; animation: source-formatting-spin .8s linear infinite; }
.submission-source-scroll { width: 100%; max-width: 100%; overflow-x: auto; background: #fff; }
.submission-source-lines { min-width: max-content; margin: 0; padding: 10px 0; list-style: none; counter-reset: source-line; color: #29231f; background: #fff; font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.35; tab-size: 4; }
.submission-source-lines li { min-height: 18px; display: grid; grid-template-columns: 48px minmax(max-content, 1fr); counter-increment: source-line; }
.submission-source-lines li:target { background: #fff4d7; }
.source-line-number { position: sticky; z-index: 2; left: 0; padding: 0 9px 0 5px; color: #a88d7b; background: #f7f1e8; box-shadow: 1px 0 0 #e2cfb4, 5px 0 7px rgb(96 57 37 / 8%); text-align: right; text-decoration: none; user-select: none; }
.source-line-number:hover,
.source-line-number:focus-visible { color: #fff8ed; background: var(--clay-dark); outline: none; }
.submission-source-lines code { display: block; min-height: 18px; padding: 0 12px; color: inherit; font: inherit; white-space: pre; }
.submission-source-message { margin: 0; padding: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.submission-source-lines .hljs-comment,
.submission-source-lines .hljs-quote { color: #7d8a72; font-style: italic; }
.submission-source-lines .hljs-keyword,
.submission-source-lines .hljs-selector-tag,
.submission-source-lines .hljs-literal { color: #7f3424; font-weight: 700; }
.submission-source-lines .hljs-string,
.submission-source-lines .hljs-doctag,
.submission-source-lines .hljs-regexp { color: #8a5b1f; }
.submission-source-lines .hljs-number,
.submission-source-lines .hljs-symbol,
.submission-source-lines .hljs-variable,
.submission-source-lines .hljs-template-variable { color: #9b4f32; }
.submission-source-lines .hljs-title,
.submission-source-lines .hljs-section,
.submission-source-lines .hljs-type,
.submission-source-lines .hljs-built_in { color: #3e6174; }
.submission-source-lines .hljs-meta,
.submission-source-lines .hljs-attr,
.submission-source-lines .hljs-attribute { color: #75633e; }
.submission-future-card p { margin: 0; padding: 18px 18px 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.submission-future-card > a { display: inline-block; margin: 4px 18px 18px; padding: 5px 7px; border-radius: 4px; color: var(--clay-dark); font-size: 12px; font-weight: 800; text-decoration: none; }
.submission-future-card > a:hover,
.submission-future-card > a:focus-visible { color: var(--cream); background: var(--line); outline: none; }

@keyframes source-formatting-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
  .submission-user-summary { grid-template-columns: 44px minmax(0, 1fr); }
  .submission-user-avatar { width: 44px; height: 44px; font-size: 22px; }
  .submission-user-achievements { grid-column: 1 / -1; padding: 8px 0 0; border-top: 1px solid var(--soft-line); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .submission-source-view::after { transition: none; }
  .source-formatting-status::before { animation: none; }
}

.topbar-links { display: flex; align-items: center; gap: 4px; }
.topbar-links a { min-height: 30px; display: grid; padding: 0 11px; place-items: center; border-radius: 7px; color: #f9e9d2; font-size: 13px; font-weight: 750; text-decoration: none; text-shadow: 0 1px 0 rgb(67 28 15 / 28%); }
.topbar-links a:hover,
.topbar-links a:focus-visible { color: #fffdf8; background: rgb(255 246 229 / 13%); outline: 1px solid rgb(255 240 212 / 34%); text-shadow: none; }
.topbar-links a[aria-current="page"] { color: var(--clay-dark); background: #f5dfbf; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 25%), 0 2px 7px rgb(58 24 13 / 16%); text-shadow: none; }
.account-main { min-width: 0; }
.account-surface { min-height: 540px; padding: 34px clamp(16px, 5vw, 70px) 70px; }
.account-form { width: min(760px, 100%); margin: 0 auto; padding: 26px 30px 24px; }
.account-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 12px; }
.account-row > label { color: var(--clay-dark); font-size: 13px; font-weight: 850; text-align: right; }
.account-control { min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 7px; }
.account-control--solo { padding-right: 35px; }
.account-control input,
.account-control select { width: 100%; min-width: 0; height: 36px; flex: 1 1 auto; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fffdfa; font: inherit; font-size: 13px; }
.account-control input:focus,
.account-control select:focus { outline: 3px solid rgb(201 143 87 / 22%); border-color: var(--clay); }
.help-button { width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 1px solid var(--soft-line); border-radius: 50%; color: var(--clay-dark); background: #fff8ed; font-size: 14px; font-weight: 900; cursor: pointer; }
.help-button:hover,
.help-button:focus-visible { color: #fff8ed; background: var(--clay-dark); outline: none; }
.account-actions { padding: 8px 35px 0 184px; }
.account-actions button { min-width: 92px; height: 36px; padding: 0 18px; border: 0; border-radius: 7px; color: #fff8ed; background: var(--clay-dark); font: inherit; font-size: 13px; font-weight: 850; cursor: pointer; box-shadow: 0 6px 16px rgb(92 45 26 / 14%); }
.account-actions button:hover,
.account-actions button:focus-visible { background: var(--clay); outline: 3px solid rgb(201 143 87 / 25%); }
.account-privacy-form { max-width: 650px; }
.account-message { width: min(760px, 100%); display: flex; gap: 10px; margin: 0 auto 14px; padding: 10px 13px; border-radius: 7px; font-size: 12px; }
.account-error { color: #7a2e28; background: #ffe8e8; border: 1px solid #e8b7b3; }
.account-stub { width: min(760px, 100%); margin: 0 auto; }
.account-stub p { margin: 0; padding: 18px; color: var(--muted); font-size: 13px; }
.account-dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fffdfa; box-shadow: 0 24px 70px rgb(51 27 17 / 32%); }
.account-dialog::backdrop { background: rgb(45 31 24 / 48%); backdrop-filter: blur(1px); }
.account-dialog form { display: grid; justify-items: start; gap: 11px; padding: 18px; }
.account-dialog h2 { width: calc(100% + 36px); margin: -18px -18px 0; padding: 8px 13px; border-radius: 9px 9px 0 0; color: var(--clay-dark); background: var(--sand); font-size: 14px; }
.account-dialog p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-dialog button { justify-self: end; min-width: 72px; padding: 7px 13px; border: 0; border-radius: 6px; color: #fff8ed; background: var(--clay-dark); font: inherit; font-weight: 850; cursor: pointer; }
.account-success form { grid-template-columns: 42px 1fr; align-items: center; }
.account-success h2 { width: auto; margin: 0; padding: 0; background: transparent; font-size: 20px; }
.account-success p { grid-column: 2; }
.account-success button { grid-column: 2; }
.success-mark { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #3b723e; background: #e8ffea; font-size: 20px; font-weight: 900; }

@media (max-width: 780px) {
  .topbar-links { display: none; }
  .account-surface { padding: 18px 8px 45px; }
  .account-form { padding: 20px 14px; }
  .account-row { grid-template-columns: 1fr; gap: 6px; }
  .account-row > label { text-align: left; }
  .account-actions { padding: 8px 35px 0 0; }
}
