@charset "UTF-8";
:root {
  --paper: #f7f6f2;
  --white: #ffffff;
  --ink: #1c2621;
  --muted: #6f7c74;
  --line: #e3e6dc;
  --green: #dcee9e;
  --green-dark: #32503a;
  --accent: #4a6f3b;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* Topbar */
.topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  font-size: 7.5px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--muted);
}
.brand-mark {
  background: var(--green);
  border-radius: 10px;
  width: 34px;
  height: 36px;
  line-height: 32px;
  font-family: Georgia, serif;
  font-size: 30px;
  text-align: center;
  position: relative;
  color: var(--ink);
}
.brand-mark span {
  font-family: Arial;
  font-size: 22px;
  position: absolute;
  right: 5px;
  top: 1px;
}
.top-actions { display: flex; gap: 16px; align-items: center; }
.local-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ea853;
  display: inline-block;
}
.status-dot.amber { background: #dca342; }

/* Common Buttons */
.button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  transition: all 0.15s ease;
}
.button:hover { background: #edf0e6; }
.button.quiet { background: transparent; border-color: var(--line); }
.button.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.button.primary:hover { background: #35493b; }
.icon-button {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

/* Feed Main Container */
.feed-main {
  max-width: 620px;
  margin: 28px auto 60px;
  padding: 0 16px;
}

.notice {
  padding: 12px 16px;
  background: #eaf1dc;
  border: 1px solid #d4e3bc;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.notice.error { background: #fbeee8; border-color: #f1cfc2; color: #a43922; }

/* The Social Post Card ("The First Impression") */
.social-post-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(30, 45, 35, 0.04);
  overflow: hidden;
  margin-bottom: 28px;
  transition: box-shadow 0.2s ease;
}
.social-post-card:hover {
  box-shadow: 0 6px 26px rgba(30, 45, 35, 0.07);
}

.card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f3eb;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.creator-avatar {
  background: var(--ink);
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 18px;
}
.creator-meta { flex: 1; min-width: 0; }
.creator-meta strong { display: block; font-size: 13px; line-height: 1.3; }
.creator-sub { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

.platform-picker select {
  font-size: 11px;
  font-weight: 600;
  background: #f1f4eb;
  border: 1px solid #e0e5d8;
  border-radius: 20px;
  padding: 4px 10px;
  color: #3b5036;
  outline: none;
  cursor: pointer;
}

/* Media Stage / Upload Dropzone */
.card-media-stage {
  position: relative;
  background: #f2f5ed;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s ease;
}
.card-media-stage:hover { background: #ecf0e5; }
.card-media-stage.dragover { background: #e3ebd8; outline: 2px dashed var(--accent); }

/* Empty Placeholder */
.upload-placeholder {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.03);
}
.upload-placeholder h3 { font-size: 15px; font-weight: 650; color: var(--ink); }
.upload-placeholder p { font-size: 12px; color: var(--muted); }
.browse-link { color: var(--accent); text-decoration: underline; font-weight: 600; }
.upload-sub { font-size: 10px; color: #8a968b; margin-top: 4px; }

/* Displayed Media */
.media-display {
  width: 100%;
  min-height: 260px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1612;
}
.media-container {
  width: 100%;
  min-height: 260px;
  max-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media-container img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: contain;
  display: block;
}
.media-container video {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: contain;
  display: block;
}

/* Floating Perception Overlay Banner */
.perception-banner {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 50px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #27402a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  pointer-events: none;
  animation: fadeIn 0.25s ease;
}
.perception-banner.error { background: #fff1e9; color: #8c3e25; }
#retry-media-btn { pointer-events: auto; flex-shrink: 0; }
.perception-banner #perception-text { flex: 1; }
.caption-suggestions-block { margin-top: 10px; }
.caption-suggestions-block > p { font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.caption-suggestions { display: grid; gap: 6px; }
.caption-suggestion { text-align: left; line-height: 1.5; border-radius: 8px; white-space: normal; overflow-wrap: anywhere; }
.caption-suggestion:disabled { opacity: .6; cursor: default; }
.simulated-viewers-label { font-size: 11px; font-weight: 650; margin: -8px 0 8px; }
.audience-summary { display: inline-block; font-size: 10px; line-height: 1.5; background: #f1f4eb; border-radius: 8px; padding: 6px 9px; margin-bottom: 14px; color: #49633f; }
.result-uncertainty { font-size: 10px; line-height: 1.6; color: var(--muted); margin: -7px 0 15px; }
.pill.limited { background: #f8ead0; color: #865e19; }
.empty-response { font-size: 12px; line-height: 1.7; color: var(--muted); padding: 20px 0; }
.followup-note { font-size: 10px !important; color: var(--muted) !important; }
.reply-error { font-size: 11px; color: #9e3922; line-height: 1.6; }
.comment-actions { flex-wrap: wrap; }
.comment p, .room-read-body, .audience-summary, .result-uncertainty { overflow-wrap: anywhere; }
.source-label { font-size: 9px; }
.dialog-submit { margin-top: 15px; width: 100%; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid #4a6f3b; outline-offset: 3px; }
.perception-banner.analyzing {
  background: rgba(246, 250, 240, 0.92);
  color: #3b5a2b;
}
.perception-banner.ready {
  background: rgba(240, 248, 235, 0.94);
  color: #245722;
}
.perception-icon {
  font-size: 13px;
  color: #558739;
}
.perception-icon.spin {
  display: inline-block;
  animation: spin 1.2s linear infinite;
}

.media-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s ease;
}
.media-remove-btn:hover { background: rgba(0, 0, 0, 0.85); }

/* Caption Box */
.card-caption-area {
  padding: 14px 18px 10px;
}
.card-caption-area textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  min-height: 60px;
  outline: none;
}
.card-caption-area textarea::placeholder {
  color: #9aa49a;
}
.caption-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.chip-button {
  background: #f1f6ea;
  border: 1px solid #d5e3c7;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: #3f6630;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-button:hover {
  background: #e4eed7;
  transform: translateY(-1px);
}
.char-count {
  font-size: 9px;
  color: var(--muted);
  margin-left: auto;
}

/* Card Action Footer */
.card-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid #f2f5ec;
  display: flex;
  justify-content: flex-end;
}
.post-action-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 12px;
  transition: all 0.15s ease;
}
.post-action-btn:hover:not(:disabled) {
  background: #2f4534;
  transform: translateY(-1px);
}
.btn-spinner {
  display: inline-block;
  animation: spin 1.2s linear infinite;
  margin-right: 6px;
}

/* Virtual Citizens Response Feed */
.citizen-feed-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(30, 45, 35, 0.04);
  padding: 22px 20px 24px;
  margin-bottom: 50px;
  animation: slideUp 0.3s ease;
}
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.feed-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #e5f1d7;
  color: #355d28;
}

/* Simulated Metrics Bar */
.social-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f7f9f3;
  border: 1px solid #e5ebd9;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: center;
}
.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.metric-icon { font-size: 14px; color: var(--muted); }
.metric-item strong { font-size: 16px; font-weight: 750; color: var(--ink); }
.metric-item small { font-size: 11px; color: var(--muted); }
.response-audience-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; font-size: 13px; font-weight: 650; }
.response-audience-label select { width: auto; max-width: 60%; padding: 7px 10px; font: inherit; border: 1px solid var(--line, #e5ebd9); border-radius: 8px; background: white; color: var(--ink); }

/* Reaction Mood Bar */
.reaction-mood-card {
  margin-bottom: 20px;
}
.reaction-bar {
  height: 10px;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.reaction-segment { height: 100%; min-width: 0; }
.reaction-segment.warm { background: #9ecb78; }
.reaction-segment.curious { background: #b8a6db; }
.reaction-segment.skeptical { background: #e5ab82; }
.reaction-segment.neutral { background: #d7dbd2; }
.reaction-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.reaction-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.swatch.warm { background: #9ecb78; }
.swatch.curious { background: #b8a6db; }
.swatch.skeptical { background: #e5ab82; }
.swatch.neutral { background: #d7dbd2; }

/* Citizen Comments Thread */
.comments-thread {
  border-top: 1px solid #f0f3eb;
  padding-top: 6px;
}
.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f2f5ec;
}
.comment:last-child { border-bottom: none; }
.comment .avatar {
  background: #e8eee0;
  color: #44613c;
  font-size: 11px;
}
.comment:nth-child(2n) .avatar { background: #ebdff5; color: #6d4b85; }
.comment:nth-child(3n) .avatar { background: #fae6d9; color: #8e5833; }

.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-head strong { font-size: 12px; font-weight: 700; color: var(--ink); }
.comment-theme-tag {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f4ec;
  color: #63755b;
}
.comment p {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 5px;
  color: #2b3930;
}
.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}
.reply-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.reply-btn:hover { text-decoration: underline; }

.practice-reply-box {
  margin-top: 8px;
  background: #f4f7ed;
  border-left: 2.5px solid #a6bf82;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
}
.practice-reply-box strong { font-size: 10px; color: #3b5033; }
.practice-reply-box p { font-size: 11px; margin-top: 3px; color: #2e3a2b; }

.citizen-followup-box {
  margin-top: 6px;
  background: #f7faf4;
  border-left: 2.5px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}
.citizen-followup-box strong { font-size: 10px; color: var(--accent); }
.citizen-followup-box p { font-size: 11px; margin-top: 2px; color: #2e3a2b; }

/* Visual Perception Breakdown Card */
.perception-card-summary {
  margin-top: 14px;
  background: #f7faf4;
  border: 1px solid #dbe6d5;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.6;
}
.perception-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  color: #2e432a;
}
.perception-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  color: #3b4e36;
}
.perception-details-grid strong {
  color: #1e301b;
}

/* Collapsible Room Read & Evidence */
.room-read-details {
  margin-top: 16px;
  border-top: 1px solid #edf1e6;
  padding-top: 12px;
}
.room-read-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}
.room-read-details summary::-webkit-details-marker { display: none; }
.room-read-body {
  padding: 10px 0 6px;
  font-size: 11px;
  line-height: 1.7;
  color: #5d6b5e;
}
.room-read-body ul {
  padding-left: 18px;
  margin: 0 0 8px 0;
}
.provenance-note {
  font-size: 9.5px;
  color: #889484;
}

.feed-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

/* Dialogs */
dialog {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 480px;
  width: calc(100% - 32px);
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 16px 80px rgba(20, 35, 25, 0.15);
}
dialog::backdrop {
  background: rgba(20, 32, 22, 0.35);
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.dialog-header h2 { font-size: 18px; font-weight: 700; }
.dialog-intro { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
dialog label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 12px; }
dialog input, dialog textarea {
  display: block;
  width: 100%;
  border: 1px solid #dae0d1;
  background: #fafbfa;
  padding: 9px 12px;
  border-radius: 9px;
  margin-top: 5px;
  font-size: 12px;
}
blockquote {
  margin: 0 0 12px;
  border-left: 3px solid #b7cc99;
  padding: 8px 12px;
  background: #f4f6ee;
  font-size: 11px;
  line-height: 1.6;
  color: #4a5c44;
}

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 520px) {
  .feed-main { padding: 0 12px; margin-top: 16px; }
  .card-media-stage { min-height: 260px; }
  .social-metrics-bar { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
}
