/* ===== dantocsanchay.com — green theme ===== */
:root {
  --green-950: #052e16;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --gold:      #e9b949;
  --gold-dark: #c7952a;
  --red:       #b91c1c;
  --ink:       #12201a;
  --ink-2:     #3d4f45;
  --muted:     #6b7c72;
  --line:      #e3ebe5;
  --bg:        #f6faf7;
  --card:      #ffffff;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(5,46,22,.06), 0 6px 20px rgba(5,46,22,.06);
  --shadow-lg: 0 12px 40px rgba(5,46,22,.14);
  --serif: "Noto Serif", Georgia, serif;
  --sans:  "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--green-800); text-decoration: none; }
a:hover { color: var(--green-600); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
code { background: var(--green-50); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(820px, 100% - 32px); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--green-950); color: #b7d7c2; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar a:hover { color: var(--gold); }

.site-header { background: var(--green-900); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand img { border-radius: 12px; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.35rem; letter-spacing: .2px; }
.brand small { display: block; color: #a7d3b5; font-size: .78rem; }

.search { flex: 1; max-width: 420px; margin-left: auto; display: flex; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; transition: background .2s; }
.search:focus-within { background: rgba(255,255,255,.18); border-color: var(--gold); }
.search input { flex: 1; background: none; border: 0; color: #fff; padding: 9px 16px; font: inherit; outline: none; }
.search input::placeholder { color: #a7d3b5; }
.search button { background: none; border: 0; color: #fff; padding: 0 14px; cursor: pointer; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; font-size: 1.2rem; padding: 4px 10px; cursor: pointer; }

.main-nav { background: var(--green-800); border-top: 1px solid rgba(255,255,255,.08); }
.nav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.main-nav a { color: #e3f5e9; padding: 11px 15px; font-weight: 500; font-size: .93rem; white-space: nowrap; border-bottom: 3px solid transparent; transition: .15s; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.main-nav a.active { color: #fff; border-bottom-color: var(--gold); }
.main-nav .nav-voice { margin-left: auto; color: var(--gold); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font: 600 .92rem var(--sans); cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); color: #fff; box-shadow: 0 4px 14px rgba(21,128,61,.3); }
.btn-gold { background: var(--gold); color: var(--green-950); }
.btn-gold:hover { background: #f3c95e; color: var(--green-950); }
.btn-light { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn-light:hover { border-color: var(--green-600); color: var(--green-700); }
.btn-danger { background: #fff; color: var(--red); border-color: #f3d0d0; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Alerts ---------- */
.alert { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid; background: #fff; box-shadow: var(--shadow); }
.alert-success { border-color: var(--green-600); }
.alert-info { border-color: var(--gold); background: #fffbeb; }
.alert-error { border-color: var(--red); background: #fef2f2; color: #7f1d1d; }

/* ---------- Covers ---------- */
.cover { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cover-ph { display: grid; place-items: center; background:
    repeating-linear-gradient(45deg, rgba(233,185,73,.16) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, var(--green-800), var(--green-950)); }
.cover-ph svg { width: 22%; max-width: 72px; min-width: 28px; height: auto; opacity: .9; }

/* ---------- Badges & meta ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--green-700); margin-bottom: 6px; }
.badge:hover { color: var(--gold-dark); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.meta span + span::before { content: "•"; margin-right: 14px; opacity: .5; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.65fr 1fr; gap: 24px; margin: 28px 0 8px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 440px; box-shadow: var(--shadow-lg); }
.hero-media { position: absolute; inset: 0; }
.hero-main:hover .cover { transform: scale(1.04); }
.hero-overlay { position: absolute; inset: auto 0 0 0; padding: 32px; color: #fff; background: linear-gradient(transparent, rgba(5,46,22,.55) 30%, rgba(5,46,22,.95)); }
.hero-overlay .badge { background: var(--gold); color: var(--green-950); padding: 3px 10px; border-radius: 999px; }
.hero-overlay h1 { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.25rem); margin: 8px 0 10px; }
.hero-overlay h1 a { color: #fff; }
.hero-overlay p { color: #d6eadc; margin: 0 0 12px; max-width: 640px; }
.hero-overlay .meta { color: #b7d7c2; }
.hero-main .cover-ph { place-items: start center; padding-top: 12%; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side .row-item { flex: 1; background: var(--card); padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Row item ---------- */
.row-item { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.row-media { aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; display: block; }
.row-item:hover .cover { transform: scale(1.06); }
.row-item h4 { font-size: .98rem; margin: 0 0 4px; font-weight: 600; }
.row-item h4 a { color: var(--ink); }
.row-item h4 a:hover { color: var(--green-700); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr 330px; gap: 32px; margin: 24px 0 56px; align-items: start; }
.content { min-width: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-family: var(--serif); font-size: 1.35rem; border-bottom: 2px solid var(--line); margin: 28px 0 18px; }
.section-title span { border-bottom: 3px solid var(--green-700); padding-bottom: 8px; margin-bottom: -2px; }
.see-all { font-family: var(--sans); font-size: .85rem; font-weight: 600; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card:hover .cover { transform: scale(1.05); }
.card-media { aspect-ratio: 16/10; overflow: hidden; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.08rem; font-weight: 700; margin: 0 0 8px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--green-700); }
.card p { color: var(--ink-2); font-size: .9rem; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; }

.cat-block-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.cat-block-list { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 140px; }
.widget { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget-title { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 14px; }
.widget-voice { background: linear-gradient(160deg, var(--green-800), var(--green-950)); color: #fff; }
.widget-voice .widget-title { color: var(--gold); }
.widget-voice .muted { color: #a7d3b5; }
.word-of-day { position: relative; padding: 16px; background: rgba(255,255,255,.07); border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.1); }
.wod-phrase { font-family: var(--serif); font-size: 1.5rem; margin: 8px 50px 4px 0; }
.wod-meaning { color: #c8e6d1; font-size: .92rem; }
.word-of-day .play-btn { position: absolute; right: 14px; top: 50%; translate: 0 -50%; }
.widget-actions { display: flex; gap: 8px; margin-top: 14px; }
.widget-actions .btn { flex: 1; }
.popular { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.popular li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.popular li:last-child { border: 0; }
.popular .num { font-family: var(--serif); font-size: 1.5rem; color: var(--green-100); -webkit-text-stroke: 1px var(--green-600); line-height: 1; min-width: 22px; }
.popular a { color: var(--ink); font-weight: 500; font-size: .93rem; }
.widget-cta { background: var(--green-50); border: 1px dashed var(--green-500); box-shadow: none; }
.widget-cta h3 { font-family: var(--serif); font-size: 1.1rem; }
.widget-cta p { font-size: .9rem; color: var(--ink-2); }

.chip { display: inline-block; background: var(--gold); color: var(--green-950); font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.chip-light { background: var(--green-50); color: var(--green-800); }

/* ---------- Play button ---------- */
.play-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--gold); color: var(--green-950); font-size: 1rem; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 4px 14px rgba(233,185,73,.4); transition: transform .15s; }
.play-btn:hover { transform: scale(1.08); }
.play-btn.playing { background: var(--green-500); color: #fff; animation: pulse 1.2s infinite; }
.play-sm { width: 32px; height: 32px; font-size: .75rem; box-shadow: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }

/* ---------- Article ---------- */
.article { background: var(--card); border-radius: var(--radius); padding: clamp(20px, 4vw, 44px); box-shadow: var(--shadow); min-width: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.article-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
.article-meta { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); margin: 16px 0 22px; }
.article-meta .btn { margin-left: auto; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 700; }
.lead { font-size: 1.15rem; color: var(--ink-2); font-weight: 500; }
.article-cover { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.prose { font-size: 1.08rem; line-height: 1.8; }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-family: var(--serif); font-size: 1.5rem; margin: 1.6em 0 .6em; color: var(--green-900); }
.prose blockquote { margin: 1.5em 0; padding: 14px 22px; border-left: 4px solid var(--gold); background: #fffbeb; font-style: italic; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.share span { font-weight: 600; color: var(--muted); }

/* ---------- Page head / empty ---------- */
.page-head { padding: 30px 0 10px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 4px 0; }
.page-head-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--green-600); }
.eyebrow-light { color: var(--gold); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty-hero { text-align: center; padding: 80px 20px; margin: 30px 0; background: linear-gradient(160deg, var(--green-800), var(--green-950)); color: #fff; border-radius: var(--radius); }
.empty-hero h1 { font-family: var(--serif); font-size: 2.2rem; }
.empty-hero p { color: #c8e6d1; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; }
.pagination .current { background: var(--green-700); color: #fff; border-color: var(--green-700); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-card { background: var(--card); padding: clamp(20px, 4vw, 34px); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 56px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea {
  font: 400 1rem var(--sans); color: var(--ink); padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfdfc; transition: border .15s, box-shadow .15s; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(22,163,74,.12); background: #fff; }
.form textarea { resize: vertical; line-height: 1.6; }
.form input[type=file] { font-size: .88rem; }
.input-lg { font-size: 1.2rem !important; font-weight: 600 !important; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 2fr 1fr 2fr; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.check { flex-direction: row !important; align-items: flex-start; font-weight: 500 !important; gap: 10px !important; }
.check input { margin-top: 4px; accent-color: var(--green-700); width: 18px; height: 18px; flex-shrink: 0; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px 18px; margin: 0; }
.fieldset legend { font-weight: 700; color: var(--green-800); padding: 0 6px; }
.cover-preview img { max-height: 220px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; }

.auth-card { max-width: 440px; margin: 48px auto 64px; background: var(--card); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow-lg); border-top: 5px solid var(--green-700); }
.auth-card h1 { font-family: var(--serif); }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .92rem; }

/* ---------- Tables / admin ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 30px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--green-50); padding: 12px 14px; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline { display: inline; }
.status { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f1f5f2; color: var(--ink-2); }
.status-pending { background: #fef3c7; color: #92400e; }
.status-published { background: var(--green-100); color: var(--green-800); }
.status-rejected { background: #fee2e2; color: #991b1b; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 10px 0 20px; }
.admin-stats a { background: var(--card); padding: 18px 22px; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); border: 2px solid transparent; }
.admin-stats a.active { border-color: var(--green-600); }
.admin-stats strong { display: block; font-size: 2rem; font-family: var(--serif); color: var(--green-700); }
.admin-stats span { color: var(--muted); font-size: .88rem; }

.tabs { display: flex; gap: 6px; margin: 16px 0 20px; flex-wrap: wrap; }
.tabs a { padding: 8px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.tabs a.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }

/* ---------- Voice library ---------- */
.voice-hero { position: relative; overflow: hidden; background: radial-gradient(ellipse at 80% 0%, var(--green-700), var(--green-950) 65%); color: #fff; padding: 56px 0 90px; }
.voice-hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; position: relative; z-index: 1; }
.voice-hero h1 { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3rem); margin: 8px 0 14px; }
.voice-hero p { color: #c8e6d1; font-size: 1.08rem; max-width: 560px; margin: 0 0 22px; }
.voice-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.voice-stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 18px 10px; text-align: center; backdrop-filter: blur(6px); }
.voice-stats strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--gold); }
.voice-stats span { font-size: .82rem; color: #c8e6d1; }
.wave { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; display: flex; align-items: flex-end; gap: 4px; padding: 0 8px; opacity: .25; }
.wave i { flex: 1; height: var(--h); background: var(--gold); border-radius: 4px 4px 0 0; animation: wave 2.4s ease-in-out infinite; animation-delay: calc(var(--h) * -0.04s); transform-origin: bottom; }
@keyframes wave { 0%,100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }

.voice-filter { display: flex; gap: 10px; margin: -28px 0 0; position: relative; z-index: 2; background: #fff; padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.voice-filter input, .voice-filter select { font: inherit; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfdfc; }
.voice-filter input { flex: 1; min-width: 0; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 56px; }
.word-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--green-600); }
.word-head { display: flex; gap: 14px; align-items: center; }
.word-head h3 { font-family: var(--serif); font-size: 1.3rem; margin: 0; }
.word-meaning { margin: 2px 0 0; color: var(--ink-2); }
.word-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.word-note { font-size: .88rem; color: var(--muted); margin: 0; font-style: italic; }
.rec-list { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.rec-list li { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: var(--ink-2); }
.add-rec { font-size: .86rem; font-weight: 600; margin-top: auto; }

/* Recorder */
.recorder { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; background: linear-gradient(160deg, var(--green-50), #fff); border: 1.5px solid var(--green-100); border-radius: var(--radius); padding: 22px; }
.recorder .rec-file, .recorder .hint { grid-column: 1 / -1; }
.rec-btn { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; background: #fff; box-shadow: 0 6px 24px rgba(185,28,28,.25), 0 0 0 2px #fecaca; cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.rec-btn:hover { transform: scale(1.05); }
.rec-dot { width: 46px; height: 46px; border-radius: 50%; background: var(--red); transition: border-radius .2s, width .2s, height .2s; }
.recorder.is-recording .rec-dot { width: 30px; height: 30px; border-radius: 6px; }
.recorder.is-recording .rec-btn { animation: recpulse 1.4s infinite; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(185,28,28,.45), 0 0 0 2px #fecaca; } 50% { box-shadow: 0 0 0 16px rgba(185,28,28,0), 0 0 0 2px #fecaca; } }
.rec-status { font-weight: 600; color: var(--ink-2); }
.rec-timer { font: 700 1.8rem var(--sans); font-variant-numeric: tabular-nums; color: var(--green-800); }
.rec-viz { width: 100%; height: 50px; display: block; }
.recorder audio { width: 100%; margin-top: 6px; }
.word-preview { background: var(--green-50); border-radius: var(--radius-sm); padding: 16px 20px; }
.word-preview h2 { font-family: var(--serif); margin: 8px 0 2px; }
.word-preview p { margin: 0; color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-950); color: #c8e6d1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 48px 0 32px; }
.site-footer h4 { color: var(--gold); font-size: .95rem; text-transform: uppercase; letter-spacing: 1px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #e3f5e9; }
.site-footer a:hover { color: var(--gold); }
.muted-light { color: #93b9a1; font-size: .92rem; margin-top: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; font-size: .82rem; color: #7fa38c; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-side .row-item { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .brand small { display: none; }
  .brand { min-width: 0; gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 1.1rem; }
  .header-inner { flex-wrap: wrap; }
  .header-actions .btn-gold { display: none; }

  .search { order: 3; max-width: none; flex-basis: 100%; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { padding: 7px 12px; font-size: .82rem; }
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .nav-inner { flex-direction: column; }
  .main-nav .nav-voice { margin-left: 0; }
  .hero-main { min-height: 360px; }
  .hero-overlay { padding: 20px; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-side .row-item { grid-template-columns: 100px 1fr; }
  .grid-3, .cat-block-grid, .form-row, .form-row-3, .footer-grid, .voice-hero-inner { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .voice-filter { flex-wrap: wrap; }
  .recorder { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .topbar-inner > span:first-child { display: none; }
}
.nav-write { display: none; }
@media (max-width: 760px) { .main-nav .nav-write { display: block; color: var(--gold); } }

/* ---------- Rich-text editor (write.php) ---------- */
.editor-field { display: flex; flex-direction: column; gap: 6px; }
.editor-label { font-weight: 600; font-size: .9rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.editor-status { font-weight: 500; color: var(--green-700); font-size: .82rem; }
.editor-status.is-error { color: var(--red); }
.editor-wrap { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border .15s, box-shadow .15s; }
.editor-wrap:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.editor-wrap .ql-toolbar.ql-snow { position: sticky; top: 118px; z-index: 5; background: var(--green-50); border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 8px 10px; font-family: var(--sans); }
.editor-wrap .ql-container.ql-snow { border: 0; font: 400 1.05rem/1.75 var(--sans); }
.editor-wrap .ql-editor { min-height: 420px; padding: 20px 24px; color: var(--ink); }
.editor-wrap .ql-editor.ql-blank::before { color: #9aaba1; font-style: normal; left: 24px; }
.editor-wrap .ql-editor h2 { font-family: var(--serif); font-size: 1.45rem; color: var(--green-900); margin: 1em 0 .4em; }
.editor-wrap .ql-editor h3 { font-size: 1.15rem; margin: .9em 0 .3em; }
.editor-wrap .ql-editor p { margin-bottom: .7em; }
.editor-wrap .ql-editor blockquote { border-left: 4px solid var(--gold); background: #fffbeb; padding: 8px 16px; margin: 1em 0; }
.editor-wrap .ql-editor img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; }
.editor-wrap .ql-snow .ql-stroke { stroke: var(--green-800); }
.editor-wrap .ql-snow .ql-fill { fill: var(--green-800); }
.editor-wrap .ql-snow .ql-picker { color: var(--green-800); }
.editor-wrap .ql-snow button:hover .ql-stroke, .editor-wrap .ql-snow button.ql-active .ql-stroke { stroke: var(--gold-dark); }
.editor-wrap .ql-snow button:hover .ql-fill, .editor-wrap .ql-snow button.ql-active .ql-fill { fill: var(--gold-dark); }
.editor-wrap .ql-snow .ql-picker-label[data-value="2"]::before, .editor-wrap .ql-snow .ql-picker-item[data-value="2"]::before { content: "Tiêu đề lớn" !important; }
.editor-wrap .ql-snow .ql-picker-label[data-value="3"]::before, .editor-wrap .ql-snow .ql-picker-item[data-value="3"]::before { content: "Tiêu đề nhỏ" !important; }
.editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-label::before, .editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Đoạn văn"; }
.editor-wrap .ql-snow .ql-picker.ql-header { width: 112px; }
.editor-wrap .ql-snow .ql-tooltip { z-index: 10; border-radius: 8px; box-shadow: var(--shadow-lg); }
.editor-wrap .ql-snow .ql-tooltip::before { content: "Liên kết:"; }
.editor-wrap .ql-snow .ql-tooltip[data-mode=link]::before { content: "Nhập liên kết:"; }
.editor-wrap .ql-snow .ql-tooltip a.ql-action::after { content: "Sửa"; }
.editor-wrap .ql-snow .ql-tooltip a.ql-remove::before { content: "Gỡ"; }
.editor-wrap .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Lưu"; }
.draft-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.draft-note { align-self: center; }

/* ---------- Rich content on article pages ---------- */
.prose h3 { font-size: 1.2rem; margin: 1.4em 0 .5em; color: var(--green-900); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1.4em auto; display: block; box-shadow: var(--shadow); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--green-700); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose pre { background: var(--green-50); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }
.prose .ql-indent-1 { padding-left: 2em; } .prose .ql-indent-2 { padding-left: 4em; } .prose .ql-indent-3 { padding-left: 6em; }
@media (max-width: 760px) {
  .editor-wrap .ql-toolbar.ql-snow { top: 0; }
  .editor-wrap .ql-editor { min-height: 300px; padding: 16px; }
}

/* ---------- Comments ---------- */
.comments { margin-top: 36px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.comment-form-main { flex: 1; }
.comment-form textarea { width: 100%; font: 400 .98rem/1.6 var(--sans); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfdfc; resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(22,163,74,.12); background: #fff; }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-login { background: var(--green-50); border: 1px dashed var(--green-500); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; font-size: .92rem; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.comment:target { background: #fffbeb; border-radius: var(--radius-sm); padding-inline: 10px; }
.comment .avatar, .comment-form .avatar { width: 38px; height: 38px; flex-shrink: 0; font-size: .9rem; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-body { color: var(--ink-2); line-height: 1.65; overflow-wrap: anywhere; }
.comment-del { margin-left: auto; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.link-btn:hover { color: var(--red); text-decoration: underline; }
.comment-cell { max-width: 420px; font-size: .88rem; }

/* ---------- Stars ---------- */
.stars-ro { font-size: .82rem; white-space: nowrap; }
.stars-on { color: var(--gold); letter-spacing: 1px; }
.stars-off { color: #d5ded8; letter-spacing: 1px; }
.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rate-stars { display: inline-flex; }
.rate-stars .star { background: none; border: 0; padding: 0 2px; font-size: 1.5rem; line-height: 1; color: #d5ded8; cursor: pointer; transition: transform .1s, color .1s; }
.rate-stars .star.on { color: var(--gold); }
.rate-stars .star:hover { transform: scale(1.15); }
.rate-stars .star.hover { color: var(--gold-dark); }
.rate.saving { opacity: .6; pointer-events: none; }
.rate-msg { font-size: .78rem; color: var(--green-700); }
.rate-msg.is-error { color: var(--red); }

/* ---------- Word detail page (tu.php) ---------- */
.word-hero { display: flex; gap: 22px; align-items: center; background: linear-gradient(160deg, var(--green-800), var(--green-950)); color: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); }
.word-hero h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 4px; }
.word-hero-meaning { font-size: 1.15rem; color: #c8e6d1; margin: 0; }
.word-hero .word-note { color: #a7d3b5; margin-top: 10px; }
.play-btn.play-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.rec-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rec-card { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); flex-wrap: wrap; }
.rec-card-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.rec-card-rate { margin-left: auto; }
.related-words { list-style: none; padding: 0; margin: 0; }
.related-words li { border-bottom: 1px solid var(--line); }
.related-words li:last-child { border: 0; }
.related-words a { display: flex; flex-direction: column; padding: 10px 0; color: var(--ink); }
.related-words strong { font-family: var(--serif); }
.related-words span { font-size: .85rem; color: var(--muted); }
.word-card h3 a { color: var(--ink); }
.word-card h3 a:hover { color: var(--green-700); }
.rec-list li { flex-wrap: wrap; }
.rec-who { flex: 1; min-width: 0; }
.word-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; font-size: .84rem; font-weight: 600; }
.word-foot .add-rec { margin-top: 0; }
@media (max-width: 760px) {
  .word-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .rec-card-rate { margin-left: 0; width: 100%; }
}

/* ---------- Legal pages ---------- */
.legal { margin: 30px 0 56px; }
.legal-note { background: var(--green-50); border-left: 4px solid var(--green-600); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 20px; margin: 18px 0 26px; line-height: 1.7; }
.legal .prose { font-size: 1rem; line-height: 1.75; }
.legal .prose h2 { font-size: 1.25rem; margin-top: 1.8em; }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-bottom a { color: #b7d7c2; }
.footer-bottom a:hover { color: var(--gold); }
.check span a { text-decoration: underline; }

/* ---------- Submissions (gui-bai.php, admin inbox) ---------- */
.sent-box { text-align: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 48px 28px; margin: 40px 0 64px; }
.sent-box h1 { font-family: var(--serif); }
.sent-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 2.2rem; display: grid; place-items: center; }
.admin-stats-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-3eq { grid-template-columns: repeat(3, 1fr); }
.row-new td { background: #fffbeb; }
.row-new td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.sub-view { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); margin-bottom: 56px; }
.sub-view h2 { font-family: var(--serif); font-size: 1.7rem; margin: 10px 0; }
.sub-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--ink-2); font-size: .9rem; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sub-body { padding: 20px 0; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.sub-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.sub-files img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
@media (max-width: 760px) { .admin-stats-3, .form-row-3eq { grid-template-columns: 1fr; } }

/* Voice section in gui-bai.php + inbox audio */
.voice-box { border: 1.5px solid var(--green-100); border-radius: var(--radius); padding: 0 18px; background: linear-gradient(160deg, var(--green-50), #fff); }
.voice-box[open] { padding-bottom: 18px; }
.voice-box summary { cursor: pointer; font-weight: 700; color: var(--green-800); padding: 14px 0; list-style: none; }
.voice-box summary::-webkit-details-marker { display: none; }
.voice-box summary::after { content: "＋"; float: right; color: var(--green-600); }
.voice-box[open] summary::after { content: "－"; }
.voice-box > * + * { margin-top: 14px; }
.voice-box .recorder { background: #fff; }
.sub-audio { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--radius-sm); padding: 16px 18px; margin: 4px 0 20px; }
.sub-audio-head { font-weight: 700; color: var(--green-800); margin-bottom: 10px; }
.sub-audio audio { width: 100%; margin-bottom: 10px; }
.sub-audio dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: .92rem; }
.sub-audio dt { color: var(--muted); }
.sub-audio dd { margin: 0; }
