/* Autopilot launcher: the central home that opens each mini app. Same palette as the dashboard (style.css). */
:root {
  color-scheme: dark;
  --bg: #090a1f; --panel: #111331; --panel-2: #15173b; --raise: #1a1d48;
  --line: rgba(129, 140, 248, .17); --line-2: rgba(129, 140, 248, .28);
  --text: #f3f4ff; --muted: #9ea2cc; --faint: #6f739f;
  --accent: #7c5cff; --accent-2: #a78bfa; --accent-soft: rgba(124, 92, 255, .16); --panel: #111331; --grad: linear-gradient(135deg, #7c4dff 0%, #9566ff 100%);
  --ok: #4ade80; --ok-bg: rgba(34, 197, 94, .16);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .14);
  --bad: #fb7185; --bad-bg: rgba(251, 113, 133, .15);
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, .18), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 14px/1.5 var(--font); min-height: 100vh;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font: 600 13.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-2); }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 8px 24px rgba(124, 77, 255, .35); }
.btn.ghost { background: transparent; }

.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.logo { display: inline-flex; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; }
.login-card .muted { margin: 0; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.login-card input { height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); padding: 0 12px; font: 14px var(--font); }
.error { color: var(--bad); margin: 0; }

/* hub */
.hub { max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { margin: 34px 0 22px; }
.hello h1 { font-size: 30px; }
.hello p { margin: 6px 0 0; }

.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 20px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.app:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.app-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.app-ico svg.i { width: 26px; height: 26px; stroke-width: 1.9; }
.app-ico.dm { background: linear-gradient(135deg, #fa7e1e, #d62976 55%, #4f5bd5); }
.app-ico.sched { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.app-ico.li { background: linear-gradient(135deg, #0a66c2, #3b82f6); }
.app h3 { font-size: 18px; }
.app p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--raise); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: rgba(9, 10, 31, .45); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stat b { display: block; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.app-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; }
.app-foot .open { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.app-foot .note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: rgba(9, 10, 31, .35); border: 1px solid var(--line); text-decoration: none; min-width: 0; }
a.row:hover { border-color: var(--line-2); }
.row .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.row .dot.bad { background: var(--bad-bg); color: var(--bad); }
.row .dot.warn { background: var(--warn-bg); color: var(--warn); }
.row .dot.dm, .row .dot.sched { background: rgba(214, 41, 118, .18); color: #f472b6; }
.row .dot.li { background: rgba(10, 102, 194, .22); color: #60a5fa; }
.row .txt { min-width: 0; flex: 1; }
.row .txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .txt span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.empty.ok { color: var(--ok); }
.skeleton { height: 56px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

@media (max-width: 1000px) { .apps { grid-template-columns: minmax(0, 1fr); } .pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .hub { padding: 16px 16px 40px; }
  .hello { margin: 24px 0 16px; }
  .hello h1 { font-size: 24px; }
  .row .when { display: none; }
  #attention .row .txt b, #attention .row .txt span { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- content calendar on the home page (calendar.css has the calendar itself) ---------- */
.cal-home { margin-top: 18px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.sec-head h2 { font-size: 20px; }
#calendar svg.i { width: 1em; height: 1em; }
#calendar h2 { font-size: 20px; }
#calendar .stack { display: grid; gap: 18px; }
#calendar .card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
#calendar .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
#calendar .card-head > div { min-width: 0; flex: 1; }
#calendar .card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
#calendar .btn { height: auto; padding: 9px 16px; font-weight: 500; font-size: 14px; }
#calendar .btn.primary { font-weight: 600; }
#calendar .btn.small { padding: 5px 12px; font-size: 13px; }
#calendar .btn.danger { color: var(--bad); }
#calendar .btn svg { font-size: 16px; }
#calendar .icon-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); color: #dfe1ff; display: grid; place-items: center; cursor: pointer; font-size: 19px; }
#calendar .icon-btn:hover { border-color: var(--accent-2); }
#calendar .error { color: var(--bad); }
#calendar .table-wrap { overflow-x: auto; }
#calendar table { width: 100%; border-collapse: collapse; font-size: 14px; }
#calendar th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
#calendar td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
#calendar .clip { max-width: 360px; }
#calendar .empty { padding: 28px 4px; }
.pop { position: fixed; z-index: 70; min-width: 190px; padding: 6px; background: #171a47; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); display: grid; }
.pop button { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; font: 14px var(--font); }
.pop button:hover, .pop button:focus-visible { background: rgba(124, 92, 255, .2); }
.pop svg.i { width: 16px; height: 16px; }
.pop .cap { padding: 6px 12px 2px; font-size: 11.5px; color: var(--faint); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2056; border: 1px solid var(--line-2); color: var(--text); padding: 11px 18px; border-radius: 12px; z-index: 80; max-width: 90vw; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); }
.toast.bad { background: #4a1526; border-color: rgba(251, 113, 133, .5); }
@media (max-width: 560px) { #calendar .card { padding: 14px; } }

/* ---------- AI content studio ---------- */
.studio { margin-top: 18px; }
.studio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.studio-title { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1; }
.studio-title h2 { font-size: 20px; }
.studio-title p { margin: 4px 0 0; }
.studio-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #0a66c2, #7c4dff); }
.studio-ico svg.i { width: 22px; height: 22px; }
.studio-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: rgba(9, 10, 31, .35); min-width: 0; display: grid; gap: 12px; align-content: start; }
.box h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.box h3 svg.i { color: var(--accent-2); }
.box p { margin: 0; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #d9dbf5; }
.studio textarea, .studio input, .studio select {
  width: 100%; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  padding: 10px 12px; font: 14px/1.5 var(--font);
}
.studio textarea { resize: vertical; min-height: 72px; }
.studio select, .studio input { height: 40px; padding: 0 12px; }
.studio textarea:focus-visible, .studio input:focus-visible, .studio select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.studio .btn { height: 38px; padding: 0 14px; font-size: 13.5px; }
.studio .btn.small { height: 32px; padding: 0 11px; font-size: 13px; }
.studio .btn:disabled { opacity: .55; cursor: default; }
.studio .btn.primary:disabled { box-shadow: none; }
.btn.ai { background: linear-gradient(135deg, #0a66c2, #7c4dff); border-color: transparent; box-shadow: 0 8px 22px rgba(60, 90, 255, .3); }
.draft-card { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: rgba(21, 23, 59, .6); }
.draft-card textarea { min-height: 190px; }
.draft-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pick input { width: auto; flex: 1; min-width: 190px; }
.note { font-size: 12.5px; color: var(--muted); }
.note b { color: var(--text); font-weight: 600; }
.note.ok { color: var(--ok); } .note.bad { color: var(--bad); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 22px; border-radius: 99px; background: var(--raise); border: 1px solid var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c7c9ee; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.queue { display: grid; gap: 8px; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9, 10, 31, .35); min-width: 0; }
.qrow .when { color: var(--warn); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qrow .txt { flex: 1; min-width: 0; color: #d9dbf5; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup { display: grid; gap: 8px; }
.setup .row .dot.done { background: var(--ok-bg); color: var(--ok); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .qrow { flex-wrap: wrap; } .qrow .txt { flex-basis: 100%; order: 3; white-space: normal; } }
