/* ── AGL Racing News ──
   Ported from the main site's Sports Desk styles (chalkzone-blog.css):
   same desk, reader, newspaper layouts and editor, recolored for racing
   (AGL teal accent, black surfaces instead of navy). Used by index.html
   (#news) and admin/index.html (News tool). */

/* ── Desk ── */
.news-wrap { padding: 1rem 1rem 0; scroll-margin-top: 96px; }
.rn-desk { --rn-accent: var(--agl-teal); --rn-accent-soft: #6be6ff; --rn-accent-rgb: var(--agl-teal-rgb); min-width: 0; font-family: var(--font-racing); }
.rn-desk .eyebrow { color: var(--rn-accent-soft); }
.rn-desk .panel-heading h2 { box-shadow: inset 0 -2px 0 rgba(var(--rn-accent-rgb), .55); padding-bottom: .15rem; }
.rn-desk-layout { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rn-desk-side { min-width: 0; }
@media (max-width: 900px) {
  .rn-desk-layout { grid-template-columns: 1fr; }
}

.rn-top { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; }
.rn-top-logo { width: 96px; height: auto; flex: 0 0 auto; }
.rn-intro { font-size: .85rem; line-height: 1.55; color: rgba(255,255,255,.55); margin: 0; max-width: 72ch; }
.rn-actions:empty { display: none; }
.rn-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rn-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.rn-link:hover { color: #fff; }

/* Search */
.rn-search { display: flex; gap: .5rem; margin: 0 0 .7rem; }
.rn-search[hidden] { display: none; }
.rn-search-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.rn-search-field svg { position: absolute; left: .8rem; width: 16px; height: 16px; color: rgba(255,255,255,.4); pointer-events: none; }
.rn-search-field input {
  width: 100%; box-sizing: border-box; min-height: 0; padding: .6rem 2.2rem .6rem 2.35rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(192,196,210,.22); border-radius: 8px;
  color: #f0f3f8; font: inherit; font-family: var(--font-racing); font-size: .85rem;
}
.rn-search-field input::placeholder { color: rgba(255,255,255,.35); }
.rn-search-field input:focus { outline: none; border-color: rgba(var(--rn-accent-rgb), .6); box-shadow: 0 0 0 3px rgba(var(--rn-accent-rgb), .14); }
.rn-search-field input::-webkit-search-cancel-button { display: none; }
.rn-search-clear { position: absolute; right: .35rem; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: rgba(255,255,255,.55); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.rn-search-clear:hover { color: #fff; background: rgba(255,255,255,.08); }
.rn-search .button { cursor: pointer; font: inherit; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.rn-summary { min-height: 1.1em; margin: 0 0 .6rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.45); }
.rn-summary .rn-btn { margin-left: .25rem; padding: .25rem .65rem; font-size: .66rem; }

/* Headline list: newest first, scrolls after a page of headlines */
.rn-rail { display: flex; flex-direction: column; gap: .3rem; max-height: 26rem; overflow-y: auto; padding: .3rem; border: 1px solid rgba(192,196,210,.16); border-radius: 10px; background: rgba(255,255,255,.02); scrollbar-width: thin; scrollbar-color: rgba(var(--rn-accent-rgb), .5) transparent; }
.rn-rail[hidden] { display: none; }
.rn-rail[aria-busy="true"] { opacity: .6; }
.rn-rail .rn-state { border: 0; }
.rn-rail-item { display: block; width: 100%; padding: .5rem .65rem; border: 0; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; background: none; color: #e7ebf2; font: inherit; text-align: left; cursor: pointer; }
.rn-rail-item:hover { background: rgba(255,255,255,.05); }
.rn-rail-item:focus-visible { outline: 2px solid rgba(var(--rn-accent-rgb), .7); outline-offset: -2px; }
.rn-rail-item.is-on { border-left-color: var(--rn-accent); background: rgba(var(--rn-accent-rgb), .13); }
.rn-rail-title { display: block; font-size: .86rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.rn-rail-item.is-on .rn-rail-title { color: #fff; }
.rn-rail-meta { display: block; margin-top: .2rem; font-size: .66rem; font-weight: 700; letter-spacing: .03em; color: rgba(255,255,255,.45); }
.rn-rail-kind { display: inline-block; margin-right: .4rem; padding: 0 .35rem; border: 1px solid rgba(var(--rn-accent-rgb), .45); border-radius: 4px; color: var(--rn-accent-soft); font-size: .56rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.rn-state { padding: 1.6rem 1rem; text-align: center; border: 1px dashed rgba(192,196,210,.22); border-radius: 10px; color: rgba(255,255,255,.55); font-size: .85rem; }
.rn-state p { margin: 0 0 .6rem; }
.rn-state p:last-child { margin: 0; }

/* Pager */
.rn-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem; margin-top: .6rem; }
.rn-pager[hidden] { display: none; }
.rn-page { min-width: 2.2rem; padding: .4rem .65rem; border: 1px solid rgba(192,196,210,.22); border-radius: 6px; background: rgba(255,255,255,.04); color: #dfe5ee; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.rn-page:hover:not(:disabled) { border-color: rgba(var(--rn-accent-rgb), .55); background: rgba(255,255,255,.08); }
.rn-page.is-current { background: rgba(var(--rn-accent-rgb), .18); border-color: var(--rn-accent); color: var(--rn-accent-soft); cursor: default; }
.rn-page:disabled { opacity: .35; cursor: default; }
.rn-page-gap { color: rgba(255,255,255,.35); padding: 0 .1rem; }

/* Reader */
.rn-reader { min-width: 0; container-type: inline-size; }
.rn-reader:empty { display: none; }
.rn-reader .rn-np-mast-name { font-size: clamp(.95rem, 5cqi, 2.1rem); letter-spacing: .05em; white-space: nowrap; }

/* ── Posts (written mode) ── */
.rn-post { padding: 1rem 1.1rem; border: 1px solid rgba(192,196,210,.18); border-radius: 10px; background: linear-gradient(160deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.012) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); font-family: var(--font-racing); }
.rn-post:not(.rn-np) { border-left: 3px solid var(--agl-teal); }
.rn-post-title { margin: 0 0 .3rem; font-family: inherit; font-size: 1.15rem; line-height: 1.3; letter-spacing: 0; text-transform: none; color: #f0f3f8; overflow-wrap: anywhere; }
.rn-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; margin-bottom: .75rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.45); }
.rn-post-author { color: #6be6ff; text-transform: uppercase; letter-spacing: .1em; font-weight: 900; }
.rn-post-edited { font-style: italic; font-weight: 600; }
.rn-post-body { font-size: .9rem; line-height: 1.65; color: rgba(255,255,255,.78); overflow-wrap: anywhere; }
.rn-post-body p { margin: 0 0 .8rem; }
.rn-post-body p:last-child { margin-bottom: 0; }
.rn-post-body .rn-h { margin: 1.15rem 0 .5rem; font-family: inherit; font-size: .95rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #6be6ff; line-height: 1.35; }
.rn-post-body .rn-h:first-child { margin-top: 0; }
.rn-post-body strong { color: #fff; font-weight: 800; }
.rn-post-body .rn-h strong { color: inherit; font-weight: inherit; }
.rn-post-body em { font-style: italic; color: rgba(255,255,255,.88); }
.rn-post-body .rn-list { margin: 0 0 .8rem; padding-left: 1.35rem; }
.rn-post-body .rn-list li { margin: 0 0 .3rem; padding-left: .15rem; }
.rn-post-body .rn-list li::marker { color: var(--agl-teal); font-weight: 800; }
.rn-post-body .rn-quote { margin: 0 0 .8rem; padding: .5rem .9rem; border-left: 3px solid var(--agl-teal); border-radius: 0; background: rgba(var(--agl-teal-rgb), .07); color: rgba(255,255,255,.88); font-style: italic; }
.rn-share { margin-left: auto; padding: .1rem .55rem; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: none; color: rgba(255,255,255,.6); font: inherit; font-size: .66rem; font-weight: 800; letter-spacing: .06em; cursor: pointer; }
.rn-share:hover:not(:disabled) { border-color: rgba(var(--agl-teal-rgb), .6); color: #6be6ff; }
.rn-share:disabled { color: #4ade80; border-color: rgba(74,222,128,.45); cursor: default; }
.rn-post mark { background: rgba(var(--agl-teal-rgb), .35); color: #fff; border-radius: 2px; padding: 0 .1em; }
.rn-post-tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .8rem 0 0; padding: 0; }
.rn-tag { padding: .15rem .55rem; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.04); color: rgba(255,255,255,.65); font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer; }
.rn-tag:hover { border-color: rgba(var(--agl-teal-rgb), .6); color: #6be6ff; }
.rn-post-actions { display: flex; gap: .5rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid rgba(255,255,255,.07); }

/* Buttons */
.rn-btn { padding: .38rem .9rem; border: 1px solid rgba(192,196,210,.28); border-radius: 6px; background: rgba(255,255,255,.05); color: #dfe5ee; font: inherit; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.rn-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(var(--agl-teal-rgb), .5); }
.rn-btn--danger { color: #f87171; border-color: rgba(248,113,113,.4); }
.rn-btn--danger:hover { background: rgba(248,113,113,.12); border-color: #f87171; }
.rn-btn--solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.rn-btn--solid:hover { background: #ef4444; border-color: #ef4444; }
.rn-btn:disabled { opacity: .55; cursor: default; }
/* Publish / Create: the gunmetal style of the landing page's Join the Grid button */
.button.rn-save { border-color: rgba(255,255,255,.7); background: linear-gradient(180deg, #3a4048, #15181c); color: #fff; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px rgba(0,0,0,.6); }
.button.rn-save:hover { border-color: #fff; }
.button.rn-save:disabled { opacity: .55; cursor: wait; transform: none; }
.rn-create-btn { min-height: 38px; padding: .5rem 1rem; }

/* Images and dividers (both media modes) */
.rn-fig { margin: .4rem 0 1rem; break-inside: avoid; }
.rn-fig-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.rn-fig img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.04); }
.rn-fig figcaption, .rn-np-hero-cap { margin: .35rem 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: .76rem; font-style: italic; line-height: 1.4; color: rgba(255,255,255,.58); }
.rn-credit { margin-left: .45rem; font-family: inherit; font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.rn-divider { width: 40%; height: 1px; margin: 1.3rem auto; border: 0; background: linear-gradient(90deg, transparent, rgba(var(--agl-teal-rgb), .75), transparent); }

/* ── Newspaper mode: night edition (black paper, gold rules as on the Sports Desk) ── */
.rn-np { position: relative; overflow: hidden; padding: 1.1rem 1.3rem 1.2rem; border-color: rgba(201,162,39,.3); background: linear-gradient(180deg, #141416 0%, #0a0a0b 100%); }
.rn-np .rn-post-author { color: #c9a227; }
.rn-np .rn-post-body .rn-h { color: #f0cf61; }
.rn-np .rn-post-body .rn-list li::marker { color: #c9a227; }
.rn-np .rn-post-body .rn-quote { border-left-color: #c9a227; background: rgba(201,162,39,.07); }
.rn-np .rn-divider { background: linear-gradient(90deg, transparent, rgba(201,162,39,.75), transparent); }
.rn-np-mast { margin: 0 0 .95rem; padding: .35rem 0 .3rem; border-top: 3px double #c9a227; border-bottom: 1px solid rgba(201,162,39,.55); text-align: center; }
.rn-np-mast-name { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.35rem, 3.6vw, 2.1rem); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #f5f6f9; line-height: 1.15; }
.rn-np-mast-line { display: flex; justify-content: space-between; gap: .6rem; margin-top: .2rem; padding-top: .2rem; border-top: 1px solid rgba(201,162,39,.25); font-size: .6rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.rn-np-hl { margin: 0 0 .45rem; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.35rem, 3.4vw, 2rem); font-weight: 700; line-height: 1.12; letter-spacing: 0; text-transform: none; color: #f5f6f9; overflow-wrap: anywhere; }
.rn-np-deck { margin: 0 0 .6rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.02rem; font-style: italic; line-height: 1.45; color: rgba(255,255,255,.72); }
.rn-np-by { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .75rem; margin: 0 0 1rem; padding-bottom: .65rem; border-bottom: 1px solid rgba(201,162,39,.25); font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.45); }
.rn-np-body { font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; line-height: 1.72; color: rgba(255,255,255,.84); }
.rn-np-body .rn-h { font-family: inherit; letter-spacing: .04em; break-after: avoid; }
.rn-np-body .rn-quote { break-inside: avoid; }
.rn-np .rn-fig--hero img { max-height: 460px; object-fit: cover; }
.rn-np-extras { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.rn-np-extras .rn-fig { flex: 1 1 220px; min-width: 0; margin: 0; }
/* A · Front page: columns + drop cap */
.rn-np--front .rn-np-cols { column-width: 17em; column-gap: 1.8rem; column-rule: 1px solid rgba(201,162,39,.2); }
.rn-np--front .rn-np-cols > p:first-child::first-letter { float: left; margin: .06em .12em 0 0; font-size: 3.5em; font-weight: 700; line-height: .82; color: #f0cf61; }
/* B · Feature: headline on the hero, big pull quotes */
.rn-np-hero { position: relative; margin: -1.1rem -1.3rem 0; }
.rn-np-hero .rn-fig { margin: 0; }
.rn-np-hero .rn-fig img { max-height: 440px; min-height: 220px; object-fit: cover; border-radius: 0; }
.rn-np-hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 1.3rem 1rem; background: linear-gradient(180deg, transparent, rgba(0,0,0,.94)); pointer-events: none; }
.rn-np-hero-text .rn-np-hl { margin: 0; font-size: clamp(1.5rem, 4vw, 2.4rem); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.rn-np-hero-cap { margin: .4rem 0 .9rem; }
.rn-np--feature .rn-np-hero + .rn-np-deck, .rn-np--feature .rn-np-hero + .rn-np-by { margin-top: .9rem; }
.rn-np--feature .rn-np-body .rn-quote { margin: 1.2rem 0; padding: .8rem 1rem; border: 0; border-top: 2px solid #c9a227; border-bottom: 2px solid #c9a227; background: none; font-size: 1.25rem; line-height: 1.4; text-align: center; color: #f5f6f9; }
/* C · Sidebar */
.rn-np-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.3rem; }
.rn-np-aside { display: flex; flex-direction: column; gap: .8rem; padding-left: 1.2rem; border-left: 1px solid rgba(201,162,39,.22); }
.rn-np-aside .rn-fig { margin: 0; }
/* D · Photo story */
.rn-np--photo .rn-np-hl, .rn-np--photo .rn-np-deck { text-align: center; }
.rn-np--photo .rn-np-by { justify-content: center; }
.rn-np-gallery { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.1rem; }
.rn-np-gallery .rn-fig { flex: 1 1 200px; min-width: 0; margin: 0; }
.rn-np-gallery .rn-fig:first-child { flex-basis: 100%; }
.rn-np-gallery .rn-fig:not(:first-child) img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 640px) {
  .rn-np { padding: .95rem .95rem 1rem; }
  .rn-np-hero { margin: -.95rem -.95rem 0; }
  .rn-np-hero-text { padding: 2.5rem .95rem .85rem; }
  .rn-np-split { grid-template-columns: 1fr; }
  .rn-np-aside { padding-left: 0; border-left: 0; }
  .rn-np-mast-line span:last-child { display: none; }
}

/* ── Modals: editor, delete confirmation, lightbox ── */
.rn-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; font-family: var(--font-racing); }
.rn-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(3px); }
.rn-modal-card { position: relative; width: min(680px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.2rem 1.3rem; border: 1px solid rgba(192,196,210,.25); border-radius: 12px; background: linear-gradient(160deg, #18181b, #0a0a0b); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.rn-modal-card--wide { width: min(860px, 100%); }
.rn-modal-card--image { width: min(1100px, 100%); padding: .8rem; }
.rn-lightbox { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.rn-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 9rem); width: auto; height: auto; border-radius: 6px; }
.rn-lightbox figcaption { align-self: stretch; font-family: Georgia, 'Times New Roman', serif; font-size: .85rem; font-style: italic; color: rgba(255,255,255,.7); }
body.has-open-modal { overflow: hidden; }

/* Editor form. Headings / labels / buttons follow the page font (Orbitron in
   the admin); typed text stays Segoe UI, like the admin's other fields. */
.rn-form { display: flex; flex-direction: column; gap: .4rem; }
.rn-form h3 { margin: 0 0 .4rem; font-size: 1.15rem; color: #f0f3f8; }
.rn-form label, .rn-form .rn-form-label { margin-top: .4rem; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.rn-form input, .rn-form textarea { width: 100%; box-sizing: border-box; padding: .6rem .7rem; background: rgba(255,255,255,.05); border: 1px solid rgba(192,196,210,.22); border-radius: 8px; color: #f0f3f8; font: inherit; font-family: var(--font-racing); font-size: .9rem; }
.rn-form textarea { resize: vertical; min-height: 10rem; line-height: 1.55; }
.rn-form input:focus, .rn-form textarea:focus { outline: none; border-color: rgba(var(--agl-teal-rgb), .6); box-shadow: 0 0 0 3px rgba(var(--agl-teal-rgb), .14); }
.rn-form-hint { display: flex; justify-content: space-between; gap: 1rem; font-size: .68rem; color: rgba(255,255,255,.4); }
.rn-form-status { min-height: 1.2em; margin: .3rem 0 0; font-size: .78rem; color: #f87171; }
.rn-form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.rn-form-actions .button { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.rn-confirm-text { margin: 0; font-size: .88rem; line-height: 1.5; color: rgba(255,255,255,.7); overflow-wrap: anywhere; }
.rn-form-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.rn-form-top h3 { margin: 0; }
.rn-counter.is-near { color: #fbbf24; }

/* Toolbar + preview */
.rn-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .4rem; }
.rn-tool { padding: .28rem .6rem; border: 1px solid rgba(192,196,210,.24); border-radius: 6px; background: rgba(255,255,255,.04); color: #dfe5ee; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.rn-tool:hover:not(:disabled) { border-color: rgba(var(--agl-teal-rgb), .55); background: rgba(255,255,255,.08); }
.rn-tool:disabled { opacity: .4; cursor: default; }
.rn-tool.is-b { font-weight: 900; }
.rn-tool.is-i { font-style: italic; }
.rn-tool--preview { margin-left: auto; color: #6be6ff; border-color: rgba(var(--agl-teal-rgb), .45); }
.rn-tool--danger { color: #f87171; border-color: rgba(248,113,113,.35); }
.rn-preview { min-height: 12rem; max-height: 50vh; overflow-y: auto; padding: .8rem 1rem; border: 1px dashed rgba(var(--agl-teal-rgb), .4); border-radius: 8px; background: rgba(255,255,255,.03); container-type: inline-size; }
.rn-preview[hidden] { display: none; }
.rn-preview .rn-post { margin: 0; }
.rn-preview .rn-np-mast-name { font-size: clamp(.95rem, 5cqi, 2.1rem); white-space: nowrap; }
.rn-preview-empty { color: rgba(255,255,255,.45); font-style: italic; }

/* Media mode + layouts */
.rn-seg { display: inline-flex; border: 1px solid rgba(192,196,210,.28); border-radius: 8px; overflow: hidden; }
.rn-seg button { padding: .42rem 1rem; border: 0; background: transparent; color: rgba(255,255,255,.7); font: inherit; font-size: .74rem; font-weight: 800; letter-spacing: .06em; cursor: pointer; }
.rn-seg button + button { border-left: 1px solid rgba(192,196,210,.2); }
.rn-seg button:hover { background: rgba(255,255,255,.06); }
.rn-seg button[aria-pressed="true"] { background: rgba(var(--agl-teal-rgb), .2); color: #6be6ff; }
.rn-np-fields { display: flex; flex-direction: column; gap: .4rem; }
.rn-np-fields[hidden] { display: none; }
.rn-layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.rn-layout { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .4rem .45rem; border: 1px solid rgba(192,196,210,.22); border-radius: 8px; background: rgba(255,255,255,.03); color: rgba(255,255,255,.65); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.rn-layout:hover { border-color: rgba(var(--agl-teal-rgb), .5); }
.rn-layout[aria-pressed="true"] { border-color: var(--agl-teal); background: rgba(var(--agl-teal-rgb), .09); color: #6be6ff; }
.rn-layout-sketch { display: block; line-height: 0; }
.rn-layout-hint { margin: 0; display: block; }

/* Images */
.rn-imgs { display: flex; flex-direction: column; gap: .45rem; }
.rn-imgs:empty { display: none; }
.rn-img-hint { display: block; margin: 0; }
.rn-img-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: .6rem; align-items: start; padding: .5rem; border: 1px solid rgba(192,196,210,.18); border-radius: 8px; background: rgba(255,255,255,.03); }
.rn-img-thumb { position: relative; width: 92px; height: 64px; overflow: hidden; border-radius: 6px; background: #1c1c1f; }
.rn-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rn-img-num, .rn-img-tag { position: absolute; bottom: 3px; padding: 0 .3rem; border-radius: 4px; font-size: .6rem; font-weight: 900; line-height: 1.5; }
.rn-img-num { left: 3px; background: rgba(var(--agl-teal-rgb), .92); color: #02121a; }
.rn-img-tag { right: 3px; background: rgba(0,0,0,.85); color: #6be6ff; letter-spacing: .04em; }
.rn-img-fields { display: flex; flex-direction: column; gap: .3rem; }
.rn-form .rn-img-fields input { padding: .38rem .55rem; font-size: .8rem; }
.rn-img-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; max-width: 160px; }
.rn-img-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.rn-img-status { font-size: .74rem; color: #6be6ff; }
.rn-draft-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; border: 1px solid rgba(var(--agl-teal-rgb), .4); border-radius: 8px; background: rgba(var(--agl-teal-rgb), .08); font-size: .78rem; color: #6be6ff; }

@media (max-width: 560px) {
  .rn-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rn-img-row { grid-template-columns: 72px minmax(0, 1fr); }
  .rn-img-thumb { width: 72px; height: 54px; }
  .rn-img-btns { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}

@media (max-width: 520px) {
  .rn-top-logo { width: 72px; }
  .rn-search { flex-wrap: wrap; }
  .rn-search .button { flex: 1; }
  .rn-post { padding: .85rem .85rem; }
  .rn-post-title { font-size: 1.02rem; }
}

/* Phone / installed web app only: size the popup to the visible screen
   (dvh excludes the browser toolbars) and keep its swipes inside it. */
@media (max-width: 860px), (display-mode: standalone) {
  .rn-modal-card { max-height: calc(100dvh - 2rem); overscroll-behavior: contain; }
}
