/* =================================================================
   web-ext.css · extension styles: scrollbars, entry depth, tools hub,
   holidays, admin, challenge/weak-word cards. Palette: Widhura amber.
   ================================================================= */

/* ---------- custom scrollbars in the artifact palette ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--amber) 55%, var(--line)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 999px; border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }
.sidenav::-webkit-scrollbar { width: 5px; }
.sidenav::-webkit-scrollbar-thumb { border: 0; background: #4A4033; }
.sidenav::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }

/* ---------- entry modal depth ---------- */
.enextra { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.enrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.enrow > .muted.tiny { min-width: 64px; flex: none; }
.enrow code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: .85rem; }
.enextra .chipwrap { display: flex; flex-wrap: wrap; gap: 6px; }
.enextra .chipword { padding: 4px 10px; font-size: .78rem; }
#enDef { margin: 0; font-size: .92rem; }
#enOrigin { margin: 0; }

/* ---------- tools hub ---------- */
.tl-tabs { display: flex; width: 100%; margin-bottom: 14px; }
.tl-tabs button { flex: 1 1 auto; white-space: nowrap; }
.tabpanel { display: flex; flex-direction: column; gap: 14px; }
.tabpanel .card h3 { margin-top: 0; }
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.toolnote { font-size: .75rem; color: var(--muted); border-left: 3px solid var(--amber); padding: 4px 10px; background: var(--amber-soft); border-radius: 0 8px 8px 0; }
.srcbadge { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; border-radius: 6px; padding: 3px 8px; background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber-deep); }
.srcbadge.off { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.outbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 44px; white-space: pre-wrap; word-break: break-word; font-size: .9rem; }

/* ---------- holidays ---------- */
.hd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hd-year { display: flex; align-items: center; gap: 8px; }
.hd-year b { font-size: 1.3rem; min-width: 64px; text-align: center; }
.hd-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.hd-tag { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.hd-tag.is-on { color: var(--ink); border-color: var(--amber); background: var(--amber-soft); }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hd-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.hd-month h4 { margin: 0 0 8px; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-deep); }
.hd-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.hd-dow { font-size: .6rem; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0; }
.hd-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .72rem; border-radius: 8px; color: var(--ink); }
.hd-day.blank { visibility: hidden; }
.hd-day.today { outline: 2px solid var(--amber); font-weight: 800; }
.hd-day.has { cursor: pointer; font-weight: 700; }
.hd-day.has:hover { background: var(--amber-soft); }
.hd-dots { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.hd-dot { width: 4px; height: 4px; border-radius: 50%; }
.hd-dot.P { background: var(--green); } .hd-dot.B { background: #2F7FD1; }
.hd-dot.M { background: var(--amber-deep); } .hd-dot.PD { background: #8B5CF6; }
.hd-list { display: flex; flex-direction: column; gap: 8px; }
.hd-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.hd-date { flex: none; width: 58px; text-align: center; border-right: 1px solid var(--line); padding-right: 10px; }
.hd-date b { display: block; font-size: 1.25rem; color: var(--amber-deep); }
.hd-date span { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hd-names { flex: 1; min-width: 0; }
.hd-names b { display: block; font-size: .9rem; }
.hd-names small { color: var(--muted); font-size: .76rem; }
.hd-badges { display: flex; gap: 4px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.hd-b { font-size: .6rem; font-weight: 800; letter-spacing: .05em; border-radius: 6px; padding: 3px 6px; color: #fff; }
.hd-b.P { background: var(--green); } .hd-b.B { background: #2F7FD1; }
.hd-b.M { background: var(--amber-deep); } .hd-b.PD { background: #8B5CF6; }
.hd-row.next { border-color: var(--amber); background: linear-gradient(140deg, var(--amber-soft), var(--surface) 70%); }
.hd-countdown { font-size: .7rem; font-weight: 700; color: var(--amber-deep); white-space: nowrap; }

/* ---------- admin ---------- */
.ad-banner { display: flex; align-items: center; gap: 10px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: 12px; padding: 10px 14px; font-size: .8rem; margin-bottom: 14px; }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ad-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.ad-stat b { display: block; font-size: 1.6rem; color: var(--amber-deep); }
.ad-stat span { font-size: .74rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ad-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 560px; }
.ad-table th { text-align: left; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ad-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table tr:hover td { background: color-mix(in srgb, var(--amber) 6%, transparent); }
.ad-pill { font-size: .64rem; font-weight: 800; border-radius: 6px; padding: 3px 7px; letter-spacing: .04em; }
.ad-pill.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.ad-pill.warn { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber-deep); }
.ad-pill.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

/* ---------- learn: daily challenge + weak words ---------- */
.chalrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chalbar { flex: 1; min-width: 120px; height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.chalbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-deep)); border-radius: 999px; transition: width .4s; }
.weakrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.weakrow:last-child { border-bottom: 0; }
.weakrow b { font-size: 1rem; }
.weakrow .muted { flex: 1; font-size: .78rem; }
.weaklaps { font-size: .66rem; font-weight: 800; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-radius: 6px; padding: 3px 7px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tl-tabs button { padding: 7px 9px; font-size: .74rem; }
  .hd-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .hd-row { flex-wrap: wrap; }
  .hd-badges { justify-content: flex-start; }
  .ad-stats { grid-template-columns: repeat(2, 1fr); }
  .toolgrid { grid-template-columns: 1fr; }
}