:root {
  --fs-base: 12px;
  --fs-small: 11px;
  --gap-halves: 8px;
  --win-min: 307px;
  --win-max: 420px;
}

/* ============================================================
   Base
   ============================================================ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("bliss.jpg") center / cover no-repeat #3F83C4;
}
body {
  margin: 0 5px;
  background: #3F83C4;
}

.window {
  container-type: inline-size;
  min-width: var(--win-min);
  max-width: var(--win-max);
  margin: 25px auto 50px;
}

.window.dragged { margin: 0; }

.window,
button,
.status-bar-field,
input,
label,
textarea {
  font-family: Arial, sans-serif;
  font-size: var(--fs-base);
}

abbr,
small,
.small,
legend {
  font-size: var(--fs-small);
}

label { display: initial; }
legend { color: #222; }

button:focus-visible,
a:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .window,
  .title-bar,
  button {
    transition: none;
    animation: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================================================
   Title bar
   ============================================================ */

.title-bar-text {
  display: flex;
  align-items: center;
  gap: 3px;
}

.title-bar-text img {
  width: 16px;
  height: 16px;
  margin: 0;
}

.title-bar { cursor: grab; }
.title-bar:active { cursor: grabbing; }

.title-bar.dragging {
  user-select: none;
  -webkit-user-select: none;
}

.title-bar-controls > .button {
  color: #000;
  display: inline-block;
  text-align: center;
  line-height: 20px;
}
.title-bar-controls > .button > i {
  margin-left: -1px;
}

/* ============================================================
   Header / tagline
   ============================================================ */

#andrew,
#tagline {
  text-align: center;
  padding-bottom: 7px;
}

#andrew { margin: 0; font-size: 0; }

/* ============================================================
   Tabs & content
   ============================================================ */

.window-body { padding: 0 4px; }
[role="tabpanel"] { padding: 10px; }
menu[role="tablist"] button { padding: 0 8px 1px; }

/* ============================================================
   Two-column helper (.halves)
   ============================================================ */

.halves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--gap-halves);
}

.halves > div {
  box-sizing: border-box;
  flex: 0 0 calc(50% - (var(--gap-halves) / 2));
  padding: 0;
}

.right { float: right; text-align: right; }

/* ============================================================
   Fieldsets & statuses
   ============================================================ */

.window fieldset {
  padding: 4px 11px 10px;
  margin-bottom: 5px;
}

.window fieldset#statuses { margin-bottom: 11px; }
.window article fieldset { padding: 0 5px 6px; }

fieldset#statuses .status-text {
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

fieldset#statuses .status-icon {
  font-size: 3em;
  line-height: 1;
  order: 2;
  flex-shrink: 0;
}

fieldset .status-text { padding: 3px 3px 0; }

fieldset .status-text > p,
.faux-field > p {
  margin: 0 0 5px;
}

/* ============================================================
   Status bar
   ============================================================ */

.status-bar-field {
  padding-top: 2px;
  font-size: var(--fs-small);
}

#drama { padding-bottom: 1px; }

/* ============================================================
   Responsive - container queries
   Breakpoint tracks the WINDOW width, not the viewport,
   so it stays correct if components get reused elsewhere
   ============================================================ */

@container (max-width: 415px) {
  menu[role="tablist"] button { padding: 0 2px 1px; }
  #tab-post .halves > div { flex-basis: 100%; }
}

/* Viewport-level fallback for very old browsers that lack
   container query support */
@supports not (container-type: inline-size) {
  @media (max-width: 460px) { /* viewport ≈ window + margins */
    menu[role="tablist"] button { padding: 0 2px 1px; }
    #tab-post .halves > div { flex-basis: 100%; }
  }
}