/* phai-dbstudio.monrak.net — one style (Phai Studio's site's, in Phai Database Studio's red) for the whole page, after desktopserver.monrak.net and monrak.net.
   Tokens first; every card on the page is the same .card, with the same hover (spotlight, tilt, lift),
   the same running light on its border, and the same fade-in. Only the tokens change colour. */

:root {
    --green: #c8293a;          /* the brand: buttons, accents, the running light */
    --green-rgb: 200 41 58;
    --green-dark: #8f1d2b;
    --green-soft: #fbe7e9;
    --ink: #2a1215;            /* headings */
    --text: #3a2326;
    --muted: #6f5a5d;
    --line: #f0dfe1;
    --surface: #ffffff;
    --tint: #fdf6f6;           /* alternate sections */
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 16px 36px rgb(var(--green-rgb) / .12), 0 2px 6px rgb(0 0 0 / .04);
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --sans: "IBM Plex Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
    --wrap: 1120px;
}

* { box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; scroll-padding-top: 72px; }   /* every rem 2px smaller than the browser's 16px */
body { margin: 0; background: var(--surface); color: var(--text); font: 1rem/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--green); }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .88em; background: var(--green-soft); color: var(--green-dark); padding: 1px 6px; border-radius: 6px; }
pre { margin: 12px 0 0; padding: 14px 16px; overflow-x: auto; background: #2a1215; color: #f6dfe2; border-radius: var(--radius-sm); }
pre code { background: none; color: inherit; padding: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--tint); }
::-webkit-scrollbar-thumb { background: #e6b9bf; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* texture: a faint grid behind everything */
#grid-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(to right, rgb(42 18 21 / .045) 1px, transparent 1px), linear-gradient(to bottom, rgb(42 18 21 / .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 40%, transparent 100%); }
main, .foot { position: relative; z-index: 2; }

/* the small mono labels above every heading */
.label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--green); }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: rgb(255 255 255 / .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { font: 500 9px/1 var(--mono); letter-spacing: .24em; color: var(--muted); }
.brand b { font-size: 1.05rem; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav a:hover { color: var(--green); }
.nav .lang { display: inline-flex; align-items: center; gap: 4px; }
.nav .cta { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; }
.nav .cta:hover { background: var(--green); color: #fff; }
@media (max-width: 860px) { .nav .hide-sm { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; text-decoration: none; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding: 96px 0 56px; }
.hero-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin: 6px 0 18px; color: var(--ink); font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.18; font-weight: 700; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero .lead { margin: 0 0 28px; max-width: 40em; color: var(--muted); font-size: 1.08rem; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(300px, 70vw); height: auto; filter: drop-shadow(0 22px 44px rgb(var(--green-rgb) / .28)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.stats div { padding: 0 28px; border-left: 1px solid var(--line); }
.stats div:first-child { padding-left: 0; border-left: 0; }
.stats small { display: block; font: 500 10px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stats b { display: block; font: 600 1.6rem/1.3 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
    .hero { padding: 48px 0 32px; }
    .hero-row { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .hero-art img { width: 160px; }
    .stats div { padding: 0 16px; }
}

/* sections */
.section { position: relative; padding: 80px 0; border-top: 1px solid var(--line); }
.section.tint { background: rgb(253 246 246 / .8); }
.section h2 { margin: 0 0 10px; color: var(--ink); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; font-weight: 700; }
.section .sub { margin: 0 0 32px; max-width: 46em; color: var(--muted); font-size: 1.04rem; }
.mt { margin-top: 24px; }
.note { margin: 10px 0 0; color: var(--muted); font-size: .94rem; }
.note i { color: var(--green); }
@media (max-width: 860px) { .section { padding: 56px 0; } }

/* grids */
.grid { display: grid; gap: 16px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid.g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.g3, .grid.g2 { grid-template-columns: 1fr; } }

/* THE card: every box on the page */
.card { position: relative; display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 255 255 / .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--text); text-decoration: none; isolation: isolate; }
.card .icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 1.4rem; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .3s, color .3s, box-shadow .3s; }
.card h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card.row { display: flex; gap: 14px; align-items: flex-start; }
.card.row .icon { flex: none; margin-bottom: 0; }
.card.main { border-color: rgb(var(--green-rgb) / .4); background: linear-gradient(150deg, rgb(227 243 235 / .9), rgb(255 255 255 / .8) 65%); }

/* the running light around the border */
@property --beam { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; padding: 1px;
    background: conic-gradient(from var(--beam), transparent 0deg, transparent 300deg, rgb(var(--green-rgb) / .4) 335deg, rgb(var(--green-rgb) / .95) 352deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: beam 6s linear infinite; }
.card:nth-child(3n+2)::after { animation-delay: -2s; }
.card:nth-child(3n)::after { animation-delay: -4s; }
@keyframes beam { to { --beam: 360deg; } }

/* hover: a spotlight under the pointer, a slight tilt, a lift; the icon turns green */
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--green-rgb) / .1), transparent 62%); }
.card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, opacity .7s ease-out; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.card:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); box-shadow: var(--shadow); border-color: rgb(var(--green-rgb) / .3); }
.card:hover::before { opacity: 1; }
.card:hover::after { animation-duration: 2.5s; }
.card:hover .icon { transform: scale(1.1) rotate(-6deg); background: var(--green); color: #fff; box-shadow: 0 6px 16px rgb(var(--green-rgb) / .3); }

/* fade in once, then drift a little with the scrollbar */
.reveal { opacity: 0; translate: 0 18px; transition: opacity .7s ease-out, translate .7s ease-out, transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.reveal.shown { opacity: 1; translate: none; }
.glide { translate: 0 var(--drift, 0px); will-change: translate; }

@media (hover: none), (prefers-reduced-motion: reduce) { .card, .card:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .card::after { animation: none; opacity: 0; } .hero-art img { animation: none; } .reveal { opacity: 1; translate: none; } }

/* lessons: numbered */
.lesson b { display: block; margin-bottom: 4px; font: 600 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--green); }

/* gallery: a slider of real screens; a click opens it large */
.gallery { display: grid; grid-template-columns: 1fr; gap: 14px; }
.slider { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 20px 50px rgb(var(--green-rgb) / .12); }
.slides { display: flex; transition: transform .6s ease; }
.slide { flex: 0 0 100%; display: block; cursor: zoom-in; }
.slide img { display: block; width: 100%; height: auto; aspect-ratio: 1432 / 969; object-fit: contain; background: #f3f6f4; }
.slider .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--green); font-size: 1.3rem; cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / .15); opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.slider:hover .nav-btn, .slider .nav-btn:focus-visible { opacity: 1; }
.slider .nav-btn:hover { background: var(--green); color: #fff; }
.sl-prev { left: 12px; }
.sl-next { right: 12px; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgb(42 18 21 / .7); color: #fff; font-size: .82rem; pointer-events: none; }
.caption { margin: 0; text-align: center; color: var(--muted); font-size: .95rem; }
.caption b { color: var(--ink); }
@media (hover: none) { .slider .nav-btn { opacity: 1; } }

.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 16px; background: rgb(28 10 12 / .94); }
.lightbox[hidden] { display: none; }
.lb-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; }
.lb-stage img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }
.lb-caption { margin: 10px 0 0; color: #fff; text-align: center; font-size: .95rem; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; font-size: 1.5rem; cursor: pointer; }
.lightbox button:hover { background: var(--green); }
.lb-close { top: 10px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox { padding: 56px 8px 12px; } }

/* install steps */
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px; border-radius: 50%; background: var(--green); color: #fff; font: 600 .9rem/1 var(--mono); }

/* contacts */
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.contact { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.contact .icon { margin: 0; border-radius: 50%; background: var(--brand); color: #fff; }
.contact:hover .icon { background: var(--brand); }
.contact b { display: block; color: var(--ink); }
.contact small { color: var(--muted); overflow-wrap: anywhere; }
.contact.line { --brand: #06c755; }
.contact.fb { --brand: #1877f2; }
.contact.mail { --brand: #ea4335; }
@media (max-width: 860px) { .contacts { grid-template-columns: 1fr; } }

/* download */
.file { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.file h3 { margin-bottom: 2px; }
.file details { margin-top: 6px; color: var(--muted); font-size: .85rem; }
.file .sha { word-break: break-all; }
/* What's new: each release a card, the newest first. */
.history { display: grid; gap: 12px; margin-top: 18px; }
.release h3 { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); }
.release h3 small { color: var(--muted); font: 400 .85rem/1 inherit; font-family: inherit; }
.release ul { margin: 6px 0 0; padding-left: 1.2em; }
.release li { margin: 3px 0; }

/* footer */
.foot { padding: 56px 0 72px; border-top: 1px solid var(--line); background: rgb(253 246 246 / .85); }
.foot blockquote { margin: 18px 0 28px; padding: 4px 0 4px 18px; border-left: 3px solid var(--green); color: var(--muted); font-style: italic; }
.foot h3 { margin: 0 0 14px; color: var(--ink); font-size: 1rem; }
.foot .copy { margin: 28px 0 0; color: var(--muted); font-size: .9rem; }
.family .card { padding: 16px 18px; }
.family .card b { display: block; color: var(--green); }
.family .card span { color: var(--muted); font-size: .9rem; }

/* where you are on the page, bottom left */

/* Thai: lines break between phrases only (assets/thai-wrap.js), no lone word on the last line. */
.nb { white-space: nowrap; }
p, li, h1, h2, h3, figcaption, blockquote, small, span { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }

/* The guide in two parts (tools a page each, Rust lessons) and the made-with card. */
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .grid.g4 { grid-template-columns: 1fr; } }
h3.part { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 1.15rem; }
h3.part.mt { margin-top: 36px; }
h3.part .ti { color: var(--green); font-size: 1.3rem; }
h3.part + .muted { margin: 0 0 16px; }
.card.tool .icon img { width: 26px; height: 26px; }
.card.tool p { font-size: .92rem; }
/* The guide's cards: the icon on the left, the name and what it is beside it. */
#learn .card.lesson { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 14px; }
#learn .card.lesson .icon { grid-row: 1 / 3; align-self: center; margin-bottom: 0; }
#learn .card.lesson b { margin: 2px 0 2px; }
#learn .card.lesson p { margin: 0; }
/* Tighter guide cards: the tool's name is what is read first, the line under it smaller and quieter. */
#learn .card.lesson { padding: 14px 16px; grid-template-columns: 40px 1fr; column-gap: 12px; }
#learn .card.lesson .icon { width: 40px; height: 40px; border-radius: 10px; font-size: 1.25rem; }
#learn .card.lesson.tool .icon img { width: 24px; height: 24px; }
#learn .card.lesson.tool b { margin: 0 0 1px; font-family: var(--sans, inherit); font-weight: 600; font-size: 1rem; line-height: 1.35; letter-spacing: 0; text-transform: none; color: var(--text); }
#learn .card.lesson p { font-size: .86rem; line-height: 1.5; }
/* A tool's own icon (a picture, not a font glyph) turns white on the green, as the glyphs do. */
#learn .card.lesson.tool .icon img { transition: filter .3s; }
#learn .card.lesson.tool:hover .icon img, #learn .card.lesson.tool:focus-visible .icon img { filter: brightness(0) invert(1); }
/* Every card in a grid the same size: each row as tall as the tallest card anywhere in the grid. */
.grid.g3, .grid.g4 { grid-auto-rows: 1fr; }
/* Every card with an icon: the icon on the left, everything else beside it. */
.card:not(.row):not(.contact):not(.lesson):not(.made):has(> .icon) { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; align-content: start; }
.card:not(.row):not(.contact):not(.lesson):not(.made):has(> .icon) > .icon { grid-row: 1 / span 9; margin-bottom: 0; }
.card:not(.row):not(.contact):not(.lesson):not(.made):has(> .icon) > :not(.icon) { grid-column: 2; }
.card:not(.row):not(.contact):not(.lesson):not(.made):has(> .icon) > h3 { margin-top: 10px; }
/* The screenshots smaller than the page's width, in the middle. */
/* The screenshots on the left, what the screen is on the right. */
.gallery { grid-template-columns: 11fr 9fr; gap: 36px; align-items: center; }
.shot-info { min-height: 300px; }
.shot-info .shot-n { font: 500 12px/1 var(--mono); letter-spacing: .14em; color: var(--muted); }
.shot-info .shot-n b { font-size: 1.5rem; color: var(--green); letter-spacing: 0; margin-right: 2px; }
.shot-info h3 { margin: 10px 0 6px; font-size: 1.5rem; line-height: 1.3; color: var(--ink); }
.shot-info p { margin: 0 0 14px; color: var(--muted); }
.shot-info ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.shot-info li { position: relative; padding-left: 26px; font-size: .95rem; line-height: 1.55; }
.shot-info li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.shot-info.fresh > * { animation: shot-in .45s ease-out both; }
.shot-info.fresh > :nth-child(2) { animation-delay: .05s; } .shot-info.fresh > :nth-child(3) { animation-delay: .1s; } .shot-info.fresh > :nth-child(4) { animation-delay: .15s; }
@keyframes shot-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .shot-info.fresh > * { animation: none; } }
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr; gap: 18px; } .shot-info { min-height: 0; } }
.slider { overflow: clip; clip-path: inset(0 round var(--radius)); }
/* Phai Desk: one line about it, then the same slider as the screens. */
.made-lead { margin: -8px 0 22px; max-width: 70ch; color: var(--muted); }
.made-lead b { color: var(--ink); }
.grid.demos { grid-auto-rows: auto; }
.card.demo { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 12px; }
.card.demo .demo-shot { display: block; aspect-ratio: 840 / 578; margin-bottom: 8px; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.card.demo .demo-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .4s ease; }
.card.demo:hover .demo-shot img { transform: scale(1.04); }
.card.demo b { padding: 0 4px; font-weight: 600; color: var(--ink); }
.card.demo small { padding: 0 4px; color: var(--muted); font-size: .85rem; }

/* --- The Q&A board (/board) --------------------------------------------------------------- */
.board { padding-top: 28px; padding-bottom: 48px; }
.board h1 { margin: 0 0 6px; font-size: 1.9rem; color: var(--ink); }
.board h2 { margin: 36px 0 12px; font-size: 1.25rem; color: var(--ink); }
.board .sub { margin: 0 0 20px; color: var(--muted); }
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumbs { margin-bottom: 14px; font-size: .92rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.group { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.group:hover { border-color: var(--green); box-shadow: var(--shadow); }
.group > .ti { font-size: 1.6rem; color: var(--green); background: var(--green-soft); border-radius: 10px; padding: 8px; }
.group span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.group b { color: var(--ink); }
.group small { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.g-count, .t-count { flex: none !important; text-align: right; font-weight: 700; color: var(--ink); }
.g-count small, .t-count small { font-weight: 400; }
.topics { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.topic { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.topic:first-child { border-top: 0; }
.topic:hover { background: var(--tint); }
.t-title { font-weight: 600; color: var(--ink); }
.t-meta { grid-column: 1; font-size: .86rem; color: var(--muted); }
.t-count { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.t-grp .ti { color: var(--green); }
.none { padding: 18px 16px; margin: 0; color: var(--muted); }
.post { position: relative; padding: 18px 20px; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.post.first { border-color: var(--green); box-shadow: var(--shadow); }
.post h1 { font-size: 1.6rem; }
.post-body { margin-top: 10px; overflow-wrap: anywhere; }
.post-body pre.code { white-space: pre; }
.board-form { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--tint); }
.board-form.narrow { max-width: 380px; }
.board-form label { display: grid; gap: 4px; font-weight: 600; color: var(--ink); }
.board-form input, .board-form select, .board-form textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.board-form textarea { resize: vertical; font-family: var(--sans); }
.board-form input:focus, .board-form select:focus, .board-form textarea:focus { outline: 2px solid rgb(var(--green-rgb) / .35); border-color: var(--green); }
.board-form small, .rules { font-weight: 400; color: var(--muted); font-size: .85rem; margin: 0; }
.board-form .row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.board-form .row label { flex: 1; min-width: 200px; }
.board-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { color: #b42318; font-weight: 600; }
.pages { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.del { position: absolute; top: 12px; right: 12px; }
.admin-item .del { position: static; }
.btn-del { border: 1px solid #f3c7c2; background: #fff5f4; color: #b42318; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: .85rem; }
.btn-del:hover { background: #fde4e1; }
.admin-list { display: grid; gap: 8px; }
.admin-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.excerpt { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.board-foot { padding: 20px 16px 40px; text-align: right; font-size: .85rem; }
.board-foot a { color: var(--muted); }
.board-form .cap input { max-width: 160px; }

/* The board's write window: the form opens over the page, so the page shows the topics. */
.board-dialog { width: min(760px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); color: var(--text); }
.board-dialog::backdrop { background: rgb(42 18 21 / .45); }
.board-dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.board-dialog .dlg-head h2 { margin: 0; font-size: 1.2rem; }
.board-dialog .dlg-x { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.board-dialog .dlg-x:hover { background: var(--tint); color: var(--ink); }
.board-dialog .err { margin: 14px 20px 0; }
.board-dialog .board-form { border: 0; border-radius: 0; background: var(--surface); }
.reply-bar { display: flex; justify-content: flex-end; margin: 18px 0 8px; }
/* On a phone: where Phai Studio goes, above a button that sends the page to a computer. */
.phone-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border: 1px solid rgb(var(--green-rgb) / .3); border-radius: 12px; background: var(--green-soft); color: var(--text); font-size: .95rem; line-height: 1.55; }
.phone-note .ti { color: var(--green); font-size: 1.4rem; line-height: 1.1; }
.phone-note span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.phone-note b { display: block; color: var(--ink); }
