/* MORPH phone dashboard. Fonts come from media.bughio.com; until they exist the system stack below is used. */
@font-face {
  font-family: "Sora";
  src: url("https://media.bughio.com/fonts/Sora-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("https://media.bughio.com/fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --midnight: #101625;
  --midnight-2: #182036;
  --midnight-3: #222b44;
  --ivory: #f5f2eb;
  --ivory-2: #ebe7dc;
  --ink: #101625;
  --ink-2: #4a5165;
  --ink-3: #6b7184;
  --line: rgba(16, 22, 37, 0.12);
  --on-dark-2: #b6c0d4;
  --on-dark-line: rgba(245, 242, 235, 0.14);
  --violet: #866cff;
  --focus: #c9beff;
  --radius: 16px;
  --sys: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "Sora", var(--sys);
  --body: "Manrope", var(--sys);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--midnight);
  color: var(--ivory);
  font: 500 15px/1.5 var(--body);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 64px; }
.wrap.wide { max-width: 1120px; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.orb {
  flex: none; width: 34px; height: 34px;
  border-radius: 46% 54% 50% 50%;
  background: radial-gradient(circle at 35% 30%, #ffb98f, #e6519c 60%, #a35be0);
}
.brand { min-width: 0; flex: 1; }
.brand b { display: block; font: 800 19px/1.15 var(--head); letter-spacing: -0.01em; }
.brand span { display: block; font-size: 12.5px; color: var(--on-dark-2); }
.icon-btn {
  flex: none; display: inline-grid; place-items: center;
  min-width: 44px; height: 44px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--on-dark-line);
  background: var(--midnight-2); color: var(--ivory);
  font-weight: 800; font-size: 14px; text-decoration: none; cursor: pointer;
}
.icon-btn:hover { background: var(--midnight-3); }

/* Summary counters */
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
.stat {
  background: var(--midnight-2); border: 1px solid var(--on-dark-line);
  border-radius: 14px; padding: 10px 12px;
}
.stat b { display: block; font: 800 22px/1.1 var(--head); }
.stat span { font-size: 12.5px; color: var(--on-dark-2); }
.stat.alert { border-color: rgba(255, 140, 120, 0.55); }
.stat.alert b { color: #ffb4a6; }

/* Sections */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 2px 10px; }
.section-head h2 { margin: 0; font: 800 17px/1.2 var(--head); }
.section-head span { color: var(--on-dark-2); font-size: 13px; }
.day { margin: 16px 4px 8px; font: 700 12.5px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-dark-2); }

/* Post rows (ivory cards) */
.card {
  background: var(--ivory); color: var(--ink);
  border-radius: var(--radius); padding: 14px 14px 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
}
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; text-decoration: none; }
.row .time { grid-row: span 4; font: 800 15px/1.3 var(--head); color: var(--ink); padding-top: 1px; }
.row .time small { display: block; font: 600 11.5px/1.3 var(--body); color: var(--ink-3); }
.row .title { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.row .title a { flex: 1; min-width: 0; font: 700 15.5px/1.3 var(--head); text-decoration: none; color: var(--ink); }
.row .title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row .views { flex: none; font: 700 12.5px/1.6 var(--body); color: var(--ink-2); white-space: nowrap; }
.row .meta { grid-column: 2; font-size: 12.5px; color: var(--ink-3); }
.row .chips { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row .err { grid-column: 2; margin-top: 6px; font-size: 12.5px; color: #8f2219; }

/* Status chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 4px 10px; border-radius: 999px;
  font: 700 12.5px/1.2 var(--body); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
}
.chip .p { font-weight: 800; }
.chip .s { opacity: 0.9; font-weight: 600; }
a.chip:hover { text-decoration: underline; text-underline-offset: 2px; }
.st-pending { background: #e4e0d5; color: #3d4457; }
.st-working, .st-processing { background: #dde5ff; color: #23389c; }
.st-posted { background: #d3eedb; color: #135c33; }
.st-failed { background: #fbdcd9; color: #93221a; }
.st-needs_check { background: #fbe7bd; color: #6e4300; }
.st-reminded { background: #e9e1ff; color: #43299f; }
.st-cancelled { background: transparent; border-color: var(--line); color: var(--ink-3); }
.st-cancelled .s { text-decoration: line-through; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-working .dot, .st-processing .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: 800 14px/1 var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { background: #fbfaf6; }
.btn.primary { background: var(--midnight); border-color: var(--midnight); color: var(--ivory); }
.btn.primary:hover { background: var(--midnight-3); }
.btn.small { min-height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; }
.btn.violet { background: #43299f; border-color: #43299f; color: #fff; }
.btn.violet:hover { background: #3a2390; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* Empty / error states */
.empty {
  border: 1px dashed var(--on-dark-line); border-radius: var(--radius);
  padding: 18px; color: var(--on-dark-2); font-size: 14px; text-align: center;
}
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #3a1f24; border: 1px solid rgba(255, 140, 120, 0.4); color: #ffd9d2;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px;
}
.banner span { flex: 1 1 200px; }
.skeleton { height: 86px; border-radius: var(--radius); background: var(--midnight-2); animation: pulse 1.4s ease-in-out infinite; }

/* Post page */
.post-head h1 { margin: 0 0 6px; font: 800 24px/1.2 var(--head); letter-spacing: -0.01em; }
.post-head .meta { color: var(--on-dark-2); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; }
.player {
  display: block; width: 100%; max-height: 72vh; border-radius: var(--radius);
  background: #000; aspect-ratio: 9 / 16; object-fit: contain;
}
.player.long { aspect-ratio: 16 / 9; }
.gone {
  display: grid; align-content: center; justify-items: center; text-align: center; gap: 4px;
  min-height: 160px; border-radius: var(--radius); padding: 18px;
  background: var(--midnight-2); border: 1px dashed var(--on-dark-line); color: var(--on-dark-2); font-size: 14px;
}
.gone b { color: var(--ivory); font-family: var(--head); }
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.slides img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--midnight-2); }
.media .btn { width: 100%; }

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.card h2 { margin: 0 0 10px; font: 800 15px/1.2 var(--head); }
.deliv { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.deliv:first-of-type { border-top: 0; padding-top: 2px; }
.deliv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.deliv-top .name { font: 800 14.5px/1.2 var(--head); }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.kv b { color: var(--ink); font-weight: 800; }
.deliv .err { font-size: 13px; color: #8f2219; background: #fbeceb; border-radius: 10px; padding: 8px 10px; }
.deliv a.link { font-size: 13px; font-weight: 700; color: #23389c; }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.num { background: var(--ivory-2); border-radius: 10px; padding: 6px 8px; }
.num b { display: block; font: 800 16px/1.2 var(--head); }
.num span { font-size: 11.5px; color: var(--ink-3); }

.callout { background: #e9e1ff; color: #2c1a75; }
.callout h2 { color: #2c1a75; }
.callout ol { margin: 0 0 12px; padding-left: 20px; font-size: 14px; }
.callout .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.deliv .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.caption {
  white-space: pre-wrap; font: 500 14px/1.55 var(--body);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; max-height: 260px; overflow: auto; margin: 0 0 10px;
}
.cap-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cap-head h2, .cap-head h3 { margin: 0; }
.cap-head h3 { font: 800 13.5px/1.2 var(--head); }
details.more { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
details.more summary { cursor: pointer; font-weight: 800; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
details.more .capbox { margin-top: 10px; }

/* Mark-posted dialog */
dialog {
  width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 18px;
  background: var(--ivory); color: var(--ink);
}
dialog::backdrop { background: rgba(5, 8, 16, 0.7); }
dialog h2 { margin: 0 0 4px; font: 800 18px/1.25 var(--head); }
dialog p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
dialog label { display: block; font-weight: 800; font-size: 13.5px; margin-bottom: 6px; }
dialog label span { font-weight: 600; color: var(--ink-3); }
dialog input {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid rgba(16, 22, 37, 0.25); background: #fff; color: var(--ink); font-size: 16px;
}
dialog .msg { min-height: 20px; margin: 8px 0 0; font-size: 13px; color: #8f2219; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px);
  background: var(--ivory); color: var(--ink); font-weight: 800; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.foot { margin-top: 30px; text-align: center; font-size: 12.5px; color: var(--on-dark-2); }

@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 22px; }
  .media { position: sticky; top: 18px; }
  .post-head h1 { font-size: 30px; }
  .row { grid-template-columns: 64px minmax(0, 1fr); }
}

/* Fixes after the 375/1280 screenshots */
.media .btn.primary { background: var(--ivory); border-color: var(--ivory); color: var(--ink); }
.media .btn.primary:hover { background: #fff; }
.nums { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
.num span { overflow-wrap: normal; }
details.more summary { list-style: none; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "Show"; font-size: 12.5px; color: var(--ink-3); }
details.more[open] summary::after { content: "Hide"; }
