/* The Saathi app. Uses the tokens from site.css. */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.hint { margin: .2rem 0 1.1rem; color: var(--muted); font-size: .9rem; }

.app-head { display: flex; align-items: center; gap: 1.1rem; padding-block: clamp(1.6rem, 4vw, 2.6rem) 1.25rem; }
.app-head h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
.app-head p { margin-top: .35rem; color: var(--muted); max-width: 52ch; }
.app-head__guide { display: inline-block; margin-top: .4rem; color: var(--marigold); }

.banner { margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 10px; background: #123331; color: var(--ok); font-size: .94rem; }
.banner--demo { background: #3A2C0E; color: var(--marigold); }
.banner a { color: inherit; font-weight: 700; }

/* Login screen for logged-out visitors */
.gate { display: grid; gap: 1rem; max-width: 46rem; margin-top: .5rem; padding: clamp(1.4rem, 4vw, 2.2rem); border: 1px solid var(--line); border-radius: var(--r); background: var(--charcoal); }
.gate h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.gate p { color: var(--muted); }
.gate__actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.gate__steps { display: grid; gap: .5rem; margin: .4rem 0 0; padding-left: 1.2rem; list-style: disc; color: var(--muted); }
.gate__steps b { color: var(--bone); }

/* Tabs: a row on computers, a bar along the bottom on phones */
.tabs { display: flex; gap: .4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; }
.tabs a:hover { color: var(--bone); }
.tabs a[aria-current="page"] { color: var(--bone); border-bottom-color: var(--marigold); }
.tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 720px) {
  .app { padding-bottom: 5.5rem; }
  .tabs { position: fixed; inset: auto 0 0 0; z-index: 30; margin: 0; padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); justify-content: space-around; gap: 0; border-top: 1px solid var(--line); border-bottom: 0; background: rgba(14, 14, 15, .95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .tabs a { flex: 1; flex-direction: column; gap: .15rem; padding: .45rem .2rem; border: 0; font-size: .74rem; }
  .tabs a[aria-current="page"] { color: var(--marigold); }
  .nav__apps { display: none; }
  .site-footer { display: none; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.toolbar input[type="time"] { padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--graphite); color: var(--bone); font: inherit; }

.uploads { display: grid; gap: .35rem; margin-bottom: 1rem; font-size: .92rem; }
.uploads li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; border-radius: 8px; background: var(--graphite); }
.uploads .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads .ok { color: var(--ok); white-space: nowrap; }
.uploads .err { color: var(--err); }

.drafts-note { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: .95rem; }

/* Ad cards */
.ads { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.ad { display: flex; flex-direction: column; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--charcoal); color: var(--bone); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease; }
.ad:hover { border-color: var(--line-strong); }
.ad__media { display: block; aspect-ratio: 4 / 5; background: var(--graphite); }
.ad__media img, .ad__media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad__gone { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }
.ad__body { display: grid; gap: .4rem; padding: .8rem .9rem 1rem; }
.ad__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.ad__when { font-size: .86rem; font-weight: 600; }
.ad__caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; color: var(--muted); }
.ad__caption--empty { font-style: italic; }
.ad__platforms { font-size: .8rem; color: var(--muted); }

/* Calendar: the next 30 days */
.cal { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); margin-top: 1.25rem; }
.day { display: grid; align-content: start; gap: .45rem; min-height: 132px; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--charcoal); }
.day--today { border-color: var(--marigold); }
.day__date { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.day__date b { color: var(--bone); font-size: 1rem; }
.day__free { color: #5c5b61; font-size: .82rem; }
.slot { display: flex; align-items: center; gap: .5rem; padding: .3rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--graphite); color: var(--bone); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.slot:hover { border-color: var(--marigold); }
.slot img, .slot video, .slot .slot__ph { flex: none; width: 36px; height: 36px; border-radius: 5px; object-fit: cover; background: var(--black); }

/* Accounts */
.accounts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.acc { display: grid; gap: .7rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--charcoal); }
.acc h3 { font-size: 1.3rem; }
.acc p { color: var(--muted); font-size: .92rem; }
.acc b { color: var(--bone); overflow-wrap: anywhere; }
.notice--ok { grid-column: 1 / -1; border: 1px solid var(--ok); color: var(--bone); }
.notice--err { grid-column: 1 / -1; border: 1px solid var(--err); color: var(--bone); }
.install-tip { display: grid; gap: .5rem; margin-top: 1.5rem; padding: 1.2rem; border-radius: var(--r); background: var(--graphite); font-size: .95rem; }
.install-tip p { color: var(--muted); }
.install-tip b { color: var(--bone); }

/* History */
.hist { display: grid; gap: .7rem; }
.hist__row { display: grid; grid-template-columns: 64px 1fr; gap: .9rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--charcoal); }
.hist__thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--graphite); }
.hist__thumb img, .hist__thumb video { width: 100%; height: 100%; object-fit: cover; }
.hist__main { display: grid; gap: .35rem; min-width: 0; }
.hist__results { display: flex; flex-wrap: wrap; gap: .35rem; }
.hist__note { font-size: .86rem; color: var(--err); }
.hist__row .btn { justify-self: start; }

/* Editor */
.editor { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--charcoal); color: var(--bone); }
.editor::backdrop { background: rgba(0, 0, 0, .7); }
.editor form { display: grid; gap: .45rem; padding: 1.1rem 1.2rem 1.3rem; }
.ed-head { display: flex; align-items: center; justify-content: space-between; }
.ed-head h2 { font-size: 1.4rem; }
.ed-x { border: 0; background: none; color: var(--muted); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.ed-x:hover { color: var(--bone); }
.ed-media { max-height: 280px; overflow: hidden; border-radius: 10px; background: var(--black); }
.ed-media img, .ed-media video { display: block; width: 100%; max-height: 280px; object-fit: contain; }
.editor label, .editor legend { margin-top: .5rem; font-weight: 600; font-size: .92rem; }
.editor textarea, .editor input[type="text"], .editor input[type="date"], .editor input[type="time"] { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--graphite); color: var(--bone); font: inherit; font-size: 1rem; }
.editor textarea:focus, .editor input:focus { outline: none; border-color: var(--marigold); }
.editor textarea { resize: vertical; }
.editor :disabled { opacity: .6; }
.ed-platforms { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 0; padding: 0; border: 0; }
.ed-platforms legend { width: 100%; margin-bottom: .3rem; padding: 0; }
.ed-platforms label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
.ed-platforms input { width: 1.1rem; height: 1.1rem; accent-color: var(--marigold); }
.ed-youtube { display: grid; gap: .45rem; }
.ed-youtube[hidden] { display: none; }
.ed-when { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.ed-status:empty, .ed-error:empty { display: none; }
.ed-status { display: flex; flex-wrap: wrap; gap: .35rem; }
.ed-error { color: var(--err); font-size: .92rem; }
.ed-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin-top: .8rem; }
#ed-delete:hover:not(:disabled) { background: var(--err); border-color: var(--err); color: var(--black); }
