/* khlink — public page styles (shared by index.html and the editor preview) */

.kh-page {
  --bg: #f5f5f3;
  --card: #ffffff;
  --text: #121212;
  --muted: #6e6e6b;
  --line: rgba(0, 0, 0, 0.07);
  --chip: #f1f1ee;

  box-sizing: border-box;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 16px 28px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}
.kh-page *, .kh-page *::before, .kh-page *::after { box-sizing: border-box; }

.kh-page[data-theme="violet"] { --bg: #701dff; --card: #ffffff; --text: #1c0a45; --muted: #6b5a92; --line: rgba(40,0,110,0.12); --chip: #f1eaff; --on-bg: #ffffff; --on-bg-muted: rgba(255,255,255,0.78); }
.kh-page[data-theme="ink"] { --bg: #0f0f11; --card: #1a1a1e; --text: #f3f3f4; --muted: #9b9ba3; --line: rgba(255,255,255,0.07); --chip: #26262b; }
.kh-page[data-theme="sand"] { --bg: #efe9df; --card: #fbf8f3; --text: #2b261f; --muted: #857b6d; --line: rgba(60,40,10,0.08); --chip: #f1ebe1; }
.kh-page[data-theme="mist"] { --bg: #e8eef6; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: rgba(15,23,42,0.07); --chip: #eef2f8; }

.kh-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.kh-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip);
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--muted);
}

.kh-name {
  margin: 20px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--on-bg, var(--text));
}
.kh-handle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--on-bg-muted, var(--muted));
}
.kh-bio {
  margin: 12px 0 0;
  max-width: 36ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--on-bg-muted, var(--muted));
  text-align: center;
  white-space: pre-line;
}

.kh-links {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kh-link {
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px var(--line);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kh-link:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--line), 0 6px 16px var(--line); }
.kh-link:active { transform: scale(0.99); }
.kh-link:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.kh-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--chip);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.kh-icon img { width: 20px; height: 20px; border-radius: 4px; }
.kh-icon--custom { overflow: hidden; }
.kh-icon--custom img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.kh-icon svg { width: 18px; height: 18px; }

.kh-text { min-width: 0; }
.kh-title {
  display: block;
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kh-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kh-arrow { width: 18px; height: 18px; color: var(--muted); }

.kh-empty {
  margin-top: 32px;
  font-size: 14px;
  color: var(--on-bg-muted, var(--muted));
  text-align: center;
}

.kh-footer {
  margin-top: auto;
  padding-top: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--on-bg-muted, var(--muted));
  text-decoration: none;
  letter-spacing: 0.01em;
}
.kh-footer img { width: 16px; height: 16px; border-radius: 5px; }
.kh-footer b { color: var(--on-bg, var(--text)); font-weight: 650; }
