/* LaunchDesk — Desk suite look. Main colour: muted mulberry #6E2C6B. */
:root {
  --gd-main: #6E2C6B;
  --gd-main-dark: #572255;
  --gd-main-soft: #f4ecf3;
  --gd-gold: #D4A537;
  --accent: #6E2C6B;
  --ink: #1f2328;
  --muted: #5b636d;
  --line: #d9dde3;
  --bg: #f7f6f7;
  --card: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #b42318;
  --info: #0b5cad;
  --radius: 8px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--info); }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gd-gold); outline-offset: 2px; }

/* ---------- Desk bars ---------- */
.deskbar { background: var(--gd-main); color: #fff; }
.deskbar .inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; }
.wordmark, .wordmark:hover { text-decoration: none; }
.deskbar .wordmark { font-weight: 700; font-size: 1.2rem; }
.wordmark .w1 { color: #fff; }
.wordmark .w2 { color: var(--gd-gold); }
.deskbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.deskbar nav a { color: #f1e4ef; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.deskbar nav a:hover, .deskbar nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.deskbar .who { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: #f1e4ef; }
.deskbar .who a { color: #fff; }
.deskbar form { margin: 0; }
.linkbtn { background: none; border: none; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.deskfooter { background: var(--gd-main); color: #f1e4ef; text-align: center; padding: 12px 16px; font-size: .9rem; margin-top: 32px; }


/* ---------- layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.narrow { max-width: 1100px; }
.reading { max-width: 860px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cols { display: grid; gap: 20px; grid-template-columns: 1fr 320px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- category tiles ---------- */
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tile .ico { display: inline-flex; width: 36px; height: 36px; border-radius: 8px; background: var(--gd-main-soft); color: var(--accent); align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: 8px; }
.tile h3 { margin: 0 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- lists ---------- */

/* ---------- article body ---------- */

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 4px 14px 4px 0; }
.hint { color: var(--muted); font-size: .86rem; font-weight: 400; margin-top: 2px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number],
input[type=date], input[type=color], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #b9c0c8; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
input[type=color] { width: 64px; height: 38px; padding: 2px; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid #b9c0c8; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #f7f1f6; text-decoration: none; }
.btn.primary { background: var(--gd-main); border-color: var(--gd-main); color: #fff; }
.btn.primary:hover { background: var(--gd-main-dark); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: #fdecea; }
.btn.small { padding: 4px 10px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 16px; margin: 16px 0; }
legend { font-weight: 700; padding: 0 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #f6f0f5; font-size: .88rem; color: #3a414a; white-space: nowrap; }
table.data tr:hover td { background: #fbf8fa; }
table.data td.cb, table.data th.cb { width: 34px; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--gd-main-soft); border: 1px solid #e2cfe0; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 10px; }
.bulkbar select, .bulkbar input { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 220px; }

/* ---------- badges / flashes ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef0f3; color: #3a414a; white-space: nowrap; }
.badge.published { background: #dcf3e2; color: var(--ok); }
.badge.draft { background: #eef0f3; }
.badge.in_review, .badge.awaiting_approval { background: #fff1d6; color: var(--warn); }
.badge.archived, .badge.unpublished { background: #f1f1f1; color: var(--muted); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.role { background: var(--gd-main-soft); color: var(--gd-main); }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.flash.success { background: #e9f6ec; border-color: #a6d9b3; color: #15532a; }
.flash.error { background: #fdecea; border-color: #f2b8b3; color: #8a1c13; }
.flash.info { background: #eaf2fd; border-color: #b4d1f5; color: #0b4a8a; }
.warnbox { background: #fff4e0; border: 1px solid #f0d39b; color: #6b4a00; padding: 10px 14px; border-radius: var(--radius); margin: 10px 0; }
.empty { color: var(--muted); padding: 14px 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; }
.tabs a.active { color: var(--gd-main); border-bottom-color: var(--gd-main); }

/* ---------- editor ---------- */

/* ---------- diffs ---------- */

.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
details summary { cursor: pointer; font-weight: 600; }

.auth { max-width: 440px; margin: 40px auto; }

/* ---------- LaunchDesk tiles ---------- */
.hello { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #fff; color: var(--ink); border: 1px solid #e7e2e6; border-left: 6px solid var(--gd-main);
  border-radius: 14px; padding: 22px 28px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(31,35,40,.06); }
.hello h1 { margin: 0 0 4px; font-size: 1.6rem; }
.hello .muted { color: var(--muted); margin: 0; }
.hello-tools { display: flex; gap: 8px; align-items: center; }
.hello-tools input[type=search] { width: 220px; border: 1px solid #d0d4da; border-radius: 8px; padding: 8px 12px; }
.ico { width: 16px; height: 16px; }
.apps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.apptile { display: flex; flex-direction: column; background: #fff; border: 1px solid #e6e1e8; border-radius: 14px;
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 1px 3px rgba(31,35,40,.06);
  transition: transform .15s ease, box-shadow .15s ease; }
.apptile:hover, .apptile:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,35,40,.14); text-decoration: none; }
.apptile .band { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px; min-height: 84px; color: #fff;
  background-image: linear-gradient(135deg, rgba(255,255,255,.14), rgba(0,0,0,.12)); }
.apptile .mark { flex: 0 0 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); font-weight: 700; font-size: 1.1rem; letter-spacing: .5px; }
.apptile .tname { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.apptile .tname .w1 { color: #fff; }
.apptile .tname .w2 { color: var(--gd-gold); }
.apptile .ext { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; opacity: .7; }
.apptile:hover .ext { opacity: 1; }
.apptile .body { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px 18px 16px; flex: 1; }
.apptile .ds { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.apptile .go { font-weight: 600; font-size: .88rem; color: var(--gd-main); }
.apptile:hover .go span { margin-left: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.emptycard { text-align: center; padding: 36px 20px; }
.emptycard svg { width: 44px; height: 44px; fill: var(--gd-main-soft); stroke: var(--gd-main); stroke-width: 1.2; }
.nomatch { margin-top: 14px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.preset { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9ced5; cursor: pointer; padding: 0; }
.preset:hover, .preset.on { box-shadow: 0 0 0 2px var(--ink); }
.bulkbar .sep { width: 1px; align-self: stretch; background: #e2cfe0; margin: 0 4px; }
.ticklist { list-style: none; padding: 0; margin: 0 0 8px; }
.ticklist li { padding: 6px 0; border-bottom: 1px solid #eef0f3; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }
.c-0{background:#6E2C6B}
.keybox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; background: #fff8e1; border: 1px solid #e6c65c; border-radius: 6px; padding: 12px; word-break: break-all; user-select: all; }
.qrbox svg { width: 220px; height: 220px; display: block; margin: 10px 0; background: #fff; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.ok-dot { color: var(--ok); } .bad-dot { color: var(--bad); }
.mt { margin-top: 18px; } .inline-form { display: inline; margin: 0; } .w-auto { width: auto; }
[hidden] { display: none !important; }
.filters input, .filters select { width: auto; }
.bulkbar select { padding: 4px 8px; font-size: .88rem; }
.ticklist.cols { columns: 2 220px; column-gap: 24px; }
.ticklist.cols li { break-inside: avoid; }
.rolepick { margin: 6px 0 4px 26px; }
.ticklist.cols li { padding: 3px 0; border-bottom: 0; }
.ticklist label.inline { margin: 0; }

/* ---------- header menu (wide screens show everything) ---------- */
.navwrap { display: flex; flex: 1; align-items: center; gap: 18px; }
.menubtn { display: none; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }            /* stops iPhone zooming into fields */
  .deskbar .inner { padding: 0 14px; gap: 0; }
  .menubtn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: .95rem; cursor: pointer; }
  .menubtn svg { width: 20px; height: 20px; }
  .navwrap { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 12px; }
  .navwrap.open { display: flex; }
  .deskbar nav { flex-direction: column; gap: 2px; }
  .deskbar nav a { padding: 11px 12px; font-size: 1rem; }
  .deskbar .who { border-top: 1px solid rgba(255,255,255,.2); margin-top: 8px; padding: 12px 12px 0; justify-content: space-between; }

  .wrap { padding: 16px 12px; }
  h1 { font-size: 1.4rem; }
  .spread { flex-direction: column; align-items: stretch; gap: 10px; }
  .actions { flex-wrap: wrap; }
  .filters input, .filters select { width: 100%; min-width: 0; }
  .filters > .btn { width: auto; }

  .hello { padding: 16px 16px 16px 18px; border-left-width: 5px; }
  .hello h1 { font-size: 1.35rem; }
  .hello > div:first-child { flex-basis: 100%; }
  .hello-tools { width: 100%; }
  .hello-tools input[type=search] { flex: 1; width: auto; min-width: 0; }
  .apps { grid-template-columns: 1fr; gap: 12px; }
  .apptile .band { min-height: 0; padding: 12px 14px; }
  .apptile .mark { flex-basis: 40px; height: 40px; border-radius: 10px; font-size: 1rem; }
  .apptile .tname { font-size: 1.15rem; }
  .apptile .body { padding: 10px 14px 12px; gap: 6px; }
  .apptile .ds { min-height: 0; }

  /* tables as cards */
  .table-wrap { overflow: visible; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data { background: none; }
  table.data thead { display: none; }
  table.data tr { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 10px 12px; }
  table.data tr.has-cb { padding-right: 44px; }
  table.data tr:hover td { background: none; }
  table.data td { border: 0; padding: 3px 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
  table.data td.title { display: block; padding-bottom: 6px; }
  table.data td.whole { display: block; }
  table.data td[data-label]::before { content: attr(data-label); flex: 0 0 34%; color: var(--muted); font-size: .82rem; }
  table.data td:empty { display: none; }
  table.data td.cb { position: absolute; top: 10px; right: 8px; width: auto; padding: 4px; }
  table.data td.cb input { width: 22px; height: 22px; }
  table.data td.nowrap { white-space: normal; gap: 6px; }
  .bulkbar { gap: 6px; }
  .ticklist.cols { columns: 1; }
  .rolepick { margin-left: 0; }
}
