:root {
  --bg: #07100f; --panel: #0f191b; --panel-2: #142124; --panel-3: #1a2a2e; --line: #22343a; --line-2: #2d454c;
  --fg: #eef6f7; --muted: #8fa3a9; --tq: #16c4d2; --tq-deep: #00a8b5; --mg: #e91e63; --yl: #ffc400;
  --s-new: #b48cff; --s-assigned: #4f8cff; --s-in_progress: #16c4d2; --s-review: #ffc400; --s-changes: #ff5c8a;
  --s-approved: #2fd38a; --s-published: #8fe3a8; --s-cancelled: #6b7b80;
  --f-ar: "IBM Plex Sans Arabic", system-ui, sans-serif; --f-sport: "Saira", "IBM Plex Sans Arabic", sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-ar); font-size: 15px; line-height: 1.6; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tq); }
:focus-visible { outline: 2px solid var(--tq); outline-offset: 2px; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(60% 50% at 85% 10%, rgba(22,196,210,.16), transparent 70%), radial-gradient(50% 40% at 10% 90%, rgba(233,30,99,.12), transparent 70%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 26px; display: grid; gap: 16px; text-align: center; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-card p { margin: 0; color: var(--muted); }
.bars { display: flex; gap: 5px; justify-content: center; }
.bars i { width: 26px; height: 5px; border-radius: 3px; display: block; }
.bars i:nth-child(1) { background: var(--tq); } .bars i:nth-child(2) { background: var(--mg); } .bars i:nth-child(3) { background: var(--yl); }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
.dev-box { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; text-align: start; }
.dev-box b { font-size: 13px; color: var(--yl); }
.err { color: var(--s-changes); font-size: 14px; }

/* ---------- shell */
.top { position: sticky; top: 0; z-index: 20; background: rgba(7,16,15,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1480px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand .bars { gap: 3px; } .brand .bars i { width: 14px; height: 4px; }
.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--panel-3); color: var(--fg); }
.top-act { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--f-sport); }
.me { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 4px 3px 12px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; overflow: hidden; flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.me-name { font-size: 13px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--tq); }
.btn.primary { background: var(--tq); border-color: var(--tq); color: #021416; font-weight: 700; }
.btn.ok { background: var(--s-approved); border-color: var(--s-approved); color: #03140b; }
.btn.warn { color: var(--s-changes); border-color: var(--s-changes); background: transparent; }
.btn.amber { color: var(--yl); border-color: var(--yl); background: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: default; }
main { max-width: 1480px; margin: 0 auto; padding: 16px; }

/* ---------- stats + filters */
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 8px 14px; display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--f-sport); font-size: 20px; color: var(--fg); }
.stat.click { cursor: pointer; } .stat.on { border-color: var(--tq); }
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; margin-bottom: 14px; }
.f-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--panel-3); color: var(--fg); border-color: var(--tq); }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.inp, select.inp { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 14px; min-width: 0; }
.inp.search { flex: 1 1 200px; }
.f-lab { font-size: 12px; color: var(--muted); }
.f-sep { width: 1px; height: 22px; background: var(--line); }

/* ---------- table */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--panel-2); }
.tbl tr.unread td:first-child { box-shadow: inset -3px 0 0 var(--mg); }
.t-title { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thumb { width: 40px; height: 50px; border-radius: 6px; object-fit: cover; background: var(--panel-3); display: block; }
.thumb.ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.ev { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-sport); font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.muted { color: var(--muted); }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mg); display: inline-block; }
.plats { display: flex; gap: 4px; flex-wrap: wrap; }
.plat { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); color: #c7d4d7; white-space: nowrap; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.cards { display: none; }

/* ---------- board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100dvh - 230px); }
.col-h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.col-h .n { margin-inline-start: auto; color: var(--muted); font-family: var(--f-sport); }
.col-b { padding: 10px; display: grid; gap: 8px; overflow-y: auto; align-content: start; }
.kc { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; cursor: pointer; text-align: start; width: 100%; }
.kc:hover { border-color: var(--line-2); }
.kc.unread { border-inline-start: 3px solid var(--mg); }
.kc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kc-t { font-weight: 600; font-size: 14px; line-height: 1.45; }
.kc-img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; background: var(--panel-3); }
.kc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ---------- calendar */
.cal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-h h2 { margin: 0; font-size: 18px; min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 110px; padding: 6px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.day.out { opacity: .35; }
.day.today { border-color: var(--tq); }
.day .d { font-family: var(--f-sport); font-size: 13px; color: var(--muted); }
.ce { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--panel-3); cursor: pointer; border: 0; text-align: start; width: 100%; min-width: 0; }
.ce span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce.unread { box-shadow: inset -2px 0 0 var(--mg); }

/* ---------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }
.drawer { position: fixed; z-index: 41; top: 0; bottom: 0; inset-inline-start: 0; width: min(1080px, 100%); background: var(--bg); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; }
.dr-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dr-h h2 { margin: 0; font-size: 18px; flex: 1 1 200px; min-width: 0; }
.dr-b { overflow-y: auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.sec h3 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fld { display: grid; gap: 4px; min-width: 0; }
.fld label, .fld .lab { font-size: 12px; color: var(--muted); }
.fld textarea { min-height: 110px; resize: vertical; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; }
.fld .val { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
.fld .val.empty-v { color: var(--muted); }
.copy { margin-inline-start: auto; }
.plat-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.side { display: grid; gap: 14px; position: sticky; top: 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.note-in { width: 100%; min-height: 70px; resize: vertical; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px; }
.tl { display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
.tl-top { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.tl-top time { color: var(--muted); font-size: 12px; }
.tl-note { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border-radius: 8px; padding: 6px 10px; }
.links-l { display: grid; gap: 6px; }
.link-row { display: flex; gap: 6px; align-items: center; }
.link-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }

/* files */
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.drop.over { border-color: var(--tq); background: rgba(22,196,210,.06); }
.up-opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.ver { display: grid; gap: 10px; }
.ver-h { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.fcard .pv { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: #000; cursor: zoom-in; border: 0; padding: 0; }
.fcard .pv.story { aspect-ratio: 9/16; }
.fcard .pv img, .fcard .pv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard .pv.doc { display: grid; place-items: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.fmeta { padding: 6px 8px; display: flex; gap: 4px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.fmeta .nm { flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); direction: ltr; text-align: right; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); }
.prog { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; width: 100%; }
.prog i { display: block; height: 100%; background: var(--tq); width: 0; transition: width .2s; }

/* lightbox with zoom/pan */
.lb { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #cfd8da; font-size: 14px; flex-wrap: wrap; background: rgba(0,0,0,.6); z-index: 2; }
.lb-bar .cap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.lb-zoom { font-family: var(--f-sport); min-width: 54px; text-align: center; direction: ltr; }
.lb-stage { position: relative; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.lb-stage.drag { cursor: grabbing; }
.lb-stage img, .lb-stage video { position: absolute; top: 0; left: 0; transform-origin: 0 0; max-width: none; will-change: transform; -webkit-user-drag: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #000; font-size: 24px; z-index: 3; display: grid; place-items: center; }
.lb-nav.prev { right: 12px; } .lb-nav.next { left: 12px; }
.lb-thumbs { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; justify-content: center; background: rgba(0,0,0,.6); }
.lb-thumbs button { width: 44px; height: 55px; padding: 0; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: #111; flex: none; }
.lb-thumbs button[aria-current="true"] { border-color: var(--tq); }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #8fa3a9; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; }

/* phone mock in preview */
.mock-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* team */
.team-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.perm { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.chk-row { display: flex; gap: 12px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--line-2); padding: 10px 18px; border-radius: 12px; z-index: 80; font-size: 14px; max-width: calc(100% - 32px); }
.toast.bad { border-color: var(--s-changes); }
.bell-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; display: grid; gap: 4px; max-height: 70dvh; overflow-y: auto; z-index: 30; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.bell-pop .bi { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: transparent; border: 0; text-align: start; width: 100%; }
.bell-pop .bi:hover { background: var(--panel-2); }
.bell-pop .bi small { color: var(--muted); }
.rel { position: relative; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .dr-b { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .top-in { gap: 8px; padding: 8px 12px; }
  .brand span.txt { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .me-name { display: none; }
  .me { padding: 3px; }
  main { padding: 12px; }
  .tbl-wrap { display: none; }
  .cards { display: grid; gap: 8px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .dr-b { padding: 12px; }
  .cal { gap: 3px; }
  .day { min-height: 64px; padding: 4px; }
  .ce span.t { display: none; }
  .ce { padding: 3px; justify-content: center; }
  .filters { padding: 10px; }
  .board { grid-auto-columns: 82%; }
  .lb-nav { width: 38px; height: 38px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn { white-space: nowrap; }
.link-row > svg, .fld svg { width: 16px; height: 16px; flex: none; }
.fld .val, .tl-note { unicode-bidi: plaintext; text-align: start; }
.files { align-items: start; }
.fcard .pv { height: auto; }
.lb { grid-template-columns: minmax(0, 1fr); }
.lb-bar > * { flex: none; }
.lb-bar .cap { flex: 1 1 140px; }
@media (max-width: 760px) {
  .lb-hint { display: none; }
  .lb-bar { gap: 6px; padding: 8px; }
  .lb-bar .cap { order: 9; flex-basis: 100%; font-size: 12px; }
}
@media (max-width: 1000px) { .tabs { order: 3; flex-basis: 100%; } }
@media (max-width: 900px) { .tbl-wrap.main-tbl { display: none; } .cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 520px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.team-grid > * { min-width: 0; }
.team-grid > div { grid-template-columns: minmax(0, 1fr); }
.link-row .inp { min-width: 0; }
.sec { grid-template-columns: minmax(0, 1fr); }
.fld > .inp, .fld > select { width: 100%; }
@media (max-width: 760px) { .cal-h > span.muted { display: none; } }
.perm { position: relative; } .sr { inset: 0; }
.fcard .pv { overflow: hidden; min-height: 0; } .fcard .pv img, .fcard .pv video { position: relative; }
.files { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); }
.fcard .pv { display: block; position: relative; width: 100%; }
.fcard .pv img, .fcard .pv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fcard { grid-template-columns: minmax(0, 1fr); }

/* ===== simplified UI (v2) ===== */
main { max-width: 1100px; }
.gtabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.gtab { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; white-space: nowrap; position: relative; }
.gtab b { font-family: var(--f-sport); color: var(--fg); font-size: 16px; }
.gtab[aria-selected="true"] { background: var(--panel-3); color: var(--fg); border-color: var(--tq); }
.gtab .new-dot { position: absolute; top: 6px; inset-inline-start: 6px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; }
.tlist { display: grid; gap: 8px; }
.trow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; text-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.trow:hover { border-color: var(--line-2); background: var(--panel-2); }
.trow.unread { border-inline-start: 3px solid var(--mg); }
.trow .thumb { width: 52px; height: 65px; border-radius: 8px; }
.tr-main { display: grid; gap: 4px; min-width: 0; }
.tr-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-title .new-dot { flex: none; }
.tr-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.tr-side { display: grid; gap: 6px; justify-items: end; font-size: 13px; }
.dr-b { display: block; }
.drawer { width: min(820px, 100%); }
.tk { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.info { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: #c7d4d7; }
.info b { color: var(--fg); font-weight: 600; }
.info-who { display: inline-flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.inp.sm { padding: 4px 8px; font-size: 13px; }
.actbox { border: 1px solid var(--line-2); border-inline-start: 4px solid var(--c); background: var(--panel); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.ab-t { font-size: 17px; font-weight: 700; }
.ab-s { color: var(--muted); font-size: 14px; margin-top: -6px; }
.ab-note { background: rgba(255,92,138,.08); border: 1px solid rgba(255,92,138,.35); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; unicode-bidi: plaintext; }
.btn.big { padding: 11px 26px; font-size: 15px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
details.more > summary { cursor: pointer; font-size: 14px; color: var(--muted); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "‹"; display: inline-block; transition: transform .15s; font-size: 16px; }
details.more[open] > summary::before { transform: rotate(-90deg); }
details.more .more-b { display: grid; gap: 12px; margin-top: 12px; }
details.sec { display: block; }
.drop { padding: 18px; }
.drop.small { padding: 10px; }
.fmeta { flex-wrap: nowrap; }
@media (max-width: 760px) {
  .trow { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .trow .thumb { width: 44px; height: 55px; }
  .tr-side { grid-column: 2; display: flex; justify-items: start; gap: 10px; align-items: center; }
  .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .gtab { flex: 1 0 auto; padding: 8px 10px; }
  .info-who { margin-inline-start: 0; }
}
.tk .files { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { .tk .files { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== timeline + assign (v3) ===== */
.seg2 { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.seg2 button { border: 0; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 9px; font-weight: 600; }
.seg2 button[aria-selected="true"] { background: var(--panel-3); color: var(--fg); }
.tl-by { display: inline-flex; gap: 6px; align-items: center; margin-inline-start: auto; font-size: 13px; }
.tl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.tl-grid { display: grid; position: relative; min-width: max-content; grid-auto-rows: minmax(34px, auto); }
.tl-corner { position: sticky; inset-inline-start: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.tl-month { font-size: 12px; font-weight: 700; padding: 6px 8px; border-inline-start: 1px solid var(--line); color: var(--fg); white-space: nowrap; }
.tl-day { display: grid; justify-items: center; font-family: var(--f-sport); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 2px 0 4px; }
.tl-day small { font-family: var(--f-ar); font-size: 10px; }
.tl-day.we { background: rgba(255,255,255,.025); }
.tl-day.now { color: var(--tq); font-weight: 700; }
.tl-today { background: rgba(22,196,210,.08); border-inline: 1px solid rgba(22,196,210,.35); pointer-events: none; z-index: 0; }
.tl-group { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding: 6px 10px; background: var(--panel-2); border-block: 1px solid var(--line); position: sticky; inset-inline-start: 0; z-index: 2; }
.tl-group .muted { font-weight: 500; }
.tl-label { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--panel); grid-column: 1; display: flex; align-items: center; border-inline-end: 1px solid var(--line); min-width: 0; }
.tl-label button { background: none; border: 0; color: #c7d4d7; font-size: 13px; padding: 0 10px; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; display: flex; gap: 6px; align-items: center; }
.tl-label button:hover { color: var(--fg); }
.tl-bar { position: relative; z-index: 1; align-self: center; height: 24px; margin: 0 2px; border-radius: 7px; border: 0; padding: 0 8px; background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 0 0 0 1px var(--c); color: var(--fg); font-size: 12px; text-align: start; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.tl-bar:hover { background: color-mix(in srgb, var(--c) 45%, transparent); }
.tl-bar.unread { box-shadow: inset 0 0 0 1px var(--c), 0 0 0 2px var(--mg); }
.tl-bar.cut-s { border-start-start-radius: 0; border-end-start-radius: 0; }
.tl-bar.cut-e { border-start-end-radius: 0; border-end-end-radius: 0; }
.tl-bt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; z-index: 1; }
.tl-pub { position: absolute; inset-inline-end: 3px; top: 50%; width: 10px; height: 10px; background: var(--c); transform: translateY(-50%) rotate(45deg); border-radius: 2px; }
.tl-dl { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--yl); border-radius: 1px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.tl-legend span { display: inline-flex; gap: 6px; align-items: center; }
.tl-pub-k { width: 9px; height: 9px; background: var(--muted); transform: rotate(45deg); border-radius: 2px; display: inline-block; }
.tl-dl-k { width: 2px; height: 12px; background: var(--yl); display: inline-block; }
.assign { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 10px; align-items: end; }
.assign > .dl-hint, .assign > .err { grid-column: 1 / -1; }
.dl-hint { font-size: 14px; color: var(--tq); min-height: 1em; }
input[type="datetime-local"].inp, input[type="date"].inp { color-scheme: dark; }
@media (max-width: 760px) {
  .assign { grid-template-columns: minmax(0, 1fr); }
  .tl-grid { grid-template-columns: 120px repeat(35, 30px) !important; }
  .tl-by { margin-inline-start: 0; }
}
.cal-h { flex-wrap: wrap; }
@media (max-width: 760px) { .cal-h h2 { font-size: 15px; min-width: 0; } }

.re-box { flex-basis: 100%; background: var(--panel); border: 1px solid var(--tq); border-radius: 12px; padding: 12px; }

.pend { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; background: var(--panel-2); }
.pend-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.pend-t { background: none; border: 0; padding: 0; color: var(--fg); font-weight: 700; font-size: 15px; text-align: start; }
.pend-t:hover { color: var(--tq); }
.pend-s { color: #c7d4d7; font-size: 14px; white-space: pre-wrap; unicode-bidi: plaintext; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pend .re-box { margin-top: 4px; }
details.sec .more-b > form.sec { border: 0; padding: 0; background: none; }

.tl-sec { margin: 10px 0 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tl-sec:first-child { margin-top: 0; }
.lang-row { display: grid; gap: 8px; }
.lang-h { font-size: 13px; font-weight: 700; color: var(--muted); }
.tk .files.by-lang { grid-template-columns: repeat(auto-fill, minmax(170px, 210px)); align-items: end; }
@media (max-width: 600px) { .tk .files.by-lang { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ev-row { display: grid; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ev-row:last-of-type { border-bottom: 0; }

.fcard.editing { border-color: var(--tq); }
.fcard.editing .fmeta { flex-wrap: wrap; gap: 4px; }
.fcard.editing .fmeta select { flex: 1 1 80px; min-width: 0; }

.relink { display: grid; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.relink .inp { width: 100%; }
.relink .acts { gap: 6px; }
.relink-open { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.relink-open svg { width: 14px; height: 14px; }

.fcard .removing-note { display: none; font-size: 12px; color: var(--s-changes); padding: 0 8px 8px; }
.fcard.removing { border-color: var(--s-changes); }
.fcard.removing .pv { opacity: .3; }
.fcard.removing .removing-note { display: block; }
.relink-note { font-size: 12px; color: var(--tq); }
.relink-note:empty { display: none; }
.adds { display: grid; gap: 6px; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* change requests: impossible to miss */
.chg-strip { display: flex; align-items: center; gap: 12px; background: rgba(255,92,138,.14); border: 1px solid var(--s-changes); border-inline-start: 6px solid var(--s-changes); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.chg-strip.on { justify-content: space-between; }
.chg-strip .chg-ico { font-size: 26px; color: var(--s-changes); line-height: 1; }
.chg-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.chg-txt b { font-size: 16px; color: #ffd7e2; }
.chg-txt span { color: #f3b5c6; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.chg { border-color: var(--s-changes); border-inline-start: 5px solid var(--s-changes); background: rgba(255,92,138,.08); }
.tr-chg { color: #ff8fae; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.chg-box { background: rgba(255,92,138,.12); border: 2px solid var(--s-changes); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 8px; }
.chg-head { display: flex; align-items: center; gap: 10px; color: var(--s-changes); font-size: 20px; }
.chg-head .chg-ico { font-size: 26px; line-height: 1; }
.chg-note { margin: 0; font-size: 18px; line-height: 1.7; color: #fff; white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.chg-by { font-size: 13px; color: #f3b5c6; }
@media (max-width: 760px) { .chg-strip { flex-wrap: wrap; } .chg-note { font-size: 16px; } }

/* activity stack */
.tl-row { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-row.tl-chg { background: rgba(255,92,138,.07); border-radius: 10px; padding: 8px; }
.tl-files { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: #c7d4d7; margin-top: 2px; }
.tl-diff { display: grid; gap: 8px; margin-top: 4px; }
.tl-ch { display: grid; gap: 2px; font-size: 13px; background: var(--panel-2); border-radius: 8px; padding: 6px 10px; }
.tl-ch b { font-size: 12px; color: var(--muted); }
.tl-old, .tl-new { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; overflow-wrap: anywhere; }
.tl-old { color: #8fa3a9; text-decoration: line-through; text-decoration-color: rgba(255,92,138,.6); }
.tl-old span, .tl-new span { text-decoration: none; display: inline; color: var(--muted); }
.tl-new { color: #eef6f7; }
.tl-cm { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.tl-files > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.tl-row > div { min-width: 0; }
.tl-row { min-width: 0; }
.tk { grid-template-columns: minmax(0, 1fr); }
.tk > * { min-width: 0; }
@media (max-width: 760px) { .drop .link-row { flex-wrap: wrap; } .drop .link-row .f-lab { flex-basis: 100%; white-space: normal !important; } }

/* member colours */
.uname { font-weight: 700; }
.av img { border-radius: 50%; }
input.ucolor { width: 30px; height: 30px; padding: 0; border: 2px solid var(--line-2); border-radius: 50%; background: none; cursor: pointer; flex: none; overflow: hidden; }
input.ucolor::-webkit-color-swatch-wrapper { padding: 0; }
input.ucolor::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* task page layout v3: two columns on wide screens */
.drawer { width: min(1240px, 100%); }
.tk { max-width: 1200px; }
.tk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.tk-main, .tk-side { display: grid; gap: 14px; min-width: 0; align-content: start; }
.tk-side { position: sticky; top: 0; }
.tk-side .actbox .drop { padding: 10px; gap: 8px; }
.tk-side .actbox .drop small { display: none; }
.tk-side .actbox .drop .link-row { flex-wrap: wrap; }
.tk-side .actbox .drop .link-row .f-lab { flex-basis: 100%; white-space: normal !important; }
.tk-side .actbox .acts .btn.big, .tk-side .actbox .acts .btn { flex: 1 1 auto; justify-content: center; }
.tk-side .tl-row .tl-note { font-size: 13px; }
@media (max-width: 1000px) {
  .tk-cols { display: flex; flex-direction: column; }
  .tk-main, .tk-side { display: contents; }
  .tk-side { position: static; }
}
.tk-side { position: static; }

/* team page v2: full-width members table, add-member row, settings cards below */
.team-page { display: grid; gap: 14px; }
.team-page > .sec { min-width: 0; }
.tbl-scroll { overflow-x: auto; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.add-member { display: grid; gap: 10px; background: var(--panel-2); border: 1px solid var(--tq); border-radius: 12px; padding: 12px; }
.add-grid { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: end; }
@media (max-width: 760px) { .add-grid { grid-template-columns: 60px minmax(0, 1fr); } .add-grid > :last-child { grid-column: 1 / -1; } }
.ev-row { grid-template-columns: minmax(0, 1fr); }
.team-cards { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.team-cards > * { min-width: 0; }
