/* Shared style for the simple site: a small sidebar on the LEFT, one plain content column. */
:root {
  --bg: #fafaf8; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6b66; --line: #e4e3de;
  --accent: #1f5f8b; --accent-ink: #ffffff; --ok: #2e7d32; --bad: #b3261e; --soft: #f1f0ec;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Heebo", "Arial Hebrew", Arial, sans-serif;
}
a { color: var(--accent); }

/* layout: force LTR on the frame so the sidebar sits on the left, content stays RTL */
.frame {
  display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; direction: ltr;
  background: linear-gradient(to right, var(--panel) 209px, var(--line) 209px, var(--line) 210px, var(--bg) 210px);
}
.side {
  background: var(--panel);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; direction: rtl;
}
.brand { display: block; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; padding: 4px 10px 14px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); direction: ltr; text-align: right; }
.nav a {
  display: block; text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 15px;
}
.nav a small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); direction: ltr; text-align: right; }
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--accent); color: var(--accent-ink); }
.nav a.on small { color: rgba(255,255,255,.8); }
.side .acct { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 10px 0; font-size: 13.5px; color: var(--muted); }
.side .acct b { color: var(--ink); display: block; word-break: break-all; }
.side .acct button { margin-top: 6px; }

main { direction: rtl; padding: 36px 40px 60px; max-width: 860px; width: 100%; }
h1 { font-size: 28px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 28px 0 10px; }
.sub { color: var(--muted); margin: 0 0 24px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button, .btn {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border-radius: 8px;
  padding: 9px 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
button.rec { background: var(--bad); border-color: var(--bad); }

textarea, input, select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 4px; }

.out { white-space: pre-wrap; min-height: 90px; background: var(--soft); border-radius: 8px; padding: 12px 14px; }
.out:empty::before { content: attr(data-empty); color: var(--muted); }
.status { color: var(--muted); font-size: 14px; min-height: 22px; }
.status.err { color: var(--bad); }
.free { font-size: 13px; color: var(--muted); }

.diff .rep { background: #e3f1e4; color: var(--ok); border-radius: 4px; padding: 0 2px; }
.diff .ins { background: #e3f1e4; color: var(--ok); border-radius: 4px; padding: 0 2px; }
.diff .del { text-decoration: line-through; color: var(--bad); }

/* saved list */
.saved { list-style: none; padding: 0; margin: 0; }
.saved li { border-top: 1px solid var(--line); padding: 12px 0; }
.saved li:first-child { border-top: 0; }
.saved .meta { font-size: 12.5px; color: var(--muted); }
.saved .txt { margin: 4px 0 8px; white-space: pre-wrap; max-height: 7.5em; overflow: hidden; }
.saved .row button { padding: 5px 12px; font-size: 13.5px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); margin-left: 6px; }

/* tool cards on the landing page */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tools a { text-decoration: none; color: var(--ink); }
.tools .card { height: 100%; }
.tools .card:hover { border-color: var(--accent); }
.tools h3 { margin: 0 0 4px; font-size: 18px; }
.tools p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* sign-in modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal .box { direction: rtl; background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 380px; }
.modal h3 { margin: 0 0 6px; }
.modal .msg { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.modal .err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }
.modal .linkbtn { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 500; font-size: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 99px; font-size: 14.5px; z-index: 60; direction: rtl; }

@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; background: var(--bg); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .brand { padding: 4px 8px; width: 100%; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a small { display: none; }
  .side .acct { margin-top: 0; border-top: 0; padding: 6px 8px; width: 100%; }
  main { padding: 22px 16px 48px; }
}
