@import url(fonts/fonts.css);
:root {
  --bg: #f4f6f5; --card: #ffffff; --ink: #14201c; --muted: #5d6b66; --line: #e2e8e5;
  --brand: #0f6e63; --brand-2: #138a7c; --brand-soft: #e3f2ef; --on-brand: #fff;
  --red: #c2352b; --red-soft: #fbe9e7; --amber: #a86400; --amber-soft: #fff3df; --green: #1e8a4c; --green-soft: #e4f5ea;
  --shadow: 0 1px 2px rgba(10, 30, 25, .06), 0 4px 14px rgba(10, 30, 25, .06);
  --r: 14px; --nav: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1412; --card: #16201d; --ink: #e7efec; --muted: #9aaba5; --line: #25332f;
    --brand: #2fb3a2; --brand-2: #3cc9b7; --brand-soft: #173430; --on-brand: #04201c;
    --red: #ff7b6e; --red-soft: #3a1c19; --amber: #ffb347; --amber-soft: #3a2a10; --green: #5fd38f; --green-soft: #15301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1412; --card: #16201d; --ink: #e7efec; --muted: #9aaba5; --line: #25332f;
  --brand: #2fb3a2; --brand-2: #3cc9b7; --brand-soft: #173430; --on-brand: #04201c;
  --red: #ff7b6e; --red-soft: #3a1c19; --amber: #ffb347; --amber-soft: #3a2a10; --green: #5fd38f; --green-soft: #15301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 'Plex', system-ui, sans-serif; }
body { min-height: 100dvh; padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 12px); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }

header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
header.top h1 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
header.top .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }

main { max-width: 720px; margin: 0 auto; padding: 4px 16px 24px; }
h2 { font-size: 15px; margin: 22px 4px 8px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
h2 .n { background: var(--line); color: var(--ink); border-radius: 99px; padding: 0 8px; font-size: 12.5px; }
h2.red { color: var(--red); } h2.red .n { background: var(--red-soft); color: var(--red); }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin: 8px 0; }
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.task:first-child { border-top: 0; }
.task .chk { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; margin-top: 1px; cursor: pointer; display: grid; place-items: center; transition: .15s; padding: 0; }
.task .chk:hover { border-color: var(--green); background: var(--green-soft); }
.task.high .chk { border-color: var(--red); }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 500; overflow-wrap: anywhere; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.task .meta .late { color: var(--red); font-weight: 600; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task.done .chk { background: var(--green); border-color: var(--green); color: #fff; }
.task.pop { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); background: var(--green-soft); } 100% { transform: scale(1); } }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 500; }
.tag.red { background: var(--red-soft); color: var(--red); } .tag.amber { background: var(--amber-soft); color: var(--amber); } .tag.green { background: var(--green-soft); color: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 22px 12px; font-size: 14.5px; }

.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.hero .k { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; text-align: center; cursor: pointer; border: 0; }
.hero .k b { display: block; font-size: 24px; line-height: 1.2; }
.hero .k span { font-size: 12.5px; color: var(--muted); }
.hero .k.red b { color: var(--red); } .hero .k.green b { color: var(--green); }

.btn { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--brand); color: var(--on-brand); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.plain { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.red { background: var(--red-soft); color: var(--red); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; }
label.f { display: block; margin: 12px 0 4px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
input.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; min-height: 44px; outline: none; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.in { min-height: 96px; resize: vertical; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch small { display: block; color: var(--muted); font-size: 12.5px; }

nav.bar { position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(var(--nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
nav.bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500; position: relative; }
nav.bar a svg { width: 24px; height: 24px; }
nav.bar a.on { color: var(--brand); }
nav.bar a .dot { position: absolute; top: -2px; inset-inline-end: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; padding: 0 4px; }
nav.bar .mic { justify-self: center; width: 64px; height: 64px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--bg); background: linear-gradient(145deg, var(--brand-2), var(--brand)); color: var(--on-brand);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(15, 110, 99, .35); cursor: pointer; }
nav.bar .mic svg { width: 28px; height: 28px; }

/* لوحة التسجيل */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(5, 15, 12, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); width: 100%; max-width: 720px; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }
.sheet .handle { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: -6px auto 12px; }
.recbox { text-align: center; padding: 8px 0 4px; }
.recbtn { width: 116px; height: 116px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(145deg, var(--brand-2), var(--brand)); color: var(--on-brand); display: inline-grid; place-items: center; position: relative; margin: 10px 0; }
.recbtn svg { width: 44px; height: 44px; }
.recbtn.live { background: linear-gradient(145deg, #e0483c, #b3271d); }
.recbtn:not(.live) .ring { display: none; }
.recbtn .ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid rgba(224, 72, 60, .45); transform: scale(var(--lvl, 1)); transition: transform .08s linear; }
.timer { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; direction: ltr; }
.hint { color: var(--muted); font-size: 14px; }
.live-text { min-height: 48px; background: var(--bg); border-radius: 12px; padding: 10px 12px; text-align: start; margin-top: 10px; color: var(--ink); white-space: pre-wrap; }
.result .item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.result .item:first-child { border-top: 0; }
.result .item .ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--brand-soft); }
.result .item.done .ic { background: var(--green-soft); }
.result .item .grow { flex: 1; min-width: 0; }
.big-ok { font-size: 20px; font-weight: 700; color: var(--green); text-align: center; margin: 4px 0 10px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 18px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* الاجتماعات */
.meet-live { text-align: center; }
.meet-live .state { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 14px; }
.meet-live .state.paused { background: var(--amber-soft); color: var(--amber); }
.meet-live .state i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.meter { height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; margin: 14px 0; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--green)); transition: width .08s linear; }
.minutes { white-space: pre-wrap; }
details.tx summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: 6px 0; }
details.tx div { white-space: pre-wrap; font-size: 14.5px; color: var(--muted); max-height: 50vh; overflow: auto; }
audio { width: 100%; height: 40px; margin-top: 6px; }

.toast { position: fixed; inset-inline: 16px; bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 14px); z-index: 60; max-width: 520px; margin: 0 auto;
  background: #10201c; color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: up .2s; }
.toast .grow { flex: 1; }
.toast button { background: transparent; border: 0; color: #7fe3d3; font-weight: 700; cursor: pointer; }

.login { max-width: 400px; margin: 10vh auto 0; padding: 0 16px; }
.login .logo { width: 72px; height: 72px; border-radius: 20px; display: block; margin: 0 auto 10px; }
.login h1 { text-align: center; font-size: 22px; margin: 0; }
.login p.sub { text-align: center; color: var(--muted); margin: 4px 0 18px; }
.err { color: var(--red); font-size: 14px; margin-top: 8px; min-height: 1.2em; }
.note { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.note.info { background: var(--brand-soft); color: var(--brand); }
.reply-box { background: var(--bg); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; border: 1px dashed var(--line); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (min-width: 760px) { nav.bar { max-width: 720px; margin: 0 auto; border-radius: 18px 18px 0 0; border: 1px solid var(--line); } }
