/* هوية المسابقة الأصلية — أخضر تركوازي، مع تحسين الشكل والتجاوب */
:root {
  --dark: #004d40;
  --teal: #00796b;
  --teal-2: #009688;
  --page: #f4f7f6;
  --card: #ffffff;
  --text: #333333;
  --verse: #2c3e50;
  --muted: #6b7c76;
  --line: #e0e7e4;
  --vote: #e57373;
  --vote-deep: #d32f2f;
  --votes: #d84315;
  --open: #4CAF50;
  --open-deep: #388E3C;
  --closed: #D32F2F;
  --closed-deep: #B71C1C;
  --gold: #FFC107;
  --shadow: 0 8px 28px rgba(0, 77, 64, .12);
  --radius: 16px;
  --ui: "Cairo", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.diwan {
  font-family: var(--ui);
  background:
    radial-gradient(900px 380px at 100% 0, rgba(0, 121, 107, .08), transparent 55%),
    var(--page);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  overflow-x: hidden;
}

body.diwan a {
  color: inherit;
}

.bg-glow {
  display: none;
}

.navbar,
.hero,
.content-wrapper,
.site-foot,
.admin-navbar,
.container,
.login-wrap {
  position: relative;
  z-index: 1;
}

/* ========== Nav ========== */
.navbar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
  justify-self: start;
}

.nav-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  justify-self: center;
  width: auto;
  max-width: none;
}

.nav-spacer {
  justify-self: end;
  min-height: 1px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  background: var(--teal);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 800;
}

.brand-copy small {
  color: #b2dfdb;
  font-size: 11px;
  font-weight: 600;
}

.nav-item,
.nav-link,
.logout-button {
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 0;
  transition: background .25s ease, transform .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  cursor: pointer;
  font-family: var(--ui);
}

.nav-item:hover,
.nav-link:hover {
  background: var(--teal);
}

.nav-item.is-active,
.home-link {
  background: var(--teal);
}

.logout-button {
  background: var(--vote);
}

.logout-button:hover {
  background: var(--vote-deep);
}

/* ========== Hero ========== */
.hero {
  padding: 36px 6vw 28px;
  text-align: center;
  background: var(--dark);
  color: #fff;
  border-radius: 0 0 24px 24px;
  margin-bottom: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #80cbc4;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: #80cbc4;
}

.hero h1,
.main-title {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  line-height: 1.35;
  margin: 0 0 8px;
  color: #fff;
}

.hero-lead {
  margin: 0 auto 22px;
  max-width: 34em;
  color: #cde7e3;
  font-size: 1.02rem;
  font-weight: 600;
}

.status-container-wrapper {
  width: min(650px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-card {
  padding: 14px 16px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
  transition: transform .25s ease;
}

.status-card:hover {
  transform: translateY(-3px);
}

.status-card h4 {
  margin: 0 0 5px;
  font-size: .95rem;
}

.status-card .status-state {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
}

.status-card.open {
  background: var(--open);
  border: 2px solid var(--open-deep);
}

.status-card.closed {
  background: var(--closed);
  border: 2px solid var(--closed-deep);
}

/* ========== Content ========== */
.content-wrapper {
  padding: 22px 6vw 72px;
}

.form-container,
.poems-list,
.winner-box {
  width: min(700px, 100%);
  margin-inline: auto;
}

.login-box {
  width: min(380px, 100%);
}

.container {
  width: min(950px, calc(100% - 32px));
  margin: 22px auto 50px;
}

.logout-form {
  margin: 0;
  display: inline-block;
}

.form-container,
.poems-list,
.login-box,
.container {
  background: var(--card);
  color: var(--text);
  padding: clamp(22px, 4vw, 32px);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.form-container {
  margin-bottom: 22px;
}

.poems-list {
  margin-top: 8px;
}

.form-container h2,
.poems-list h2,
.container h2 {
  font-family: var(--ui);
  font-size: 1.45rem;
  margin: 0 0 16px;
  color: var(--dark);
  font-weight: 800;
  border-bottom: 3px solid var(--teal);
  padding-bottom: 8px;
  display: inline-block;
}

.section-kicker {
  font-size: 12px;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  font-family: var(--ui);
  text-align: right;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  font-size: 1.05rem;
  line-height: 1.9;
  min-height: 140px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, .18);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#charCount.is-limit,
#poetCount.is-limit {
  color: var(--vote-deep);
}

button,
.vote-btn,
.open-btn,
.close-btn,
.publish-btn,
.unpublish-btn,
.delete-btn,
.login-box button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--ui);
  font-weight: 800;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  color: #fff;
  background: var(--teal);
  transition: background .2s ease, transform .2s ease;
}

button:hover:not(:disabled),
.vote-btn:hover:not(:disabled) {
  background: var(--dark);
  transform: translateY(-1px);
}

.form-container button[type="submit"] {
  width: 100%;
}

.vote-btn {
  background: var(--vote);
  min-height: 44px;
  min-width: 112px;
}

.vote-btn:hover:not(:disabled) {
  background: var(--vote-deep);
}

.vote-btn.owner,
.vote-btn[disabled] {
  background: #9e9e9e !important;
  color: #fff !important;
  cursor: not-allowed;
  transform: none;
}

.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-top: 8px;
  font-weight: 700;
}

.alert.success {
  background: #e8f5e9;
  color: #2e7d32;
  border-right: 5px solid var(--open);
}

.alert.error {
  background: #fce4e4;
  color: #c00;
  border-right: 5px solid var(--closed);
}

/* ========== Poems ========== */
.poem-card,
.blog-card {
  position: relative;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, rgba(0, 121, 107, .18), rgba(0, 77, 64, .08)) border-box;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 26px 24px 18px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(0, 77, 64, .08);
  overflow: hidden;
  animation: rise .5s ease both;
  transition: transform .25s ease, box-shadow .25s ease;
}

.poem-card:hover,
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 77, 64, .14);
}

.poem-card::after,
.blog-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 121, 107, .12);
  border-radius: 12px;
  pointer-events: none;
}

.poem-card:nth-child(2),
.blog-card:nth-child(2) { animation-delay: .05s; }
.poem-card:nth-child(3),
.blog-card:nth-child(3) { animation-delay: .1s; }
.poem-card:nth-child(4),
.blog-card:nth-child(4) { animation-delay: .15s; }
.poem-card:nth-child(5),
.blog-card:nth-child(5) { animation-delay: .2s; }

.poem-card::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 8px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--teal), var(--dark));
}

.poem-ornament {
  height: 14px;
  margin: 0 auto 14px;
  width: 92px;
  background:
    radial-gradient(circle at 50% 50%, var(--teal) 1.5px, transparent 1.7px),
    linear-gradient(90deg, transparent, var(--teal), transparent);
  background-size: 16px 16px, 100% 1px;
  background-repeat: repeat-x, no-repeat;
  background-position: center, center;
  opacity: .55;
}

.poem-content,
.blog-text {
  font-family: var(--ui);
  font-size: clamp(1.12rem, 3vw, 1.32rem);
  font-weight: 700;
  line-height: 2.15;
  color: var(--verse);
  margin: 0;
  white-space: pre-line;
  text-align: center;
  padding: 4px 8px 16px;
}

.vote-section,
.blog-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.votes-count {
  font-weight: 800;
  color: var(--votes);
  font-size: .98rem;
}

.votes-count span {
  color: var(--dark);
}

.empty-poems {
  text-align: center;
  color: #888;
  padding: 18px 8px;
  font-weight: 700;
}

/* ========== Winner ========== */
.winner-box {
  background: #fff;
  border: 5px solid var(--gold);
  padding: clamp(24px, 5vw, 36px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(255, 193, 7, .35);
  text-align: center;
  margin: 16px auto 24px;
  color: var(--text);
  animation: rise .6s ease both;
}

.winner-box h2 {
  font-family: var(--ui);
  color: #FF9800;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin: 0 0 12px;
  border: 0;
  display: block;
}

.winner-name-highlight {
  font-size: 1.4rem;
  font-weight: 800;
  color: #E91E63;
  background: #fce4ec;
  padding: 8px 20px;
  border-radius: 50px;
  display: inline-block;
  margin-top: 8px;
}

.winner-poem {
  font-family: var(--ui);
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  font-weight: 700;
  color: var(--dark);
  margin: 22px 0;
  line-height: 2.15;
  padding: 18px;
  background: #e0f2f1;
  border-radius: 12px;
  border-right: 8px solid var(--teal);
}

.winner-stats {
  font-size: 1.2rem;
  color: var(--votes);
  font-weight: 800;
}

.winner-stats span {
  color: var(--teal);
  font-size: 1.35em;
}

.results-table,
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 18px;
  border-radius: 10px;
  overflow: hidden;
  text-align: right;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
}

.results-table th,
.results-table td,
.stats-table th,
.stats-table td {
  padding: 13px 11px;
  text-align: right;
  vertical-align: top;
  font-size: 1rem;
}

.results-table th,
.stats-table th {
  background: var(--dark);
  color: #fff;
  font-weight: 800;
}

.stats-table th {
  background: var(--teal);
}

.results-table td,
.stats-table td {
  background: #fff;
  border-bottom: 1px solid #eee;
  color: var(--text);
}

.results-table tr:nth-child(even) td,
.stats-table tr:nth-child(even) {
  background: #f7f7f7;
}

.results-table td:first-child {
  font-weight: 800;
  color: var(--votes);
}

/* ========== Overlay + toast ========== */
.redirect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 80;
  padding: 20px;
}

.redirect-box,
.toast {
  background: #fff;
  color: var(--dark);
  padding: 26px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  text-align: center;
  max-width: 400px;
  width: 100%;
  border-top: 5px solid var(--teal);
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  z-index: 90;
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.ok { border-top-color: var(--open); }
.toast.err { border-top-color: var(--closed); }

.site-foot {
  text-align: center;
  padding: 8px 6vw 32px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ========== Admin ========== */
body.admin-body {
  font-family: var(--ui);
  background: var(--page);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

.admin-navbar {
  background: #37474f;
  color: #fff;
  padding: 12px 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}

.admin-navbar .title {
  font-size: 1.25rem;
  font-weight: 800;
}

.container h3 {
  color: #37474f;
  margin: 0;
  font-size: 1.05rem;
}

.setting-box {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.setting-box > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.open-btn { background: var(--open); }
.open-btn:hover { background: var(--open-deep); }
.close-btn { background: var(--closed); }
.close-btn:hover { background: var(--closed-deep); }
.publish-btn { background: var(--gold); color: #333; }
.publish-btn:hover { background: #FFA000; color: #333; }
.unpublish-btn { background: #795548; }
.delete-btn { background: #E67E22; }

.status { font-weight: 800; }

.message-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-right: 5px solid var(--open);
}

.stats-poem {
  color: #555;
  max-width: 420px;
  line-height: 1.9;
}

.stats-rank {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--votes);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #004d40 0%, #00796b 100%);
}

.login-box h2 {
  color: var(--dark);
  margin: 0 0 22px;
  font-size: 1.7rem;
  border-bottom: 3px solid var(--teal);
  display: inline-block;
  padding-bottom: 6px;
}

.login-box button {
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.blog-grid {
  width: min(760px, 100%);
  margin: 8px auto 0;
  display: grid;
  gap: 4px;
}

.blog-card {
  margin-bottom: 14px;
}

.blog-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.blog-card-top strong {
  color: var(--dark);
  font-size: .95rem;
  background: #e8f5f3;
  padding: 4px 10px;
  border-radius: 999px;
}

.blog-card-top time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.blog-card-foot {
  justify-content: flex-end;
}

.star-like {
  background: #fff8e1;
  color: #c79100;
  border: 1px solid #ffe082;
  min-width: 88px;
  box-shadow: none;
  border-radius: 999px;
}

.star-like:hover:not(:disabled) {
  background: #ffecb3;
  color: #b36b00;
}

.star-like.is-liked,
.star-like:disabled.is-liked {
  background: var(--gold) !important;
  color: #5d4100 !important;
  cursor: default;
}

.star-icon {
  font-size: 1.15rem;
  line-height: 1;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .navbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .brand {
    justify-self: start;
    width: 100%;
  }

  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-spacer {
    display: none;
  }

  .nav-item {
    padding: 7px 11px;
    font-size: 13px;
  }

  .hero {
    padding: 24px 16px 22px;
    border-radius: 0 0 18px 18px;
  }

  .content-wrapper {
    padding: 16px 14px 56px;
  }

  .status-container-wrapper {
    grid-template-columns: 1fr;
  }

  .vote-section {
    flex-direction: column;
    align-items: stretch;
  }

  .vote-btn {
    width: 100%;
  }

  .results-table,
  .stats-table,
  .results-table thead,
  .stats-table thead,
  .results-table tbody,
  .stats-table tbody,
  .results-table th,
  .results-table td,
  .stats-table th,
  .stats-table td,
  .results-table tr,
  .stats-table tr {
    display: block;
  }

  .results-table thead,
  .stats-table thead {
    display: none;
  }

  .results-table tr,
  .stats-table tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .setting-box {
    align-items: flex-start;
  }

  .admin-navbar {
    justify-content: center;
    text-align: center;
  }
}


/* ========== Tadwinat journal cards ========== */
body.tadwinat-page.tad-lock {
  overflow: hidden;
}

.tad-hero .hero-lead {
  margin-bottom: 18px;
}

.tad-compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #1aa089, var(--teal));
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(0, 77, 64, .28);
}

.tad-compose-btn:hover:not(:disabled) {
  background: var(--dark);
}

.tad-compose-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.tad-compose-btn--ghost {
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--teal);
  box-shadow: none;
}

.tad-compose-btn--ghost:hover:not(:disabled) {
  background: var(--teal);
  color: #fff;
}

.tad-wrap {
  padding-top: 28px;
}

.tad-toolbar {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.tad-toolbar-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--dark);
  font-weight: 800;
  border: 0;
  padding: 0;
  display: block;
}

.tad-count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.tad-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 268px;
  background: var(--card);
  border-radius: 18px;
  padding: 18px 16px 14px;
  box-shadow: 0 10px 26px rgba(0, 77, 64, .08);
  border: 1px solid rgba(0, 121, 107, .12);
  cursor: pointer;
  overflow: hidden;
  animation: rise .45s ease both;
  animation-delay: var(--delay, 0s);
  transition: transform .22s ease, box-shadow .22s ease;
}

.tad-card:hover,
.tad-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 77, 64, .16);
  outline: none;
}

.tad-card-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--teal-2), var(--dark));
}

.tad-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.tad-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #0f766e, #004d40);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}

.tad-card-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tad-card-meta strong {
  color: var(--dark);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tad-card-meta time,
#tadReaderDate {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tad-card-excerpt {
  margin: 0 0 14px;
  color: var(--verse);
  font-size: 14.5px;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 6.8em;
  flex: 1;
}

.tad-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.tad-read {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.tad-star {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff4c2, #ffd54f);
  color: #8a5a00;
  border: 1px solid #e0b42a;
  box-shadow: 0 2px 0 #d4a017, 0 6px 12px rgba(212, 160, 23, .22);
}

.tad-star:hover:not(:disabled) {
  background: #fff6cc;
  color: #8a6500;
  transform: none;
}

.tad-star.is-liked,
.tad-star:disabled.is-liked {
  background: linear-gradient(180deg, #ffd54f, #f5b400) !important;
  color: #5a3d00 !important;
  border-color: #e0a800;
  cursor: default;
}

.tad-star-svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.5));
}

.tad-star.is-liked .tad-star-svg {
  filter: drop-shadow(0 0 4px rgba(255, 193, 7, .7));
}

.tad-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 42px 16px;
  background: #fff;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 700;
}

.tad-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}

.tad-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.tad-modal[hidden] {
  display: none;
}

.tad-modal.is-open[hidden] {
  display: grid;
}

.tad-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 34, .55);
}

.tad-modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .28);
  border-top: 6px solid var(--teal);
}

.tad-modal-x {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #eef5f3;
  color: var(--dark);
  font-size: 22px;
  line-height: 1;
}

.tad-modal-x:hover:not(:disabled) {
  background: var(--dark);
  color: #fff;
}

.tad-reader-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tad-reader-head h2 {
  margin: 0;
  border: 0;
  padding: 0;
  display: block;
  font-size: 1.2rem;
  color: var(--dark);
}

.tad-reader-verse {
  font-family: "Amiri", "Cairo", serif;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  font-weight: 700;
  line-height: 2.25;
  color: var(--verse);
  text-align: center;
  white-space: pre-line;
  margin: 8px 0 18px;
}

.tad-reader-foot {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tad-compose-panel button[type="submit"] {
  width: 100%;
}

@media (max-width: 1100px) {
  .tad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .tad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tad-grid { grid-template-columns: 1fr; }
  .tad-card { min-height: 0; }
  .tad-toolbar { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
