:root {
  --fg: #111;
  --muted: #555;
  --bg: #fff;
  --panel: #f4f4f4;
  --line: #d0d0d0;
  --accent: #d71921;
  --link: #0b3d91;
  --ok: #0a5c2b;
  --err: #8a0f14;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: var(--link);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
video:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}
.skip {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: #fff;
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  outline: 3px solid #1a73e8;
  inset-inline-start: 0;
}
.devbanner {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 0.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.brand,
.brand:hover {
  text-decoration: none;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
header.site nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
header.site nav {
  flex: 1;
  min-width: 0;
}
header.site nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}
header.site nav a:hover {
  background: var(--panel);
}
header.site nav a[aria-current="page"] {
  background: #e4e4e4;
  font-weight: 700;
}
header.site > form.lang {
  margin-inline-start: auto;
}
.profile {
  position: relative;
  margin-inline-start: auto;
}
.profile > summary {
  list-style: none;
  display: block;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
}
.profile > summary::-webkit-details-marker {
  display: none;
}
.avatar {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  background: #444;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  user-select: none;
}
.avatar-initials {
  position: absolute;
  inset: 0;
}
.avatar-img {
  position: absolute;
  inset: 0;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
}
.avatar-img[hidden] {
  display: none;
}
.tone-0 {
  background: #8a0f14;
}
.tone-1 {
  background: #0a5c2b;
}
.tone-2 {
  background: #0b3d91;
}
.tone-3 {
  background: #6a2c91;
}
.tone-4 {
  background: #8a4b00;
}
.tone-5 {
  background: #0b6070;
}
.tone-6 {
  background: #7a2a5a;
}
.tone-7 {
  background: #3d4a5c;
}
.profile[open] > summary .avatar {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--fg);
}
.profile-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 240px;
  max-width: calc(100vw - 2rem);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
  animation: profile-in 0.12s ease-out;
}
@keyframes profile-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.profile-id {
  display: grid;
  gap: 0.15rem;
  justify-items: start;
}
.profile-name,
.profile-email {
  overflow-wrap: anywhere;
}
.profile-email {
  color: var(--muted);
  font-size: 0.9rem;
}
.profile-panel form.lang {
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.profile-panel form.lang label {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-panel form.lang select {
  flex: 1;
  min-width: 0;
}
.profile-out {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin: 0;
}
form.lang {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}
main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
main:focus {
  outline: none;
}
footer.site {
  border-top: 1px solid var(--line);
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}
h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}
.btn,
button {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 2px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.primary,
button.primary {
  background: var(--fg);
  color: #fff;
}
.btn.danger,
button.danger {
  border-color: var(--err);
  color: var(--err);
}
.btn.small,
button.small {
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
}
button[aria-disabled="true"],
button:disabled {
  opacity: 0.75;
  border-style: dashed;
  cursor: not-allowed;
}
.field {
  margin: 0 0 1rem;
  max-width: 640px;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="search"],
.field select,
.field textarea,
input[type="search"],
input[type="file"] {
  font: inherit;
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #777;
  border-radius: 6px;
  background: #fff;
  color: var(--fg);
}
.field textarea {
  min-height: 7rem;
}
textarea.vtt {
  min-height: 20rem;
  font-family: ui-monospace, Menlo, monospace;
}
.hint {
  color: var(--muted);
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}
.field-error,
.errors {
  color: var(--err);
}
.errors {
  border: 2px solid var(--err);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.flash {
  background: #e8f5ec;
  border: 2px solid var(--ok);
  color: var(--ok);
  padding: 0.6rem 1rem;
  border-radius: 6px;
}
.grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.card h3 {
  font-size: 1rem;
  margin: 0.5rem 0 0.1rem;
}
.card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.thumb-link {
  display: block;
}
.card img,
.thumb-ph {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #222;
  border-radius: 6px;
  display: block;
}
.searchbar {
  display: flex;
  gap: 0.5rem;
  max-width: 640px;
}
.searchbar input {
  flex: 1;
}
.pager {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
}
video,
.player iframe {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  border-radius: 6px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
th,
td {
  text-align: start;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel);
}
.table-wrap {
  overflow-x: auto;
}
.inline {
  display: inline;
  margin: 0;
}
.inline select {
  width: auto;
}
.cards-radio {
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
  margin: 1rem 0;
  border: 0;
  padding: 0;
}
.cards-radio label {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border: 2px solid #777;
  border-radius: 8px;
  cursor: pointer;
}
.cards-radio input {
  width: 1.4rem;
  height: 1.4rem;
}
.badge {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.4rem;
  font-size: 0.8rem;
}
progress {
  width: 100%;
  max-width: 640px;
  height: 1.25rem;
}
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.ai-note {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 640px;
}
.muted {
  color: var(--muted);
}
@media (max-width: 600px) {
  header.site {
    gap: 0.5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
[hidden] {
  display: none !important;
}
.sr {
  position: absolute;
  margin: -1px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
code {
  font-size: 0.85rem;
  word-break: break-all;
}
.taglist {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0;
}
.taglist a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  text-decoration: none;
}
.desc {
  white-space: pre-wrap;
  max-width: 70ch;
}
