:root {
  --navy-900: #0a1628;
  --navy-800: #0f2040;
  --navy-700: #172a52;
  --navy-600: #1e3564;
  --navy-500: #264478;
  --navy-400: #3a5a96;
  --navy-300: #6b8bbf;
  --navy-200: #a8bdd9;
  --navy-100: #d4e0f0;
  --navy-50:  #edf2f9;

  --primary:       var(--navy-600);
  --primary-dark:  var(--navy-700);
  --primary-light: var(--navy-50);

  --surface:   #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #edf1f7;
  --border:    #d0daea;
  --border-strong: #b0c0d8;

  --text:   #0a1628;
  --text-2: #3d4f6e;
  --text-3: #7a8fa8;

  --danger:  #c0392b;
  --success: #1a7f5a;
  --warning: #b8860b;

  --shadow-xs: 0 1px 2px rgba(10,22,40,.06);
  --shadow-sm: 0 2px 6px rgba(10,22,40,.08);
  --shadow:    0 4px 16px rgba(10,22,40,.10);
  --shadow-lg: 0 8px 32px rgba(10,22,40,.14);

  --radius:    10px;
  --radius-sm: 6px;
  --nav-h:     60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent-start: #FFC2D2;
  --accent-end:   #8397FE;
  --accent-grad:  linear-gradient(90deg, var(--accent-start), var(--accent-end));
}

body {
  font-family: 'LINESeedJP_A', 'LINE Seed JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: inline-block;
  margin-bottom: 1px;
}


/* ナビ 検索アイコンボタン */
.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ナビ ユーザーメニュー */
.nav-user-menu {
  position: relative;
}
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-username {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-caret { font-size: 10px; opacity: .7; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
  white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--surface-3); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }
.nav-dropdown-danger { color: #c53030; }
.nav-dropdown-danger:hover { background: #fff5f5; }

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: #8397FE;
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(.93); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.9); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface-3); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--navy-200);
}
.btn-outline:hover { border-color: var(--primary); background: var(--primary-light); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 28px; font-size: 15px; }

/* ===== Layout ===== */
#main {
  margin-top: var(--nav-h);
  padding: 28px 24px;
  min-height: calc(100vh - var(--nav-h));
}

/* compare-page / feed は padding なしでフルハイト */
#main:has(.compare-page) {
  padding: 0;
  min-height: unset;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.container      { max-width: 780px;  margin: 0 auto; }
.wide-container { max-width: 1080px; margin: 0 auto; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

/* ===== Auth ===== */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--navy-900);
}
.auth-card .auth-sub {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--surface);
  color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 96px; }

.form-error { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-entry { position: relative; margin-bottom: 20px; }
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 20px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--primary);
}

/* 期間エントリー（end_dateあり）: 丸ドットを縦バーに変える */
.timeline-entry.entry-span::before {
  width: 3px;
  height: calc(100% + 20px);
  border-radius: 2px;
  top: 16px;
  left: -21px;
  box-shadow: none;
  border: none;
  background: #8397FE;
}

.entry-card--span {
  border-left: 3px solid #8397FE;
}

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
  cursor: pointer;
}
.entry-card:hover { box-shadow: var(--shadow-sm); }

.entry-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.entry-body { padding: 16px 18px; }

.entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.entry-date {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.entry-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.entry-detail {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.entry-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-author {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.entry-author:hover { color: var(--primary); }

.entry-actions { display: flex; gap: 6px; }

/* ===== Tags ===== */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  border: 1px solid;
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; }

/* タグドロップダウン */
.tag-dropdown { position: relative; margin-top: 6px; }
.tag-dd-btn {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  gap: 8px;
}
.tag-dd-btn:hover { border-color: var(--border-strong); }
.tag-dd-caret { font-size: 10px; color: var(--text-3); flex-shrink: 0; }
.tag-dd-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tag-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
}
.tag-dd-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
}
.tag-dd-item:hover { background: var(--surface-3); }
.tag-dd-item input[type=checkbox] { cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }
.tag-dd-empty { display: block; padding: 12px; font-size: 12px; color: var(--text-3); text-align: center; }

.tag-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-option {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all .12s;
  font-family: inherit;
  font-weight: 500;
}
.tag-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== Visibility badge ===== */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ===== Profile ===== */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.profile-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: -0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }

.profile-info { flex: 1; }
.profile-username {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  margin-bottom: 6px;
}
.profile-bio {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.55;
}
.profile-stats { display: flex; gap: 28px; }
.stat { cursor: pointer; }
.stat:hover .stat-count { color: var(--primary); }
.stat-count { font-size: 18px; font-weight: 700; color: var(--navy-800); }
.stat-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Compare ===== */
.compare-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 700px) { .compare-view { grid-template-columns: 1fr; } }

.compare-column h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--primary);
}

.compare-entry {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow .12s;
}
.compare-entry:hover { box-shadow: var(--shadow-xs); }
.compare-date  { font-size: 11px; color: var(--text-3); margin-bottom: 5px; font-weight: 500; }
.compare-title { font-size: 14px; font-weight: 600; color: var(--navy-900); }
.compare-detail { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

/* ===== Empty state ===== */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
}
.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  margin: 0 auto 14px;
}
.empty h3 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.empty p  { font-size: 13px; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hidden { display: none !important; }
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,.55);
}
.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--navy-900);
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }

/* ===== Toast ===== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn .25s ease;
  max-width: 300px;
  border: 1px solid;
}
.toast-success { background: #f0faf5; color: #145a3c; border-color: #a7d7be; }
.toast-error   { background: #fdf2f2; color: #7f1d1d; border-color: #f5b7b1; }
.toast-info    { background: var(--primary-light); color: var(--primary-dark); border-color: var(--navy-200); }

@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: all .15s;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== Loading ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== User list ===== */
.user-list { list-style: none; }
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.user-list-item:last-child { border-bottom: none; }
.user-list-info { flex: 1; }
.user-list-name { font-weight: 600; font-size: 14px; color: var(--navy-900); }
.user-list-bio  { font-size: 12px; color: var(--text-3); }

/* ===== Landing ===== */
.landing {
  text-align: center;
  padding: 36px 24px 48px;
  max-width: 600px;
  margin: 0 auto;
}
.landing h1 {
  font-size: 38px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.04em;
  margin-bottom: 14px;
  line-height: 1.15;
}
.landing h1 span {
  color: var(--primary);
}
.landing-sub {
  font-size: 16px;
  color: var(--text-2);
  margin-bottom: 32px;
  line-height: 1.6;
}
.landing-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 48px 0 0;
  text-align: left;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.feature-title { font-size: 13px; font-weight: 700; color: var(--navy-900); margin-bottom: 6px; letter-spacing: -0.01em; }
.feature-desc  { font-size: 12px; color: var(--text-2); line-height: 1.55; }

/* ===== Tag filter row ===== */
.tag-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.tag-filter-row::-webkit-scrollbar { display: none; }
.tag-filter-btn {
  flex-shrink: 0;
  padding: 4px 13px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all .12s;
  font-family: inherit;
  white-space: nowrap;
}
.tag-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* ===== Image preview ===== */
.image-preview { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-sm); margin-top: 8px; display: none; border: 1px solid var(--border); }
.image-preview.show { display: block; }

/* ===== Specific viewers ===== */
.specific-viewers-section { display: none; }
.specific-viewers-section.show { display: block; }

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ===== Demo badge ===== */
.demo-banner {
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ===== Compare redesign ===== */
.compare-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

/* コントロールパネル（sticky） */
.compare-controls {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  white-space: nowrap;
  min-width: 80px;
}

/* アカウント切替チップ */
.col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: all .15s;
  user-select: none;
}
.col-toggle.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.col-toggle.active.official {
  border-color: var(--navy-800);
  background: var(--navy-800);
  color: #fff;
}
.col-toggle:not(.active) { opacity: .45; }

.official-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--navy-800);
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.col-toggle.active .official-badge { background: rgba(255,255,255,.25); }

/* カラム群 */
.compare-columns-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  gap: 0;
  padding: 0;
}

.compare-col {
  flex: 0 0 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.compare-col:last-child { border-right: none; }

/* 自分のカラムは明確に区別 */
.compare-col.col-mine {
  background: var(--navy-50);
  flex: 0 0 320px;
  min-width: 320px;
}

/* カラムヘッダー */
.compare-col-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-col.col-mine .compare-col-header {
  background: var(--navy-800);
  border-bottom-color: var(--navy-700);
}
.compare-col.col-official .compare-col-header {
  background: var(--navy-900);
  border-bottom-color: var(--navy-800);
}

.col-header-name {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  letter-spacing: -0.01em;
}
.compare-col.col-mine .col-header-name,
.compare-col.col-official .col-header-name { color: #fff; }

/* 自分カラムのカテゴリフィルター */
.col-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: inherit;
}

/* カテゴリチップ：除外モード */
/* chip-on = 表示中（デフォルト）, chip-off = 非表示 */
.cat-chip {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, opacity .15s;
  font-family: inherit;
}
.cat-chip.chip-on {
  background: var(--chip-color, var(--primary));
  color: #fff;
  border-color: transparent;
}
.cat-chip.chip-off {
  background: var(--surface-3);
  color: var(--text-3);
  border-color: var(--border);
  opacity: .5;
  text-decoration: line-through;
}

/* アバターアップロード */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

/* カラム内エントリーリスト */
.compare-col-entries {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* エントリーカード（比較用・コンパクト） */
.cmp-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: box-shadow .12s;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cmp-entry:hover { box-shadow: var(--shadow-xs); }
.cmp-entry-body { flex: 1; min-width: 0; }
.cmp-entry-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}

.compare-col.col-mine .cmp-entry {
  border-left: 3px solid var(--primary);
}
.compare-col.col-official .cmp-entry {
  border-left: 3px solid var(--navy-700);
}

.cmp-date {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.cmp-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.35;
}
.cmp-detail {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
}
.cmp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cmp-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid;
}

/* ===== フィード年別タイムライン ===== */
.feed-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.feed-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ヘッダー: グリッド・縦sticky */
.feed-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--border);
}
.feed-head--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.feed-head-mine {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  background: #8397FE;
  color: #fff;
}
.feed-head-fol {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.feed-head-off {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  background: var(--navy-800);
  color: #fff;
  border-left: 1px solid var(--border);
}

/* 年区切り行 */
.feed-year-sep {
  padding: 3px 12px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-3);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
}

/* 年ごとのグリッド */
.feed-year-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 28px;
}
.feed-year-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.feed-year-mine {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--navy-50);
  border-right: 1px solid var(--border);
  min-width: 0;
}
.feed-year-fol {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.feed-year-row--3 .feed-year-fol {
  border-right: 1px solid var(--border);
}
.feed-year-off {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: var(--surface-2);
}

/* フィルターアイコンボタン */
.feed-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}
.feed-filter-btn:hover { background: rgba(255,255,255,.24); }
.feed-filter-btn-light {
  border-color: var(--border);
  background: var(--surface-3);
  color: var(--text-2);
}
.feed-filter-btn-light:hover { background: var(--border); }
.feed-filter-btn.is-active { background: rgba(255,255,255,.28); }
.feed-filter-btn-light.is-active { background: var(--navy-100); border-color: var(--navy-300); color: var(--navy-700); }

/* フォロワー（一般）カード */
.cmp-entry { background: var(--surface); }

/* 公式アカウントカード */
.cmp-entry--official {
  background: #f7f4ff;
  border-color: #c5bef8 !important;
}

/* 公式アカウントのアバター */
.cmp-entry--official .avatar {
  background: #8397FE;
}

/* 絞り込みモーダルのリスト項目 */
.filter-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.filter-modal-item:last-of-type { border-bottom: none; }
.filter-modal-item input[type=checkbox] { cursor: pointer; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }


/* モーダル横並びフォーム */
.form-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: start;
  gap: 4px 10px;
  margin-bottom: 8px;
}
.form-row > label {
  padding-top: 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
  line-height: 1.3;
}
.form-row > * { min-width: 0; }
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
.form-row input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
  min-width: 0;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus { border-color: var(--primary); }
.form-row textarea { resize: vertical; min-height: 56px; }
.form-row .tag-dropdown { margin-top: 0; }
.form-row .image-upload-area { flex-wrap: nowrap; }

/* 3カラムレイアウト: 各カラムが均等に幅を占める */
.col-flex {
  flex: 1 1 0;
  min-width: 260px;
}

/* フォロー中カラムのヘッダー */
.col-header-normal {
  background: var(--surface-3) !important;
  border-bottom-color: var(--border-strong) !important;
}

/* カラムヘッダーの件数バッジ */
.col-header-count {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
  font-weight: 400;
}

/* 統合カラム内のユーザー情報 */
.cmp-entry-author {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* 画像アップロードエリア */
.image-upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 空状態（カラム内） */
.col-empty {
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  padding: 32px 12px;
}

/* ===== エクスポートモーダル ===== */
.export-modal { max-width: 480px; }
.export-modal-desc {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 16px;
  line-height: 1.5;
}
.export-template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-template-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.export-template-card:hover {
  border-color: #8397FE;
  background: #f5f4ff;
}
.export-template-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.export-template-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}
.export-template-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ===== 年齢バッジ ===== */
.entry-age {
  display: inline-block;
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  font-weight: 500;
}

/* ===== 共有バッジ ===== */
.shared-badge {
  display: inline-block;
  font-size: 10px;
  color: #8397FE;
  background: #ede9ff;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
  font-weight: 600;
}

/* ===== pending 共有リクエスト ===== */
.pending-shares {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.pending-shares-title {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 10px;
}
.pending-share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #fde68a;
}
.pending-share-item:last-child { border-bottom: none; padding-bottom: 0; }
.pending-share-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pending-share-from { font-size: 12px; font-weight: 600; color: var(--text); }
.pending-share-entry { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-share-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== 学校入学提案 ===== */
.school-suggest {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.school-suggest-title {
  font-size: 13px;
  font-weight: 700;
  color: #3730a3;
  margin-bottom: 4px;
}
.school-suggest-desc {
  font-size: 12px;
  color: #6366f1;
  margin-bottom: 12px;
}
.school-suggest-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.school-suggest-card {
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 12px 14px;
}
.school-suggest-card-label {
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 10px;
}
.school-suggest-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.school-suggest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.school-suggest-row label {
  width: 90px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-3);
}
.school-suggest-row input[type="date"],
.school-suggest-row input[type="text"] {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.school-suggest-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== toggle-label ===== */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  font-weight: normal;
  margin-bottom: 0;
}

/* ===== 検索ページ ===== */
.search-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.search-header {
  padding: 14px 16px 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input-wrap {
  position: relative;
  margin-bottom: 10px;
}
.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-2);
  transition: border-color .15s;
  box-sizing: border-box;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent-end);
  background: #fff;
}
.search-tabs {
  display: flex;
  gap: 0;
  border-bottom: none;
}
.search-tab {
  flex: 1;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.search-tab.is-active {
  color: var(--accent-end);
  border-bottom-color: var(--accent-end);
}
#searchPageResults {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.search-section-label {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.search-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.search-results {
  display: flex;
  flex-direction: column;
}
.search-user-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background .12s;
}
.search-user-card:hover { background: var(--bg-2); }
.search-user-card.is-official {
  background: #faf8ff;
}
.search-user-card.is-official:hover { background: #f3efff; }
.search-user-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.search-user-card-info {
  flex: 1;
  min-width: 0;
}
.search-user-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-official-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-end);
  background: #ede9ff;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: .03em;
}
.search-user-card-bio {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-user-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* 公式アカウントのアバター色（検索カード内） */
.avatar.avatar-official {
  background: #8397FE;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  #main { padding: 16px 14px; }
  .navbar { padding: 0 12px; gap: 10px; }
  .nav-username { display: none; }
  .auth-card { padding: 28px 22px; }
  .profile-top { flex-direction: column; align-items: center; text-align: center; }
  .profile-stats { justify-content: center; }
  .modal { padding: 8px; }
  .modal-box { padding: 16px; width: 100%; }

  .compare-col-header { padding: 10px 8px; gap: 5px; }
  .col-header-name { font-size: 11px; }
  .compare-col-entries .cmp-entry { padding: 8px; }
  .cmp-entry-title { font-size: 12px; }
  .form-row { grid-template-columns: 48px 1fr; }
  .landing h1 { font-size: 28px; }
  .landing { padding: 28px 20px 40px; }
  .auth-page { padding: 16px; align-items: flex-start; padding-top: 32px; }
  .auth-card { padding: 24px 20px; }

  /* フィードの3列目（公式）はモバイルでは非表示 */
  .feed-head--3 { grid-template-columns: 1fr 1fr; }
  .feed-year-row--3 { grid-template-columns: 1fr 1fr; }
  .feed-head--3 .feed-head-off { display: none; }
  .feed-year-row--3 .feed-year-off { display: none; }
}

/* ===== パスワードリセット ===== */
.forgot-result-box {
  background: var(--bg-2, #f6f8fc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
}
.forgot-reset-link {
  display: block;
  word-break: break-all;
  font-size: 11px;
  color: #8397FE;
  background: #fff;
  border: 1px dashed #c5cfe8;
  border-radius: 4px;
  padding: 8px 10px;
  text-decoration: none;
  margin-top: 6px;
}
.forgot-reset-link:hover { text-decoration: underline; }
