:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f1419;
  --muted: #536471;
  --border: #dce3ea;
  --border-strong: #c7d1dc;
  --accent: #1d9bf0;
  --accent-dark: #0c7ec5;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 14px 34px rgba(15, 20, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand,
.header-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 17px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.header-nav {
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.header-nav a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.lang-button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.lang-button:last-child {
  border-right: 0;
}

.lang-button.is-active {
  background: var(--text);
  color: #fff;
}

.app-shell {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.intro p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats div {
  padding: 14px 12px;
  border-right: 1px solid var(--border);
}

.stats div:last-child {
  border-right: 0;
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  position: sticky;
  top: 84px;
  padding: 22px;
}

.panel h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.account-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.account-form label {
  display: grid;
  gap: 7px;
}

.account-form label > span,
.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-form input,
.account-form select,
.account-form textarea,
.search-box input,
.select-box select {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.account-form input,
.account-form select,
.search-box input,
.select-box select {
  padding: 0 12px;
}

.account-form textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.55;
}

.account-form input:focus,
.account-form select:focus,
.account-form textarea:focus,
.search-box input:focus,
.select-box select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.16);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.primary-button,
.rate-button,
.report-button,
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.list-panel {
  min-height: 520px;
  padding: 22px;
}

.list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.list-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 132px 132px;
  gap: 8px;
}

.list-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-list {
  display: grid;
  gap: 10px;
}

.account-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.account-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #0f1419;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.name-line h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.blue-only-tag,
.caution-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef7ff;
  color: #0669ad;
  font-size: 12px;
  font-weight: 750;
}

.caution-tag {
  background: #fff5f4;
  color: var(--danger);
}

.blue-only-tag[hidden],
.caution-tag[hidden] {
  display: none;
}

.handle-link {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.handle-link:hover {
  text-decoration: underline;
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-box {
  min-width: 62px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.score-box strong,
.score-box span {
  display: block;
}

.score-box strong {
  font-size: 18px;
  line-height: 1.1;
}

.score-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
}

.home-link {
  background: var(--text);
  color: #fff;
}

.home-link:hover {
  background: #26323d;
}

.rate-button {
  background: #f1f9f5;
  border-color: #bfe7cf;
  color: var(--success);
}

.report-button {
  background: #fff5f4;
  border-color: #ffd0cc;
  color: var(--danger);
}

.rate-button:disabled,
.report-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.pagination[hidden] {
  display: none;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination button,
.page-gap {
  min-height: 34px;
  min-width: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  color: var(--muted);
  cursor: default;
}

.page-number {
  padding: 0;
}

.page-number.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

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

.admin-shell {
  max-width: 960px;
}

.admin-panel {
  padding: 22px;
}

.admin-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.admin-heading h1 {
  margin: 0;
  font-size: 24px;
}

.admin-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.admin-token {
  display: grid;
  gap: 7px;
}

.admin-token span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-token input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 12px;
}

.admin-message {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--success);
  font-size: 13px;
  font-weight: 750;
}

.admin-message.is-error {
  color: var(--danger);
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.admin-row h2 {
  margin: 0;
  font-size: 16px;
}

.admin-row a {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.admin-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.delete-button {
  min-height: 38px;
  border: 1px solid #ffd0cc;
  border-radius: 8px;
  background: #fff5f4;
  color: var(--danger);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .site-header {
    padding: 0 20px;
  }

  .app-shell {
    width: 100%;
    max-width: 680px;
    padding-left: 14px;
    padding-right: 14px;
    padding-top: 24px;
  }

  .intro,
  .workspace,
  .list-header {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-panel {
    position: static;
  }

  .account-card,
  .account-meta {
    grid-template-columns: 1fr;
  }

  .list-controls {
    grid-template-columns: 1fr;
  }

  .account-meta {
    align-items: stretch;
  }

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

@media (max-width: 560px) {
  .header-nav {
    display: none;
  }

  .site-header {
    gap: 12px;
  }

  .header-actions {
    gap: 8px;
  }

  .lang-button {
    padding: 0 8px;
  }

  .intro h1 {
    font-size: 27px;
  }

  .account-card {
    padding: 14px;
  }

  .admin-heading,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .home-link,
  .rate-button,
  .report-button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
  }
}
