:root {
  --ink: #17211c;
  --muted: #5f6b65;
  --paper: #f7f1e8;
  --surface: #fffdf8;
  --surface-2: #efe7da;
  --accent: #1f6a4f;
  --accent-dark: #164c39;
  --line: #d8cfc1;
  --danger: #9a332d;
  --shadow: 0 18px 50px rgba(27, 38, 32, 0.10);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 64px);
  background: rgba(247, 241, 232, 0.94);
  border-bottom: 1px solid rgba(216, 207, 193, 0.7);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 220px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 22px;
}
.brand strong { display: block; font-family: Georgia, serif; font-size: 20px; line-height: 1.1; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.admin-link { font-weight: 700; color: var(--accent-dark); }

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 17px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.button-primary { background: var(--accent); color: white; box-shadow: 0 7px 18px rgba(31, 106, 79, .18); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: var(--surface-2); color: var(--ink); }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button-large { min-height: 52px; padding: 14px 22px; font-size: 17px; }
.button-danger { background: #f3dedb; color: var(--danger); }
.full-width { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { border: 0; background: transparent; font-size: 32px; line-height: 1; cursor: pointer; color: var(--muted); }

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(72px, 11vw, 150px) 24px clamp(62px, 8vw, 110px);
}
.eyebrow { margin: 0 0 12px; color: var(--accent-dark); font-size: 13px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero h1, .section-heading h2, .about-section h2, .admin-intro h1, .dialog h2 {
  font-family: Georgia, serif;
  letter-spacing: -0.025em;
}
.hero h1 { max-width: 790px; margin: 0; font-size: clamp(52px, 8vw, 102px); line-height: .94; font-weight: 500; }
.hero-copy { max-width: 670px; margin: 30px 0 0; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.4; color: #35413b; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.quiet { margin-top: 18px; max-width: 690px; color: var(--muted); line-height: 1.5; }

.principles {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.principles article { padding: 22px; border-top: 1px solid var(--line); }
.principles strong { display: block; margin-bottom: 8px; font-size: 18px; }
.principles span { color: var(--muted); line-height: 1.45; }

.feed-section { background: #e9dfd0; padding: clamp(58px, 8vw, 100px) 24px; }
.section-heading { max-width: 1120px; margin: 0 auto 34px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 5vw, 60px); font-weight: 500; }
.filter-label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 12px 13px;
  min-height: 46px;
}
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 106, 79, .25); outline-offset: 2px; }

.wisdom-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.wisdom-card { overflow: hidden; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-media video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #152019; }
.text-card-art {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--accent-dark);
  color: white;
  font-family: Georgia, serif;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.2;
  text-align: center;
}
.card-body { padding: 22px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.topic-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.contributor { color: var(--muted); font-weight: 700; }
.advice-text { margin: 18px 0 0; padding: 0; border: 0; font-family: Georgia, serif; font-size: 26px; line-height: 1.32; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.helpful-button { border: 0; background: transparent; cursor: pointer; padding: 8px 0; font-weight: 800; color: var(--accent-dark); }
.helpful-button.voted { color: var(--accent); }
.status-message { max-width: 1120px; margin: 16px auto; padding: 14px 16px; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.45); }

.sponsor-section { max-width: 1120px; margin: 0 auto; padding: 28px 24px; text-align: center; color: var(--muted); }
.sponsor-section a { margin-left: 6px; font-weight: 800; color: var(--ink); }
.about-section { max-width: 1120px; margin: 0 auto; padding: 80px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.about-section h2 { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 500; line-height: 1.05; }
.about-section > p { margin: 28px 0 0; font-size: 20px; line-height: 1.65; color: #35413b; }
.site-footer { display: flex; justify-content: space-between; gap: 30px; padding: 32px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); color: var(--muted); }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--ink); }
.site-footer p { margin: 0; }

.dialog { width: min(720px, calc(100vw - 24px)); max-height: 90vh; padding: 0; border: 0; border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(14, 22, 18, .62); }
.dialog form { padding: 28px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 22px; }
.dialog h2 { margin: 0; font-size: 38px; font-weight: 500; }
.dialog fieldset { border: 0; padding: 0; margin: 0; }
.dialog label { display: grid; gap: 7px; margin: 0 0 16px; font-weight: 750; }
.field-row { display: grid; grid-template-columns: 1fr 130px; gap: 14px; }
.field-help, .char-count { margin: -8px 0 16px; color: var(--muted); font-size: 13px; }
.char-count { text-align: right; }
.choice-group { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 20px !important; }
.choice-group legend { grid-column: 1 / -1; margin-bottom: 8px; font-weight: 800; }
.choice-card { display: flex !important; gap: 10px !important; align-items: flex-start; margin: 0 !important; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.choice-card input { width: auto; min-height: 0; margin-top: 3px; }
.choice-card span { display: grid; gap: 3px; }
.choice-card small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.choice-group.compact { margin-top: 4px !important; }
.checkbox-label { display: flex !important; gap: 10px !important; align-items: flex-start; font-weight: 600 !important; line-height: 1.45; }
.checkbox-label input { width: 20px; min-height: 20px; margin-top: 1px; }
.notice, .moderation-note { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); color: #3d4943; line-height: 1.5; margin-bottom: 18px; }
.notice .button { margin-top: 12px; }
.file-check { margin: -8px 0 16px; font-weight: 700; color: var(--accent-dark); }
.file-check.error { color: var(--danger); }

.admin-main { max-width: 1120px; margin: 0 auto; padding: 70px 24px; }
.admin-intro h1 { margin: 0; font-size: clamp(44px, 7vw, 78px); font-weight: 500; }
.admin-intro p:last-child { color: var(--muted); font-size: 18px; }
.moderation-grid { display: grid; gap: 18px; margin-top: 30px; }
.moderation-card { background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); display: grid; grid-template-columns: 240px 1fr; gap: 22px; }
.moderation-card video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: #17211c; }
.moderation-text-preview { min-height: 160px; display: grid; place-items: center; padding: 18px; border-radius: 12px; background: var(--accent-dark); color: white; font-family: Georgia, serif; font-size: 24px; text-align: center; }
.moderation-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); margin-bottom: 10px; font-size: 14px; }
.moderation-content h3 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.moderation-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.uploader-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 850px) {
  .site-header { align-items: flex-start; }
  .header-actions { max-width: 55%; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .wisdom-grid { grid-template-columns: 1fr; }
  .about-section { grid-template-columns: 1fr; gap: 10px; }
  .moderation-card { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header { position: static; flex-direction: column; gap: 12px; }
  .header-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .hero { padding-top: 62px; }
  .principles { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .field-row, .choice-group { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
  .dialog form { padding: 20px; }
}

/* In-browser 10-second recorder */
.record-panel {
  margin: 4px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.record-panel-copy { display: grid; gap: 4px; margin-bottom: 14px; }
.record-panel-copy strong { font-size: 19px; }
.record-panel-copy span { color: var(--muted); font-weight: 500; line-height: 1.4; }
.record-button { width: 100%; min-height: 58px; font-size: 18px; }
.recorder-stage, .recorded-preview { position: relative; margin-top: 14px; overflow: hidden; border-radius: 16px; background: #152019; }
.recorder-stage video, .recorded-preview video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #152019; }
.recording-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  color: white;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}
.recording-overlay span { font-size: 18px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.recording-overlay strong { font-family: Georgia, serif; font-size: clamp(78px, 20vw, 130px); line-height: .95; font-weight: 500; }
.stop-recording-button { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; }
.recorded-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: white; }
.recorded-actions span { color: var(--accent-dark); font-weight: 850; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

@media (max-width: 600px) {
  .record-panel { padding: 14px; }
  .recorded-actions { align-items: stretch; flex-direction: column; }
  .recorded-actions .button { width: 100%; }
}

.my-wisdom-list { display: grid; gap: .8rem; margin-top: 1rem; }
.my-wisdom-item { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid var(--line, #d8d0c4); border-radius: 16px; background: #fff; }
.my-wisdom-item div { display: grid; gap: .25rem; }
.my-wisdom-item small { color: var(--muted, #6d746f); text-transform: capitalize; }


/* Visible Wisdom IDs and removal workflow */
.card-media { position: relative; }
.wisdom-stamp { position: absolute; z-index: 2; top: 12px; right: 12px; padding: 6px 9px; border-radius: 999px; background: rgba(14, 22, 18, .82); color: #fff; font-size: 11px; font-weight: 850; letter-spacing: .03em; backdrop-filter: blur(5px); }
.footer-removal-button { display: inline; margin-left: .4rem; }
.admin-section { margin-top: 48px; }
.admin-section-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; }
.admin-section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 46px); font-weight: 500; }
.admin-section-heading > p { max-width: 540px; margin: 0; color: var(--muted); line-height: 1.5; }
.removal-admin-section { padding-top: 42px; border-top: 1px solid var(--line); }
.removal-id-panel { min-height: 180px; display: grid; place-content: center; gap: 8px; text-align: center; border-radius: 14px; background: var(--accent-dark); color: white; }
.removal-id-panel span, .removal-id-panel small { opacity: .78; }
.removal-id-panel strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.removal-notes { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.removal-accepted { border: 2px solid var(--accent); }
@media (max-width: 700px) { .admin-section-heading { display: grid; align-items: start; } }


/* My Wisdom is not wrapped in a form, so give it its own dialog spacing/scrolling. */
#myWisdomDialog {
  padding: 28px;
  overflow-y: auto;
  box-sizing: border-box;
}

#myWisdomDialog .my-wisdom-list {
  width: 100%;
}

#myWisdomDialog .my-wisdom-item {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 700px) {
  #myWisdomDialog {
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  #myWisdomDialog .my-wisdom-item {
    align-items: stretch;
    flex-direction: column;
  }

  #myWisdomDialog .remove-wisdom-button {
    width: 100%;
  }
}


.policy-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  line-height: 1.65;
}
.policy-page h1 { margin-top: 24px; }
.policy-page h2 { margin-top: 32px; }
.policy-page p { max-width: 72ch; }
.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
  font-size: 0.95rem;
}
.text-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 700px) {
  .policy-page { padding: 28px 20px 56px; }
}
