/* Sacred Gita manuscript study identity. Layout and input geometry remain in app.css. */
:root {
  --ink: #241b26;
  --muted: #5f4c42;
  --line: #d5bd8e;
  --paper: #fff8e8;
  --paper-deep: #f6e8cb;
  --panel: #fffaf0;
  --teal: #9b4a10;
  --teal-soft: #fae6c7;
  --gold: #9b681f;
  --shadow: 0 14px 36px rgba(12, 20, 46, .2);
}

body {
  background-color: #17213d;
  background-image: linear-gradient(rgba(13, 20, 42, .36), rgba(24, 27, 48, .72)),
    url('assets/art/gita-study-pavilion.png');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.sidebar, .workspace, .bottom-panel, .journey-panel, .sheet {
  background: rgba(255, 250, 239, .97);
  border-color: rgba(141, 95, 34, .45);
  box-shadow: var(--shadow);
}

.sidebar, .workspace, .journey-panel, .sheet, .preview-pane {
  border-radius: 12px;
}

.brand h1, .topbar h2, .journey-title, .gita-verse-heading {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: .01em;
}

.mark {
  background: #20294a;
  color: #f8d990;
  border: 1px solid #b88a42;
  box-shadow: inset 0 0 0 3px rgba(248, 217, 144, .12);
}

.tool-btn, .pill-btn, .verse-btn, .chip {
  border-color: #b9945d;
  background: #fffaf0;
  color: #292337;
}

.tool-btn:not(.primary):not(.warn):hover,
.pill-btn:hover, .verse-btn:hover, .chip:hover {
  border-color: #8a561b;
  background: #f7e9cd;
}

.tool-btn.primary {
  color: #fff;
  background: #87400e;
  border-color: #713208;
}
.tool-btn.primary:hover { background: #6f320a; }
.actions .tool-btn:not(.primary):not(.warn) {
  background: #20294a;
  border-color: #806332;
  color: #fffaf0;
}
.actions .tool-btn:not(.primary):not(.warn):hover {
  background: #303c60;
  border-color: #c39344;
}
.actions .tool-btn:disabled { background: #67636a; color: #fff; }
.verse-btn[aria-pressed="true"], .chip[aria-pressed="true"] {
  background: #f8e3bd;
  border-color: #8a561b;
}

.preview-pane {
  background: rgba(255, 249, 235, .98);
  border-color: #b9945d;
}
.preview-pane-frame { border-color: #8c704c; }
.page { box-shadow: 0 2px 0 #d3b885, 0 10px 24px rgba(43, 29, 19, .12); }

/* The chapter and verse cards are separate rows: never stretch either into the writing area. */
.workspace { grid-template-rows: none; grid-auto-rows: max-content; align-content: start; }
.sidebar-pills-4 { display: flex; flex-wrap: wrap; }
.sidebar-pills-4 > .pill-btn { flex: 1 1 auto; min-height: 44px; padding: 8px 10px; white-space: nowrap; }

.gita-chapter-card {
  margin: 16px 0 0;
  padding: 16px 20px;
  color: #fff8e7;
  background: linear-gradient(125deg, #18213c, #303a5a);
  border: 1px solid #b9904d;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(210, 170, 99, .14);
}
.gita-chapter-card[hidden] { display: none; }
.gita-chapter-count { color: #f5dcad; font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.gita-chapter-name { margin-top: 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.25rem; }
.gita-chapter-sanskrit { margin-top: 3px; color: #f5dcad; font-size: .95rem; }

.gita-verse-introduction {
  margin: 14px 0 18px;
  padding: 13px 16px;
  border: 1px solid #d4ba88;
  border-left: 4px solid #a6671d;
  border-radius: 8px;
  background: #fff9ed;
  color: #302523;
}
.gita-verse-introduction[hidden] { display: none; }
.gita-verse-heading { font-size: 1rem; font-weight: 700; }
.gita-verse-english { margin-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .gita-verse-introduction { padding: 11px 13px; margin: 10px 0 14px; }
}

@media (forced-colors: active) {
  .gita-verse-introduction { border-color: CanvasText; }
  .tool-btn.primary { forced-color-adjust: auto; }
}

/* The chapter reader presents the same licensed verses used on the writing page. */
.gita-reader { width:min(860px, 94vw); max-width:none; max-height:90vh; padding:0; border:1px solid #b88a42; border-radius:14px; background:#fff9ed; color:#241b26; box-shadow:0 20px 70px rgba(0,0,0,.4); }
.gita-reader::backdrop { background:rgba(9,14,31,.78); }
.gita-reader-inner { padding:clamp(18px, 4vw, 42px); }
.gita-reader-header { display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid #ddc69b; padding-bottom:16px; }
.gita-reader-header h2 { font-family:Georgia,serif; margin:3px 0 0; font-size:clamp(1.3rem,3vw,1.8rem); }
.gita-reader-eyebrow { color:#835a20; font-size:.8rem; font-weight:700; margin:0; }
.gita-reader-verses { list-style:none; padding:0; margin:0; }
.gita-reader-verses li { padding:22px 0; border-bottom:1px solid #eadbbd; }
.gita-reader-verses h3 { color:#835a20; font-size:.9rem; margin:0 0 10px; }
.gita-reader-verses p { margin:.45em 0; line-height:1.6; }
.gita-reader-sanskrit { font-size:1.25rem; font-weight:600; }
.gita-reader-transliteration { color:#5e5348; font-style:italic; }
.gita-reader-translation { color:#282029; }
@media (max-width:480px) { .gita-reader-header { align-items:flex-start; flex-direction:column; } }

.gita-reader { box-sizing:border-box; overflow-x:hidden; overflow-y:auto; }
.gita-reader-verses p { overflow-wrap:anywhere; }

/* Keep the selected ink color readable against its pale highlight. */
.chip[aria-pressed="true"] { color:#241b26; }

.gita-reader-practice { display:inline-block; min-height:44px; margin-top:10px; padding:8px 17px; border:1px solid #9b681f; border-radius:8px; background:#f7e5c1; color:#241b26; font:inherit; font-weight:700; cursor:pointer; }
.gita-reader-practice:hover { background:#edd6aa; }
.gita-reader-practice:focus-visible { outline:3px solid #9b4a10; outline-offset:2px; }

/* Full study workspace. Scoped to its new root so the existing writer keeps its layout. */
.web-study { box-sizing:border-box; min-height:100vh; min-height:100dvh; padding:env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(18px,env(safe-area-inset-left)); color:#241b26; background:linear-gradient(155deg,rgba(16,25,51,.88),rgba(34,34,54,.93)),url('assets/art/gita-study-pavilion.png') center top/cover fixed; --shadow:0 8px 28px rgba(7,12,26,.23); }
.web-study[hidden],.web-study [hidden] { display:none !important; }
.web-study .study-topbar { max-width:1220px; margin:0 auto; min-height:78px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid rgba(236,206,151,.38); color:#fff8e7; }
.web-study .study-brand { display:flex; align-items:center; gap:13px; }
.web-study .study-brand h1 { margin:0; color:#fff8e7; font:600 1.25rem Georgia,'Times New Roman',serif; }
.web-study .study-mark { display:grid; place-items:center; width:44px; height:44px; color:#f8d990; border:1px solid #b88a42; border-radius:50%; font-size:1.45rem; }
.web-study .study-eyebrow { margin:0 0 5px; color:#8b5f20; font-size:.72rem; font-weight:800; letter-spacing:.12em; }
.web-study .study-topbar .study-eyebrow,.web-study .study-welcome-row .study-eyebrow { color:#f3dba9; }
.web-study .study-top-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.web-study .study-action { display:inline-flex; min-height:44px; align-items:center; justify-content:center; gap:7px; padding:9px 15px; border:1px solid #b9945d; border-radius:9px; background:#fffaf0; color:#292337; font:inherit; font-size:.95rem; font-weight:600; text-decoration:none; cursor:pointer; }
.web-study .study-action:hover { background:#f7e9cd; border-color:#8a561b; }
.web-study .study-action:focus-visible,.web-study .study-word:focus-visible { outline:3px solid #1975b9; outline-offset:3px; }
.web-study .study-action-primary { background:#87400e; border-color:#713208; color:#fff; }
.web-study .study-action-primary:hover { background:#6f320a; color:#fff; }
.web-study .study-home,.web-study .study-reader-view { max-width:1220px; margin:0 auto; padding:clamp(22px,4vw,48px) 0 32px; }
.web-study .study-welcome-row { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; padding:clamp(22px,4vw,42px); border:1px solid #b9904d; border-radius:18px; color:#fff8e7; background:linear-gradient(120deg,rgba(23,33,60,.97),rgba(44,53,81,.9)); box-shadow:var(--shadow); }
.web-study .study-welcome-row .study-help { color:#f4e8d0; }
.web-study .study-welcome-row h2 { margin:0; font:600 clamp(1.65rem,4vw,2.65rem) Georgia,'Times New Roman',serif; }
.web-study .study-intro { max-width:650px; margin:12px 0 0; color:#f4e8d0; font-size:1.03rem; line-height:1.6; }
.web-study .study-start-actions { display:flex; flex-shrink:0; flex-wrap:wrap; gap:9px; }
.web-study .study-status { min-height:1.5em; margin:12px 2px; color:#fff8e7; }
.web-study .study-status[data-error="true"] { color:#ffd2c9; }
.web-study .study-tools { margin-top:20px; padding:clamp(17px,3vw,26px); border:1px solid rgba(185,148,93,.65); border-radius:15px; background:rgba(255,250,240,.97); box-shadow:var(--shadow); }
.web-study .study-search-label { display:block; margin-bottom:8px; font-weight:750; }
.web-study .study-search-row { display:flex; flex-wrap:wrap; gap:8px; }
.web-study .study-search-row input { flex:1 1 260px; min-width:0; min-height:46px; padding:10px 13px; border:1px solid #9f8a6b; border-radius:9px; color:#241b26; background:white; font:inherit; }
.web-study .study-section-heading { display:flex; align-items:baseline; justify-content:space-between; gap:15px; margin-bottom:13px; }
.web-study .study-section-heading h2 { margin:0; font:600 clamp(1.15rem,2.3vw,1.55rem) Georgia,'Times New Roman',serif; }
.web-study .study-section-heading span { color:#65594c; font-size:.9rem; }
.web-study .study-results,.web-study .study-bookmarks { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:9px; margin-top:12px; }
.web-study .study-results { list-style:none; padding:0; }
.web-study .study-results > li { min-width:0; }
.web-study .study-result,.web-study .study-bookmark-item { display:block; width:100%; padding:13px 15px; border:1px solid #d2bb8f; border-radius:10px; background:#fffdf7; color:#241b26; text-align:left; cursor:pointer; }
.web-study .study-result:hover,.web-study .study-bookmark-item:hover { background:#f8edda; }
.web-study .study-result strong,.web-study .study-result span,.web-study .study-bookmark-item strong,.web-study .study-bookmark-item span { display:block; }
.web-study .study-result span,.web-study .study-bookmark-item span { margin-top:5px; color:#55493e; line-height:1.45; }
.web-study .study-result-sa { font-size:1.07rem; }
.web-study .study-chapters { margin-top:26px; }
.web-study .study-chapter-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,275px),1fr)); gap:12px; }
.web-study .study-chapter-card { display:grid; grid-template-columns:auto 1fr; gap:3px 12px; align-content:start; min-height:130px; padding:17px; border:1px solid #b9904d; border-radius:13px; background:rgba(255,250,240,.97); color:#241b26; text-align:left; box-shadow:var(--shadow); cursor:pointer; }
.web-study .study-chapter-card:hover { transform:translateY(-1px); background:#fffdf7; }
.web-study .study-chapter-number { grid-row:span 3; display:grid; place-items:center; width:38px; height:38px; border:1px solid #b9904d; border-radius:50%; background:#20294a; color:#f8d990; font:700 1rem Georgia,serif; }
.web-study .study-chapter-name { font:700 1rem Georgia,'Times New Roman',serif; }
.web-study .study-chapter-original { color:#765923; font-size:1rem; }
.web-study .study-chapter-meta,.web-study .study-chapter-progress { color:#65594c; font-size:.86rem; }
.web-study .study-footer { display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; padding:18px 4px; color:#fff8e7; font-size:.87rem; }
.web-study .study-footer a { color:#ffdf9c; }
.web-study .study-reader-nav { position:sticky; z-index:2; top:0; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px max(2px,env(safe-area-inset-left)) 13px; background:rgba(24,32,57,.97); }
.web-study .study-reader-location { margin-left:auto; color:#fff8e7; font-weight:700; }
.web-study .study-reference-label { color:#fff8e7; font-weight:700; }
.web-study .study-reference { min-height:44px; width:100px; padding:8px 10px; border:1px solid #b9945d; border-radius:8px; background:#fffaf0; color:#241b26; font:inherit; }
.web-study .study-reader-status { max-width:920px; margin:0 auto 12px; padding:11px 14px; border-radius:8px; background:#fff2d5; color:#34261a; }
.web-study .study-reader-status[data-error="true"] { border:1px solid #a72d1b; background:#fff0ed; color:#761c11; }
.web-study .study-passage { max-width:920px; margin:0 auto; padding:clamp(19px,4vw,42px); border:1px solid #b9904d; border-radius:16px; background:#fffaf0; box-shadow:var(--shadow); }
.web-study .study-passage-heading { text-align:center; padding-bottom:18px; border-bottom:1px solid #ddc69b; }
.web-study .study-passage-heading h2 { margin:4px 0 7px; font:600 clamp(1.5rem,3.4vw,2.2rem) Georgia,'Times New Roman',serif; }
.web-study .study-chapter-sanskrit { color:#765923; font-size:1.25rem; }
.web-study .study-layers { display:flex; flex-wrap:wrap; justify-content:center; gap:12px 20px; padding:18px 0 10px; color:#40352c; }
.web-study .study-layers label { display:flex; align-items:center; gap:7px; min-height:42px; cursor:pointer; }
.web-study .study-layers input { width:19px; height:19px; accent-color:#87400e; }
.web-study .study-verse-sanskrit,.web-study .study-verse-transliteration,.web-study .study-verse-meaning { margin:14px 0; padding:clamp(15px,3.2vw,25px); border-radius:10px; line-height:1.75; overflow-wrap:anywhere; }
.web-study .study-verse-sanskrit { background:#f3e4c7; color:#251d2a; font-size:clamp(1.35rem,3.5vw,2rem); line-height:1.8; text-align:center; }
.web-study .study-verse-transliteration { background:#f8f0e1; color:#574a3e; font-size:clamp(1rem,2vw,1.16rem); font-style:italic; }
.web-study .study-verse-meaning { background:#fffdf7; border-left:4px solid #a6671d; color:#302523; font-size:clamp(1rem,2vw,1.15rem); }
.web-study .study-word-section { margin-top:24px; padding-top:18px; border-top:1px solid #ddc69b; }
.web-study .study-word-section h3 { margin:0; font:600 1.25rem Georgia,'Times New Roman',serif; }
.web-study .study-help { color:#65594c; line-height:1.5; }
.web-study .study-word-list { display:flex; flex-wrap:wrap; gap:8px; }
.web-study .study-word { min-height:44px; padding:8px 12px; border:1px solid #b9945d; border-radius:8px; background:#fffdf7; color:#241b26; font-size:1.1rem; cursor:pointer; }
.web-study .study-word:hover,.web-study .study-word[aria-pressed="true"] { background:#f5e1bb; }
.web-study .study-word-detail { margin-top:16px; padding:16px; border:1px solid #d2bb8f; border-radius:10px; background:#fffdf7; }
.web-study .study-word-detail h4 { margin:0 0 7px; font-size:1.1rem; }
.web-study .study-occurrences { display:grid; gap:8px; margin-top:12px; }
.web-study .study-occurrence { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:11px; border:1px solid #e1cfaa; border-radius:8px; }
.web-study .study-occurrence-text { min-width:0; flex:1 1 260px; line-height:1.5; overflow-wrap:anywhere; }
.web-study .study-occurrence-text strong { display:block; }
.web-study .study-practice-row { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:26px; }
@media(max-width:700px) {
  .web-study { padding-left:max(14px,env(safe-area-inset-left)); padding-right:max(14px,env(safe-area-inset-right)); }
  .web-study .study-topbar { align-items:flex-start; flex-direction:column; padding:15px 0; }
  .web-study .study-top-actions { width:100%; }
  .web-study .study-top-actions .study-action { flex:1; }
  .web-study .study-welcome-row { align-items:stretch; flex-direction:column; }
  .web-study .study-start-actions .study-action { flex:1 1 145px; }
  .web-study .study-reader-location { flex-basis:100%; margin-left:0; text-align:center; }
  .web-study .study-reader-nav .study-action { flex:1 1 28%; }
  .web-study .study-reference-label { flex:1 1 100%; }
  .web-study .study-verse-sanskrit { font-size:clamp(1.32rem,5vw,1.8rem); }
}
