/* «أدواتي»: the tools list, describing a new tool, and a tool's page. */
.tool-sub { margin: 0 0 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tool-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-height: 250px; transition: transform .2s ease, box-shadow .2s ease; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-ico { width: 44px; height: 44px; border-radius: var(--r); background: var(--c50); color: var(--cobalt); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-name { margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.tool-want { margin: 0; font-size: 13px; line-height: 1.7; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tool-del { width: 44px; padding: 0; justify-content: center; flex-shrink: 0; }
.tool-new { min-height: 250px; border-radius: var(--r-lg); }

.tool-newpage, .tool-page { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.tool-newpage { padding-top: 4vh; }
.tool-newhead { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.tool-newhead h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); font-weight: 700; }
.tool-newhead p { margin: 0; font-size: 16px; line-height: 1.8; }
.tool-ask { background: #fff; border: 2px solid var(--c200); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-up); display: flex; flex-direction: column; gap: 14px; }
.tool-ask-title { font-size: 15px; }
.tool-box { border: 0; outline: 0; resize: vertical; min-height: 150px; font: inherit; font-size: 17px; line-height: 1.8; color: var(--ink); background: transparent; width: 100%; }
.tool-box:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 6px; border-radius: 8px; }
.tool-ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.tool-note { color: var(--err); min-height: 1em; }
.tool-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-fact { background: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tool-fact b { font-size: 14px; }
.tool-fact span { font-size: 13px; line-height: 1.7; color: var(--mute); }
.tool-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-soon { display: flex; align-items: center; gap: 10px; background: var(--c50); border: 1px solid var(--c200); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.7; color: var(--c700); }
.tool-soon svg { flex-shrink: 0; }
.tool-want-full { margin: 0; font-size: 16px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .tool-facts { grid-template-columns: 1fr; }
  .tool-ask { padding: 16px; border-radius: 18px; }
  .tool-ask-foot { flex-direction: column; align-items: stretch; }
  .tool-ask-foot .btn { width: 100%; justify-content: center; }
  .tool-box { font-size: 16px; }
}
/* A tool's own page: the talk with the director, the tool running in its frame, and what it does. */
.tool-main { display: flex; flex-direction: column; min-height: 100vh; }
.tool-build { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr) 300px; gap: 20px; padding: 20px 24px 24px; align-items: stretch; }
.tool-chat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 150px); position: sticky; top: 20px; }
.tool-talk { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tool-say { align-self: flex-end; max-width: 92%; background: var(--bg); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 14px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.tool-say.me { align-self: flex-start; background: var(--ink); color: #fff; border-radius: 16px 16px 16px 4px; }
.tool-say.work { background: var(--c50); border: 1px solid var(--c200); color: var(--c700); display: flex; align-items: center; gap: 10px; }
.tool-dots { display: inline-flex; gap: 4px; flex-shrink: 0; }
.tool-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); animation: tool-dot 1.2s ease-in-out infinite; }
.tool-dots i:nth-child(2) { animation-delay: .15s; } .tool-dots i:nth-child(3) { animation-delay: .3s; }
.tool-dots.big i { width: 10px; height: 10px; }
@keyframes tool-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.tool-chat-note { margin: 0; padding: 0 16px 8px; }
.tool-chat-foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
.tool-say-in { flex: 1; min-width: 0; height: 46px; }
.tool-send { height: 46px; flex-shrink: 0; }
.tool-preview { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tool-preview-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.tool-live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.tool-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tool-seg { display: flex; gap: 4px; background: var(--line-2); border-radius: 10px; padding: 4px; }
.tool-seg button { height: 36px; padding: 0 14px; border-radius: 7px; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--mute); cursor: pointer; }
.tool-seg button.on { background: #fff; color: var(--ink); font-weight: 500; }
.tool-stage { flex: 1; min-height: 520px; height: calc(100vh - 200px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-up); overflow: hidden; position: relative; display: flex; }
.tool-stage.phone { width: 390px; max-width: 100%; align-self: center; flex: none; }
.tool-stage.empty { flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; box-shadow: none; border-style: dashed; background: var(--paper); }
.tool-stage.empty b { font-size: 17px; }
.tool-stage.empty .hint { max-width: 380px; line-height: 1.8; }
.tool-frame { border: 0; width: 100%; height: 100%; flex: 1; background: var(--bg); }
.tool-veil { position: absolute; inset: 0; background: rgba(243, 243, 240, .82); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--c700); }
.tool-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tool-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.tool-panel b { font-size: 15px; }
.tool-panel p { margin: 0; line-height: 1.8; color: var(--mute); white-space: pre-line; overflow-wrap: anywhere; }
.tool-first p { max-height: 132px; overflow-y: auto; }
.tool-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; line-height: 1.7; }
.tool-steps li { display: flex; gap: 10px; }
.tool-step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--c50); color: var(--c700); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.tool-safe { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #0A6B4A; background: var(--ok-bg); border-radius: var(--r); padding: 10px 12px; }
@media (max-width: 1180px) {
  .tool-build { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .tool-chat { position: static; height: auto; max-height: 46vh; }
  .tool-stage { height: 70vh; min-height: 420px; }
}
@media (prefers-reduced-motion: reduce) { .tool-dots i { animation: none; opacity: .7; } }
.tool-month { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--mute); border-top: 1px solid var(--line-2); padding-top: 10px; }
.tool-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tool-kv span { color: var(--mute); }
.tool-kv b { font-size: 14px; white-space: nowrap; }
.tool-price .hint { margin: 0; }
.tool-log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tool-log li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; }
.tool-log b { font-size: 13px; font-weight: 600; }
.tool-run { position: absolute; inset-inline: 16px; bottom: 16px; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-size: 14px; box-shadow: var(--shadow-up); }
.tool-run[hidden] { display: none; }
.tool-run .tool-dots i { background: #fff; }
.tool-run-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-run .btn { flex-shrink: 0; }
.tool-hosts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tool-hosts li { font-family: var(--mono); font-size: 12px; background: var(--bg); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.tool-say-files, .tool-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tool-chips { margin: 0; padding: 8px 14px 0; align-items: center; }
.tool-file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: rgba(255,255,255,.16); border-radius: 8px; padding: 3px 8px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-chips .tool-file-chip { background: var(--bg); color: var(--ink); }
.tool-file-chip button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; min-width: 24px; min-height: 24px; }
.tool-attach { width: 46px; height: 46px; padding: 0; justify-content: center; flex-shrink: 0; }
.tool-voices { align-self: stretch; background: #fff; border: 1px solid var(--c200); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tool-voice { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.tool-voice.on { background: var(--c50); }
.tool-voice .mk-play { width: 40px; height: 40px; flex-shrink: 0; }
.tool-voice-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.tool-voice-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-voice .btn { flex-shrink: 0; min-height: 40px; }
.tool-fixed-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool-fixed-file { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.tool-fixed-file img, .tool-fixed-doc { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--mute); }
.tool-fixed-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(17,18,20,.72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tool-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tool-notes li { position: relative; background: var(--bg); border-radius: 10px; padding: 8px 40px 8px 10px; line-height: 1.6; }
[dir="rtl"] .tool-notes li { padding: 8px 10px 8px 40px; }
.tool-notes .tool-x { top: 50%; transform: translateY(-50%); background: var(--line-2); color: var(--ink); }

/* «مهامي»: the week at a glance, the tasks, and the form. */
.task-h { margin: 22px 0 12px; font-size: 16px; font-weight: 700; }
.task-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.task-day { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.task-day.today { border-color: var(--c200); box-shadow: var(--shadow); }
.task-day-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2px; }
.task-day-head b { font-size: 13px; }
.task-day-none { color: var(--mute-2); font-size: 13px; }
.task-pill { display: flex; flex-direction: column; gap: 1px; background: var(--c50); color: var(--c700); border-radius: 9px; padding: 6px 8px; text-decoration: none; font-size: 12px; line-height: 1.4; }
.task-pill:hover { background: var(--c100, var(--c200)); }
.task-pill-time { font-weight: 700; }
.task-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.task-card.off { opacity: .78; }
.task-card-top { display: flex; align-items: flex-start; gap: 12px; }
.task-card-names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-when { margin: 0; font-size: 14px; font-weight: 600; }
.task-inputs { margin: 0; font-size: 13px; color: var(--mute); line-height: 1.7; overflow-wrap: anywhere; }
.task-facts { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.task-facts div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.task-facts dt { color: var(--mute); }
.task-facts dd { margin: 0; text-align: end; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.task-form .tool-ask { gap: 18px; }
.task-field { display: flex; flex-direction: column; gap: 8px; }
.task-field:empty { display: none; }
.task-label { font-size: 14px; font-weight: 600; }
.task-seg { max-width: 360px; }
.task-days { display: flex; flex-wrap: wrap; gap: 6px; }
.task-days button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: var(--ink); }
.task-days button[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.task-times { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-time { display: flex; gap: 6px; align-items: center; }
.task-time .input { width: 150px; }
.task-est { margin: 0; font-size: 14px; color: var(--c700); background: var(--c50); border-radius: 12px; padding: 12px 14px; line-height: 1.7; }
.task-est:empty { display: none; }
@media (max-width: 760px) {
  .task-week-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; padding-bottom: 6px; }
  .task-grid { grid-template-columns: 1fr; }
  .task-seg { max-width: none; }
}
.task-asks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.task-ask { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff; border: 2px solid var(--c200); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.task-ask-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-ask-sample { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.task-extra { margin: 0; }
.task-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.task-check input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--cobalt); }
.task-check > span { display: flex; flex-direction: column; gap: 2px; }
#task-cap { width: 150px; }
@media (max-width: 760px) {
  .task-ask { flex-direction: column; align-items: stretch; }
  .task-ask .prow .btn { flex: 1; justify-content: center; }
}
.task-modes { max-width: 460px; margin: 0 auto; width: 100%; }
.task-mode { display: contents; }
.task-results { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.task-run { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.task-run.quiet { box-shadow: none; background: var(--line-2); }
.task-run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.task-run-when { display: flex; flex-direction: column; gap: 2px; }
.task-run-text { white-space: pre-wrap; line-height: 1.9; font-size: 15px; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.task-run-files { display: flex; flex-wrap: wrap; gap: 8px; }
.task-needs { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff4f2; border: 1px solid #f3c7bf; border-radius: 12px; padding: 12px 14px; }
.task-needs p { margin: 0; line-height: 1.8; }
.btn.sm.on { background: var(--c50); border-color: var(--c200); color: var(--c700); }
@media (max-width: 760px) { .task-needs { flex-direction: column; align-items: stretch; } }
.task-btns { flex-wrap: wrap; }

/* «الخزنة» */
.tip-row { display: inline-flex; align-items: center; gap: 8px; }
.tip-row h1, .tip-row h2 { margin: 0; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vault-key { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.vault-key-top { display: flex; align-items: center; gap: 12px; }
.vault-key-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vault-key-name b, .vault-key-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-key-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.vault-dots { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; background: var(--soft, #f4f4f1); border-radius: 6px; padding: 2px 8px; }
.vault-log { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.vault-uses { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; overflow: hidden; }
.vault-use { display: grid; grid-template-columns: 120px minmax(80px, 1fr) minmax(80px, 1fr) minmax(120px, 1.4fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.vault-use:first-child { border-top: 0; }
.vault-use > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-form { display: flex; flex-direction: column; gap: 14px; }
.vault-safe { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted, #6b6f76); line-height: 1.7; }
.vault-safe svg { flex: none; margin-top: 3px; }
@media (max-width: 720px) {
  .vault-use { grid-template-columns: 1fr auto; }
  .vault-use > :nth-child(3), .vault-use > :nth-child(4) { grid-column: 1 / -1; }
}
