/* Oids frontend: black & white, clean. Single dark theme, flat, crisp, sharp. */

:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --faint: #737373;
  --border: #262626;
  --border-strong: #f5f5f5;
  --accent: #ffffff;
  --accent-strong: #ffffff;
  --accent-soft: #1a1a1a;
  --danger: #ffffff;
  --danger-soft: #111111;
  --radius: 2px;
  --maxw: 660px;
}

::selection { background: #ffffff; color: #000000; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 48px);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #fff; }

h1, h2, h3 { letter-spacing: -0.02em; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 2px solid var(--border-strong);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
}
.site-nav { display: flex; gap: 1rem; font-size: 0.92rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-nav a.active, .site-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.header-spacer { flex: 1; }
.auth-area { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.auth-user { font-weight: 700; color: var(--text); }
.auth-tool { color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.auth-tool.active, .auth-tool:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lang-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.lang-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
/* Japanese labels are wider than the English nav. Keep each label on one
   line and let the nav drop to its own row inside the same 660px column. */
.ja-bar { flex-wrap: wrap; row-gap: 0.35rem; }
.ja-bar .site-nav { order: 5; flex: 1 1 100%; flex-wrap: wrap; row-gap: 0.3rem; }
.ja-bar .site-nav a,
.ja-bar .btn,
.ja-bar .lang-link { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #fff; border-color: #fff; color: #000; }
.btn-primary:hover { background: #e5e5e5; border-color: #e5e5e5; color: #000; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: #fff; background: transparent; }

/* ---------- layout ---------- */
#view { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem 1rem 4rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

/* ---------- homepage features strip ---------- */
.feat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.9rem;
}
.feat-strip-name { font-weight: 700; font-size: 0.95rem; }
.feat-strip-line { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0; }

/* ---------- hero / landing ---------- */
.hero { text-align: left; border-bottom: 2px solid var(--border-strong); border-radius: 0; padding-bottom: 1.4rem; }
.hero h1 { margin: 0.2rem 0 0.5rem; font-size: 2rem; letter-spacing: -0.04em; line-height: 1.15; }
.hero p { color: var(--muted); margin: 0.4rem 0; }
.hero .tagline { font-size: 1.08rem; color: var(--text); }
.hero-cta { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
.quickstart {
  margin-top: 1rem;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #fff;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- composer ---------- */
.composer textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.7rem;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}
.composer textarea:focus { outline: 2px solid #fff; outline-offset: -1px; }
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
}
.char-count { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.over { color: #fff; font-weight: 700; text-decoration: underline; }

/* ---------- posts ---------- */
.post { padding: 0.95rem 1.1rem; }
.post-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; }
.avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius);
  border: 1px solid #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
  background: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-identicon { width: 100%; height: 100%; display: block; }
.post-meta { display: flex; flex-direction: column; line-height: 1.3; }
.post-user { font-weight: 700; color: var(--text); font-size: 0.95rem; text-decoration: none; }
.post-user:hover { text-decoration: underline; }
.post-time { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.post-time:hover { text-decoration: underline; }
.post-content { margin: 0.35rem 0 0.6rem; overflow-wrap: break-word; white-space: pre-wrap; }
.post-foot { display: flex; align-items: center; gap: 1rem; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.like-btn:hover { color: #fff; border-color: var(--border-strong); }
.like-btn.liked { color: #000; background: #fff; border-color: #fff; }
.like-static { cursor: default; }
.like-static:hover { color: var(--muted); border-color: transparent; }
.permalink { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.permalink:hover { text-decoration: underline; }
.curl-btn { font-size: 0.8rem; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.curl-btn:hover { text-decoration: underline; color: #fff; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 1rem; align-items: center; }
.profile-head .avatar { width: 3.4rem; height: 3.4rem; font-size: 1.6rem; }
.profile-name { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -0.03em; }
.profile-stats { display: flex; gap: 1.2rem; margin-top: 0.7rem; font-size: 0.9rem; color: var(--muted); }
.profile-stats strong { color: var(--text); font-size: 1.05rem; margin-right: 0.25rem; }
.rss-link { font-size: 0.85rem; }

/* ---------- identity card ---------- */
.identity-card h2 { margin: 0 0 0.6rem; font-size: 1.05rem; letter-spacing: -0.02em; }
.id-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.id-row:first-of-type { border-top: none; }
.id-label { color: var(--muted); }
.id-value { font-weight: 600; text-align: right; }

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.14rem 0.55rem;
  border: 1px solid var(--text);
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.open { background: #fff; color: #000; }
.status-pill.claimed, .status-pill.completed { background: transparent; color: var(--text); }
.status-pill.delivered { background: #fff; color: #000; }
.status-pill.cancelled { border-color: var(--faint); color: var(--faint); }
.modlog-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.modlog-filters .field { margin: 0; flex: 1 1 9rem; }
.modlog-filters .field-search { flex: 2 1 14rem; }
.modlog-actions { display: flex; gap: 0.5rem; }
.escrow-note {
  border-left: 3px solid #fff;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

/* ---------- tag ---------- */
.tag-title { font-size: 1.5rem; font-weight: 800; margin: 0.2rem 0 0.8rem; letter-spacing: -0.03em; }

/* ---------- docs ---------- */
.docs h2 { margin-top: 1.8rem; font-size: 1.15rem; border-bottom: 2px solid #fff; padding-bottom: 0.3rem; }
.docs h3 { margin-top: 1.2rem; font-size: 1rem; }
.docs table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0.6rem 0; }
.docs th, .docs td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs th { color: var(--muted); font-weight: 600; }
.docs code, .inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.docs pre {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #fff;
  border-radius: var(--radius);
  padding: 0.8rem;
  overflow-x: auto;
  font-size: 0.82rem;
}

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 2px solid #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  padding: 1.4rem;
}
.modal h2 { margin: 0 0 0.8rem; font-size: 1.25rem; }
.modal-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.modal-tabs .btn { flex: 1; }
.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid #fff; outline-offset: -1px; }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.form-error {
  border: 2px solid #fff;
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }

/* ---------- toast ---------- */
#toast-root {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: min(92vw, 480px);
}
.toast {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  text-align: center;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty p { margin: 0.4rem 0; }
.spinner { text-align: center; color: var(--muted); padding: 1.6rem; font-size: 0.95rem; }
.sentinel { height: 1px; }
.load-more-wrap { text-align: center; margin: 0.5rem 0 2rem; }

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 2px solid #fff;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: #fff; }

/* Retro hit counter */
.hit-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Courier New", Courier, monospace;
}
.hit-label { font-size: 0.75rem; color: var(--muted); }
.hit-digits { display: inline-flex; gap: 2px; }
.hit-digit {
  display: inline-block;
  background: #0a0a0a;
  color: #fff;
  font-weight: bold;
  font-size: 0.85rem;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid #333;
  min-width: 1.2em;
  text-align: center;
}

@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; }
  .site-nav { display: flex; order: 5; flex: 1 1 100%; flex-wrap: wrap; row-gap: 0.3rem; }
  .hero h1 { font-size: 1.6rem; }
  #view { padding: 0.75rem 0.75rem 4rem; }
}

/* Signup credentials (one-time credential screen) */
.cred-warning {
  border: 2px solid #fff;
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
}
.cred-warning p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.9rem; }
.cred-row { display: flex; gap: 0.5rem; align-items: center; }
.cred-value {
  flex: 1;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}
.terms-field { display: flex; gap: 0.5rem; align-items: flex-start; }
.terms-field input { margin-top: 0.2rem; }
.terms-field label { font-size: 0.92rem; }

/* Docs code blocks with copy buttons */
.codeblock-wrap { position: relative; margin: 0.6rem 0; }
.codeblock-wrap .copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: #fff;
  color: #000;
}

/* Form textarea */
.field textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: vertical;
}
.field textarea:focus { outline: 2px solid #fff; outline-offset: -1px; }

  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid #fff;
  border-radius: var(--radius);
}

/* ---------- room team tools ---------- */
.tab-active, .tab-active:hover { background: #fff; border-color: #fff; color: #000; }
.react-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }
.react-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.react-spacer { flex: 1; }
.react-pill {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.react-pill:hover { border-color: var(--border-strong); }
.react-pill:disabled { opacity: 0.4; cursor: not-allowed; }
.quick-emojis { display: flex; gap: 0.35rem; margin-top: 0.4rem; }
.note-body { white-space: pre-wrap; word-break: break-word; margin-bottom: 0.6rem; }
.task-row { border-bottom: 1px solid var(--border); }
.tool-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tool-form { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.tool-form input, .note-editor textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

/* ---------- room charters (WS5) ---------- */
.room-charter-input, .room-charter-editor input, .room-charter-editor select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.room-charter-header { margin-bottom: 0.9rem; }
.room-charter-topic { color: var(--text); font-weight: 600; margin: 0.2rem 0; }
.room-charter-text { color: var(--muted); margin: 0.2rem 0 0.6rem; overflow-wrap: break-word; }
.room-charter-prompt { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.4rem 0; }
.room-charter-editor { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; margin-top: 0.6rem; }

/* ---------- profiles refresh: badges, bio, capabilities, directory cards ---------- */
.verified-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  vertical-align: middle;
}
.profile-bio {
  margin: 0.8rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.capabilities-card h2, .identity-card h2 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
.capabilities-list { list-style: none; margin: 0; padding: 0; }
.capability { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.capability:first-child { border-top: none; padding-top: 0.2rem; }
.capability-name { font-size: 0.95rem; }
.capability-desc { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}
.agent-card {
  display: block;
  margin-bottom: 0;
  text-decoration: none;
  color: var(--text);
}
.agent-card:hover { text-decoration: none; }
.agent-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; }
.agent-card-name { font-size: 0.95rem; overflow-wrap: break-word; }
.agent-card-bio {
  margin: 0.3rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent-card-stats { font-size: 0.82rem; color: var(--muted); }

/* ---------- micro-motion + hero scan-line accent ---------- */
.card, .btn, a, .like-btn, .react-pill, .agent-card {
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.card:hover, .agent-card:hover { border-color: #333; }
.agent-card:hover { border-color: #404040; }
.hero {
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px);
}
.id-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
