/* TS v1.0 - 10.25.2026 */
/* Castle Coaches blog writing tool. Light only (Colette uses light mode). */
:root {
  --red: #9d1111; --red-dark: #7a0d0d; --ink: #1f1f1f; --muted: #6b6b6b; --line: #e3e0dc;
  --bg: #f7f5f2; --card: #ffffff; --ok: #1d7a3a; --warn: #a35d00; --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--red); color: #fff; position: sticky; top: 0; z-index: 20; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-weight: 700; letter-spacing: .02em; }
.brand-sub { opacity: .8; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.who { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.who a, .who .link { color: #fff; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 80px; }
.center { text-align: center; }
.muted { color: var(--muted); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #c9c3bc; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: #a01010; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.signin { max-width: 420px; margin: 12vh auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; text-align: center; }
.signin p { color: var(--muted); }
.zoho { margin-top: 12px; font-size: 16px; padding: 12px 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--red); font-weight: 600; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; text-align: center; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.item .thumb { width: 72px; height: 48px; border-radius: 6px; background: #eee center/cover no-repeat; }
.item .title { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 13px; }
.item .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; margin-right: 6px; }
.badge.draft { color: var(--muted); }
.badge.pending { color: var(--warn); }
.badge.published { color: var(--ok); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

/* editor */
.edit-top { position: sticky; top: 52px; z-index: 10; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.edit-top .spacer { flex: 1; }
.saved { color: var(--muted); font-size: 13px; }
.note { background: #fff6e5; border: 1px solid #f0d49a; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
input[type=text], input[type=email], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 70px; resize: vertical; }
.title-input { font-size: 1.6rem; font-weight: 700; border: 0 !important; background: transparent !important; padding: 4px 0 !important; }
.title-input:focus { outline: none; }
.cover { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cover .pic { width: 220px; aspect-ratio: 2 / 1; border-radius: 8px; background: #eee center/cover no-repeat; border: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
details.adv { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
details.adv summary { cursor: pointer; font-weight: 600; }
details.adv[open] summary { margin-bottom: 12px; }

#editor-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
#editor-wrap .ql-toolbar { border: 0; border-bottom: 1px solid var(--line); position: sticky; top: 110px; background: #fff; z-index: 5; border-radius: var(--radius) var(--radius) 0 0; }
#editor-wrap .ql-container { border: 0; font-size: 17px; min-height: 420px; }
.ql-editor { min-height: 420px; line-height: 1.7; }
.ql-editor img { max-width: 100%; height: auto; }
.ql-editor h2 { font-size: 1.5em; } .ql-editor h3 { font-size: 1.2em; }

/* users */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #faf8f6; }
tr.off td { opacity: .55; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #eee center/cover no-repeat; display: inline-block; vertical-align: middle; margin-right: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.roles { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding-left: 18px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal .box { background: #fff; border-radius: var(--radius); padding: 20px; width: min(520px, 100%); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.err { background: #a01010; }

@media (max-width: 700px) {
  main { padding: 16px 14px 80px; }
  .item { grid-template-columns: 56px 1fr; }
  .item .thumb { width: 56px; height: 40px; }
  .item .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .who a:first-child { display: none; }
  .edit-top { top: 48px; }
  #editor-wrap .ql-toolbar { top: 0; position: static; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 4px 12px; }
}
