/* Study Quest — css/sabor.css (V7.9 sabor): the Sabor's hall window and the Sudbina Stone. Flat colour + texture, never gradients. */
.sb-win .win-body { padding: 10px 14px 12px; max-height: min(78vh, 680px); overflow-y: auto; font: 400 13px/1.45 var(--cx-font-body, Georgia, serif); color: var(--cx-text, #ebe4d6); }
.sb-win h4 { margin: 0 0 6px; padding-bottom: 3px; font: 700 12px/1.2 var(--cx-font-head, Cinzel, serif); letter-spacing: 0.05em; color: var(--cx-gold, #e3b562);
  border-bottom: 1px solid rgba(222, 190, 120, 0.25); }
.sb-win section { margin-top: 12px; }
.sb-win .lib-word, .sb-win .ot { color: #f0c977; border-bottom: 1px dotted rgba(240, 201, 119, 0.6); cursor: help; }
.sb-note { margin: 8px 0; font: italic 400 13.5px/1.4 var(--cx-font-body, Georgia, serif); color: var(--cx-text-dim, #aea89c); }
.sb-lead { margin: 6px 0 10px; }
.sb-dim { color: var(--cx-text-dim, #aea89c); font-size: 12px; }
.sb-msg { margin: 6px 0; padding: 5px 26px 5px 8px; position: relative; background: rgba(40, 70, 40, 0.45); border: 1px solid rgba(150, 200, 130, 0.35); border-radius: 3px; font-size: 12.5px; }
.sb-x { position: absolute; right: 4px; top: 2px; background: none; border: 0; color: inherit; font-size: 15px; cursor: pointer; }
.sb-win code { font: 11.5px/1 ui-monospace, Menlo, monospace; color: #d8c49a; }

/* the tabs */
.sb-tabs { display: flex; gap: 4px; margin-bottom: 4px; }
.sb-tabs button { flex: 1; padding: 5px 6px; font: 700 12.5px/1.2 var(--cx-font-head, Cinzel, serif); color: var(--cx-text-dim, #aea89c); cursor: pointer;
  background: #2a2119; border: 1px solid #4a3a28; border-bottom-width: 3px; border-radius: 3px 3px 0 0; }
.sb-tabs button.is-on { color: #f3d58a; background: #3b2e20; border-color: #8a6b3c; }
.sb-tabs button .lib-word, .sb-tabs button .ot { border-bottom: 0; color: inherit; }
.sb-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e0a43a; box-shadow: 0 0 0 1px #3a2a10; vertical-align: 1px; }

/* buttons */
.sb-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sb-btn { padding: 4px 11px; font: 700 12.5px/1.3 var(--cx-font-head, Cinzel, serif); color: #f1e3c0; cursor: pointer; background: #4a3720; border: 1px solid #8a6b3c;
  border-bottom-width: 2px; border-radius: 3px; }
.sb-btn:hover { background: #5a4428; }
.sb-btn:disabled { opacity: 0.5; cursor: default; }
.sb-btn.is-pri { background: #6b4e1f; border-color: #c49a52; }
.sb-btn.is-yes { background: #2f4a2a; border-color: #6f9a5c; }
.sb-btn.is-no { background: #4d2a24; border-color: #a0604f; }

/* the head */
.sb-head { display: flex; gap: 12px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid rgba(222, 190, 120, 0.2); }
.sb-mini { width: 40px; height: 50px; flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45)); }
.sb-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb-name b { font: 700 16px/1.2 var(--cx-font-head, Cinzel, serif); color: #f3d58a; }
.sb-name span { font-size: 12px; color: var(--cx-text-dim, #aea89c); }
.sb-name span b { font: inherit; color: var(--cx-text, #ebe4d6); }
.sb-title { margin: 10px 0 0; padding: 6px 8px; background: #3a2a4a; border: 1px solid #7a5f9a; border-radius: 3px; }
.sb-title b { color: #e6cdf7; }

/* the week */
.sb-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; counter-reset: wk; }
.sb-week li { padding: 5px 6px; background: #2a2119; border: 1px solid #4a3a28; border-radius: 3px; display: flex; flex-direction: column; gap: 1px; }
.sb-week li b { font: 700 11.5px/1.2 var(--cx-font-head, Cinzel, serif); color: var(--cx-text-dim, #aea89c); }
.sb-week li span { font-size: 11px; color: var(--cx-text-dim, #aea89c); }
.sb-week li.is-past { opacity: 0.6; }
.sb-week li.is-now { background: #3b2e20; border-color: #c49a52; box-shadow: inset 0 -3px 0 #c49a52; }
.sb-week li.is-now b { color: #f3d58a; }

/* the council and the chips */
.sb-council ul, .sb-list, .sb-table, .sb-ballot, .sb-things, .sb-drawn { list-style: none; margin: 0; padding: 0; }
.sb-council li { display: flex; align-items: baseline; gap: 6px; padding: 3px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.sb-council li.is-you b { color: #9cc8ec; }
.sb-chip { font-style: normal; font-size: 10.5px; padding: 0 6px; border: 1px solid #6b5636; border-radius: 8px; color: #d8c49a; white-space: nowrap; }
.sb-plasht { display: inline-block; width: 11px; height: 14px; flex: none; align-self: center; background: #6a3f8a; border: 1px solid #2a1838;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 50% 85%, 0 100%); }
.sb-kamen { display: inline-block; width: 10px; height: 8px; margin-right: 3px; border-radius: 50% 45% 50% 40%; background: #9b968a; box-shadow: inset -2px -1px 0 #6d695f; vertical-align: 0; }
.sb-keep { white-space: nowrap; }
.sb-youtag { font-size: 10.5px; padding: 0 5px; background: #2d4a63; color: #cfe6f7; border-radius: 2px; }

/* you */
.sb-ok { color: #a9d68f; }
.sb-bars { display: grid; gap: 4px; margin: 6px 0; }
.sb-bars label { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; align-items: center; gap: 8px; font-size: 12px; color: var(--cx-text-dim, #aea89c); }
.sb-bar { display: block; height: 9px; background: #1f1812; border: 1px solid #4a3a28; border-radius: 2px; overflow: hidden; }
.sb-bar i { display: block; height: 100%; background: #c49a52; }
.sb-bar.is-cards i { background: #7fa6c4; }
.sb-bar.is-yes { background: #6a3a30; }
.sb-bar.is-yes i { background: #6f9a5c; }

/* the ballot and the table */
.sb-measure { padding: 8px 9px; margin-bottom: 6px; background: #2a2119; border: 1px solid #4a3a28; border-left-width: 4px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.sb-k-festival { border-left-color: #c9a24a; }
.sb-k-boss { border-left-color: #a0604f; }
.sb-k-bonus { border-left-color: #6f9a5c; }
.sb-k-law { border-left-color: #7fa6c4; }
.sb-k-free { border-left-color: #b49ad1; }
.sb-mtitle { display: flex; gap: 6px; align-items: baseline; }
.sb-mtitle b { font: 700 13.5px/1.3 var(--cx-font-head, Cinzel, serif); }
.sb-measure p { margin: 3px 0 5px; }
.sb-mrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sb-mrow .sb-bar { flex: 1; min-width: 100px; }
.sb-votebtns { display: flex; gap: 6px; }
.sb-kind { font-style: normal; padding: 0 5px; font: 700 10px/16px var(--cx-font-body, Georgia, serif); text-transform: uppercase; letter-spacing: 0.05em; border-radius: 2px;
  color: #1f160d; background: #d9b24c; white-space: nowrap; }
.sb-cast { color: #a9d68f; font-style: italic; }
.sb-result { font-weight: 700; }
.sb-result.is-passed { color: #a9d68f; }
.sb-result.is-failed, .sb-result.is-outvoted, .sb-result.is-no-quorum { color: #d99a86; }
.sb-tally { font-size: 12px; }
.sb-table li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sb-table li b { flex: 1 1 200px; }
.sb-state { font-size: 11.5px; padding: 0 5px; border-radius: 2px; background: #3d3426; color: #d8c49a; }
.sb-state.is-ok { background: #2f4a2a; color: #cfe8c0; }
.sb-state.is-no { background: #4d2a24; color: #f1cbbf; }
.sb-form { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-form select, .sb-form input { min-width: 0; flex: 1 1 160px; padding: 4px 6px; color: var(--cx-text, #ebe4d6); background: #1f1812; border: 1px solid #5a4630; border-radius: 3px; font: inherit; }
.sb-list li { padding: 3px 0; }
.sb-things li { padding: 2px 0; }

/* the Rachun */
.sb-rachun { padding: 8px 10px; margin-bottom: 8px; background: #efe3c6; color: #3a2a17; border: 1px solid #b49a6a; border-radius: 2px; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25); }
.sb-rachun h4 { margin-top: 8px; color: #6b4a1a; border-bottom-color: rgba(107, 74, 26, 0.3); }
.sb-rachun .sb-dim { color: #6e5d44; }
.sb-rachun .sb-result.is-passed { color: #2f6a24; }
.sb-rachun .sb-result.is-failed, .sb-rachun .sb-result.is-outvoted, .sb-rachun .sb-result.is-no-quorum { color: #8a3a28; }

/* the check */
.sb-check { margin-top: 8px; padding: 6px 9px; border-radius: 3px; font-size: 12.5px; }
.sb-check p { margin: 2px 0; }
.sb-check.is-ok { background: #24361f; border: 1px solid #6f9a5c; }
.sb-check.is-bad { background: #3d211c; border: 1px solid #a0604f; }

/* the Sudbina Stone drawing */
.sb-show-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sb-stone { width: 100%; height: auto; display: block; }
.sb-carve { font: 700 15px var(--cx-font-head, Cinzel, serif); letter-spacing: 0.3em; fill: #cfc6b0; }
.sb-col { font: 700 11px var(--cx-font-body, Georgia, serif); letter-spacing: 0.03em; }
.sb-more { font: 10px var(--cx-font-body, Georgia, serif); fill: #2c2a25; }
.sb-slot { fill: #3f3c35; stroke: #2a2823; stroke-width: 1; }
.sb-slot.is-rest { fill: #55524b; stroke-dasharray: 2 2; }
.sb-slot.is-lit { stroke: #1d1a14; }
.sb-slot.is-new { animation: sb-light 0.9s ease-out; }
.sb-you { fill: #9cc8ec; stroke: #1d2a36; }
.sb-ball { fill: #1d1b17; stroke: #000; }
.sb-ball.is-white { fill: #efe8d6; stroke: #5b5340; }
.sb-ball.is-drop { animation: sb-drop 0.8s cubic-bezier(.5, 0, .9, .6); transform-box: fill-box; }
@keyframes sb-drop { from { transform: translateY(-240px); } to { transform: translateY(0); } }
@keyframes sb-light { 0% { fill: #fff6d8; } 100% { } }
.sb-drawn li { padding: 4px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sb-drawn li.is-new { animation: sb-in 0.6s ease-out; }
@keyframes sb-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.sb-show.is-still .sb-ball, .sb-show.is-still .sb-slot, .sb-show.is-still li { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .sb-ball.is-drop, .sb-slot.is-new, .sb-drawn li.is-new { animation: none !important; } }
body.reduced-motion .sb-ball.is-drop, body.reduced-motion .sb-slot.is-new, body.reduced-motion .sb-drawn li.is-new { animation: none !important; }

@media (max-width: 660px) {
  .sb-show-row { grid-template-columns: 1fr; }
  .sb-week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-bars label { grid-template-columns: 1fr; gap: 2px; }
}
