:root {
  color-scheme: dark;
  --bg: #070707;
  --grid: rgba(255, 255, 255, 0.045);
  --panel: #1a1a1a;
  --panel-strong: #202020;
  --panel-soft: #151515;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f4f4;
  --muted: #8e8e8e;
  --muted-strong: #b7b7b7;
  --active-bg: #f2f2f2;
  --active-text: #101010;
  --green: #28d26d;
  --green-deep: #063d1c;
  --amber: #ffb020;
  --red: #ef4444;
  --purple: #7770ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f6;
  --grid: rgba(12, 14, 18, 0.055);
  --panel: #ffffff;
  --panel-strong: #f7f8f9;
  --panel-soft: #f2f3f5;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #171717;
  --muted: #70757d;
  --muted-strong: #3d4249;
  --active-bg: #141414;
  --active-text: #ffffff;
  --green-deep: #dcfce7;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 57px;
  padding: 0 24px;
  background: rgba(18, 18, 18, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.avatar-button,
.pill,
.ghost-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--panel-soft);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.avatar-button {
  width: 38px;
  height: 38px;
  padding: 1px;
  border-radius: 999px;
}

.avatar-button img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--panel-strong);
}

.icon-button svg,
.side-link svg,
.pill svg,
.ghost-pill svg,
.edit-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  width: min(1180px, calc(100vw - 48px));
  margin: 32px auto 72px;
}

body.authorize-view .shell {
  display: block;
  width: min(560px, calc(100vw - 32px));
  margin-top: 58px;
}

body.authorize-view .sidebar,
body.authorize-view .avatar-button {
  display: none;
}

.main {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--muted-strong);
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}

.side-link.active {
  color: var(--active-text);
  background: var(--active-bg);
  font-weight: 800;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.title-block h1,
.title-block h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.title-block p,
.tiny-note,
.footer {
  color: var(--muted);
}

.title-block p {
  margin: 0;
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
}

.pill,
.ghost-pill {
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
}

.pill {
  color: var(--active-text);
  background: var(--active-bg);
}

.ghost-pill {
  color: var(--text);
  background: transparent;
}

.danger-pill {
  color: #ff9aa9;
  background: rgba(255, 92, 122, 0.1);
}

.danger-pill:hover {
  color: #ffc3cf;
}

.delete-action {
  position: relative;
}

.delete-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 92, 122, 0.32);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.delete-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 24px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(255, 92, 122, 0.32);
  border-left: 1px solid rgba(255, 92, 122, 0.32);
  background: var(--panel);
  transform: rotate(45deg);
}

.delete-popover strong {
  display: block;
  margin-bottom: 6px;
}

.delete-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.danger-confirm {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: #1b0508;
  background: #ff5c7a;
  font-weight: 900;
  cursor: pointer;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.skeleton-shell {
  width: 100%;
  max-width: 793px;
  animation: skeleton-enter 0.28s cubic-bezier(0.2, 0, 0, 1) both;
}

.skeleton-page-head {
  min-height: 46px;
}

.skeleton-line,
.skeleton-section-title,
.skeleton-pill,
.skeleton-badge,
.skeleton-ring,
.skeleton-bar,
.skeleton-chip,
.skeleton-edit,
.skeleton-app-icon,
.skeleton-input,
.skeleton-slots span {
  display: block;
  position: relative;
  overflow: hidden;
  border: 0;
  background: linear-gradient(90deg, #262626, #303030, #262626);
  background-size: 240% 100%;
  box-shadow: none;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.skeleton-line {
  width: 160px;
  height: 12px;
  border-radius: 999px;
}

.skeleton-line.skeleton-title {
  width: 186px;
  height: 22px;
}

.skeleton-line.skeleton-subtitle {
  width: 260px;
  height: 12px;
  margin-top: 12px;
}

.skeleton-line.wide {
  width: min(360px, 100%);
}

.skeleton-line.short {
  width: 92px;
}

.skeleton-line.mini {
  width: 44px;
}

.skeleton-section-title {
  width: 74px;
  height: 12px;
  margin: 20px 0 16px;
  border-radius: 999px;
}

.skeleton-pill {
  width: 118px;
  height: 38px;
  border-radius: 999px;
}

.skeleton-pill.ghost {
  width: 96px;
}

.skeleton-card {
  position: relative;
  isolation: isolate;
  padding: 24px;
  border-radius: 16px;
  border-color: #2a2a2a;
  background: #1c1c1c;
  box-shadow: none;
}

.skeleton-card::before,
.skeleton-form::before,
.skeleton-table::before {
  display: none;
}

.skeleton-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.skeleton-badge {
  width: 68px;
  height: 24px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.skeleton-ring-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.skeleton-ring-item {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 113px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.skeleton-ring {
  width: 88px;
  height: 88px;
  overflow: visible;
  border: 8px solid #262626;
  border-radius: 999px;
  background: transparent;
  animation: none;
}

.skeleton-ring::before {
  display: none;
}

.skeleton-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 8px solid transparent;
  border-top-color: rgba(160, 160, 160, 0.36);
  border-right-color: rgba(160, 160, 160, 0.14);
  animation: skeleton-ring-spin 1.8s linear infinite;
}

.skeleton-progress-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.skeleton-progress-row {
  display: grid;
  gap: 6px;
}

.skeleton-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
}

.skeleton-quota-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-quota-card {
  min-height: 61px;
  padding: 12px 16px;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
}

.skeleton-quota-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.skeleton-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.skeleton-slots span {
  height: 6px;
  border-radius: 2px;
}

.skeleton-app-card .skeleton-line + .skeleton-line {
  margin-top: 11px;
}

.skeleton-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.skeleton-chip {
  width: 58px;
  height: 26px;
  border-radius: 999px;
}

.skeleton-chip.small {
  width: 48px;
}

.skeleton-edit {
  width: 84px;
  height: 36px;
  border-radius: 999px;
}

.skeleton-table {
  position: relative;
  isolation: isolate;
  padding: 22px;
}

.skeleton-table-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 1fr 0.7fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.skeleton-table .skeleton-title {
  margin-bottom: 18px;
}

.skeleton-form {
  position: relative;
  isolation: isolate;
  padding: 24px;
}

.skeleton-input {
  width: 100%;
  height: 46px;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 140% 0;
  }

  100% {
    background-position: -140% 0;
  }
}

@keyframes skeleton-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes skeleton-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.requirements-card {
  padding: 26px 26px 22px;
}

.leader-card {
  display: grid;
  place-items: center;
  justify-self: stretch;
  width: 100%;
  max-width: 793px;
  min-height: min(560px, calc(100vh - 190px));
  padding: 64px 24px;
  text-align: center;
}

main#app > .leader-card {
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.leader-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.leader-party {
  margin-top: 26px;
  font-size: 82px;
  line-height: 1;
}

.requirements-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.requirements-title h2 {
  margin: 0 0 12px;
  font-size: 21px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  color: #ff6b6b;
  background: rgba(239, 68, 68, 0.12);
  font-weight: 800;
  font-size: 13px;
}

.status-badge.reached {
  color: var(--green);
  background: rgba(40, 210, 109, 0.12);
}

.section-label {
  margin: 28px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.ring-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 22px;
}

.ring-item {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 138px;
}

.ring {
  --p: 100%;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--p), rgba(255, 255, 255, 0.06) 0);
}

.ring::before {
  content: "";
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--panel);
}

.ring-text {
  position: relative;
  display: grid;
  justify-items: center;
  line-height: 1.05;
}

.ring-text strong {
  color: var(--ring-color);
  font-size: 13px;
}

.ring-text span,
.ring-item small {
  color: var(--muted);
  font-size: 12px;
}

.ring-item small {
  font-size: 14px;
}

.progress-stack {
  display: grid;
  gap: 18px;
}

.metric-row {
  display: grid;
  gap: 8px;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-strong);
  font-size: 14px;
}

.metric-head strong {
  color: var(--green);
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  width: min(100%, var(--value));
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

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

.segmented-warning {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.segmented-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted-strong);
  margin-bottom: 12px;
  font-size: 14px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.segments span {
  height: 6px;
  border-radius: 999px;
  background: rgba(40, 210, 109, 0.34);
}

.segments span.danger {
  background: var(--red);
}

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

.record {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(40, 210, 109, 0.32);
  background: rgba(40, 210, 109, 0.12);
}

.record.bad {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.17);
}

.record-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(40, 210, 109, 0.12);
}

.record.bad .record-icon {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
}

.record strong,
.record .count {
  font-weight: 900;
}

.record small {
  display: block;
  color: var(--muted-strong);
}

.record .count {
  color: var(--green);
}

.record.bad .count {
  color: #ff6b6b;
}

.divider {
  height: 1px;
  margin: 24px 0 18px;
  background: var(--line);
}

.warning-copy {
  margin: 10px 0 0;
  color: #ff5d5d;
  font-weight: 900;
}

.app-list {
  display: grid;
  gap: 12px;
}

.app-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 120px;
  padding: 24px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.app-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.app-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.app-card p span {
  display: inline-block;
  min-width: 68px;
  margin-right: 8px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
}

.app-card .secret-line {
  color: #d7fbe4;
}

.tags {
  display: flex;
  gap: 8px;
}

.tag {
  padding: 4px 9px;
  color: var(--green);
  background: var(--green-deep);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.tag.level {
  color: #c7c4ff;
  background: rgba(119, 112, 255, 0.22);
}

.edit-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 800;
}

.table-card {
  overflow: hidden;
}

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

.mobile-log-list {
  display: none;
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 800;
}

td:first-child {
  font-weight: 800;
}

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

.allow {
  display: inline-flex;
  padding: 4px 10px;
  color: var(--green);
  background: var(--green-deep);
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.form-card {
  padding: 26px;
}

.form-grid {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 9px;
}

.field label,
.level-label {
  color: var(--muted-strong);
  font-weight: 800;
  font-size: 14px;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

.field textarea {
  min-height: 76px;
  padding-top: 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--muted-strong);
}

.level-options {
  display: inline-grid;
  grid-template-columns: repeat(5, 54px);
  overflow: hidden;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.level-options label {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-right: 1px solid var(--line);
  color: var(--muted-strong);
  cursor: pointer;
}

.level-options label:last-child {
  border-right: 0;
}

.level-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.level-options span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.level-options input:checked + span {
  color: var(--active-text);
  background: var(--active-bg);
  font-weight: 900;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.button-reset {
  border: 0;
  cursor: pointer;
}

.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.login-card strong {
  display: block;
  margin-bottom: 4px;
}

.login-card span {
  color: var(--muted);
  font-size: 13px;
}

.authorize-wrap {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.authorize-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  color: var(--muted-strong);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.authorize-icon svg {
  width: 44px;
  height: 44px;
}

.authorize-wrap h1 {
  margin: 4px 0 -8px;
  font-size: 30px;
  line-height: 1.15;
}

.authorize-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
}

.authorize-user,
.authorize-card,
.authorize-actions {
  width: 100%;
}

.authorize-user {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 18px;
}

.authorize-user img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--panel-strong);
}

.authorize-user strong {
  display: block;
  margin-bottom: 3px;
}

.authorize-user span {
  color: var(--muted);
  font-size: 13px;
}

.authorize-card {
  padding: 20px;
}

.authorize-card .section-label {
  margin-top: 0;
}

.authorize-line,
.permission-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  color: var(--muted-strong);
}

.authorize-line svg,
.permission-row svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.link-line {
  color: #5fb7ff;
}

.authorize-permission-title {
  margin-top: 28px !important;
}

.permission-row {
  min-height: 44px;
  color: var(--text);
}

.permission-row span {
  flex: 1;
}

.permission-row strong {
  margin-left: 2px;
}

.mini-circle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: var(--muted-strong);
  background: var(--panel-strong);
  cursor: pointer;
}

.mini-circle svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.mini-circle.open svg {
  transform: rotate(180deg);
}

.permission-details {
  display: grid;
  gap: 7px;
  margin: 4px 0 0 27px;
  padding: 10px 12px;
  color: var(--muted-strong);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.authorize-actions {
  display: grid;
  gap: 10px;
}

.allow-action,
.deny-action {
  width: 100%;
  min-height: 50px;
  font-weight: 900;
}

.allow-action.disabled {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line);
  cursor: not-allowed;
  pointer-events: none;
}

:root[data-theme="light"] .allow-action.disabled {
  color: rgba(15, 23, 42, 0.45);
  background: rgba(15, 23, 42, 0.08);
}

.trust-warning {
  margin: 0;
  color: var(--red);
  text-align: center;
  font-size: 13px;
}

.footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 12px 20px;
  background: rgba(8, 8, 8, 0.76);
  border-top: 1px solid var(--line);
  font-size: 13px;
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .footer {
  background: rgba(255, 255, 255, 0.78);
}

.footer a {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 16px;
  }

  .shell {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 720px);
    margin-top: 18px;
  }

  .sidebar {
    order: -1;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .side-link {
    justify-content: center;
    min-height: 40px;
    padding: 0 10px;
  }

  .side-link span {
    font-size: 13px;
  }

  .page-head,
  .requirements-title,
  .login-card,
  .skeleton-page-head,
  .skeleton-card-head {
    display: grid;
  }

  .actions {
    flex-wrap: wrap;
  }

  .ring-grid,
  .skeleton-ring-grid,
  .compliance-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .skeleton-table {
    overflow-x: auto;
  }

  .skeleton-table-row {
    min-width: 680px;
  }

  .app-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .app-card .edit-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .table-card {
    overflow-x: auto;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .requirements-card,
  .form-card,
  .skeleton-card,
  .skeleton-form {
    padding: 18px;
  }

  .skeleton-line.skeleton-title,
  .skeleton-line.skeleton-subtitle,
  .skeleton-line.wide {
    width: 100%;
  }

  .skeleton-progress-row {
    grid-template-columns: 1fr;
  }

  .level-options {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    width: 100%;
  }
}

/* Reference-grade dashboard polish */
:root {
  --bg: #0a0a0a;
  --grid: rgba(255, 255, 255, 0.03);
  --dot-color: rgba(255, 255, 255, 0.06);
  --panel: #1c1c1c;
  --panel-strong: #262626;
  --panel-soft: #141414;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --text: #f0f0f0;
  --muted: #666666;
  --muted-strong: #a0a0a0;
  --active-bg: #f0f0f0;
  --active-text: #111111;
  --green: #22c55e;
  --green-deep: #0a2e14;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #7770ff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --theme-transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

:root[data-theme="light"] {
  --bg: #f0f0f0;
  --grid: rgba(0, 0, 0, 0.03);
  --dot-color: rgba(0, 0, 0, 0.07);
  --panel: #ffffff;
  --panel-strong: #ebebeb;
  --panel-soft: #f5f5f5;
  --line: #e0e0e0;
  --line-strong: #cccccc;
  --text: #111111;
  --muted: #888888;
  --muted-strong: #555555;
  --active-bg: #111111;
  --active-text: #ffffff;
  --green-deep: #f0fdf4;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-position: 16px 16px, 0 0, 0 0;
  background-size: 32px 32px, 32px 32px, 32px 32px;
  transition: var(--theme-transition);
}

.topbar {
  min-height: 56px;
  padding: 0 24px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  transition: var(--theme-transition);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.9);
}

.brand {
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.brand-logo {
  width: 18px;
  height: 18px;
}

.top-actions {
  gap: 8px;
}

.icon-button,
.avatar-button {
  width: 36px;
  height: 36px;
  color: var(--muted-strong);
  background: var(--panel);
  border-color: var(--line);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.avatar-button:hover,
.avatar-button.active {
  color: var(--text);
  background: var(--panel-strong);
}

.icon-button svg,
.avatar-button svg {
  width: 18px;
  height: 18px;
}

.user-menu {
  position: relative;
}

.avatar-button {
  position: relative;
  cursor: pointer;
}

.avatar-button::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='5' y1='7' x2='19' y2='7'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cline x1='5' y1='17' x2='19' y2='17'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 8px;
  transition: transform 0.6s ease;
}

.avatar-button.active::after {
  transform: rotate(-270deg);
}

.user-menu-dropdown {
  display: none;
  position: fixed;
  top: 58px;
  right: 24px;
  z-index: 530;
  min-width: 180px;
  padding: 6px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-info {
  display: grid;
  gap: 2px;
  padding: 10px 10px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-menu-info strong {
  color: var(--text);
  font-size: 13px;
}

.user-menu-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.user-menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 35px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}

.user-menu-link:not(.active):hover,
.side-link:not(.active):hover {
  color: var(--text);
  background: var(--panel-strong);
}

.user-menu-link.active {
  color: var(--active-text);
  background: var(--active-bg);
  font-weight: 600;
}

.user-menu-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.user-menu-danger {
  color: var(--red);
}

.user-menu-danger:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
}

.user-menu-overlay,
.user-menu-drawer-header,
.user-menu-link[data-route],
.sidebar-nav-divider {
  display: none;
}

.shell {
  width: min(100%, 1180px);
  margin: 0 auto 72px;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 0;
}

.main {
  padding: 32px 24px;
}

.sidebar {
  top: 56px;
  padding: 32px 24px 20px 10px;
  gap: 4px;
}

.side-link {
  min-height: 36px;
  padding: 8px 12px;
  color: var(--muted-strong);
  font-size: 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link svg {
  width: 16px;
  height: 16px;
}

.side-link.active {
  font-weight: 600;
}

.page-head {
  margin-bottom: 24px;
}

.title-block h1,
.title-block h2 {
  font-size: 22px;
}

.card {
  background: var(--panel);
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: none;
  transition: var(--theme-transition);
}

.requirements-card {
  max-width: 793px;
  padding: 24px;
  animation: cardRise 0.35s cubic-bezier(0.2, 0, 0, 1) both;
}

.requirements-title {
  margin-bottom: 22px;
}

.requirements-title h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.status-badge {
  padding: 5px 10px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  font-size: 13px;
}

.status-badge:not(.reached) {
  animation: badgePulse 1.8s ease-in-out infinite;
}

.section-label {
  margin: 24px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.ring-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.ring-item {
  gap: 8px;
  min-height: 113px;
}

.ring {
  position: relative;
  width: 88px;
  height: 88px;
  background: transparent;
  animation: ringFloat 2.4s ease-in-out infinite;
}

.ring-item:nth-child(2) .ring {
  animation-delay: 0.15s;
}

.ring-item:nth-child(3) .ring {
  animation-delay: 0.3s;
}

.ring::before {
  display: none;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  transform: rotate(-90deg);
}

.ring-svg circle {
  fill: none;
  stroke-width: 8;
}

.ring-track {
  stroke: var(--panel-strong);
}

.ring.unmet .ring-track {
  animation: ringTrackPulse 1.8s ease-in-out infinite;
}

.ring-progress {
  stroke: var(--ring-color);
  stroke-linecap: round;
  stroke-dasharray: 238.76;
  stroke-dashoffset: var(--ring-offset);
  animation: ringDraw 0.8s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.ring-item:nth-child(2) .ring-progress {
  animation-delay: 0.1s;
}

.ring-item:nth-child(3) .ring-progress {
  animation-delay: 0.2s;
}

.ring-text {
  position: absolute;
  inset: 0;
  align-content: center;
}

.ring-text strong {
  color: var(--ring-color);
  font-size: 12px;
  line-height: 1.2;
}

.ring-text span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.ring-item small {
  color: var(--muted-strong);
  font-size: 12px;
}

.progress-stack {
  gap: 14px;
}

.metric-row {
  gap: 6px;
}

.metric-head {
  color: var(--muted-strong);
  font-size: 13px;
}

.metric-head strong,
.metric-row.unmet .metric-head strong {
  color: var(--amber);
}

.metric-row.met .metric-head strong {
  color: var(--green);
}

.bar {
  position: relative;
  overflow: hidden;
  height: 8px;
  background: var(--panel-strong);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: translateX(-100%);
  animation: barTrackSweep 2s ease-in-out infinite;
}

.bar span {
  position: relative;
  z-index: 1;
  overflow: visible;
  width: var(--value);
  background: linear-gradient(90deg, var(--amber), #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: barFill 0.7s cubic-bezier(0.2, 0, 0, 1.08) both;
}

.bar.met span {
  background: linear-gradient(90deg, var(--green), #4ade80);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bar span::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -2px;
  bottom: -1px;
  width: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.6);
  opacity: 0;
  animation: barTip 0.7s cubic-bezier(0.2, 0, 0, 1.08) both;
}

.metric-row:nth-child(1) .bar span,
.metric-row:nth-child(1) .bar span::after {
  animation-delay: 0.1s;
}

.metric-row:nth-child(2) .bar span,
.metric-row:nth-child(2) .bar span::after {
  animation-delay: 0.2s;
}

.metric-row:nth-child(3) .bar span,
.metric-row:nth-child(3) .bar span::after {
  animation-delay: 0.3s;
}

.metric-row:nth-child(4) .bar span,
.metric-row:nth-child(4) .bar span::after {
  animation-delay: 0.4s;
}

.metric-row:nth-child(5) .bar span,
.metric-row:nth-child(5) .bar span::after {
  animation-delay: 0.5s;
}

.segmented-warning {
  border-color: var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  transition: var(--theme-transition);
}

.segmented-head {
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-size: 13px;
}

.segments {
  gap: 5px;
}

.segments span {
  height: 6px;
  background: rgba(34, 197, 94, 0.25);
}

.segments span.danger {
  background: var(--red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
  animation: slotBreak 0.6s ease-out both;
}

.segments span.danger:nth-child(2) {
  animation-delay: 0.15s;
}

.segments span.danger:nth-child(3) {
  animation-delay: 0.3s;
}

.segments span.danger:nth-child(4) {
  animation-delay: 0.45s;
}

.segments span.danger:nth-child(5) {
  animation-delay: 0.6s;
}

.record-grid {
  margin-top: 12px;
}

.record {
  min-height: 64px;
  border-radius: 10px;
  transform-style: preserve-3d;
}

.record.bad {
  animation: vetoFlip 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.record:nth-child(2).bad {
  animation-delay: 0.6s;
}

.divider {
  margin: 18px 0;
}

.footer {
  background: transparent;
}

.notice-card {
  max-width: 808px;
  padding: 24px;
}

.card-title-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.card-title-icon svg {
  width: 16px;
  height: 16px;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes ringDraw {
  0% {
    stroke-dashoffset: 238.76;
  }
}

@keyframes ringFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes ringTrackPulse {
  0%,
  100% {
    stroke: var(--panel-strong);
  }

  50% {
    stroke: rgba(245, 158, 11, 0.38);
  }
}

@keyframes barFill {
  0% {
    width: 0;
  }
}

@keyframes barTrackSweep {
  0% {
    transform: translateX(-100%);
  }

  55%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes barTip {
  0% {
    opacity: 0;
  }

  15%,
  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes slotBreak {
  0% {
    background: var(--green);
    opacity: 0.25;
    transform: scaleY(1);
    box-shadow: none;
  }

  25% {
    background: var(--green);
    opacity: 0.6;
    transform: scaleY(1.6);
  }

  40% {
    background: #ffffff;
    opacity: 0.9;
    transform: scaleY(2);
  }

  55% {
    background: var(--red);
    opacity: 0;
    transform: scaleY(0.4);
  }

  100% {
    background: var(--red);
    opacity: 0.8;
    transform: scaleY(1);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
  }
}

@keyframes vetoFlip {
  0% {
    transform: rotateX(0deg);
  }

  40% {
    transform: rotateX(95deg);
  }

  70% {
    transform: rotateX(170deg);
  }

  85% {
    transform: rotateX(185deg);
  }

  100% {
    transform: rotateX(0deg);
  }
}

@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }

  50% {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}

@media (min-width: 861px) {
  .user-menu-link[data-route],
  .sidebar-nav-divider {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    z-index: 500;
  }

  .shell {
    display: block;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    margin-top: 0;
  }

  .main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 32px 24px;
  }

  .sidebar {
    display: none;
  }

  .user-menu-link[data-route],
  .sidebar-nav-divider {
    display: flex;
  }

  .user-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 520;
    border: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
  }

  .user-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .user-menu-dropdown {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 530;
    width: 260px;
    max-width: 75vw;
    height: 100dvh;
    max-height: 100dvh;
    min-width: 0;
    padding: 0 6px 6px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 16px 0 0 16px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .user-menu-dropdown.open {
    transform: translateX(0);
  }

  .avatar-button {
    z-index: 510;
  }

  .user-menu-drawer-header {
    display: block;
    height: 56px;
  }
}

@media (max-width: 660px) {
  .topbar {
    padding: 0 16px;
  }

  .main {
    padding: 32px 24px;
  }

  .requirements-card,
  .leader-card,
  .form-card,
  .skeleton-card,
  .skeleton-form {
    padding: 16px;
  }

  .leader-card {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    width: 100% !important;
    inline-size: 100% !important;
    max-width: none;
    overflow: hidden;
    background: var(--panel);
    min-height: calc(100svh - 112px);
    padding: 44px 20px;
  }

  .leader-card h1 {
    display: block;
    width: 100%;
    max-width: 12em;
    font-size: 25px;
    line-height: 1.25;
    text-wrap: balance;
    word-break: keep-all;
  }

  .leader-party {
    margin-top: 18px;
    font-size: 60px;
  }

  .ring-grid {
    gap: 12px;
  }

  .ring {
    width: 74px;
    height: 74px;
  }

  .ring-svg circle {
    stroke-width: 7;
  }

  .compliance-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .table-card {
    width: 100%;
    overflow: visible;
  }

  .desktop-log-table {
    display: none !important;
  }

  .mobile-log-list {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .mobile-log-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
  }

  .mobile-log-card div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  .mobile-log-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-log-card strong {
    min-width: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .table-card table,
  .table-card thead,
  .table-card tbody,
  .table-card tr,
  .table-card th,
  .table-card td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-card thead {
    display: none;
  }

  .table-card tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .table-card td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .table-card td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
}

@media (max-width: 390px) {
  .leader-card {
    min-height: calc(100svh - 96px);
    padding: 36px 16px;
  }

  .leader-card h1 {
    font-size: 22px;
  }

  .leader-party {
    font-size: 52px;
  }
}
