/* PocketPlay account, editor, privacy, directory and error pages. Kit v2 tokens only. */
/* Shim: kit `.pp a { color: inherit }` (0,1,1) outranks `.pp-btn` (0,1,0), so anchor buttons lose their colour. Remove once pp.css is fixed. */
.pp a.pp-btn { color: var(--accent-ink); }
.pp a.pp-btn--ink { color: var(--bg); }
.pp a.pp-btn--secondary { color: var(--ink); }
.pp a.pp-btn--ghost { color: var(--ink-2); }
.pp a.pp-btn--ghost:hover { color: var(--ink); }
.pp a.pp-btn--soft { color: var(--accent-text); }
.pp a.pp-link { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.pp a.pp-link:hover { text-decoration-color: currentColor; }

/* Account panel */
.ac-wrap { padding-top: 56px; padding-bottom: 24px; display: grid; justify-items: center; }
.ac-panel { width: 100%; max-width: 440px; padding: 36px 32px 28px; display: grid; gap: 20px; }
.ac-panel--wide { max-width: 520px; }
.ac-brand { display: grid; justify-items: center; }
.ac-brand .pp-logo { width: 52px; height: 52px; }
.ac-brand .pp-logo .pp-logo__dot { fill: #ff8a3d; }
.ac-title { font-size: 26px; text-align: center; letter-spacing: -.03em; margin-top: -4px; }
.ac-sub { text-align: center; color: var(--ink-3); font-size: 14.5px; margin-top: -12px; }
.ac-form { display: grid; gap: 16px; }
.ac-form .pp-btn--block { margin-top: 4px; }
.ac-alert { margin: 0; }
.ac-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 14px; color: var(--ink-3); padding-top: 16px; border-top: 1px solid var(--line); }
.ac-honey, .honey { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(100%); white-space: nowrap; }
.pp-check a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }

/* Signed in */
.ac-profile { display: flex; align-items: center; gap: 16px; }
.ac-avatar { width: 56px; height: 56px; font-size: 22px; box-shadow: var(--shadow-1); }
.ac-avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.ac-avatar-choice { position: relative; cursor: pointer; }
.ac-avatar-choice > span { display: grid; justify-items: center; gap: 8px; padding: 12px 4px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.ac-avatar-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-avatar-choice input:checked + span { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.ac-avatar-choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.ac-avatar-choice small { font-size: 12px; color: var(--ink-2); }
.ac-name { font-size: 22px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.ac-profile p { color: var(--ink-3); font-size: 14.5px; margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-section { display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.ac-section h2 { font-size: 17px; }
.ac-signout { display: flex; justify-content: center; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.ac-recovery { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-m); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); }
.ac-recovery__head { display: flex; align-items: center; gap: 12px; }
.ac-recovery__head h2 { font-size: 17px; }
.ac-recovery p { font-size: 14px; color: var(--ink-2); }
.recovery-code { display: block; padding: 12px 14px; border-radius: var(--r-s); background: var(--surface); border: 1px dashed var(--line-3); font: 500 14.5px/1.5 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
.ac-recovery .pp-btn { justify-self: start; }

/* Editor */
.ed-head { padding-top: 40px; }
.ed-layout { align-items: start; }
.ed-main { padding: 28px; }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ed-box { border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 4px 16px 16px; background: var(--surface-2); }
.ed-box > summary { cursor: pointer; font-weight: 600; font-size: 14.5px; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.ed-box > summary::-webkit-details-marker { display: none; }
.ed-box > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; }
.ed-box[open] > summary::before { transform: rotate(45deg); }
.ed-box > div { display: grid; gap: 14px; margin-top: 4px; }
.ed-box > div + div { padding-top: 14px; border-top: 1px solid var(--line); }
.ed-source { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 150px; gap: 14px; }
.ed-body { min-height: 360px; font-family: var(--font-mono); font-size: 14px; }
.ed-json { min-height: 420px; font-family: var(--font-mono); font-size: 13.5px; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.ed-preview { margin-top: 18px; font-size: 14.5px; }
.ed-recent { display: grid; gap: 14px; padding: 20px; }
.ed-recent__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ed-recent__head h2 { font-size: 17px; }
.ed-recent .pp-list { box-shadow: none; }
.ed-recent .pp-listrow { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
.ed-recent .pp-listrow h3 { font-size: 14px; }
.ed-recent .pp-listrow p { font-size: 12.5px; }

/* Privacy */
.ac-doc { padding-bottom: 8px; }
.ac-doc__head { padding-top: 48px; }
.ac-doc__list { display: grid; gap: 14px; margin-top: 28px; }
.ac-doc__item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; padding: 24px 26px; }
.ac-doc__item h2 { font-size: 19px; margin-bottom: 8px; }
.ac-prose { font-size: 15.5px; line-height: 1.7; }
:lang(zh) .ac-prose { font-size: 15.5px; line-height: 1.85; }
.ac-doc__links { margin-top: 28px; gap: 8px; }

/* Directory */
.ac-dir__head { padding-top: 56px; justify-items: start; }
.ac-dir__filter { display: grid; gap: 14px; margin-top: 24px; position: sticky; top: var(--header-h); z-index: 5; padding: 12px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ac-dir__search { position: relative; display: block; max-width: 420px; }
.ac-dir__search .pp-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.ac-dir__search .pp-input { padding-left: 42px; border-radius: var(--r-pill); }
.ac-dir__body { display: grid; gap: 40px; margin-top: 20px; }
.ac-dir__group { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; }
.ac-dir__group > h2 { font-size: 20px; }
.ac-dir__grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ac-dir__item { display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.ac-dir__item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.ac-dir__item[hidden] { display: none; }
.ac-dir__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-dir__top b { font-size: 15px; font-weight: 600; }
.ac-dir__top .pp-i { width: 15px; height: 15px; color: var(--ink-4); }
.ac-dir__item small { font: 500 11.5px/1.3 var(--font-mono); color: var(--ink-3); letter-spacing: .02em; overflow-wrap: anywhere; }
.ac-dir__item p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.ac-dir [hidden] { display: none !important; }

/* Error */
.ac-error { display: grid; justify-items: center; text-align: center; gap: 16px; padding-top: 72px; padding-bottom: 24px; }
.ac-error__code { font-family: var(--font-serif); font-size: clamp(96px, 18vw, 168px); line-height: .9; letter-spacing: -.04em; color: transparent; background: linear-gradient(160deg, var(--ink-4), color-mix(in srgb, var(--accent) 45%, var(--ink-4))); -webkit-background-clip: text; background-clip: text; }
.ac-error .pp-lede { margin: 0 auto; }
.ac-error__actions { justify-content: center; margin-top: 4px; }
.ac-error__places .pp-tile--row { min-height: 0; }
.ac-error__places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 860px; margin-top: 32px; text-align: left; }

@media (max-width: 860px) {
  .ed-source { grid-template-columns: 1fr; }
  .ac-error__places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ac-wrap { padding-top: 24px; }
  .ac-panel { padding: 28px 20px 22px; border-radius: var(--r-l); }
  .ed-grid { grid-template-columns: 1fr; }
  .ed-main { padding: 20px; }
  .ac-doc__item { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .ac-dir__head { padding-top: 32px; }
  .ac-error { padding-top: 40px; }
  .ac-error__actions .pp-btn { flex: 1 1 100%; }
}
