/* Management console: plain, roomy, works on a phone at the track. */
:root { --ink: #10241b; --green: #00763a; --green-l: #e3f3ea; --bg: #eef1ef; --line: #d3dad5; --muted: #5b6a61; --red: #a8321c; --flag: #ffd21f; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--green); }
h1 { font-size: 1.7rem; line-height: 1.15; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
p { margin: 0 0 .9rem; }
code { background: #e2e7e4; padding: .05rem .35rem; border-radius: 3px; font-size: .9em; }
.muted { color: var(--muted); }
.sr { position: absolute; left: -999px; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }

.top { background: var(--ink); color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.25rem; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.top-brand { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.top-user { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; font-size: .95rem; }
.top-user a, .linklike { color: #fff; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.top-nav { display: flex; gap: .2rem; overflow-x: auto; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.top-nav a { color: #cfe0d6; text-decoration: none; padding: .65rem .9rem; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 600; }
.top-nav a:hover { color: #fff; }
.top-nav a[aria-current] { color: #fff; border-bottom-color: var(--flag); }

.shell { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.out .shell { max-width: 520px; padding-top: 4rem; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.4rem; margin-bottom: 1.3rem; }
.card.flush { padding: 0; overflow-x: auto; }
.narrow-card { max-width: 520px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.grid-2 .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 1.3rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .55rem 0; border-bottom: 1px solid #e6eae7; }
.plain li:last-child { border-bottom: 0; }
.quick { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0 1.4rem; }
.counts { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; }
.counts a { text-decoration: none; }
.counts strong { font-size: 1.4rem; margin-right: .2rem; }

.flash { padding: .8rem 1rem; border-radius: 5px; background: var(--green-l); border: 1px solid #a9d8bd; margin-bottom: 1rem; }
.flash-err { background: #fbe9e5; border-color: #e5b3a8; color: #7a2412; }

.btn { display: inline-block; padding: .65rem 1.2rem; background: var(--green); color: #fff; border: 2px solid var(--green); border-radius: 5px; font: 700 1rem/1.2 inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: #005c2d; border-color: #005c2d; }
.btn-light { background: #fff; color: var(--green); }
.btn-light:hover { background: var(--green-l); color: var(--green); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #82240f; border-color: #82240f; }

table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .8rem 1rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.list td { padding: .8rem 1rem; border-bottom: 1px solid #e6eae7; vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell > a, .actions-cell > details { display: inline-block; margin-left: .8rem; vertical-align: top; }
.state { display: inline-block; padding: .1rem .55rem; border-radius: 10px; font-size: .85rem; font-weight: 700; }
.state.live { background: var(--green-l); color: #0b5a2d; }
.state.draft { background: #e9e9e9; color: #444; }
.state.sched { background: #fff1c2; color: #6a5200; }
details.del summary { cursor: pointer; color: var(--red); list-style: none; }
details.del summary::-webkit-details-marker { display: none; }
details.del[open] { position: relative; }
details.del form { position: absolute; right: 0; z-index: 5; width: 230px; margin-top: .3rem; padding: .9rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); text-align: left; white-space: normal; }

.fields { display: flex; flex-wrap: wrap; gap: 1.1rem 1.4rem; }
.field { flex: 1 1 100%; }
.field.half { flex: 1 1 calc(50% - .7rem); min-width: 200px; }
.lab { display: block; font-weight: 700; margin-bottom: .3rem; }
.req { font-weight: 400; color: var(--muted); font-size: .85rem; }
.help { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }
.err { color: var(--red); font-weight: 600; margin: .35rem 0 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--red); }
input[type=text], input[type=url], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; border: 1px solid #a9b5ad; border-radius: 5px; background: #fff; color: inherit; }
textarea { resize: vertical; line-height: 1.5; }
.check { display: inline-flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { width: 1.15rem; height: 1.15rem; }
.group { flex: 1 1 100%; margin: .8rem 0 -.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.group:first-child { margin-top: 0; padding-top: 0; border: 0; }
.img-now { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.img-now img { height: 80px; width: auto; max-width: 160px; object-fit: cover; border: 1px solid var(--line); background: #f3f3f3; }
details.slug { background: #f5f7f6; border: 1px solid var(--line); border-radius: 5px; padding: .6rem .8rem; }
details.slug summary { cursor: pointer; }
details.slug input { margin-top: .6rem; }

.savebar { position: sticky; bottom: 0; display: flex; gap: 1.2rem; align-items: center; padding: .9rem 1.25rem; margin: 0 -1.25rem; background: rgba(238, 241, 239, .96); border-top: 1px solid var(--line); }

/* markdown editor */
.md { border: 1px solid #a9b5ad; border-radius: 5px; background: #fff; }
.md-bar { display: flex; flex-wrap: wrap; gap: .3rem; padding: .4rem; background: #f1f4f2; border-bottom: 1px solid var(--line); }
.md-bar button, .md-img { font: inherit; font-size: .9rem; padding: .3rem .65rem; background: #fff; border: 1px solid #b4bfb8; border-radius: 4px; cursor: pointer; color: var(--ink); }
.md-bar button:hover, .md-img:hover { background: var(--green-l); }
.md-bar button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.md-spacer { flex: 1; }
.md textarea { border: 0; border-radius: 0 0 5px 5px; }
.md-preview { padding: 1rem 1.2rem; min-height: 8rem; }
.md-preview[hidden] { display: none; }
.md-preview img { max-width: 100%; height: auto; }
.md-status { align-self: center; font-size: .85rem; color: var(--muted); padding-left: .4rem; }

/* gallery photos */
.thumbs { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.thumbs li { background: #f5f7f6; border: 1px solid var(--line); border-radius: 6px; padding: .5rem; cursor: grab; position: relative; }
.thumbs li.drag { opacity: .4; }
.thumbs li.removed img { opacity: .25; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; background: #ddd; }
.thumbs input[type=text] { margin: .45rem 0; padding: .4rem .5rem; font-size: .9rem; }
.tile-opts { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.mv { position: absolute; top: .8rem; right: .8rem; display: flex; gap: .25rem; }
.mv button { width: 2rem; height: 2rem; border: 0; border-radius: 4px; background: rgba(16, 36, 27, .8); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.upq { list-style: none; margin: 0; padding: 0; }
.upq li { padding: .4rem .7rem; background: #fff7d6; border: 1px solid #ecd36b; border-radius: 4px; margin-bottom: .4rem; font-size: .92rem; }
.upq li.bad { background: #fbe9e5; border-color: #e5b3a8; color: #7a2412; }

.prose h2 { font-size: 1.4rem; margin: 1.2rem 0 .4rem; } .prose h3 { font-size: 1.15rem; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 4px solid var(--flag); }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  table.list thead { position: absolute; left: -999px; }
  table.list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .list td { padding: .2rem 0; border: 0; }
  .list td[data-label]:not([data-label=Name])::before { content: attr(data-label) ': '; color: var(--muted); }
  .actions-cell { text-align: left; padding-top: .5rem !important; }
  .actions-cell > a, .actions-cell > details { margin: 0 1rem 0 0; }
  details.del form { left: 0; right: auto; }
}

.btn-small { padding: .4rem .8rem; font-size: .9rem; }
.lede { max-width: 46rem; color: var(--muted, #4a5a52); }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: .6rem 0; }
.inline-form .lab { flex-basis: 100%; margin: 0; }
details > summary { cursor: pointer; color: var(--green); font-weight: 700; }
