:root {
  --sky: #bdeaff;
  --ink: #25303d;
  --ink-soft: rgba(37, 48, 61, 0.64);
  --panel: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.86);
  --btn: #ffffff;
  --btn-hover: #f2f8ff;
  --accent: #355f93;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sky);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

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

button,
a {
  touch-action: manipulation;
}

.page {
  width: 100%;
  height: 100%;
  position: relative;
}

.center-wrap {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + var(--safe-top))
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}

.panel {
  width: min(92vw, 440px);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(24, 42, 71, 0.12);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.title {
  text-align: center;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.subtitle {
  margin-top: 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
}

.primary-btn,
.secondary-btn,
.nav-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--btn);
  color: var(--ink);
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover,
.nav-btn:hover {
  background: var(--btn-hover);
}

.primary-btn {
  background: #ffffff;
  color: var(--accent);
}

.nav-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.page-header {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
}

.back-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
}

.content-card {
  margin:
    calc(72px + var(--safe-top))
    auto
    calc(24px + var(--safe-bottom));
  width: min(92vw, 760px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.68);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(25, 42, 71, 0.1);
}

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

.simple-item {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
}

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

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(37, 48, 61, 0.12);
}

.table th {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(37, 48, 61, 0.12);
  background: #f6f8fb;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #2d3c4d;
  background: linear-gradient(180deg, #f4f8ff 0%, #e7eefb 100%);
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(37, 48, 61, 0.14);
  background: #f6f8fb;
}

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

.profile-title {
  font-size: 23px;
  line-height: 1.1;
}

.profile-subtitle {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(37, 48, 61, 0.1);
}

.kv:last-child {
  border-bottom: 0;
}

.kv .k {
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .page-title {
    font-size: 20px;
  }

  .back-link {
    padding: 7px 10px;
    font-size: 14px;
  }

  .content-card {
    width: min(94vw, 760px);
    padding: 12px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
    font-size: 13px;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }

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

  .profile-title {
    font-size: 20px;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 9px 6px;
  }
}
