html[data-theme="blue"] {
  --profile-accent: var(--theme-accent);
  --profile-accent-deep: var(--theme-accent-hover);
  --profile-accent-soft: var(--theme-soft);
  --profile-page: var(--theme-paper);
  --profile-heat-1: #dbe6fa;
  --profile-heat-2: #9bbcf4;
  --profile-heat-3: #4b86ee;
  --profile-heat-4: #0750dc;
}

html[data-theme="purple"] {
  --profile-accent: var(--theme-accent);
  --profile-accent-deep: var(--theme-accent-hover);
  --profile-accent-soft: var(--theme-soft);
  --profile-page: var(--theme-paper);
  --profile-heat-1: #e4dcf1;
  --profile-heat-2: #c2a9e4;
  --profile-heat-3: #8e5bc8;
  --profile-heat-4: #6514c5;
}

.app-shell:has(.profile-page) {
  background: var(--profile-page);
}

.app-shell:has(.profile-page) > .app-footer {
  display: none;
}

.profile-page {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(calc(100% - 32px), 1480px);
  min-height: calc(100dvh - 112px);
  margin: 20px auto 32px;
  padding: 22px;
  border: 1px solid var(--theme-rule);
  border-top: 3px solid var(--profile-accent);
  background:
    linear-gradient(135deg, var(--profile-accent) 0 16px, transparent 16px) left top / 70px 8px no-repeat,
    linear-gradient(315deg, var(--profile-accent) 0 16px, transparent 16px) right bottom / 70px 8px no-repeat,
    var(--profile-page);
  color: var(--theme-ink);
}

.profile-page *,
.profile-dialog * {
  box-sizing: border-box;
}

.profile-page [hidden],
.profile-dialog [hidden] {
  display: none !important;
}

.profile-sidebar,
.profile-panel {
  min-width: 0;
  border: 1px solid var(--theme-rule);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.profile-sidebar {
  grid-row: 1 / span 2;
  padding: 26px 22px 24px;
}

.profile-identity {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px 16px;
  align-items: center;
}

.profile-avatar {
  display: block;
  width: 108px;
  height: 108px;
  border: 1px solid var(--theme-rule);
  border-radius: 50%;
  background: var(--theme-soft);
  object-fit: cover;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-identity h1 {
  margin: 0 0 5px;
  color: var(--theme-ink);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.profile-username {
  display: block;
  margin-bottom: 5px;
  color: var(--theme-muted);
  font: 12px/1.4 var(--font-code);
  overflow-wrap: anywhere;
}

.profile-joined {
  color: var(--theme-muted);
  font-size: 13px;
  white-space: nowrap;
}

.profile-bio {
  grid-column: 1 / -1;
  min-height: 42px;
  color: var(--theme-muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.profile-bio.empty {
  color: var(--theme-muted);
}

.profile-page .profile-edit-button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--theme-ink);
  border-radius: 0;
  background: #ffffff;
  color: var(--theme-ink);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.profile-page .profile-edit-button:hover {
  border-color: var(--profile-accent);
  background: var(--profile-accent-soft);
  color: var(--profile-accent-deep);
}

.profile-stats,
.profile-achievements {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--theme-soft);
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--theme-ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.profile-section-title::before {
  flex: 0 0 18px;
  width: 18px;
  height: 12px;
  background: linear-gradient(90deg, var(--profile-accent) 0 27%, transparent 27% 37%, var(--profile-accent) 37% 65%, transparent 65% 75%, var(--profile-accent) 75% 100%);
  content: "";
  transform: skewX(-22deg);
}

.profile-stat-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.profile-stat {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  gap: 8px;
  align-items: baseline;
}

.profile-stat-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: 32px;
  height: 32px;
  color: var(--profile-accent);
}

.profile-stat-label {
  color: var(--theme-muted);
  font-size: 14px;
}

.profile-stat strong {
  color: var(--theme-ink);
  font-size: 30px;
  font-style: italic;
  line-height: 1;
}

.profile-stat-unit {
  color: var(--theme-muted);
  font-size: 13px;
}

.profile-achievement-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.profile-achievement {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--theme-muted);
  font-size: 13px;
  text-align: center;
}

.profile-achievement-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 58px;
  background: var(--profile-accent);
  color: #ffffff;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
}

.profile-achievement-empty {
  margin-top: 18px;
  color: #7a869a;
  font-size: 13px;
  line-height: 1.7;
}

.profile-panel {
  padding: 22px 24px;
}

.profile-calendar-panel > .profile-section-title {
  margin-bottom: 20px;
}

.profile-calendar-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.profile-calendar-scroll:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 5px;
}

.profile-calendar-inner {
  min-width: 600px;
}

.profile-calendar-months {
  display: grid;
  grid-template-columns: repeat(var(--weeks), minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 7px 43px;
  color: var(--theme-muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
}

.profile-calendar-layout {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  gap: 6px;
}

.profile-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 17px);
  gap: 6px;
  color: #657188;
  font-size: 11px;
  line-height: 17px;
}

.profile-calendar-weeks {
  display: grid;
  grid-template-columns: repeat(var(--weeks), minmax(0, 1fr));
  gap: 6px;
}

.profile-calendar-week {
  display: grid;
  grid-template-rows: repeat(7, 17px);
  gap: 6px;
}

.profile-calendar-day {
  display: block;
  min-width: 0;
  border-radius: 3px;
  background: #eef0f4;
}

.profile-calendar-day.future {
  background: transparent;
}

.profile-calendar-day[data-level="1"],
.profile-calendar-legend [data-level="1"] {
  background: var(--profile-heat-1);
}

.profile-calendar-day[data-level="2"],
.profile-calendar-legend [data-level="2"] {
  background: var(--profile-heat-2);
}

.profile-calendar-day[data-level="3"],
.profile-calendar-legend [data-level="3"] {
  background: var(--profile-heat-3);
}

.profile-calendar-day[data-level="4"],
.profile-calendar-legend [data-level="4"] {
  background: var(--profile-heat-4);
}

.profile-calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 16px;
  color: #69758a;
  font-size: 11px;
}

.profile-calendar-legend i {
  width: 17px;
  height: 14px;
  border-radius: 3px;
  background: #eef0f4;
}

.profile-records-panel {
  padding-bottom: 18px;
}

.profile-records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-records-count {
  color: #606c80;
  font-size: 12px;
  white-space: nowrap;
}

.profile-record-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profile-filter-tabs {
  display: flex;
  flex: 1 1 355px;
  min-width: 330px;
  align-items: center;
  gap: 2px;
}

.profile-filter-tab {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--theme-muted);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

.profile-filter-tab:hover {
  background: var(--profile-accent-soft);
  color: var(--profile-accent-deep);
}

.profile-filter-tab.active {
  background: var(--profile-accent);
  color: #ffffff;
}

.profile-search {
  display: flex;
  flex: 1 1 175px;
  align-items: center;
  gap: 7px;
  min-width: 160px;
  max-width: 225px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--theme-rule);
  border-radius: 3px;
  background: #ffffff;
  color: #606c80;
}

.profile-search:focus-within {
  border-color: var(--profile-accent);
  outline: 2px solid var(--profile-accent-soft);
}

.profile-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--theme-ink);
  font-size: 13px;
}

.profile-date-range {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  color: #788499;
}

.profile-date-range label {
  min-width: 0;
}

.profile-date-range input {
  width: 133px;
  min-height: 40px;
  padding: 6px 7px;
  border: 1px solid var(--theme-rule);
  border-radius: 3px;
  background: #ffffff;
  color: var(--theme-muted);
  font-size: 13px;
}

.profile-clear-filter {
  min-height: 40px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--profile-accent-deep);
  font-size: 13px;
  white-space: nowrap;
}

.profile-date-feedback {
  min-block-size: 40px;
  padding-block: 6px 10px;
  box-sizing: border-box;
}

.profile-date-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.profile-records-results {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 54px;
  block-size: clamp(22rem, 55svh, 32rem);
  min-inline-size: 0;
}

.profile-table-wrap {
  width: 100%;
  min-width: 0;
  min-block-size: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.profile-records-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

.profile-records-table th,
.profile-records-table td {
  padding: 13px 11px;
  border-bottom: 1px solid var(--theme-soft);
  vertical-align: middle;
}

.profile-records-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  color: #657086;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.profile-records-table th:nth-child(1) { width: 24%; }
.profile-records-table th:nth-child(2) { width: 28%; }
.profile-records-table th:nth-child(3) { width: 25%; }
.profile-records-table th:nth-child(4) { width: 23%; text-align: right; }

.profile-records-table td {
  color: var(--theme-ink);
  font-size: 13px;
}

.profile-records-table tbody tr:hover {
  background: var(--theme-paper);
}

.profile-records-table tbody tr:last-child td {
  border-bottom: 0;
}

.profile-record-time {
  font: 12px/1.5 var(--font-code);
  white-space: nowrap;
}

.profile-record-time small {
  display: block;
  margin-top: 3px;
  color: #606c80;
  font: 11px/1.4 var(--font-body);
}

.profile-record-title {
  display: block;
  color: var(--theme-ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-record-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 650;
}

.profile-record-status.completed { color: var(--profile-accent-deep); }
.profile-record-status.failed { color: #c13535; }
.profile-record-status.pending { color: var(--profile-accent-deep); }
.profile-record-status.draft { color: var(--theme-muted); }
.profile-record-status.submitted { color: var(--theme-muted); }

.profile-score {
  flex-basis: 100%;
  padding-left: 23px;
  color: #7a8598;
  font-size: 10px;
  font-weight: 400;
}

.profile-records-table .profile-record-action {
  float: right;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--theme-rule);
  border-radius: 0;
  background: #ffffff;
  color: var(--theme-ink);
  font-size: 12px;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

.profile-records-table .profile-record-action:hover {
  border-color: var(--profile-accent);
  background: var(--profile-accent-soft);
  color: var(--profile-accent-deep);
}

.profile-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--theme-soft);
}

.profile-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--theme-muted);
  font-size: 12px;
}

.profile-pagination button:hover:not(:disabled) {
  border-color: var(--theme-rule);
  background: var(--theme-paper);
}

.profile-pagination .profile-page-number.active {
  background: var(--profile-accent);
  color: #ffffff;
}

.profile-pagination .profile-page-next {
  border-color: var(--theme-rule);
  gap: 4px;
}

.profile-page-ellipsis {
  min-width: 18px;
  color: #8a94a5;
  text-align: center;
}

@media (pointer: coarse) {
  .profile-filter-tab,
  .profile-search,
  .profile-date-range,
  .profile-date-range input,
  .profile-clear-filter,
  .profile-records-table .profile-record-action,
  .profile-pagination button {
    min-height: 44px;
  }

  .profile-search input {
    height: 42px;
  }

  .profile-pagination button {
    min-width: 44px;
  }
}

.profile-records-empty {
  grid-row: 1 / -1;
  min-block-size: 0;
  overflow: auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 230px;
  align-content: center;
  padding: 28px 16px;
  color: #69758a;
  text-align: center;
}

.profile-records-empty strong {
  color: var(--theme-ink);
  font-size: 17px;
}

.profile-records-empty p {
  margin: 0 0 6px;
  font-size: 13px;
}

.profile-dialog {
  width: min(660px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 760px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #ffffff;
  color: var(--theme-ink);
  box-shadow: 0 24px 80px rgb(4 10 24 / 28%);
  overflow: auto;
}

.profile-dialog::backdrop {
  background: rgb(6 12 24 / 66%);
  backdrop-filter: blur(2px);
}

.profile-edit-form {
  min-width: 0;
}

.profile-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--theme-soft);
}

.profile-dialog-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--theme-muted);
  font-size: 30px;
  line-height: 1;
}

.profile-dialog-close:hover {
  background: var(--theme-soft);
}

.profile-form-error {
  margin: 16px 26px 0;
  padding: 10px 12px;
  border-left: 3px solid #c13535;
  background: #fff1f0;
  color: #a52626;
  font-size: 13px;
}

.profile-dialog-body {
  padding: 22px 26px 16px;
}

.profile-edit-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-edit-label {
  color: var(--theme-ink);
  font-size: 14px;
  font-weight: 700;
}

.profile-avatar-row {
  grid-template-columns: 100px minmax(0, 1fr);
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.profile-dialog-avatar {
  display: block;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border: 1px solid var(--theme-rule);
  border-radius: 50%;
  background: var(--theme-soft);
  object-fit: cover;
}

.profile-avatar-actions {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.profile-dialog .profile-upload-button {
  min-width: 142px;
  min-height: 42px;
  border: 1px solid var(--theme-ink);
  border-radius: 0;
  background: #ffffff;
  color: var(--theme-ink);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.profile-remove-avatar {
  min-height: 26px;
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: #69758a;
  font-size: 12px;
}

.profile-upload-status {
  grid-column: 2;
  margin: -10px 0 0;
  color: #6c788b;
  font-size: 12px;
}

.profile-input-wrap {
  min-width: 0;
}

.profile-input-wrap input,
.profile-input-wrap select,
.profile-input-wrap textarea {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--theme-rule);
  border-radius: 4px;
  outline: 2px solid transparent;
  outline-offset: -3px;
  background: #ffffff;
  color: var(--theme-ink);
  font-size: 14px;
}

.profile-input-wrap textarea {
  min-height: 112px;
  max-height: 230px;
  line-height: 1.65;
  resize: vertical;
}

.profile-input-wrap select:focus-visible,
.profile-input-wrap input:focus-visible,
.profile-input-wrap textarea:focus-visible {
  border-color: var(--profile-accent);
  outline-color: var(--profile-accent);
  outline-offset: 2px;
}

.profile-bio-count {
  display: block;
  margin-top: 4px;
  color: #8490a2;
  font-size: 11px;
  text-align: right;
}

.profile-bio-row {
  align-items: start;
}

.profile-bio-row .profile-edit-label {
  padding-top: 11px;
}

.profile-joined-value {
  color: #667288;
  font-size: 14px;
}

.profile-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 26px 24px;
  border-top: 1px solid var(--theme-soft);
}

.profile-dialog-footer .button {
  min-width: 126px;
  min-height: 43px;
  border-radius: 0;
  clip-path: polygon(11px 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
}

.profile-dialog .profile-dialog-cancel {
  border-color: var(--theme-ink);
  background: #ffffff;
  color: var(--theme-ink);
}

.profile-dialog .profile-dialog-save {
  border-color: var(--profile-accent);
  background: var(--profile-accent);
  color: #ffffff;
}

.profile-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1240px) {
  .profile-page {
    grid-template-columns: 255px minmax(0, 1fr);
    padding: 17px;
  }

  .profile-sidebar {
    padding-inline: 17px;
  }

  .profile-identity {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .profile-avatar {
    width: 90px;
    height: 90px;
  }

  .profile-identity h1 {
    font-size: 23px;
  }

  .profile-panel {
    padding-inline: 18px;
  }

  .profile-search {
    max-width: none;
  }

  .profile-records-table th,
  .profile-records-table td {
    padding-inline: 7px;
  }
}

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

  .profile-sidebar {
    grid-row: auto;
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 24px;
  }

  .profile-stats,
  .profile-achievements {
    margin-top: 0;
    padding-top: 0;
    padding-left: 22px;
    border-top: 0;
    border-left: 1px solid var(--theme-soft);
  }

  .profile-stat-list {
    gap: 11px;
    margin-top: 15px;
  }

  .profile-stat {
    grid-template-columns: 28px minmax(0, 1fr) auto 16px;
    gap: 5px;
  }

  .profile-stat strong {
    font-size: 24px;
  }

  .profile-stat-label {
    font-size: 12px;
  }
}

@media (max-width: 760px) {
  .app-shell:has(.profile-page) .mast-inner {
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-height: 60px;
    padding-inline: 12px;
  }

  .app-shell:has(.profile-page) .primary-nav {
    justify-self: stretch;
  }

  .app-shell:has(.profile-page) .nav-button {
    min-width: 66px;
    min-height: 38px;
    padding-inline: 14px;
  }

  .app-shell:has(.profile-page) .account {
    gap: 5px;
  }

  .app-shell:has(.profile-page) .account .theme-switch {
    display: none;
  }

  .profile-page {
    width: calc(100% - 16px);
    margin: 8px auto 16px;
    padding: 12px;
    border-width: 4px;
  }

  .profile-sidebar {
    display: block;
    padding: 20px;
  }

  .profile-identity {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
  }

  .profile-stats,
  .profile-achievements {
    margin-top: 22px;
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--theme-soft);
    border-left: 0;
  }

  .profile-stat-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .profile-stat {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 4px 7px;
    text-align: center;
  }

  .profile-stat-icon {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .profile-stat-label {
    grid-column: 1 / -1;
  }

  .profile-achievement-list {
    max-width: 280px;
    margin-inline: auto;
  }

  .profile-record-controls {
    align-items: stretch;
  }

  .profile-filter-tabs {
    flex-basis: 100%;
    min-width: 0;
    overflow-x: auto;
  }

  .profile-filter-tab {
    flex: 0 0 auto;
    min-width: 72px;
  }

  .profile-search {
    flex: 1 1 180px;
    max-width: none;
  }

  .profile-date-range {
    flex: 1 1 100%;
  }

  .profile-date-range label {
    flex: 1 1 0;
  }

  .profile-date-range input {
    width: 100%;
  }

  .profile-records-table,
  .profile-records-table tbody {
    display: block;
  }

  .profile-records-table thead {
    display: none;
  }

  .profile-records-table tbody {
    display: grid;
    gap: 12px;
  }

  .profile-records-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 14px;
    border: 1px solid var(--theme-soft);
    border-left: 3px solid var(--profile-accent);
    border-radius: 3px;
  }

  .profile-records-table td {
    display: block;
    padding: 5px 0;
    border: 0;
  }

  .profile-records-table td:nth-child(1),
  .profile-records-table td:nth-child(2),
  .profile-records-table td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .profile-records-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  .profile-records-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
  }

  .profile-record-title {
    margin: 2px 0 5px;
    font-size: 15px;
  }

  .profile-records-table .profile-record-action {
    float: none;
  }

  .profile-pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .profile-panel {
    padding: 18px 14px;
  }

  .profile-section-title {
    font-size: 18px;
  }

  .profile-records-heading {
    align-items: flex-start;
  }

  .profile-calendar-inner {
    min-width: 560px;
  }

  .profile-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .profile-dialog-header {
    padding: 17px 18px 14px;
  }

  .profile-dialog-body {
    padding: 18px;
  }

  .profile-edit-row,
  .profile-avatar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 17px;
  }

  .profile-avatar-editor {
    gap: 20px;
  }

  .profile-dialog-avatar {
    flex-basis: 84px;
    width: 84px;
    height: 84px;
  }

  .profile-dialog .profile-upload-button {
    min-width: 132px;
  }

  .profile-upload-status {
    grid-column: 1;
    margin-top: -4px;
  }

  .profile-bio-row .profile-edit-label {
    padding-top: 0;
  }

  .profile-form-error {
    margin: 14px 18px 0;
  }

  .profile-dialog-footer {
    padding: 15px 18px 20px;
  }

  .profile-dialog-footer .button {
    flex: 1 1 0;
    min-width: 0;
  }
}

.profile-page {
  border: 0;
  box-shadow: inset 2px 0 var(--profile-accent), inset -2px 0 var(--profile-accent);
}

.profile-page .profile-edit-button,
.profile-dialog .profile-upload-button,
.profile-dialog-footer .button,
.profile-dialog .profile-dialog-save,
.profile-records-table .profile-record-action {
  position: relative;
  border-color: transparent;
  background: transparent;
  clip-path: none;
}

.profile-page .profile-edit-button::before,
.profile-dialog .profile-upload-button::before,
.profile-dialog-footer .button::before,
.profile-records-table .profile-record-action::before {
  position: absolute;
  inset: 3px 1px;
  z-index: 0;
  border: 1px solid var(--theme-ink);
  background: #ffffff;
  content: "";
  pointer-events: none;
  transform: skewX(-18deg);
}

.profile-page .profile-edit-button > *,
.profile-dialog .profile-upload-button > *,
.profile-dialog-footer .button > *,
.profile-records-table .profile-record-action > * {
  position: relative;
  z-index: 1;
}

.profile-page .profile-edit-button:hover,
.profile-records-table .profile-record-action:hover {
  border-color: transparent;
  background: transparent;
}

.profile-page .profile-edit-button:hover::before,
.profile-dialog .profile-upload-button:hover::before,
.profile-dialog .profile-dialog-cancel:hover::before,
.profile-records-table .profile-record-action:hover::before {
  border-color: var(--profile-accent);
  background: var(--profile-accent-soft);
}

.profile-dialog .profile-dialog-save::before {
  border-color: var(--profile-accent);
  background: var(--profile-accent);
}

.profile-dialog .profile-dialog-save:hover::before {
  border-color: var(--profile-accent-deep);
  background: var(--profile-accent-deep);
}

.profile-records-table th {
  font-size: 13px;
}

.profile-records-table td,
.profile-record-time,
.profile-record-title,
.profile-record-status,
.profile-records-table .profile-record-action {
  font-size: 14px;
}

.profile-score {
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .profile-page *,
  .profile-dialog * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.account-settings-menu { position: relative; font-size: 14px; }
.account-settings-menu summary { cursor: pointer; padding: 10px; }
.account-settings-menu > a { position: absolute; right: 0; top: 100%; z-index: 20; padding: 12px 20px; white-space: nowrap; background: var(--color-surface); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: 6px; }

.profile-password-row { border-top: 1px solid var(--color-rule); padding-top: 20px; }
.profile-password-button { justify-self: start; }

.profile-dialog.password-settings-dialog { width: min(480px, calc(100vw - 32px)); border-radius: 12px; }
.password-settings-header { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; padding: 28px 28px 0; }
.password-settings-header h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; color: var(--theme-ink); }
.password-settings-header p { margin: 0; color: var(--theme-muted); font-size: 14px; line-height: 1.6; }
.password-settings-body { display: grid; gap: 20px; padding: 28px; }
.password-settings-field { display: grid; gap: 8px; }
.password-settings-field label { font-size: 14px; font-weight: 600; color: var(--theme-ink); }
.password-settings-field small { color: var(--theme-muted); font-size: 13px; }
.password-input-wrap { display: flex; align-items: center; border: 1px solid var(--color-rule-strong); border-radius: 6px; background: #fff; }
.password-input-wrap:focus-within { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
.password-input-wrap input { width: 100%; min-width: 0; height: 46px; padding: 10px 12px; color: var(--theme-ink); background: transparent; border: 0; border-radius: 6px; font: inherit; box-shadow: none; }
.password-input-wrap input:focus { outline: none; box-shadow: none; }
.password-reveal { flex: none; align-self: stretch; min-width: 52px; border: 0; background: transparent; color: var(--theme-muted); font: inherit; font-size: 13px; cursor: pointer; }
.password-settings-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 28px; border-top: 1px solid var(--theme-soft); }
.password-settings-footer .button { min-height: 44px; padding: 10px 20px; border-radius: 6px; font-size: 14px; transform: none; }
.password-settings-footer .password-back { background: #fff; color: var(--theme-ink); border: 1px solid var(--color-rule-strong); }
.password-settings-footer .password-save { background: var(--theme-accent); color: #fff; border: 1px solid var(--theme-accent); }
.password-settings-footer .password-save:hover:not(:disabled) { background: var(--theme-accent-hover); }
.password-settings-error { margin: 0; color: #a52626; font-size: 14px; line-height: 1.5; }
.password-settings-form :disabled { opacity: .65; cursor: wait; }
@media(max-width:600px) { .password-settings-header { padding: 22px 20px 0; } .password-settings-body { padding: 24px 20px; } .password-settings-footer { padding: 16px 20px; } }
