/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-family: inherit; font-weight: 600; }

html {
  /* Prevent iOS from resizing text on rotation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* iOS zooms into any input/textarea with font-size < 16px on focus.
   Setting 16px on touch devices prevents that zoom entirely. */
@media (hover: none) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

:root {
  --sidebar-bg: #ff9d00;
  --sidebar-text: #c9d1e0;
  --sidebar-heading: #6b7a99;
  --sidebar-width: 220px;
  --accent: #4a90d9;
  --accent-hover: #3a7bc8;
  --bg: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --danger: #e53e3e;
  --success: #38a169;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid #52452d;
  flex-shrink: 0;
}

header h1 {
  font-family: "Space Mono", monospace;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sync-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 6px;
  margin-bottom: 1px;
  transition: background 0.3s;
}
.sync-indicator.ok      { background: #38a169; }
.sync-indicator.syncing { background: #d69e2e; animation: sync-pulse 1s ease-in-out infinite; }
.sync-indicator.offline { background: #a0aec0; }
.sync-indicator.error   { background: #e53e3e; }
@keyframes sync-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.search-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 6px;
  padding: 0 10px;
  gap: 6px;
}

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  width: 180px;
  padding: 6px 0;
  font-size: 13px;
}

.search-wrap input::placeholder { color: #6b7a99; }
.search-icon { color: #6b7a99; font-size: 14px; }

/* ── Layout ── */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-section h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.pill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.pill-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s;
  font-size: 13px;
}

.pill-list li:hover { background: #f5f7fa; }
.pill-list li.active { background: #edf2f7; }

.pill-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  display: inline-block;
}

.pill-dot.filled { background: currentColor; }

.pill-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill-edit,
.pill-delete {
  background: none;
  border: none;
  color: #6b7a99;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.1s;
}

.pill-list li:hover .pill-edit,
.pill-list li:hover .pill-delete { opacity: 1; }
.pill-edit:hover { color: var(--accent); }
.pill-delete:hover { color: var(--danger); }

.add-btn {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.1s, color 0.1s;
}

.add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Main Panel ── */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  gap: 16px;
}

/* ── Compose Box ── */
.compose-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  flex-shrink: 0;
}

.compose-box textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  line-height: 1.6;
}

.compose-box textarea::placeholder { color: var(--text-muted); }

.compose-meta { display: flex; flex-direction: column; gap: 6px; }

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.chip-remove:hover { opacity: 1; }

.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ── Buttons ── */
.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.primary-btn:hover { background: var(--accent-hover); }

.secondary-btn {
  background: #edf2f7;
  color: var(--text);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.secondary-btn:hover { background: #e2e8f0; }

.mini-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.1s, color 0.1s;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.type-filter { display: flex; gap: 4px; }

.done-toggle { margin-left: auto; }

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.1s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Thought List (compact rows) ── */
.thought-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.thought-row {
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.thought-row:last-child { border-bottom: none; }
.thought-row:hover { background: #f5f7fa; }
.thought-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #f5f7fa; }
.thought-row:focus .row-actions { opacity: 1; pointer-events: auto; background: linear-gradient(to right, transparent, #f5f7fa 28px); }
.thought-row.done { opacity: 0.6; }

.row-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  min-width: 0;
  user-select: none;
}

.row-expand-icon {
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 10px;
  text-align: center;
  transition: transform 0.15s;
}
.thought-row.expandable .row-line { cursor: pointer; }
.thought-row.expanded .row-expand-icon { transform: rotate(90deg); }
.thought-row:not(.expandable) .row-expand-icon { visibility: hidden; }

.row-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.row-preview {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.thought-row.done .row-preview {
  text-decoration: line-through;
  color: var(--text-muted);
}

.row-chips {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.chip-sm {
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.chip-person {
  background: #edf2f7 !important;
  color: var(--text-muted) !important;
}

/* Hover action overlay */
.row-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 36px;
  background: linear-gradient(to right, transparent, var(--card-bg) 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.thought-row:hover .row-actions {
  opacity: 1;
  pointer-events: auto;
  background: linear-gradient(to right, transparent, #f5f7fa 28px);
}

.row-action-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.1s;
  line-height: 1.4;
}
.thought-row:hover .row-action-btn { background: #f5f7fa; }
.row-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.row-action-btn.done-btn:hover { border-color: var(--success); color: var(--success); }
.row-action-btn.delete-btn:hover { border-color: var(--danger); color: var(--danger); }

/* Expanded body */
.row-body {
  display: none;
  padding: 4px 12px 10px 22px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.thought-row.expanded .row-body { display: block; }

/* Markdown in expanded body */
.row-body p { margin: 0 0 6px; }
.row-body p:last-child { margin-bottom: 0; }
.row-body h1, .row-body h2, .row-body h3,
.row-body h4, .row-body h5, .row-body h6 {
  font-weight: 600; margin: 8px 0 4px; line-height: 1.3;
}
.row-body h1 { font-size: 1.2em; }
.row-body h2 { font-size: 1.1em; }
.row-body h3 { font-size: 1em; }
.row-body ul, .row-body ol { padding-left: 1.4em; margin: 4px 0; }
.row-body li { margin: 2px 0; }
.row-body code {
  background: #edf2f7; padding: 1px 5px; border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.88em;
}
.row-body pre {
  background: #edf2f7; border-radius: 6px; padding: 10px 12px;
  overflow-x: auto; margin: 6px 0;
}
.row-body pre code { background: none; padding: 0; font-size: 0.87em; }
.row-body blockquote {
  border-left: 3px solid var(--border); padding-left: 10px;
  margin: 6px 0; color: var(--text-muted);
}
.row-body a { color: var(--accent); text-decoration: underline; }
.row-body strong { font-weight: 600; }
.row-body hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.thought-row.done .row-body { color: var(--text-muted); }
.thought-row.done .row-body p,
.thought-row.done .row-body li,
.thought-row.done .row-body h1,
.thought-row.done .row-body h2,
.thought-row.done .row-body h3 { text-decoration: line-through; }

.row-body-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  letter-spacing: 0.3px;
}
.task-badge.done-badge {
  background: #d1fae5;
  color: #065f46;
}

/* ── Modals ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.hidden { display: none !important; }

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 24px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-box h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-box label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.modal-box input[type="text"],
.modal-box textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.1s;
}

.modal-box input[type="text"]:focus,
.modal-box textarea:focus {
  border-color: var(--accent);
}

.modal-box input[type="color"] {
  width: 48px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-list {
  max-height: 200px;
  overflow-y: auto;
}

.modal-list li {
  color: var(--text);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { font-size: 14px; margin-top: 8px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e0; }

/* ── Hamburger button ── */
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #000;
  padding: 4px 8px;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── Sidebar backdrop ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}
.sidebar-backdrop.visible { display: block; }

/* ── Landscape / small-height ── */
@media (max-height: 500px) {
  .main-panel { padding: 6px 10px; gap: 6px; }
  .compose-box { padding: 6px 10px; gap: 4px; flex-shrink: 1; }
  .compose-box textarea { min-height: 28px; max-height: 28px; overflow: hidden; resize: none; }
  .compose-meta { display: none; }
  .thought-list { min-height: 60px; }
  .filter-bar { padding: 4px 0; }
}

/* ── Mobile responsive ── */
@media (max-width: 640px) {
  .menu-btn { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 52px;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }

  .main-panel {
    padding: 10px;
    gap: 10px;
  }

  .search-wrap { position: static; transform: none; flex: 1; margin: 0 8px; }
  .search-wrap input { width: 100%; }

  .filter-bar { overflow-x: auto; gap: 6px; }
  .filter-label { display: none; }

  /* Action buttons on touch: always visible (no hover on mobile) */
  .row-actions { opacity: 1; pointer-events: auto; }
  .row-action-btn { background: var(--card-bg); }
  .pill-edit, .pill-delete { opacity: 1; }

  /* On mobile show only the logout button, hide email text */
  #user-email-display { display: none; }
  .logout-btn { font-size: 11px; padding: 3px 8px; }
}

@media (max-width: 900px) {
  #user-email-display { display: none; }
}

/* ── Auth screen ── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding: 20px;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.auth-title {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--sidebar-bg);
  text-align: center;
  margin-bottom: 24px;
}

.auth-box h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.auth-box label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-box input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  width: 100%;
}

.auth-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,144,217,0.15); }

.auth-btn { width: 100%; margin-top: 8px; }

.auth-toggle {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.auth-toggle a { color: var(--accent); text-decoration: none; }
.auth-toggle a:hover { text-decoration: underline; }

.auth-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Header user info ── */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

#user-email-display {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.logout-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Sidebar nav links ── */
.sidebar-nav {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-link {
  display: block;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav-link:hover { background: #f5f7fa; color: var(--accent); }

/* ── Button size variant ── */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ── Feedback page layout ── */
.fb-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 52px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid #52452d;
  flex-shrink: 0;
}

.fb-back-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.fb-back-link:hover { color: #fff; text-decoration: underline; }

.fb-title {
  font-family: "Space Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fb-filters { display: flex; gap: 4px; flex-wrap: wrap; }

.fb-sort-select {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  outline: none;
}
.fb-sort-select:focus { border-color: var(--accent); }

.fb-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Feedback card ── */
.fb-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 0;
  overflow: hidden;
}

.fb-vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 12px 10px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  min-width: 52px;
  flex-shrink: 0;
}

.vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}
.vote-btn:hover { color: var(--accent); background: #edf2f7; }
.vote-btn.active.up   { color: var(--success); }
.vote-btn.active.down { color: var(--danger); }

.vote-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.admin-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.admin-vote-detail {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.fb-content {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fb-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fb-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #edf2f7;
  color: var(--text-muted);
}

.fb-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.fb-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.fb-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.fb-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.fb-type-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* ── Comments ── */
.fb-comments {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-comments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-comment {
  background: #f8fafc;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fb-comment-text { color: var(--text); }

.fb-comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.fb-comment-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.1s;
}
.fb-comment-input:focus { border-color: var(--accent); }

/* ── Admin ── */
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.25);
  color: #fff;
  letter-spacing: 0.5px;
  font-family: -apple-system, sans-serif;
}

.admin-author {
  font-size: 11px;
  color: var(--text-muted);
  background: #f0f4f8;
  padding: 2px 6px;
  border-radius: 4px;
}

.fb-comment-author {
  font-size: 11px;
  background: none;
  padding: 0;
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.admin-reject-btn { color: var(--danger); }
.admin-reject-btn:hover { background: #fee2e2; }

.fb-delete-btn { color: var(--danger); }
.fb-delete-btn:hover { background: #fee2e2; }

/* ── Inline edit ── */
.editing .row-line,
.editing .row-body { display: none !important; }

.inline-edit {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8faff;
  border-top: 2px solid var(--accent);
}

.inline-edit-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  min-height: 72px;
  transition: border-color 0.1s;
}
.inline-edit-text:focus { border-color: var(--accent); }

.inline-edit-meta { display: flex; flex-direction: column; gap: 6px; }

.inline-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.inline-sel-chip {
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.1s;
  user-select: none;
}
.inline-sel-chip:hover { opacity: 0.8; }
.inline-sel-chip.selected { border-width: 1.5px; }

.inline-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
