/* iSail's own look: the lobby's navy ground, its cyan primary button, its
   thin blue-edged panels and controls (isail apps/client/src/styles.css). */
:root {
  color-scheme: dark;
  --fg: #e8f2ff; --text: #cfe3f7; --muted: #9fb6cc; --line: rgba(130, 175, 210, .24);
  --bg: #0b1722; --panel: rgba(7, 18, 27, .72); --soft: rgba(9, 22, 32, .6); --soft-hover: rgba(24, 48, 68, .8);
  --accent: #7fd0ff; --gold: #f2c46d;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: radial-gradient(1200px 700px at 70% -10%, #163a52 0%, #0b1722 60%) fixed, var(--bg); }
/* The forum's name centered; the way home on the left, the reader on the right. */
header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .75rem max(16px, 1.5rem); border-bottom: 1px solid var(--line); background: rgba(7, 18, 27, .6); backdrop-filter: blur(8px); }
header .home { font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; color: var(--fg); text-decoration: none; text-align: center; }
header .site { display: inline-flex; align-items: center; gap: .45rem; color: var(--fg); text-decoration: none; font-size: 1.1rem; font-weight: 800; }
header .site img { width: 28px; height: 28px; border-radius: 6px; }
header .site:hover { color: var(--accent); }
@media (max-width: 34rem) {
  header { grid-template-columns: 1fr auto; }
  header .home { grid-column: 1 / -1; grid-row: 1; }
}
main { max-width: 52rem; margin: 0 auto; padding: 1rem max(16px, 1rem) 3rem; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; color: var(--fg); overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; color: var(--fg); margin: 0; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.titlebar h1 { margin: 0; }
.crumbs { margin: .5rem 0 0; font-size: .9rem; }
.crumbs a, .pages a { text-decoration: none; }
.pages { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.pages a:only-child:last-child:not(:first-child) { margin-left: auto; }
.meta, .who { color: var(--muted); font-size: .875rem; }
.who { color: var(--fg); font-weight: 600; }
.topics { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.topics li { border-bottom: 1px solid var(--line); }
.topics li:last-child { border-bottom: 0; }
.topics a.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 36px; gap: 0 .85rem; align-items: center; padding: .7rem 1rem; color: inherit; text-decoration: none; }
.topics a.row:hover { background: var(--soft-hover); }
.topics a.row:hover .title { color: var(--accent); }
.topics .main, .topics .latest { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.topics .title { font-size: 1.08rem; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.topics .sub, .topics .latest { font-size: .85rem; }
.topics .latest { align-items: flex-end; text-align: right; max-width: 14rem; }
.topics .row > .avatar:last-child { width: 36px; height: 36px; border-radius: 8px; }
.topics .flag { align-self: flex-start; }
@media (max-width: 34rem) {
  .topics a.row { grid-template-columns: 40px minmax(0, 1fr); }
  .topics .row > .avatar:first-child { width: 40px; height: 40px; }
  .topics .latest { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 0 .4rem; align-items: baseline; text-align: left; max-width: none; }
  .topics .row > .avatar:last-child { display: none; }
}
/* Text weights: regular is --text; medium and light step down. */
.medium { color: #b4c8dc; }
.light { color: var(--muted); }
.nm { overflow-wrap: anywhere; }
.plan { white-space: nowrap; }
.post .author .name .nm { color: var(--fg); }
.plan { margin-left: 3px; font-size: .8em; vertical-align: middle; line-height: 1; cursor: default; }
.byline { margin: -.6rem 0 .25rem; font-size: .85rem; }
.flag, .tier, .badge { font-size: .75rem; padding: .05rem .45rem; border-radius: .5rem; background: var(--soft); border: 1px solid var(--line); }
.tier { color: var(--fg); }
.post { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 1rem; margin: 0 0 .75rem; }
.post .author { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-width: 0; }
.post .ident { display: flex; flex-direction: column; gap: .25rem; min-width: 0; overflow-wrap: anywhere; }
.post .author .name { font-weight: 700; color: var(--fg); }
.post .author .avatar { width: 64px; height: 64px; }
.post .tag { display: flex; flex-wrap: wrap; gap: .25rem; }
.post .tag:empty { display: none; }
.post .content { min-width: 0; }
.post .line0 { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .85rem; padding-bottom: .4rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.post .line0 .right { display: flex; align-items: center; gap: .6rem; }
.post .line0 a { color: var(--muted); text-decoration: none; }
.post .line0 a:hover { color: var(--accent); }
.post .share svg { display: block; }
.post.preview { border-style: dashed; }
@media (max-width: 34rem) {
  .post { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .post .author { flex-direction: row; align-items: center; gap: .6rem; }
  .post .author .avatar { width: 44px; height: 44px; }
  .post .ident { gap: .1rem; }
}
.compose.reply:not(:target):not(.open) { display: none; }
.reply-open { margin-top: 1rem; }
dialog.share-dlg { color: var(--text); background: #0f2130; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; width: min(32rem, calc(100vw - 32px)); }
dialog.share-dlg::backdrop { background: rgba(0, 0, 0, .5); }
dialog.share-dlg input { width: 100%; font: inherit; padding: .5rem .6rem; color: var(--fg); background: rgba(5, 14, 21, .7); border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0 .75rem; }
.avatar { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(180deg, #7fc4e8 0%, #2f83a6 100%); display: inline-block; object-fit: cover; border: 1px solid var(--line); }
.body { overflow-wrap: anywhere; color: var(--text); }
.body pre { overflow-x: auto; background: var(--soft); padding: .75rem; border-radius: 8px; }
.body blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.body table { border-collapse: collapse; } .body td, .body th { border: 1px solid var(--line); padding: .25rem .5rem; }
.gone { color: var(--muted); font-style: italic; }
.notice { background: var(--soft); padding: .5rem .75rem; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
form.inline { display: inline; }
.compose, .moderate { display: grid; gap: .5rem; margin-top: 1.5rem; }
.compose label, .moderate label { color: var(--fg); font-weight: 600; }
.compose label.check, .moderate label:has(input[type=checkbox]) { font-weight: 400; color: var(--text); }
.buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
textarea, input[name=title], input[name=q], select { width: 100%; font: inherit; padding: .55rem .7rem; color: var(--fg); background: rgba(5, 14, 21, .7); border: 1px solid var(--line); border-radius: 8px; }
input[name=q] { width: auto; }
textarea:focus, input:focus, select:focus { outline: 2px solid rgba(127, 208, 255, .55); outline-offset: 0; border-color: transparent; }
button, .button { font: 600 .9rem/1 system-ui, sans-serif; padding: .7rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); color: #d2e3f3; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { background: var(--soft-hover); }
button.primary, .button.primary { border: 0; color: #06202e; background: linear-gradient(180deg, #7fd0ff 0%, #4ea8e0 100%); box-shadow: 0 6px 18px rgba(79, 170, 226, .28), 0 0 0 1px rgba(165, 224, 255, .55) inset; }
button.primary:hover, .button.primary:hover { background: linear-gradient(180deg, #9adcff 0%, #5fb6ec 100%); }
header button, header .button { padding: .5rem .8rem; }
.actions { margin-top: .5rem; }
.actions:empty { display: none; }
.actions a { font: 600 .8rem/1 system-ui, sans-serif; padding: .3rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); color: #d2e3f3; text-decoration: none; display: inline-block; }
.actions button { font-size: .8rem; padding: .3rem .6rem; }
.embed { margin: .75rem 0; max-width: 40rem; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; background: var(--soft); }
.embed img { display: block; max-width: 100%; height: auto; }
.embed .caption, .embed figcaption { margin: 0; padding: .5rem .75rem; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.embed.photo { margin-left: 0; margin-right: 0; }
.embed.card { display: flex; gap: .75rem; align-items: center; }
.embed.card img { width: 8rem; flex: none; }
.embed.frame button.play { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: #000; color: #fff; }
.embed.frame button.play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.embed.frame button.play .label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .4rem .9rem; border-radius: 2rem; background: rgba(0, 0, 0, .7); }
.embed.frame button.play:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.embed.frame iframe { display: block; width: 100%; border: 0; }
table.admin { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.admin th, table.admin td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; text-align: left; vertical-align: top; }
.audit { font-size: .85rem; color: var(--muted); }
header nav a { text-decoration: none; }
select { max-width: 28rem; }
header nav { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
footer { max-width: 52rem; margin: 0 auto; padding: 0 max(16px, 1rem) 2rem; font-size: .85rem; }
footer a { color: var(--muted); }
.crumbs .follow { margin-left: .75rem; }
.compose fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; margin: 0; }
.compose fieldset legend { color: var(--muted); padding: 0 .25rem; }
.compose fieldset > label, .compose fieldset > .choice { display: flex; align-items: center; gap: .4rem; margin: .25rem 0; }
.compose fieldset select { width: auto; }
.saved { color: var(--muted); font-size: .85rem; font-weight: 400; }
.saved.failed { color: var(--gold); }
.followed { padding-left: 1.2rem; }
.followed li { margin: .35rem 0; }
.followed form { margin-left: .5rem; }
