:root {
  color-scheme: light;
  --page-bg: #f3f5f4;
  --surface: #fff;
  --surface-muted: #f8faf9;
  --surface-subtle: #eef2f0;
  --surface-strong: #171c19;
  --text: #171b18;
  --text-muted: #5e6761;
  --text-soft: #7a847e;
  --border: #d6ddd8;
  --border-soft: #e5eae7;
  --input-border: #bfc9c2;
  --primary: #24733b;
  --primary-hover: #1c5e30;
  --primary-soft: #e5f3e8;
  --secondary: #5c6861;
  --secondary-hover: #46514b;
  --link: #1d6534;
  --danger: #a72c24;
  --danger-soft: #fbeceb;
  --success: #1a7434;
  --success-soft: #e8f5eb;
  --warning: #8a6116;
  --warning-soft: #fbf2dc;
  --accent: #197589;
  --accent-soft: #e4f3f6;
  --focus: rgba(36, 115, 59, .24);
  --shadow: 0 18px 50px rgba(24, 40, 30, .09);
  --shadow-soft: 0 8px 24px rgba(24, 40, 30, .07);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #141916;
  --surface: #1d2420;
  --surface-muted: #222a25;
  --surface-subtle: #29332d;
  --surface-strong: #edf3ee;
  --text: #edf2ee;
  --text-muted: #b0bbb3;
  --text-soft: #89968d;
  --border: #3d4941;
  --border-soft: #303b34;
  --input-border: #526157;
  --primary: #65bd75;
  --primary-hover: #7bcd89;
  --primary-soft: #263c2c;
  --secondary: #65736a;
  --secondary-hover: #75837a;
  --link: #84d492;
  --danger: #ff8c84;
  --danger-soft: #422a28;
  --success: #79d08b;
  --success-soft: #253b2b;
  --warning: #e6bf6d;
  --warning-soft: #3e3524;
  --accent: #75c9d6;
  --accent-soft: #253a3e;
  --focus: rgba(101, 189, 117, .28);
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

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

button,
input,
select,
textarea {
  letter-spacing: 0;
}

main {
  width: min(var(--page-width, 420px), calc(100vw - 32px));
  margin: clamp(60px, 7vh, 88px) auto;
  padding: clamp(22px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin: 28px 0 12px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  letter-spacing: 0;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 16px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}

input[readonly] {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

button,
a.button {
  display: inline-flex;
  min-height: 42px;
  margin-top: 18px;
  padding: 10px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover,
a.button:hover {
  background: var(--primary-hover);
  color: #fff;
}

button:active,
a.button:active {
  transform: translateY(1px);
}

button:focus-visible,
a.button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.site-utilities {
  position: fixed;
  z-index: 1000;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.utility-button {
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
}

.utility-button:hover,
.utility-button:focus-visible {
  border-color: var(--primary);
  background: var(--surface-muted);
  color: var(--text);
}

.theme-toggle {
  font-size: 21px;
}

button.inline-button {
  margin: 0 6px 0 0;
  padding: 6px 10px;
  font-size: 13px;
}

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

.secondary:hover {
  background: var(--secondary-hover);
}

.button-quiet {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-quiet:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.danger-button:hover {
  background: color-mix(in srgb, var(--danger) 84%, #000);
}

.warning-button {
  background: var(--warning);
  color: #fff;
}

.warning-button:hover {
  background: color-mix(in srgb, var(--warning) 84%, #000);
}

.meta {
  color: var(--text-muted);
  line-height: 1.55;
}

.error {
  margin: 12px 0 0;
  color: var(--danger);
}

.ok {
  color: var(--success);
}

.notice,
.error:not([hidden]),
.ok:not([hidden]) {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface-muted);
}

.error:not([hidden]) {
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
}

.ok:not([hidden]) {
  border-left: 3px solid var(--success);
  background: var(--success-soft);
}

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

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  padding: 3px 9px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.status-badge-accent {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.status-badge-critical {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: var(--surface-muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

fieldset {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

legend {
  font-weight: 700;
  margin-bottom: 8px;
}

label.option {
  display: flex;
  min-height: 40px;
  margin: 8px 0;
  padding: 8px 10px;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 400;
  line-height: 1.45;
}

label.option:hover {
  border-color: var(--border);
  background: var(--surface);
}

label.option input {
  margin-top: 3px;
}

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

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-heading h1 {
  margin-bottom: 6px;
}

.page-heading .meta {
  max-width: 720px;
  margin: 0;
}

.page-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-lead {
  max-width: 720px;
  margin: -8px 0 24px;
  color: var(--text-muted);
  font-size: 15px;
}

.page-section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.page-heading + .page-section,
.account-hero + .page-section {
  border-top: 0;
}

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

.section-heading h2 {
  margin: 0;
}

.section-heading > .meta {
  max-width: 520px;
  margin: 0;
  text-align: right;
}

.toolbar,
.panel {
  margin: 18px 0 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.toolbar {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
}

.toolbar h2,
.panel h2 {
  margin-top: 0;
}

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

.form-grid label {
  margin: 0;
}

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

.compact-actions {
  align-items: center;
}

.compact-actions button,
.compact-actions a.button {
  margin-top: 0;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form label {
  min-width: 190px;
  margin: 0;
}

.inline-form input {
  margin-top: 6px;
}

.inline-form button {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
}

.tab-button {
  margin-top: 0;
  min-height: 38px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
}

.tab-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  padding: 10px 2px 4px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  overflow-x: auto;
}

.table-wrap table {
  margin: 0;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.list-tools,
.import-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.list-tools input,
.list-tools select,
.import-form input,
.import-form select {
  width: auto;
  min-width: 180px;
}

.inline-option {
  margin: 0;
}

.import-result,
.check-list {
  margin: 12px 0;
}

.import-result ul,
.check-list ul {
  margin: 8px 0;
  padding-left: 20px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.page-preview {
  display: block;
  width: 96px;
  height: 136px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-subtle);
}

.page-preview-placeholder {
  display: grid;
  place-items: center;
  width: 96px;
  height: 136px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 13px;
}

.batch-group {
  padding: 14px 0 22px;
  border-top: 1px solid var(--border);
}

.batch-group:first-child {
  border-top: 0;
}

.batch-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.batch-heading h3 {
  margin: 0;
  font-size: 16px;
}

.batch-heading .meta {
  margin: 0;
}

.paper-result {
  padding: 18px 0 28px;
  border-top: 1px solid var(--border);
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed var(--input-border);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-muted);
  text-align: center;
}

.paper-result:first-of-type {
  border-top: 0;
}

.paper-result-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.paper-result-heading h2 {
  margin: 0 0 6px;
}

.paper-page-actions {
  align-items: start;
}

.paper-page-actions a.button,
.paper-page-actions button {
  margin-top: 0;
}

.paper-result-actions {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 14px;
}

.paper-export-action {
  margin-top: 0 !important;
  white-space: nowrap;
}

.paper-total {
  min-width: 110px;
  text-align: right;
}

.paper-total span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.paper-total strong {
  font-size: 24px;
}

.paper-score-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

.paper-identity {
  border-right: 1px solid var(--border);
  padding-right: 18px;
}

.paper-identity img,
.paper-identity-empty {
  width: 100%;
  min-height: 76px;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-subtle);
}

.paper-identity-empty {
  display: grid;
  place-items: center;
}

.score-table th,
.score-table td {
  min-width: 64px;
  text-align: center;
  white-space: nowrap;
}

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

@media (max-width: 720px) {
  .paper-result-heading,
  .paper-score-layout {
    display: block;
  }

  .paper-total {
    margin-top: 10px;
    text-align: left;
  }

  .paper-result-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .paper-identity {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 16px;
    margin-bottom: 14px;
  }
}

.folder-list,
.grading-task-list {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.folder-row,
.grading-task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.folder-row:hover,
.grading-task-row:hover {
  background: var(--surface-muted);
}

.folder-icon {
  color: var(--warning);
  font-size: 25px;
}

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

.folder-main strong,
.folder-main small {
  display: block;
}

.folder-main small {
  margin-top: 4px;
  color: var(--text-muted);
}

.folder-arrow {
  color: var(--text-muted);
  font-size: 25px;
}

.account-page {
  background:
    radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--primary-soft) 65%, transparent), transparent 28rem),
    var(--page-bg);
}

.account-page main {
  margin: clamp(42px, 6vh, 72px) auto;
  padding: 14px;
  overflow: visible;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 30px 90px rgba(25, 52, 37, .12), 0 2px 8px rgba(25, 52, 37, .04);
}

.account-hero {
  position: relative;
  display: grid;
  min-height: 160px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 30px 32px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 18rem),
    linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--surface) 88%, var(--primary-soft)));
}

.account-hero::after {
  position: absolute;
  right: -70px;
  bottom: -125px;
  width: 310px;
  height: 310px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px color-mix(in srgb, var(--primary) 3%, transparent),
    0 0 0 90px color-mix(in srgb, var(--primary) 2%, transparent);
  content: "";
  pointer-events: none;
}

.account-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 24px;
  background: linear-gradient(145deg, #175d3b, #0d432a);
  box-shadow: 0 18px 34px rgba(23, 93, 59, .18), inset 0 1px rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 32px;
  font-weight: 820;
  letter-spacing: -.03em;
}

.account-identity {
  position: relative;
  z-index: 1;
}

.account-identity .page-eyebrow {
  color: var(--primary);
}

.account-identity h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 760;
  letter-spacing: -.035em;
}

.account-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
}

.account-meta > span:first-child {
  padding-right: 10px;
  border-right: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}

.account-meta strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.account-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-actions form {
  margin: 0;
}

.account-actions .button,
.account-actions button {
  min-height: 44px;
  margin: 0;
  border-radius: 10px;
}

.account-page .page-section {
  margin-top: 14px;
  padding: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--surface);
}

.account-page .section-heading {
  margin-bottom: 20px;
  align-items: center;
}

.account-page .section-heading h2 {
  font-size: 24px;
  font-weight: 730;
  letter-spacing: -.025em;
}

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

.account-link {
  display: grid;
  min-width: 0;
  min-height: 112px;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(24, 40, 30, .02);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 180ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}

.account-link:hover,
.account-link:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
  color: var(--text);
  box-shadow: 0 14px 28px rgba(24, 72, 44, .1);
  transform: translateY(-3px);
}

.account-link:active {
  box-shadow: 0 6px 14px rgba(24, 72, 44, .07);
  transform: scale(.985);
}

.account-link-grid:not(.account-link-grid-compact) .account-link:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  min-height: 92px;
}

.account-link-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}

.account-link strong,
.account-link small {
  display: block;
}

.account-link strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.account-link small {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-link-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}

.account-link:hover .account-link-arrow,
.account-link:focus-visible .account-link-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.account-link-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.account-page .account-admin-section {
  --admin-gold: #b9831e;
  --admin-gold-deep: #784706;
  --admin-card-rest: #fffdfa;
  --admin-card-hover: #faedc5;
  --admin-card-active: #f4dfa4;
  border-color: #d7c7a1;
  background: #fcf8ed;
}

:root[data-theme="dark"] .account-page .account-admin-section {
  --admin-gold: #e1b658;
  --admin-gold-deep: #f0cb78;
  --admin-card-rest: #23231f;
  --admin-card-hover: #44371f;
  --admin-card-active: #514124;
  border-color: #6e5a30;
  background: #2d291f;
}

.account-admin-section .page-eyebrow,
.account-admin-section .account-link-index {
  color: var(--admin-gold-deep);
}

.account-admin-section .account-link-index {
  border-color: color-mix(in srgb, var(--admin-gold) 44%, var(--border));
  background: color-mix(in srgb, var(--admin-gold) 8%, var(--admin-card-rest));
  transition: border-color 160ms ease, background 160ms ease, box-shadow 180ms ease, color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}

.account-admin-section .account-link {
  border-color: color-mix(in srgb, var(--admin-gold) 22%, var(--border));
  background: var(--admin-card-rest);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--admin-gold) 7%, transparent);
}

.account-admin-section .account-link-arrow {
  border: 1px solid color-mix(in srgb, var(--admin-gold) 18%, var(--border-soft));
  background: color-mix(in srgb, var(--admin-gold) 5%, var(--admin-card-rest));
  color: color-mix(in srgb, var(--admin-gold-deep) 72%, var(--text-soft));
  transition: border-color 160ms ease, background 160ms ease, box-shadow 180ms ease, color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}

.account-admin-section .account-link-arrow svg {
  display: block;
  width: 14px;
  height: 14px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.account-admin-section .account-link:hover,
.account-admin-section .account-link:focus-visible {
  border-color: var(--admin-gold);
  background: var(--admin-card-hover);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--admin-gold-deep) 14%, transparent), inset 0 1px rgba(255, 255, 255, .58);
}

.account-admin-section .account-link:hover .account-link-index,
.account-admin-section .account-link:focus-visible .account-link-index {
  border-color: var(--admin-gold);
  background: transparent;
  box-shadow: none;
  color: var(--admin-gold-deep);
  transform: scale(1.04);
}

.account-admin-section .account-link:hover .account-link-arrow,
.account-admin-section .account-link:focus-visible .account-link-arrow {
  border-color: var(--admin-gold);
  background: transparent;
  box-shadow: none;
  color: var(--admin-gold-deep);
  transform: translateX(3px);
}

.account-admin-section .account-link:active {
  background: var(--admin-card-active);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--admin-gold-deep) 15%, transparent);
}

.account-page .account-advanced {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--border));
  background: color-mix(in srgb, var(--danger-soft) 34%, var(--surface));
}

.account-advanced > .meta {
  max-width: 720px;
  margin: 0;
}

.account-setuid-form {
  margin-top: 20px;
}

.account-setuid-form label {
  min-width: auto;
}

.account-setuid-form input {
  width: 240px;
}

.account-setuid-form button {
  min-height: 44px;
  border-radius: 10px;
}

.auth-page {
  background: var(--page-bg);
}

.auth-page .site-utilities {
  top: 22px;
  right: 22px;
}

.auth-page .utility-button {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 10px 28px rgba(17, 44, 29, .12);
  backdrop-filter: blur(18px) saturate(150%);
}

.auth-shell {
  display: grid;
  width: min(1080px, calc(100vw - 64px));
  min-height: min(720px, calc(100vh - 80px));
  grid-template-columns: minmax(360px, .78fr) minmax(450px, 1.22fr);
  margin: clamp(40px, 6vh, 72px) auto;
  padding: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(25, 52, 37, .14), 0 2px 8px rgba(25, 52, 37, .05);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 12%, rgba(239, 194, 74, .24), transparent 25%),
    linear-gradient(145deg, #175d3b 0%, #10482e 58%, #0b3622 100%);
  color: #fff;
  isolation: isolate;
}

.auth-brand-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.auth-brand-panel::after {
  position: absolute;
  z-index: -1;
  right: -120px;
  bottom: -150px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgba(255, 255, 255, .025),
    0 0 0 108px rgba(255, 255, 255, .018);
  content: "";
}

.auth-brush-link {
  position: relative;
  z-index: 1;
  display: block;
  width: min(92%, 390px);
  aspect-ratio: 1314 / 671;
  background: linear-gradient(112deg, #f3f8f4 5%, #b9ddc4 58%, #dfc66f 100%);
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .24));
  -webkit-mask: url("/static/images/2cho-brush.png") center / contain no-repeat;
  mask: url("/static/images/2cho-brush.png") center / contain no-repeat;
  transition: filter 180ms ease, transform 180ms cubic-bezier(.23, 1, .32, 1);
}

.auth-brush-link:hover,
.auth-brush-link:focus-visible {
  filter: drop-shadow(0 26px 38px rgba(0, 0, 0, .3));
  transform: translateY(-3px) scale(1.015);
}

.auth-brush-link:active {
  transform: scale(.98);
}

.auth-mobile-wordmark {
  display: none;
}

.auth-content {
  display: flex;
  min-width: 0;
  padding: clamp(44px, 6vw, 74px);
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.auth-header {
  padding: 0;
  border: 0;
}

.auth-header h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 760;
  letter-spacing: -.035em;
}

.auth-header .meta {
  margin: 0;
  max-width: 30em;
  font-size: 14px;
}

.auth-form {
  padding-top: 18px;
}

.auth-form label {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 720;
}

.auth-form input {
  min-height: 52px;
  margin-top: 8px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--surface-muted);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--input-border));
  background: var(--surface);
}

.password-requirements {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.password-requirements ul {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 6px 14px;
  flex-wrap: wrap;
  list-style: none;
}

.password-requirements li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: color 140ms ease;
}

.password-requirements li::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid var(--text-soft);
  border-radius: 50%;
  content: "";
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.password-requirements li[data-met="true"] {
  color: var(--success);
}

.password-requirements li[data-met="true"]::before {
  border-color: var(--success);
  background: var(--success);
  transform: scale(1.12);
}

.password-requirements li[data-met="false"] {
  color: var(--danger);
}

.password-requirements li[data-met="false"]::before {
  border-color: var(--danger);
}

.auth-submit {
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  border-radius: 12px;
  background: #175d3b;
  box-shadow: 0 10px 24px rgba(23, 93, 59, .17);
  transition: background 160ms ease, box-shadow 180ms ease, transform 120ms cubic-bezier(.23, 1, .32, 1);
}

.auth-submit:hover {
  background: #114c30;
  box-shadow: 0 14px 30px rgba(23, 93, 59, .24);
}

.auth-submit:active {
  transform: scale(.975);
  box-shadow: 0 5px 14px rgba(23, 93, 59, .16);
}

.auth-footer {
  display: flex;
  margin-top: 24px;
  padding: 0;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-footer a {
  font-weight: 730;
  text-decoration-thickness: 1px;
}

.message-page main {
  text-align: center;
}

.message-status-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 23px;
  font-weight: 850;
}

.message-copy {
  margin: 0 0 8px;
}

.message-page .button {
  margin-top: 22px;
}

.permission-search form {
  width: 100%;
}

.permission-search .actions {
  align-items: stretch;
}

.permission-search input {
  flex: 1;
  min-width: 220px;
}

.permission-table-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.form-footer {
  display: flex;
  margin-top: 18px;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.form-footer button {
  margin: 0;
}

.profile-permission-status {
  display: flex;
  margin: 22px 0 4px;
  padding: 14px 16px;
  gap: 6px 20px;
  align-items: baseline;
  border-left: 4px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.profile-permission-status span {
  color: var(--text-muted);
  font-size: 13px;
}

.profile-permission-ready {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.sticky-form-actions {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  display: flex;
  margin-top: 24px;
  padding: 12px 14px;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.sticky-form-actions button {
  margin: 0;
}

.submission-overview {
  margin: 24px 0 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-muted);
}

.submission-overview .section-heading {
  margin-bottom: 14px;
}

.upload-zone {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px 14px;
  padding: 20px;
  align-items: end;
  border: 1px dashed var(--input-border);
  border-radius: 7px;
  background: var(--surface-muted);
}

.upload-zone label {
  grid-column: 1 / -1;
  margin: 0;
}

.upload-zone input {
  background: var(--surface);
}

.upload-zone button {
  margin: 0;
}

.upload-zone .meta {
  grid-column: 1 / -1;
}

.contest-search-actions {
  flex: 1;
  justify-content: flex-end;
}

.contest-search-actions input {
  width: min(420px, 100%);
}

@media (max-width: 720px) {
  main {
    width: min(var(--page-width, 420px), calc(100vw - 20px));
    margin: 58px auto 20px;
    padding: 20px;
  }

  .page-heading,
  .section-heading,
  .toolbar {
    display: block;
  }

  .page-heading .actions,
  .section-heading > .meta,
  .toolbar .actions {
    margin-top: 14px;
    text-align: left;
  }

  .account-page main {
    margin: 58px auto 20px;
    padding: 10px;
    border-radius: 18px;
  }

  .account-hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border-radius: 14px;
  }

  .account-hero::after {
    display: none;
  }

  .account-avatar {
    width: 60px;
    height: 60px;
    border-radius: 17px;
    font-size: 24px;
  }

  .account-identity h1 {
    font-size: 30px;
  }

  .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }

  .account-actions .button,
  .account-actions form {
    flex: 1;
  }

  .account-actions button {
    width: 100%;
  }

  .account-link-grid {
    grid-template-columns: 1fr;
  }

  .account-link-grid:not(.account-link-grid-compact) .account-link:last-child:nth-child(odd) {
    grid-column: auto;
    min-height: 112px;
  }

  .account-page .page-section {
    padding: 20px;
    border-radius: 14px;
  }

  .account-setuid-form input {
    width: 100%;
  }

  .auth-footer,
  .profile-permission-status,
  .sticky-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-page .site-utilities {
    top: 8px;
    right: 8px;
  }

  .auth-shell {
    display: block;
    width: min(460px, calc(100vw - 20px));
    min-height: 0;
    margin: 58px auto 20px;
    padding: 0;
    border-radius: 18px;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-content {
    padding: 28px 22px;
  }

  .auth-mobile-wordmark {
    display: inline-block;
    margin-bottom: 34px;
    color: var(--text);
    font-size: 26px;
    font-weight: 860;
    letter-spacing: -.045em;
    line-height: 1;
    text-decoration: none;
  }

  .upload-zone {
    grid-template-columns: 1fr;
  }

  .upload-zone label,
  .upload-zone .meta {
    grid-column: 1;
  }

  .site-utilities {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .utility-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .auth-brush-link,
  .auth-submit,
  .account-link,
  .account-link-arrow {
    transition-duration: 80ms;
  }

  .auth-brush-link:hover,
  .auth-brush-link:focus-visible,
  .account-link:hover,
  .account-link:focus-visible,
  .account-link:active,
  .account-link:hover .account-link-arrow,
  .account-link:focus-visible .account-link-arrow {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .auth-page .utility-button {
    backdrop-filter: none;
  }

  .auth-page .utility-button {
    background: var(--surface);
  }
}
