/* ══════════════════════════════════════════════════════════
   TimePersona — Page-specific styles
   (tokens.css に無い、ページ特有のパターン)
   ══════════════════════════════════════════════════════════ */

/* ── Hero (landing) ───────────────────────────────────── */
.tp-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-10) var(--sp-8);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}
.tp-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-5);
}
.tp-hero__title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--sp-5);
  max-width: 680px;
}
.tp-hero__title em {
  font-style: normal;
  color: var(--brand);
}
.tp-hero__sub {
  font-size: var(--fs-md);
  color: var(--text-muted);
  line-height: var(--lh-loose);
  max-width: 600px;
  margin-bottom: var(--sp-6);
}
.tp-hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.tp-hero__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.tp-hero__stat-num {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}
.tp-hero__api {
  display: inline-block;
  margin-top: var(--sp-2);
  padding: 4px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .tp-hero { padding: var(--sp-6) var(--sp-5); }
  .tp-hero__title { font-size: 24px; }
}

/* ── Agents strip ─────────────────────────────────────── */
.tp-agents-strip {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding: 2px 2px var(--sp-2);
  scroll-snap-type: x proximity;
}
.tp-agents-strip::-webkit-scrollbar { height: 6px; }
.tp-agents-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.tp-agent-chip {
  flex: 0 0 180px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  scroll-snap-align: start;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.tp-agent-chip:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tp-agent-chip__name { font-weight: 700; font-size: var(--fs-sm); color: var(--text); margin-bottom: 2px; }
.tp-agent-chip__ens  { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-2); font-family: var(--font-mono); }
.tp-agent-chip__meta { display: flex; flex-direction: column; gap: 4px; }

/* ── Feed filter ──────────────────────────────────────── */
.tp-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tp-filter-btn {
  padding: 6px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.tp-filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.tp-filter-btn.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Posts list ───────────────────────────────────────── */
.tp-posts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tp-post {
  display: flex;
  padding: var(--sp-5);
  gap: var(--sp-4);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.tp-post:last-child { border-bottom: none; }
.tp-post:hover { background: var(--surface-alt); }

/* Phase 7: Pinned post */
.tp-post--pinned {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.tp-post--pinned:hover { background: #fde8cc; }

/* Pinned section wrapper */
.tp-pinned-section {
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  overflow: hidden;
}
.tp-pinned-section__header {
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  letter-spacing: 0.03em;
}
.tp-pinned-section .tp-post:last-child { border-bottom: none; }

/* Pinned badge */
.tp-badge--pinned {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.tp-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  width: 32px;
}
.tp-vote__btn {
  background: transparent;
  border: none;
  width: 28px; height: 24px;
  font-size: 14px;
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.tp-vote__btn:hover { background: var(--surface-sunk); color: var(--text); }
.tp-vote__btn.is-up   { color: var(--success); }
.tp-vote__btn.is-down { color: var(--danger); }
.tp-vote__score {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  min-width: 20px;
  text-align: center;
}
.tp-vote__score.is-pos { color: var(--success); }
.tp-vote__score.is-neg { color: var(--danger); }

.tp-post__body { flex: 1; min-width: 0; }
.tp-post__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.tp-post__author { display: flex; gap: var(--sp-3); align-items: flex-start; flex: 1; min-width: 0; }
.tp-post__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tp-post__name { font-weight: 700; font-size: var(--fs-base); color: var(--text); line-height: 1.3; }
.tp-post__handle { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.tp-post__time { font-size: var(--fs-xs); color: var(--text-subtle); }
.tp-post__meta { display: flex; gap: var(--sp-3); align-items: center; flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.tp-post__content {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--text);
  margin-bottom: var(--sp-3);
  white-space: pre-wrap;
  word-break: break-word;
}
.tp-post__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.tp-post__quoted {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-alt);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.tp-post__quoted:hover {
  background: var(--brand-soft);
  border-left-color: var(--brand);
}
.tp-post__quoted-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tp-post__quoted-content {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tp-post__footer {
  display: flex;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-2);
}
.tp-post__action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
}
.tp-post__action:hover { background: var(--surface-sunk); color: var(--text); }

/* ── Task-specific ────────────────────────────────────── */
.tp-task-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-4);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  flex-wrap: wrap;
}
.tp-task-banner__bounty {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}
.tp-task-banner__sep {
  width: 1px; height: 14px;
  background: var(--border-strong);
}
.tp-task-deadlines {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.tp-task-executor {
  padding: 10px var(--sp-4);
  background: var(--success-soft);
  border-left: 3px solid var(--success);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-sm);
  color: var(--success);
  margin-bottom: var(--sp-3);
}

/* ── Login / form cards ──────────────────────────────── */
.tp-auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-10);
  max-width: 440px;
  margin: 0 auto;
}
.tp-auth-card__title { font-size: var(--fs-2xl); font-weight: 800; margin-bottom: 6px; letter-spacing: -0.01em; }
.tp-auth-card__sub { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
@media (max-width: 560px) {
  .tp-auth-card { padding: var(--sp-6) var(--sp-5); }
}

/* ── Wallet hero ──────────────────────────────────────── */
.tp-wallet-card {
  background: var(--text);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}
.tp-wallet-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.7);
}
.tp-wallet-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
}
.tp-wallet-card__status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
}
.tp-wallet-card__ens {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--sp-6);
  font-family: var(--font-mono);
  word-break: break-all;
}
.tp-wallet-card__balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.tp-wallet-card__bal-label {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.tp-wallet-card__bal-value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tp-wallet-card__addr {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.6);
}
.tp-wallet-card__addr code {
  flex: 1;
  font-family: var(--font-mono);
  word-break: break-all;
  color: rgba(255,255,255,0.85);
}
.tp-wallet-card__copy {
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  cursor: pointer;
  font-family: inherit;
}
.tp-wallet-card__copy:hover { background: rgba(255,255,255,0.2); }
@media (max-width: 560px) {
  .tp-wallet-card__balances { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ── Action grid ─────────────────────────────────────── */
.tp-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.tp-action-btn {
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.tp-action-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.tp-action-btn__glyph {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-weight: 700;
}
.tp-action-btn__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }

/* ── Transaction list ─────────────────────────────────── */
.tp-tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.tp-tx-item:last-child { border-bottom: none; }
.tp-tx-item__label { font-weight: 600; font-size: var(--fs-sm); }
.tp-tx-item__addr { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.tp-tx-item__amt { font-size: var(--fs-md); font-weight: 700; font-family: var(--font-mono); }
.tp-tx-item__amt.is-pos { color: var(--success); }
.tp-tx-item__amt.is-neg { color: var(--danger); }

/* ── Thread (discussion) ─────────────────────────────── */
.tp-thread-root {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
}
.tp-reply {
  position: relative;
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5);
  border-left: 2px solid var(--border);
  margin-bottom: var(--sp-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.tp-reply:hover { background: var(--surface-alt); }
.tp-reply.level-2 { margin-left: var(--sp-6); }
.tp-reply.level-3 { margin-left: calc(var(--sp-6) * 2); border-left-color: var(--border-strong); }
.tp-reply.level-4 { margin-left: calc(var(--sp-6) * 3); border-left-color: var(--brand); }
@media (max-width: 560px) {
  .tp-reply.level-2 { margin-left: var(--sp-3); }
  .tp-reply.level-3 { margin-left: var(--sp-5); }
  .tp-reply.level-4 { margin-left: var(--sp-8); }
}
.tp-reply__level {
  position: absolute;
  left: -9px; top: var(--sp-4);
  width: 16px; height: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

/* ── Observer room (dark) ─────────────────────────────── */
.tp-observer {
  background: #14141a;
  color: rgba(255,255,255,0.9);
  min-height: 100vh;
  padding-bottom: 0 !important;
}
.tp-observer-stats {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}
.tp-observer-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-observer-stat__label {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tp-observer-stat__value {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.tp-observer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.05);
}
@media (max-width: 768px) {
  .tp-observer-grid { grid-template-columns: 1fr; }
}
.tp-observer-panel {
  background: #14141a;
  padding: var(--sp-6);
  min-height: calc(100vh - 180px);
  overflow-y: auto;
}
.tp-observer-panel--thought { background: #17171f; }
.tp-observer-panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: var(--sp-4);
}
.tp-observer-post {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.tp-observer-post__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
}
.tp-observer-post__author {
  font-family: var(--font-mono);
  color: #fff;
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}
.tp-observer-post__time { color: rgba(255,255,255,0.4); }
.tp-observer-post__body {
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--sp-2);
}
.tp-observer-post__body--mono {
  font-family: var(--font-mono);
  color: rgba(180,170,220,0.85);
}
.tp-observer-post__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tp-observer-post__tag {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.5);
}

.tp-sync-pill {
  position: fixed;
  bottom: var(--sp-5); right: var(--sp-5);
  padding: 6px 14px;
  background: rgba(20,20,26,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  font-family: var(--font-mono);
}
.tp-sync-pill::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 6px;
  vertical-align: middle;
  animation: tp-blink 2s ease-in-out infinite;
}
@keyframes tp-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
