@font-face {
  font-family: "AnmolLipi";
  src: url("/static/fonts/AnmolLipi.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f6efe0;
  --paper-strong: #efe3cb;
  --ink: #1e2430;
  --ink-soft: #59606d;
  --accent: #b45f2a;
  --accent-deep: #7d3212;
  --border: rgba(30, 36, 48, 0.14);
  --panel-shadow: 0 22px 50px rgba(39, 28, 16, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(180, 95, 42, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(34, 73, 87, 0.14), transparent 28%),
    linear-gradient(180deg, #f9f3e6 0%, #efe5d1 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  background: rgba(30, 36, 48, 0.08);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.page-shell {
  min-height: 100vh;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.page-aura {
  position: fixed;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.55;
  pointer-events: none;
}

.page-aura-left {
  background: rgba(180, 95, 42, 0.18);
  left: -4rem;
  top: 12rem;
}

.page-aura-right {
  background: rgba(23, 87, 80, 0.15);
  right: -2rem;
  top: 4rem;
}

.topbar,
.hero-card,
.panel,
.user-card,
.remark-card,
.timeline-item {
  backdrop-filter: blur(10px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 249, 239, 0.88);
  box-shadow: var(--panel-shadow);
  position: sticky;
  top: 1rem;
  z-index: 10;
}

.brand-shell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-kicker,
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent-deep);
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.content-shell {
  max-width: 1480px;
  margin: 1.5rem auto 0;
  display: grid;
  gap: 1.5rem;
}

.hero-card,
.panel,
.user-card,
.remark-card,
.timeline-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.9);
  box-shadow: var(--panel-shadow);
}

.hero-card {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.compact-card {
  grid-template-columns: 1fr auto;
}

.login-card h1,
.compact-card h1 {
  margin: 0.35rem 0 0.6rem;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  line-height: 1.1;
}

.panel,
.user-card,
.remark-card,
.timeline-item {
  padding: 1.25rem;
}

.panel-heading,
.user-card-header,
.remark-header,
.timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.panel-heading h2,
.panel h2,
.user-card h3 {
  margin: 0;
}

.form-grid,
.filter-grid,
.field-grid {
  display: grid;
  gap: 1rem;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-field,
.wide-actions {
  grid-column: 1 / -1;
}

.panel-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta-pill {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border: 1px solid rgba(30, 36, 48, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

label,
.mini-form {
  display: grid;
  gap: 0.4rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(30, 36, 48, 0.16);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7ef;
  box-shadow: 0 14px 28px rgba(125, 50, 18, 0.18);
}

.ghost-button {
  background: rgba(255, 250, 242, 0.7);
  border-color: rgba(30, 36, 48, 0.18);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.inline-form,
.button-row,
.pagination,
.mini-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.button-row {
  justify-content: flex-start;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.data-table th,
.data-table td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(30, 36, 48, 0.09);
}

.data-table th {
  background: rgba(238, 227, 205, 0.85);
}

.punjabi-cell,
.punjabi-input {
  font-family: "AnmolLipi", "Raavi", serif;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}

.english-cell,
.english-input {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

.utf8-cell,
.utf8-input {
  font-family: "Nirmala UI", "Segoe UI", sans-serif;
}

.split-grid,
.user-grid {
  display: grid;
  gap: 1.5rem;
}

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.role-pill,
.status-pill {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-transform: capitalize;
  background: rgba(30, 36, 48, 0.08);
}

.role-admin {
  background: rgba(125, 50, 18, 0.12);
}

.role-editor {
  background: rgba(15, 97, 90, 0.12);
}

.role-reviewer {
  background: rgba(73, 53, 115, 0.12);
}

.status-open {
  background: rgba(180, 95, 42, 0.14);
}

.status-addressed {
  background: rgba(15, 97, 90, 0.14);
}

.timeline-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.timeline-diff pre {
  white-space: pre-wrap;
  background: rgba(239, 227, 203, 0.45);
  border-radius: 12px;
  padding: 0.8rem;
  min-height: 4rem;
  margin: 0.45rem 0 0;
}

.history-value {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

.history-value-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}

.history-value-english {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

.history-value-utf8 {
  font-family: "Nirmala UI", "Segoe UI", sans-serif;
}

.notice,
.error-banner {
  border-radius: 16px;
  padding: 0.95rem 1rem;
}

.notice {
  background: rgba(15, 97, 90, 0.12);
  border: 1px solid rgba(15, 97, 90, 0.2);
}

.error-banner {
  background: rgba(143, 31, 31, 0.09);
  border: 1px solid rgba(143, 31, 31, 0.2);
  margin-bottom: 1rem;
}

.muted {
  color: var(--ink-soft);
}

.stack-list {
  display: grid;
  gap: 1rem;
}

.pagination-link {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pagination-link.active {
  background: rgba(180, 95, 42, 0.13);
  border-color: rgba(180, 95, 42, 0.22);
}

@media (max-width: 960px) {
  .hero-card,
  .compact-card,
  .split-grid,
  .form-grid,
  .filter-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }
}

.reader-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.reader-hero-copy h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
}

.reader-shell {
  padding: 0;
  overflow: hidden;
}

.reader-app {
  position: relative;
}

.reader-loading-state,
.reader-empty-state {
  padding: 2.5rem;
  text-align: center;
  color: var(--ink-soft);
}

.reader-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(30, 36, 48, 0.1);
  background: rgba(245, 236, 220, 0.65);
}

.reader-toolbar h2 {
  margin: 0;
}

.reader-toolbar p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.reader-search-form {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8rem) minmax(7rem, 8.5rem) minmax(14rem, 22rem) auto;
  gap: 0.65rem;
  align-items: end;
  flex: 1;
}

.reader-search-field {
  display: grid;
  gap: 0.25rem;
}

.reader-search-field span {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.reader-search-field input {
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
}

.reader-search-input-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.reader-search-field-wide {
  min-width: 0;
}

.reader-search-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.reader-search-status {
  font-size: 0.82rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.reader-search-submit-helper {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reader-search-icon-button,
.reader-search-nav-button {
  min-width: 2.45rem;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.reader-search-nav-button {
  font-size: 1.1rem;
  font-weight: 700;
}

.reader-resume-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-deep);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.reader-resume-link:disabled {
  color: var(--ink-soft);
  cursor: default;
  text-decoration: none;
}

.reader-viewport {
  position: relative;
  height: calc(100vh - 16rem);
  min-height: 32rem;
  overflow: auto;
  padding: 1rem 0.75rem 1.5rem;
}

.reader-canvas {
  position: relative;
  width: 100%;
}

.reader-card-slot {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(calc(100% - 1rem), 1160px);
  padding-bottom: 1rem;
}

.reader-card {
  position: relative;
  border-radius: 26px;
  padding: 1.9rem 1.75rem 1.5rem;
  background: rgba(255, 251, 245, 0.96);
  box-shadow: 0 16px 42px rgba(55, 32, 12, 0.1);
  border: 1px solid rgba(74, 44, 11, 0.08);
}

.reader-card-skeleton {
  min-height: 13rem;
}

.reader-card-settings {
  position: absolute;
  top: 0.85rem;
  left: 0.95rem;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(30, 36, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-deep);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(30, 36, 48, 0.08);
}

.reader-verse-label {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  color: rgba(30, 36, 48, 0.44);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.reader-line {
  position: relative;
  min-height: 2.65rem;
  padding: 0.45rem 7.35rem 0.45rem 0.95rem;
}

.reader-line-has-left-action {
  padding-left: 3.9rem;
}

.reader-line + .reader-line {
  margin-top: 0.35rem;
}

.reader-line-text {
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.reader-line-copy-button {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.reader-line-gurmukhi {
  font-family: "AnmolLipi", "Raavi", serif;
  color: #4a2c0b;
  font-size: clamp(1.32rem, 2.6vw, 1.5rem);
  letter-spacing: 0.02em;
  font-weight: 700;
}

.reader-line-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  color: #1b4a2e;
  font-size: clamp(1.1rem, 2.15vw, 1.1875rem);
  letter-spacing: 0.02em;
}

.reader-line-english {
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: #5c2a2a;
  font-size: clamp(1rem, 1.95vw, 1.09375rem);
}

.reader-line-actions {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.25rem;
  width: 6.6rem;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 180ms ease;
}

.reader-card:hover .reader-line-actions,
.reader-line:focus-within .reader-line-actions,
.reader-card:hover .reader-line-copy-button,
.reader-line:focus-within .reader-line-copy-button {
  opacity: 1;
}

.reader-icon-button {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(30, 36, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.reader-icon-button.is-disabled,
.reader-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.reader-verify-button {
  color: #2d7a43;
  font-weight: 700;
}

.reader-verify-button.is-verified {
  background: rgba(45, 122, 67, 0.14);
  border-color: rgba(45, 122, 67, 0.24);
  color: #1f5d32;
  box-shadow: inset 0 0 0 1px rgba(45, 122, 67, 0.12);
}

.reader-edit-shell {
  display: grid;
  gap: 0.75rem;
}

.reader-textarea {
  min-height: 6.75rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.reader-textarea-gurmukhi {
  font-family: "AnmolLipi", "Raavi", serif;
  color: #4a2c0b;
  font-size: 1.5rem;
  line-height: 1.4;
}

.reader-textarea-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  color: #1b4a2e;
  font-size: 1.1875rem;
  line-height: 1.4;
}

.reader-textarea-english {
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: #5c2a2a;
  font-size: 1.09375rem;
  line-height: 1.45;
}

.reader-edit-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.reader-skeleton-line {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(74, 44, 11, 0.08), rgba(74, 44, 11, 0.15), rgba(74, 44, 11, 0.08));
  background-size: 220% 100%;
  animation: reader-shimmer 1.7s linear infinite;
}

.reader-skeleton-large {
  height: 1.6rem;
  margin-top: 1.3rem;
}

.reader-skeleton-medium {
  height: 1.2rem;
  margin-top: 1.35rem;
  width: 84%;
  margin-left: auto;
  margin-right: auto;
}

.reader-skeleton-small {
  height: 1rem;
  margin-top: 1.2rem;
  width: 72%;
  margin-left: auto;
  margin-right: auto;
}

@keyframes reader-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.reader-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.65rem;
  z-index: 40;
}

.reader-toast {
  min-width: 15rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  color: #fff9ef;
  background: rgba(22, 92, 61, 0.95);
  box-shadow: 0 12px 28px rgba(15, 97, 90, 0.22);
  transition: opacity 180ms ease, transform 180ms ease;
}

.reader-toast-error {
  background: rgba(130, 33, 33, 0.96);
  box-shadow: 0 12px 28px rgba(130, 33, 33, 0.22);
}

.reader-toast-fade {
  opacity: 0;
  transform: translateY(0.35rem);
}

.reader-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.reader-modal-shell.is-hidden {
  display: none;
}

.reader-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.44);
}

.reader-modal {
  position: relative;
  width: min(92vw, 920px);
  max-height: 82vh;
  margin: 6vh auto 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 251, 245, 0.99);
  box-shadow: 0 20px 52px rgba(15, 18, 22, 0.24);
}

.reader-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(30, 36, 48, 0.08);
}

.reader-modal-header h3 {
  margin: 0.2rem 0 0;
}

.reader-modal-body {
  max-height: calc(82vh - 5.25rem);
  overflow: auto;
  padding: 1rem 1.25rem 1.35rem;
  display: grid;
  gap: 1rem;
}

.reader-details-modal {
  width: min(94vw, 1080px);
}

.reader-modal-state {
  padding: 1rem 0.25rem;
  text-align: center;
  color: var(--ink-soft);
}

.reader-modal-error {
  color: #8f1f1f;
}

.reader-history-entry {
  border: 1px solid rgba(30, 36, 48, 0.09);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(247, 240, 228, 0.58);
}

.reader-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.reader-history-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.reader-history-value {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.85rem;
}

.reader-history-value-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  letter-spacing: 0.02em;
}

.reader-history-value-english {
  font-family: Arial, "Helvetica Neue", sans-serif;
}

.reader-history-value mark {
  background: rgba(235, 192, 91, 0.45);
  border-radius: 6px;
  padding: 0.05rem 0;
}

.reader-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.reader-detail-card {
  border: 1px solid rgba(30, 36, 48, 0.09);
  border-radius: 18px;
  padding: 1rem 1.15rem;
  background: rgba(247, 240, 228, 0.58);
  text-align: center;
}

.reader-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.reader-detail-label {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.reader-detail-copy-button {
  flex: 0 0 auto;
}

.reader-detail-value {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  line-height: 1.45;
  text-align: center;
}

.reader-detail-value-punjabi {
  font-family: "AnmolLipi", "Raavi", serif;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}

.reader-detail-value-gurmukhi {
  font-family: "AnmolLipi", "Raavi", serif;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.reader-detail-value-utf8 {
  font-family: "Nirmala UI", "Segoe UI", sans-serif;
}

.reader-detail-value-english,
.reader-detail-value-default {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

@media (max-width: 960px) {
  .reader-hero,
  .reader-toolbar,
  .reader-history-diff {
    grid-template-columns: 1fr;
  }

  .reader-hero,
  .reader-toolbar {
    display: grid;
  }

  .reader-search-form {
    grid-template-columns: 1fr;
  }

  .reader-search-actions {
    justify-content: flex-start;
  }

  .reader-search-status {
    white-space: normal;
  }

  .reader-viewport {
    height: calc(100vh - 18rem);
    min-height: 28rem;
  }

  .reader-line-actions {
    opacity: 1;
  }

  .reader-line-copy-button {
    opacity: 1;
  }
}
