:root{
  --bg: #f8f5f0;
  --text: #222;
  --muted: #8b6f47;
  --surface: #ffffff;
  --card-shadow: 0 6px 24px rgba(11,12,14,0.06);
}
[data-theme="dark"]{
  --bg: #072029; /* softer dark blue-green */
  --text: #dbeef6; /* slightly less bright than pure white */
  --muted: #d0ad6a; /* warm accent in dark */
  --surface: #0c2730; /* lifted surface so it's not pure black */
  --card-shadow: 0 6px 18px rgba(2,8,12,0.46);
}

html,body{height:100%;}
body{
  background:var(--bg) !important;
  color:var(--text) !important;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  margin:0;  -webkit-font-smoothing:antialiased;
}

.app-header{
  display:flex; align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto 0 auto;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 99999;
    background: var(--bg);
    padding: 18px;
}
.app-title{font-size:1.2rem; font-weight:600; display:flex; gap:12px; align-items:center}
.app-title .hebrew{font-family: heilig, serif; font-weight:600; font-size:1rem; opacity:0.95}

.theme-toggle{
  background:transparent; border:1px solid rgba(0,0,0,0.06); color:var(--text);
  padding:8px 12px; border-radius:999px; cursor:pointer; font-size:1rem;
  box-shadow: var(--card-shadow);
}
.theme-toggle[data-state="dark"]{ background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }

/* gentle surface overrides to ensure readable cards */
.words-wrap, table{ background:transparent !important; box-shadow: none !important; }
.words-wrap .section-header a { color:var(--muted); text-decoration:none }
th{ background:var(--muted) !important; color: white !important }
.modal-content{ background:var(--surface) !important; color:var(--text) !important }

/* responsive page max width */

/* Cards list layout */
.words-wrap{ max-width:920px; margin:18px auto; display:flex; flex-direction:column; gap:14px; padding:8px; }
.section-header{ padding:6px 8px 0 8px; background:transparent; color:var(--muted); font-weight:700; text-align:right; direction:rtl; font-family:keren, heilig; font-size:1.05rem }
        .card{box-sizing: border-box; background:var(--surface); border-radius:12px; padding:14px 16px; box-shadow:var(--card-shadow); display:inline-flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; border:1px solid rgba(0,0,0,0.06); transition: transform 160ms ease, box-shadow 160ms ease; width:100%; flex-wrap:wrap; }
        .card:focus{ outline: 2px solid rgba(200,150,80,0.12); outline-offset:2px }
        .card:hover{ transform: translateY(-2px); box-shadow: 0 8px 20px rgba(3,6,12,0.10); }
        .card-left{ display:flex; flex-direction:column; gap:0; min-width:0; flex:1 1 auto; }
        .card-right{ min-width:120px; margin-left:12px; text-align:right; }
        .card .eng{ font-weight:600; color:var(--text); font-size:1.05rem; white-space:nowrap; text-overflow:ellipsis; overflow:hidden }
        .card .ydd{ text-align:right; direction:rtl; font-family:keren, heilig; color:var(--text); font-size:1.18rem }
        .card .meta{ display:flex; gap:8px; color:var(--muted); font-size:0.88rem; align-items:center }

        @media(max-width:720px){
          .card{ display:flex; flex-direction:column; align-items:stretch; }
          .card-right{ margin-left:0; margin-top:6px; }
        }
.card:focus{ outline: 2px solid rgba(200,150,80,0.18); outline-offset:2px }
.card:hover{ transform: translateY(-3px); box-shadow: 0 10px 22px rgba(3,6,12,0.12); }
.card .eng{ font-weight:600; color:var(--text); font-size:1.06rem }
.card .ydd{ text-align:right; direction:rtl; font-family:keren, heilig; color:var(--text); font-size:1.22rem }
.card .meta{ display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:0.9rem }
.no-results{ text-align:center; color:var(--muted); font-size:1.05rem; padding:20px }

/* Search input and sticky header subtle polish */
#search{ background:var(--surface) !important; color:var(--text) !important; border:1px solid rgba(0,0,0,0.06) !important; box-shadow: none !important; }
#search::placeholder{ color: rgba(0,0,0,0.28); }

#stickyHeader{ background: var(--surface) !important; color: var(--muted) !important; box-shadow: none !important; border: 1px solid rgba(0,0,0,0.05); }

/* Adjustments when dark theme active for subtler contrasts */
[data-theme="dark"] .card{ border-color: rgba(255,255,255,0.04); }
[data-theme="dark"] #search{ border-color: rgba(255,255,255,0.04) !important; }
[data-theme="dark"] .words-wrap .section-header a{ color:var(--muted); opacity:0.95 }
[data-theme="dark"] #search::placeholder{ color: rgba(255,255,255,0.22); }


