:root {
  --paper: #F5EEE1;
  --paper-2: #EDE3D2;
  --ink: #2A1A16;
  --ink-soft: #5C4A43;
  --deep: #722837;
  --deep-2: #8A3347;
  --clarity: #8A3347;
  --clarity-soft: #F6DFD2;
  --on-clarity: #FFF8EE;
  --amber: #8A5312;
  --amber-soft: #F3E2C6;
  --red: #B3261E;
  --red-soft: #F6DAD3;
  --good: #3F6238;
  --good-soft: #E1E8D0;
  --line: #DDCFB8;
  --white: #FFFCF6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(42, 26, 22, .06), 0 10px 28px -14px rgba(42, 26, 22, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0;
  color: var(--deep);
}

.mono {
  font-family: var(--font-mono);
}

::selection {
  background: var(--clarity-soft);
  color: var(--deep);
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--clarity);
  outline-offset: 2px;
}

/* ================= SCROLLBARS =================
     Main content keeps the familiar plain gray scrollbar look — but coded
     explicitly here so every browser/OS renders the same thing, instead of
     leaving it to whatever scrollbar theme the visitor's system happens to
     use. The dark sidebar below overrides this locally to match its surface. */
html {
  scrollbar-width: auto;
  scrollbar-color: #C9B79E #EDE3D2;
}

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #EDE3D2;
}

::-webkit-scrollbar-thumb {
  background-color: #C9B79E;
  border-radius: 0;
  border: 1px solid #EDE3D2;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #A8927A;
}

::-webkit-scrollbar-thumb:active {
  background-color: #722837;
}

::-webkit-scrollbar-corner {
  background: #EDE3D2;
}

.sidebar,
.sidebar * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .24) transparent;
}

.sidebar ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar ::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar ::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, .2);
  border-radius: 20px;
  border: 2px solid var(--deep);
  background-clip: padding-box;
}

.sidebar ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, .34);
}

.app {
  display: flex;
  height: 100vh;
}

/* ================= SIDEBAR (Claude / ChatGPT / Gemini style) ================= */
.sidebar {
  background: var(--deep);
  color: #F1E6D6;
  display: flex;
  flex-direction: column;
  flex: 0 0 288px;
  width: 288px;
  height: 100vh;
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
}

.sb-brand .mark {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28), 0 0 0 1.5px rgba(240, 200, 160, 0.25);
  background: #F5EEE1;
}

.brand-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sb-brand:hover .brand-mascot-img {
  transform: scale(1.08) rotate(3deg);
}

.sb-brand .word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -.01em;
  color: #FBF6EC;
}

.sb-brand .word em {
  font-style: italic;
  color: #FCD08A;
}

.sb-new {
  margin: 4px 16px 18px;
  background: var(--clarity);
  color: var(--on-clarity);
  border: none;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, transform .1s ease;
}

.sb-new:hover {
  background: #FCD08A;
}

.sb-new:active {
  transform: translateY(1px);
}

.sb-new svg {
  width: 15px;
  height: 15px;
}

.sb-search {
  margin: 0 16px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  padding: 8px 10px;
}

.sb-search svg {
  width: 14px;
  height: 14px;
  color: #D9BFA8;
  flex: none;
}

.sb-search input[type=text] {
  background: none;
  border: none;
  outline: none;
  color: #FBF6EC;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.sb-search input[type=text]:focus {
  box-shadow: none;
}

.sb-search input[type=text]::placeholder {
  color: #D9BFA8;
}

.sb-history {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
}

.sb-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #E3CDBA;
  padding: 12px 8px 6px;
}

.sb-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 2px;
  color: #EBDDCB;
}

.sb-item .t {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.sb-item .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-item .badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 10px;
  flex: none;
}

.badge-high {
  background: rgba(193, 74, 58, .28);
  color: #F3B6AA;
}

.badge-mid {
  background: rgba(192, 114, 42, .28);
  color: #F3CDA0;
}

.badge-low {
  background: rgba(63, 98, 56, .3);
  color: #D3E6C4;
}

.sb-item .time {
  display: block;
  font-size: 10.5px;
  color: #E3CDBA;
  margin-top: 3px;
}

.sb-item:hover {
  background: rgba(255, 255, 255, .06);
}

.sb-item.active {
  background: rgba(245, 238, 225, .16);
}

.sb-item.active .title {
  color: #FBF6EC;
  font-weight: 500;
}

.sb-promo {
  margin: 6px 16px 14px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  padding: 13px 14px;
}

.sb-promo .pt {
  font-size: 13px;
  font-weight: 600;
  color: #FBF6EC;
  margin-bottom: 4px;
}

.sb-promo .pd {
  font-size: 11.5px;
  color: #E3CDBA;
  line-height: 1.5;
  margin-bottom: 9px;
}

.sb-promo button {
  width: 100%;
  background: none;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #F1E6D6;
  border-radius: 6px;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 600;
}

.sb-promo button:hover {
  border-color: var(--clarity);
  color: #FCD08A;
}

.sb-foot {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-foot-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: none;
  border: none;
  color: #E3CDBA;
  font-size: 13px;
}

.sb-foot-link svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.sb-foot-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #FBF6EC;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sb-user .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--clarity-soft);
  color: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  flex: none;
}

.sb-user .info {
  min-width: 0;
}

.sb-user .name {
  font-size: 13px;
  color: #FBF6EC;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-user .role {
  font-size: 10.5px;
  color: #E3CDBA;
}

.guest-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .03em;
  background: rgba(245, 238, 225, .18);
  color: #FCD08A;
  padding: 1px 6px;
  border-radius: 8px;
  flex: none;
}

.sb-history-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  color: #E3CDBA;
  line-height: 1.6;
}

/* ================= MAIN ================= */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  height: 100vh;
  overflow: hidden;
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex: none;
}

.topbar .crumb {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.topbar .crumb b {
  color: var(--ink);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--deep);
  background: var(--clarity-soft);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ---------- Language switcher (interface language, mock) ---------- */
.lang-wrap {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.lang-btn svg {
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
  flex: none;
}

.lang-btn .chev {
  width: 11px;
  height: 11px;
  transition: transform .15s ease;
}

.lang-btn:hover {
  border-color: var(--clarity);
}

.lang-wrap.open .lang-btn .chev {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  z-index: 20;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.lang-wrap.open .lang-menu {
  display: block;
}

.lang-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--ink);
}

.lang-opt:hover {
  background: var(--paper-2);
}

.lang-opt.active {
  background: var(--clarity-soft);
  color: var(--deep);
  font-weight: 600;
}

.lang-opt .check {
  width: 14px;
  height: 14px;
  color: var(--clarity);
  visibility: hidden;
}

.lang-opt.active .check {
  visibility: visible;
}

.lang-note {
  margin-top: 4px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.design-flag {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  background: #FBF2E3;
  border: 1px dashed #D9A85A;
  color: #8A5A1E;
  border-radius: 7px;
  padding: 8px 9px;
  font-size: 10.5px;
  line-height: 1.45;
}

.design-flag svg {
  width: 12px;
  height: 12px;
  flex: none;
  margin-top: 1px;
}

.design-flag b {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

.panel {
  padding: 36px 48px 60px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hidden {
  display: none;
}

/* ---------- Form (Scribbr-inspired) ---------- */
.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 26px;
}

.page-head p.sub {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  max-width: 60ch;
}

.quickbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.quickbar svg {
  width: 16px;
  height: 16px;
  color: #D9BFA8;
  flex: none;
}

.quickbar input[type=text] {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  padding: 0;
}

.quickbar input[type=text]:focus {
  box-shadow: none;
}

.quickbar input[type=text]::placeholder {
  color: #66513F;
}

.quickbar button {
  background: var(--deep);
  color: #FBF6EC;
  border: none;
  border-radius: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.quickbar button:hover {
  background: var(--clarity);
  color: var(--on-clarity);
}

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-head {
  padding: 26px 32px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-head .fh-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-head .fh-note {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  align-items: start;
}

.field-row:first-of-type {
  margin-top: 16px;
}

.field-row>*:last-child {
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-top: 9px;
}

.field-label .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field-label .req {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 2px;
}

.help {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #CDBDA5;
  color: #6B5A4E;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 1px;
  position: relative;
}

.help:hover .tip,
.help:focus-within .tip,
.help:focus .tip {
  display: block;
}

.tip {
  display: none;
  position: absolute;
  left: 20px;
  top: -6px;
  width: 220px;
  background: var(--deep);
  color: #FBF6EC;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  z-index: 5;
  box-shadow: var(--shadow);
  font-family: var(--font-sans);
}

input[type=text],
textarea {
  width: 100%;
  border: 1px solid #D9CBB6;
  border-radius: 7px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type=text]::placeholder,
textarea::placeholder {
  color: #66513F;
}

input[type=text]:focus,
textarea:focus {
  border-color: var(--clarity);
  box-shadow: 0 0 0 3px var(--clarity-soft);
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.blank-note {
  font-size: 11.5px;
  color: #66513F;
  margin-top: 6px;
}

.char-count {
  font-size: 11px;
  color: #66513F;
  margin-top: 6px;
  text-align: right;
}

.field-error {
  font-size: 11.5px;
  color: var(--red);
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 5px;
}

.field-error svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.field-row.invalid textarea {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.field-row.invalid .field-error {
  display: flex;
}

/* ---------- Contributors (attributed persons / organizations) ---------- */
.contrib-empty {
  font-size: 12.5px;
  color: #66513F;
  font-style: italic;
  padding: 6px 2px 14px;
}

.contrib-card {
  border: 1px solid #D9CBB6;
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--white);
  overflow: hidden;
}

.contrib-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--paper-2);
}

.contrib-top .ct-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.contrib-handle {
  color: #66513F;
  flex: none;
  cursor: grab;
  display: flex;
}

.contrib-handle svg {
  width: 13px;
  height: 13px;
}

.type-tabs {
  flex: none;
  display: inline-flex;
  background: var(--white);
  border: 1px solid #D9CBB6;
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.type-tab {
  padding: 4px 13px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--ink-soft);
}

.type-tab.active {
  background: var(--clarity-soft);
  color: var(--deep);
}

.ct-summary {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-summary b {
  color: var(--ink);
  font-weight: 600;
}

.ct-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.ct-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ct-icon-btn:hover {
  background: rgba(42, 26, 22, .06);
  color: var(--ink);
}

.ct-icon-btn svg {
  width: 14px;
  height: 14px;
}

.ct-icon-btn.danger:hover {
  color: var(--red);
}

.contrib-body {
  padding: 16px 16px 14px;
}

.contrib-card.collapsed .contrib-body {
  display: none;
}

.contrib-card.collapsed .chev {
  transform: rotate(-90deg);
}

.mini-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.mini-row:last-child {
  margin-bottom: 0;
}

.mini-row label {
  font-size: 12.5px;
  color: var(--ink);
  padding-top: 8px;
}

.mini-row label small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-soft);
}

.mini-row input[type=text],
.mini-row select {
  width: 100%;
  border: 1px solid #D9CBB6;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
}

.mini-row input:focus,
.mini-row select:focus {
  border-color: var(--clarity);
  box-shadow: 0 0 0 3px var(--clarity-soft);
  outline: none;
}

@media (max-width:640px) {
  .mini-row {
    grid-template-columns: 1fr;
  }

  .mini-row label {
    padding-top: 0;
  }
}

.contrib-add-row {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.form-foot {
  padding: 22px 32px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-2);
}

.form-foot .note {
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 36ch;
}

.btn-primary {
  background: var(--deep);
  color: #FBF6EC;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, transform .1s ease;
  flex: none;
}

.btn-primary:hover {
  background: var(--clarity);
  color: var(--on-clarity);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid #D9CBB6;
  color: var(--deep);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-ghost:hover {
  border-color: var(--clarity);
  color: var(--clarity);
}

/* ---------- Report ---------- */
.report-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}

.report-top h1 {
  font-size: 26px;
}

.report-sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 6px;
}

.report-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.submitted {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 0 0;
  overflow: hidden;
}

.submitted-head {
  cursor: default;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submitted-head .st-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.submitted-head .st-left svg {
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
  flex: none;
}

.submitted-head .st-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.submitted .st-body {
  padding: 0 22px 20px;
  border-top: 1px solid var(--line);
}

.st-row {
  padding: 14px 0 0;
  font-size: 13px;
}

.st-row .st-k {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 5px;
}

.st-row .st-v {
  color: var(--ink);
  line-height: 1.6;
}

.st-row .st-v.empty {
  color: #66513F;
  font-style: italic;
}

.st-row .st-v.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  word-break: break-all;
}

.st-article {
  background: var(--paper-2);
  border-radius: 7px;
  padding: 12px 14px;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.st-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

@media (max-width:640px) {
  .st-grid {
    grid-template-columns: 1fr;
  }
}

.st-contrib-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-contrib-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper-2);
  border-radius: 6px;
  padding: 7px 10px;
}

.st-contrib-chip .kind {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--clarity);
  background: var(--clarity-soft);
  padding: 1px 6px;
  border-radius: 10px;
  flex: none;
}

.st-contrib-chip .role {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.verdict-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin: 20px 0 24px;
}

.verdict-main {
  display: flex;
  align-items: center;
  gap: 22px;
}

.verdict-num {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  color: var(--amber);
  line-height: 1;
  flex: none;
}

.verdict-text {
  min-width: 0;
}

.verdict-label {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

.verdict-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.55;
  max-width: 56ch;
}

.verdict-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.signal {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 20px;
}

.signal svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.signal-bad {
  background: var(--red-soft);
  color: var(--red);
}

.signal-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.signal-neutral {
  background: var(--clarity-soft);
  color: var(--deep);
}

.section-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.section-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.section-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-icon svg {
  width: 17px;
  height: 17px;
}

.icon-source {
  background: var(--clarity-soft);
  color: var(--deep);
}

.icon-wording {
  background: var(--amber-soft);
  color: var(--amber);
}

.section-head h2 {
  font-size: 17px;
}

.section-head .section-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.5;
  max-width: 60ch;
}

.section-body {
  padding: 20px 24px 24px;
}

.whitebox-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid #F0E7D7;
  font-size: 13.5px;
}

.whitebox-row:first-child {
  border-top: none;
}

.whitebox-row .k {
  color: var(--ink-soft);
  flex: none;
  width: 170px;
}

.whitebox-row .v {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.whitebox-row .v.risk {
  color: var(--red);
}

.whitebox-row .v.ok {
  color: var(--clarity);
}

.whitebox-note {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.sanitized {
  font-size: 14.5px;
  line-height: 1.85;
  background: #2B1B17;
  color: #EDE3D2;
  border-radius: 8px;
  padding: 18px 20px;
}

.hl {
  border-radius: 4px;
  padding: 1px 3px;
}

.hl-hi {
  background: rgba(193, 74, 58, .55);
}

.hl-med {
  background: rgba(192, 114, 42, .5);
}

.hl-lo {
  background: rgba(63, 98, 56, .45);
}

.tag-mask {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #3B2A26;
  padding: 1px 6px;
  border-radius: 4px;
  color: #E3CDBA;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.pending-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--paper-2);
  border: 1px dashed #D9CBB6;
  border-radius: 9px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.pending-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: #D9BFA8;
}

.disclaimer {
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px dashed #D9CBB6;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.55;
  margin-top: 6px;
}

.disclaimer b {
  color: var(--ink);
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- Saved reports & Settings shared page head ---------- */
.saved-head,
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

/* ---------- Saved reports ---------- */
.saved-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.saved-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  box-shadow: var(--shadow);
}

.saved-search svg {
  width: 15px;
  height: 15px;
  color: #D9BFA8;
  flex: none;
}

.saved-search input {
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  width: 100%;
}

.saved-search input::placeholder {
  color: #66513F;
}

.saved-count {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.saved-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 18px 2px 8px;
}

.saved-group-label:first-child {
  padding-top: 0;
}

.saved-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color .15s ease;
}

.saved-card:hover {
  border-color: var(--clarity);
}

.saved-card .sc-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-badge.badge-high {
  background: var(--red-soft);
  color: var(--red);
}

.sc-badge.badge-mid {
  background: var(--amber-soft);
  color: var(--amber);
}

.sc-badge.badge-low {
  background: var(--clarity-soft);
  color: var(--deep);
}

.saved-card .sc-body {
  min-width: 0;
  flex: 1;
}

.saved-card .sc-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-card .sc-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-card .sc-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #CDBDA5;
  flex: none;
}

.saved-card .sc-meta .mono {
  font-family: var(--font-mono);
}

.saved-card .sc-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.sc-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-icon-btn svg {
  width: 15px;
  height: 15px;
}

.sc-icon-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.sc-icon-btn.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.saved-empty,
.settings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
}

.saved-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--paper-2);
  color: #D9BFA8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.saved-empty h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.saved-empty p {
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 40ch;
  margin: 0 0 20px;
}

/* ---------- Settings ---------- */
.settings-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.settings-tab {
  background: none;
  border: none;
  padding: 10px 4px 12px;
  margin-right: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
}

.settings-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 2px;
}

.settings-tab:hover {
  color: var(--ink);
}

.settings-tab.active {
  color: var(--deep);
}

.settings-tab.active::after {
  background: var(--clarity);
}

.settings-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-card-head {
  padding: 20px 28px 4px;
}

.settings-card-head h2 {
  font-size: 16px;
}

.settings-card-head p {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 5px 0 0;
  line-height: 1.5;
  max-width: 60ch;
}

.settings-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.settings-row:first-of-type {
  margin-top: 14px;
}

.settings-row .sr-label .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.settings-row .sr-label .desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.5;
}

.settings-row .sr-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-row .sr-value {
  font-size: 13.5px;
  color: var(--ink);
}

.settings-row input[type=text],
.settings-row select {
  max-width: 340px;
  border: 1px solid #D9CBB6;
  border-radius: 7px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
}

.settings-row input:focus,
.settings-row select:focus {
  border-color: var(--clarity);
  box-shadow: 0 0 0 3px var(--clarity-soft);
  outline: none;
}

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--clarity-soft);
  color: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--deep);
  background: var(--clarity-soft);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Toggle switch — new primitive, styled off --clarity to match existing accent usage */
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.toggle .track {
  position: absolute;
  inset: 0;
  background: #D9CBB6;
  border-radius: 20px;
  transition: background .15s ease;
}

.toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(42, 26, 22, .25);
  transition: transform .15s ease;
}

.toggle input:checked+.track {
  background: var(--clarity);
}

.toggle input:checked+.track+.thumb {
  transform: translateX(16px);
}

.toggle input:disabled+.track {
  background: #E2D6C2;
  cursor: not-allowed;
}

.toggle input:disabled~* {
  cursor: not-allowed;
}

.toggle input:focus-visible+.track {
  outline: 2px solid var(--clarity);
  outline-offset: 2px;
}

.lock-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.lock-note svg {
  width: 11px;
  height: 11px;
  flex: none;
}

.settings-danger {
  border-color: var(--red-soft);
}

.settings-danger .settings-card-head h2 {
  color: var(--red);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-danger:hover {
  background: var(--red);
  color: #FCF5F3;
}

@media (max-width:640px) {
  .settings-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width:980px) {
  .sidebar {
    flex-basis: 240px;
    width: 240px;
  }

  .panel,
  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width:760px) {
  .sidebar {
    display: none;
  }
}

@media (max-width:640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .verdict-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .panel {
    padding: 22px 18px 40px;
  }

  .topbar {
    padding: 16px 20px;
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
  }
}

/* ================= AUTH OVERLAY (Log in / Sign up / Forgot password) ================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-overlay.hidden {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(114, 40, 55, .45);
  backdrop-filter: blur(2px);
  will-change: backdrop-filter;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 28px -8px rgba(114, 40, 55, .35);
  padding: 32px 32px 28px;
  animation: auth-pop .18s ease;
  will-change: transform, opacity;
}

@keyframes auth-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .auth-card {
    animation: none;
  }
}

.auth-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-close svg {
  width: 16px;
  height: 16px;
}

.auth-close:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
}

.auth-brand .mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(42, 26, 22, 0.15);
  background: var(--paper);
}

.auth-brand .word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--deep);
}

.auth-brand .word em {
  font-style: italic;
  color: var(--clarity);
}

.auth-tabs {
  display: flex;
  background: var(--paper-2);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 24px;
  gap: 2px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab.active {
  background: var(--white);
  color: var(--deep);
  box-shadow: 0 1px 2px rgba(42, 26, 22, .08);
}

.auth-panel.hidden {
  display: none;
}

.auth-title {
  font-size: 21px;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
}

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.auth-field .auth-optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 11.5px;
  margin-left: 2px;
}

.auth-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.auth-field-head label {
  margin-bottom: 0;
}

.auth-field input[type=text],
.auth-field input[type=email],
.auth-field input[type=password] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-field input::placeholder {
  color: #66513F;
}

.auth-field input:focus {
  border-color: var(--clarity);
  box-shadow: 0 0 0 3px var(--clarity-soft);
  outline: none;
}

.auth-field.invalid input {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.auth-field.invalid .field-error {
  display: flex;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 48px;
}

.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  background: none;
  border: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-toggle svg {
  width: 17px;
  height: 17px;
  position: absolute;
}

.pw-toggle .eye-off {
  display: none;
}

.pw-toggle[aria-pressed="true"] .eye-on {
  display: none;
}

.pw-toggle[aria-pressed="true"] .eye-off {
  display: block;
}

.pw-toggle:hover {
  color: var(--deep);
}

.field-hint {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 7px;
  line-height: 1.5;
}

.field-error {
  font-size: 11.5px;
  color: var(--red);
  margin-top: 7px;
  display: none;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.4;
}

.field-error svg {
  width: 12px;
  height: 12px;
  flex: none;
  margin-top: 1px;
}

.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.pw-strength-track {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
}

.pw-strength-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease, background .2s ease;
}

.pw-strength-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  flex: none;
  min-width: 44px;
  text-align: right;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
}

.auth-check input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  accent-color: var(--clarity);
}

.auth-inline-link {
  color: var(--deep-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-inline-link:hover {
  color: var(--deep);
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--deep-2);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-link-btn:hover {
  color: var(--deep);
  text-decoration: underline;
}

.auth-form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 2px;
}

.auth-form-error.visible {
  display: flex;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
}

.auth-switch {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 20px 0 0;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 16px;
}

.auth-back svg {
  width: 13px;
  height: 13px;
}

.auth-back:hover {
  color: var(--deep);
}

.auth-success {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--clarity-soft);
  color: var(--deep);
  border-radius: 9px;
  padding: 14px 16px;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-success.hidden {
  display: none;
}

.auth-success svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--clarity);
}

.auth-success b {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 2px;
}

.auth-success p {
  margin: 0;
}

.auth-legal {
  font-size: 11px;
  color: #66513F;
  text-align: center;
  line-height: 1.5;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Sidebar guest trigger — now an actionable button */
button.sb-user {
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.sb-user-arrow {
  width: 14px;
  height: 14px;
  color: #D9BFA8;
  flex: none;
  margin-left: auto;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}

.sb-user:hover {
  background: rgba(255, 255, 255, .06);
  border-radius: 8px;
}

.sb-user:hover .sb-user-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.sb-user:hover .role {
  color: #EBDDCB;
}

.settings-auth-actions {
  gap: 10px;
}

@media (max-width:480px) {
  .auth-card {
    padding: 26px 20px 22px;
    border-radius: 12px;
  }
}

/* ===== ACADEMIC RED & BEIGE — overrides (design only) ===== */
h1,
h2,
h3 {
  letter-spacing: -.01em;
  line-height: 1.15
}

body {
  font-size: 15px;
  line-height: 1.55
}

.sidebar {
  background: linear-gradient(180deg, #722837 0%, #5F2130 100%)
}

.sidebar :focus-visible {
  outline-color: #F5EEE1
}

.sb-new {
  background: #F5EEE1;
  color: #722837
}

.sb-new:hover {
  background: #FFFCF6
}

.sb-promo button:hover {
  border-color: #F5EEE1;
  color: #FFFCF6
}

.sb-item.active {
  box-shadow: inset 3px 0 0 #FCD08A
}

.sb-item .badge-low {
  background: rgba(160, 200, 140, .25);
  color: #D3E6C4
}

.sb-item .badge-high,
.sb-item .badge-mid {
  background: rgba(255, 255, 255, .14);
  color: #FFE3D8
}

.topbar {
  background: rgba(245, 238, 225, .92);
  backdrop-filter: blur(6px)
}

.btn-primary {
  background: var(--deep);
  color: #FFF8EE;
  letter-spacing: .01em
}

.btn-primary:hover {
  background: #561E2A;
  color: #FFF8EE
}

.btn-ghost {
  border-color: #CDBDA5
}

.btn-ghost:hover {
  background: var(--clarity-soft)
}

.verdict-card {
  border-top: 3px solid var(--deep)
}

.verdict-num {
  font-family: var(--font-serif);
  font-size: 52px
}

.whitebox-row .v.ok,
.signal-good {
  color: var(--good)
}

.signal-good {
  background: var(--good-soft)
}

.badge-low,
.sc-badge.badge-low {
  background: var(--good-soft);
  color: var(--good)
}

.hl-lo {
  background: rgba(63, 98, 56, .35)
}

.legend i[style*="30,143,134"] {
  background: rgba(63, 98, 56, .55) !important
}

.action-btn[data-action=blacklist] {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff
}

.action-btn[data-action=whitelist] {
  color: var(--good) !important;
  border-color: var(--good) !important
}

@media (pointer:coarse) {

  .btn-ghost,
  .btn-primary,
  .btn-danger,
  .sb-foot-link,
  .lang-btn,
  .settings-tab,
  .auth-tab,
  .ct-icon-btn,
  .sc-icon-btn,
  .type-tab {
    min-height: 44px
  }

  .ct-icon-btn,
  .sc-icon-btn {
    min-width: 44px
  }
}

@media (max-width:760px) {

  html,
  body {
    height: auto
  }

  .app {
    flex-direction: column;
    height: 100dvh
  }

  .sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    flex: none;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    gap: 2px 8px
  }

  .sb-brand {
    padding: 4px
  }

  .sb-new {
    margin: 0 0 0 auto;
    padding: 9px 14px
  }

  .sb-search,
  .sb-history,
  .sb-promo,
  .sb-user .info,
  .sb-user-arrow {
    display: none
  }

  .sb-foot {
    flex: 1 0 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, .14)
  }

  .sb-foot-link {
    white-space: nowrap;
    font-size: 12.5px
  }

  .sb-user {
    border: 0;
    margin: 0 0 0 auto;
    padding: 6px
  }

  .main {
    height: auto;
    flex: 1;
    min-height: 0
  }

  .page-head h1,
  .report-top h1 {
    font-size: 24px
  }

  .verdict-num {
    font-size: 44px
  }
}

/* ===== PASS 2: ink contrast, history chips, review tickets ===== */
:root {
  --ink: #1A1210;
  --ink-soft: #43342E;
  --ink-light: #43342E
}

/* --ink-light was undefined; script.js uses it */
body {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  color: var(--ink)
}

h1,
h2,
h3,
.verdict-label {
  color: var(--ink)
}

/* near-black headings, like the reference */
.page-head h1::after,
.saved-head h1::after,
.settings-head h1::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--deep);
  margin-top: 10px
}

.form-head .fh-title,
.field-label .name {
  color: var(--ink);
  font-weight: 700
}

/* Badges: one accessible system (tinted chip + dark text + hairline) */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .02em;
  line-height: 1.3;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap
}

.badge-high {
  background: #F6DAD3;
  color: #7A1710;
  border-color: #E2AFA5
}

.badge-mid {
  background: #F3E2C6;
  color: #5A3A06;
  border-color: #E0C596
}

.badge-low {
  background: #E1E8D0;
  color: #24401F;
  border-color: #BFCFA5
}

/* Sidebar (on burgundy): solid light chips so % reads at a glance */
.sb-item .badge {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  min-width: 46px;
  justify-content: center;
  border-color: transparent;
  font-variant-numeric: tabular-nums
}

.sb-item .badge.badge-high {
  background: #FFD9D0;
  color: #722837
}

.sb-item .badge.badge-mid {
  background: #F7DDA8;
  color: #5A3A06
}

.sb-item .badge.badge-low {
  background: #D3E6C4;
  color: #24401F
}

/* Filter tabs */
.saved-toolbar .btn-ghost {
  min-height: 38px
}

.saved-toolbar .btn-ghost.active {
  background: var(--deep);
  border-color: var(--deep);
  color: #FFF8EE
}

/* Review tickets */
.saved-card[data-ticket-id] {
  align-items: stretch;
  gap: 14px !important;
  padding: 20px 24px !important;
  border-left: 4px solid #A8927A;
  margin-bottom: 0
}

.saved-card[data-ticket-id]:has(.badge-high) {
  border-left-color: var(--red)
}

.saved-card[data-ticket-id]:has(.badge-low) {
  border-left-color: var(--good)
}

.saved-card[data-ticket-id]>div:first-child {
  align-items: flex-start !important;
  gap: 12px
}

.saved-card[data-ticket-id]>div:first-child>div {
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  row-gap: 8px
}

.saved-card[data-ticket-id] strong[style*="Fraunces"] {
  order: -1;
  flex: 0 0 100%;
  font-family: var(--font-serif) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  overflow-wrap: anywhere
}

.saved-card[data-ticket-id] .mono {
  color: var(--ink-soft) !important;
  font-size: 12px !important;
  white-space: nowrap
}

.saved-card[data-ticket-id]>div:nth-child(2) {
  font-size: 14px !important;
  line-height: 1.65 !important;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 14px
}

.saved-card[data-ticket-id]>div:nth-child(2) div[style*="border-radius:6px"] {
  background: var(--paper-2) !important;
  border-left: 3px solid var(--deep);
  border-radius: 6px !important;
  padding: 10px 12px !important;
  font-size: 13px !important
}

.badge[style*="1E8F86" i] {
  background: var(--paper-2) !important;
  color: var(--ink) !important;
  border-color: #A8927A !important
}

/* "New source" = neutral, not "good" */
.action-btn {
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 9px 16px !important;
  min-height: 40px;
  border-radius: 8px !important
}

.action-btn[data-action=blacklist] {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important
}

.action-btn[data-action=blacklist]:hover {
  background: #8E1A12 !important
}

.action-btn[data-action=whitelist] {
  background: transparent !important;
  color: var(--good) !important;
  border: 1px solid var(--good) !important
}

.action-btn[data-action=whitelist]:hover {
  background: var(--good-soft) !important
}

.action-btn[data-action=dismiss] {
  color: var(--ink) !important
}

.action-btn:disabled {
  opacity: .55;
  cursor: not-allowed
}

#ticketsContainer {
  gap: 16px !important
}

@media (max-width:640px) {
  .saved-card[data-ticket-id] {
    padding: 16px !important
  }

  .saved-card[data-ticket-id] .action-btn {
    flex: 1 1 100%
  }
}

.hidden,
.auth-overlay.hidden,
.auth-panel.hidden,
.auth-success.hidden {
  display: none !important
}


/* ===== PASS 3: academic typography =====
   Serif: Newsreader — drawn for long-form news reading; strong italics.
   Sans:  Libre Franklin — editorial grotesque with a newsroom heritage.
   Mono:  IBM Plex Mono (unchanged) for domains and code-like values. */
:root {
  --font-serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-sans: 'Libre Franklin', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

html {
  font-kerning: normal;
  text-rendering: optimizeLegibility
}

body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga"
}

input,
textarea,
select,
button {
  font-family: inherit
}

h1,
h2,
h3,
.verdict-label,
.auth-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.012em;
  font-optical-sizing: auto
}

.page-head h1,
.saved-head h1,
.settings-head h1,
.report-top h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.1
}

.section-head h2,
.settings-card-head h2,
.saved-empty h2 {
  font-size: 21px;
  line-height: 1.25
}

.verdict-label {
  font-size: 22px;
  font-weight: 600
}

.verdict-num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 58px;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.02em
}

.sb-brand .word,
.auth-brand .word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.015em
}

.sb-brand .word em,
.auth-brand .word em {
  font-style: italic;
  font-weight: 500
}

.saved-card[data-ticket-id] strong[style*="Fraunces"] {
  font-family: var(--font-serif) !important;
  font-size: 24px !important;
  font-weight: 600 !important
}

/* Reading text is set in the serif: the article being judged is the thing users read most */
.sanitized,
.st-article,
#articleText {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink)
}

.page-head p.sub,
.section-sub,
.verdict-desc {
  font-size: 15px;
  line-height: 1.65
}

.verdict-desc,
.section-sub {
  font-family: var(--font-serif);
  font-size: 16px
}

/* Small labels: tracked uppercase sans, the way journals set running heads */
.fh-title,
.sb-group-label,
.st-k,
.saved-group-label {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-size: 11px
}

.field-label .name,
.sb-item .title,
.btn-primary,
.btn-ghost {
  font-weight: 600
}

.badge,
.sb-item .badge {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: .01em;
  font-variant-numeric: lining-nums tabular-nums
}

.mono,
.st-v.mono,
.sc-meta .mono {
  font-family: var(--font-mono)
}

/* =====================================================================
   CREDIBILITY REVIEW TICKETS — Tun.AI Harmonious Editorial Design
   ===================================================================== */
.ticket-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
  position: relative;
}

.ticket-card:hover {
  border-color: #CBB99F;
  box-shadow: 0 4px 16px rgba(42, 26, 22, 0.1);
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ticket-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.ticket-entity-heading {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--deep);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
}

.ticket-entity-chip {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 6px;
}

.ticket-entity-chip.domain {
  background: var(--clarity-soft);
  color: var(--deep);
  border: 1px solid rgba(138, 51, 71, 0.2);
}

.ticket-entity-chip.author {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(138, 83, 18, 0.25);
}

.ticket-entity-chip.organization {
  background: #EAE2F8;
  color: #582C8A;
  border: 1px solid rgba(88, 44, 138, 0.25);
}

.ticket-timestamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper-2);
  padding: 5px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ticket-detail-box {
  background: var(--paper-2);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.ticket-detail-box .trigger-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
}

.ticket-metrics-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0 2px;
  border-top: 1px solid #E4D7C2;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

.ticket-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ticket-metric-item b {
  color: var(--ink);
  font-weight: 600;
}

.ticket-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 6px;
  flex-wrap: wrap;
}

.ticket-footer-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.ticket-buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ticket-btn-red {
  background: var(--red);
  color: #FFF8EE;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity .15s ease;
}

.ticket-btn-red:hover {
  opacity: .92;
}

.ticket-btn-green {
  background: var(--good);
  color: #FFF8EE;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity .15s ease;
}

.ticket-btn-green:hover {
  opacity: .92;
}

.ticket-drawer {
  background: var(--paper-2);
  border: 1px solid #DDCFB8;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.ticket-drawer label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.ticket-drawer textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
  min-height: 68px;
}

.ticket-drawer textarea:focus {
  outline: none;
  border-color: var(--deep);
  box-shadow: 0 0 0 3px var(--clarity-soft);
}

.ticket-audited-note {
  background: var(--paper-2);
  border-left: 3px solid var(--good);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.ticket-audited-note .meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 5px;
  font-family: var(--font-mono);
}