:root {
  --ink: #1c1915;
  --muted: #6d6458;
  --paper: #f4efe6;
  --card: #fffdf8;
  --line: #e4d9c8;
  --green: #0e6b45;
  --green-dark: #0a5235;
  --bad: #8d2b2b;
  --ok: #0e6b45;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", "DejaVu Sans", Tahoma, sans-serif;
  line-height: 1.6;
}
a { color: var(--green-dark); }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: #17241c;
  color: #f4efe6;
}
.brand { color: inherit; font-weight: 700; text-decoration: none; font-size: 1.25rem; }
nav { display: flex; gap: 14px; align-items: center; }
nav a, button.link { color: #f4efe6; background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; }
main { width: min(980px, calc(100% - 28px)); margin: 24px auto 48px; }
h1 { margin: 0 0 12px; font-size: 1.7rem; }
h2 { margin: 0 0 8px; font-size: 1.2rem; }
h3 { margin: 18px 0 8px; font-size: 1rem; }
.card, .reveal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin: 0 0 16px;
}
.narrow { width: min(440px, 100%); margin-inline: auto; }
.muted, small { color: var(--muted); }
small { display: block; margin-top: 4px; }
label { display: block; margin: 12px 0; }
label span { display: block; font-weight: 700; }
input, select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
button, .button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: white;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
button.ghost { background: #efe7da; color: var(--ink); }
button.danger { background: var(--bad); }
.flash { padding: 10px 12px; border-radius: 10px; }
.flash.ok { background: #e5f4ec; }
.flash.bad { background: #fde8e8; color: var(--bad); }
.reveal { background: #fff6d8; }
.secret { font-family: ui-monospace, monospace; letter-spacing: 0.03em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.grid article { background: #f7f3eb; border-radius: 12px; padding: 12px; }
.grid strong { display: block; font-size: 1.3rem; }
.row, .actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }
.badge { background: #efe7da; border-radius: 999px; padding: 4px 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.periods { display: flex; gap: 8px; margin-bottom: 12px; }
.periods a { text-decoration: none; background: #efe7da; color: var(--ink); border-radius: 999px; padding: 4px 10px; }
.periods a.on { background: var(--green); color: white; }
.split { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.sticky { position: sticky; bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
ul.plain { margin: 0; padding-inline-start: 18px; }
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
}
