/* CBT Reframe - Minimal RTL UI */
:root{
  --bg:#0b1220;
  --card:#101a2e;
  --muted:#93a4c7;
  --text:#e8eefc;
  --border:#20304f;
  --primary:#6ee7b7;
  --danger:#fb7185;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
  --radius:16px;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f6f7fb;
    --card:#ffffff;
    --muted:#55627a;
    --text:#0b1220;
    --border:#e5e7ef;
    --primary:#0ea5e9;
    --danger:#e11d48;
    --shadow: 0 10px 30px rgba(12, 18, 32, .10);
  }
}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
}
a{ color: inherit; }
.container{
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 0 16px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand img{ width:32px; height:32px; border-radius:10px; }
.brand h1{
  margin:0;
  font-size: 18px;
  letter-spacing:.2px;
}
.badge{
  font-size:12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
}
.row{ display:flex; gap:12px; flex-wrap:wrap; }
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card h2{
  margin:0 0 10px;
  font-size:16px;
}
.card p{ margin: 8px 0; color: var(--muted); line-height: 1.55; }
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:none;
  background: transparent;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  user-select:none;
}
.btn-primary{
  background: var(--primary);
  color: #07121f;
  font-weight: 700;
}
.btn-outline{
  border:1px solid var(--border);
}
.btn-danger{
  border:1px solid color-mix(in srgb, var(--danger) 60%, var(--border));
  color: var(--danger);
}
.btn:active{ transform: translateY(1px); }
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 820px){
  .grid-2{ grid-template-columns: 1fr 1fr; }
}
.field{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin: 10px 0 0;
}
label{
  font-size: 13px;
  color: var(--muted);
}
input[type="text"], textarea, select, input[type="password"], input[type="number"]{
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--border);
  background: color-mix(in srgb, var(--card) 92%, var(--bg));
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 15px;
  outline:none;
}
textarea{ min-height: 92px; resize: vertical; }
.small{ font-size: 12px; color: var(--muted); }
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  border:1px solid var(--border);
  padding:2px 6px;
  border-radius: 8px;
  color: var(--muted);
}
.hr{
  height:1px;
  background: var(--border);
  margin: 12px 0;
}
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
}
.item .meta{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.item .title{
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}
.pills{ display:flex; gap:6px; flex-wrap:wrap; margin-top: 8px; }
.pill{
  font-size:12px;
  padding: 4px 8px;
  border:1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
.footer-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}
.progress{
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 65%, var(--bg));
  overflow:hidden;
}
.progress > div{
  height:100%;
  background: var(--primary);
  width: 0%;
}
.toast{
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  max-width: 920px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  border:1px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display:none;
  z-index: 50;
}
.toast.show{ display:block; }
.canvas-wrap{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
}
canvas{ width: 100%; height: 220px; }
.nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.nav .btn{ padding: 8px 10px; }
