/* Everything is scoped under .al-app so your site's own table/heading/body rules
   are overridden inside the viewer only. Load this AFTER your site stylesheet. */

.al-app { display: block; width: 100%; }

.al-app .controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
                    justify-content: center; margin: 0 0 1rem; text-align: left; }
.al-app .controls select { max-width: 24rem; }

.al-app .al-page { display: block; max-width: 960px; margin: 0 auto; padding: 1.5rem 2rem 2rem;
                   box-sizing: border-box; background: #f4ecd8; color: #2a2118;
                   box-shadow: 0 2px 10px rgba(0,0,0,.25); text-align: left; overflow-x: auto;
                   font-family: "IM Fell English", Georgia, "Times New Roman", serif;
                   font-size: 16px; font-weight: normal; font-style: normal; }

.al-app .al-header { display: flex; justify-content: space-between; align-items: baseline;
                     border-bottom: 1px solid #2a2118; padding-bottom: .3rem; }
.al-app .al-title  { font: normal 1.35rem/1.25 inherit; font-family: inherit; font-style: normal;
                     margin: 0; padding: 0; text-align: left; color: inherit; }
/* nowrap + flex-shrink keep "Page 57" on one line when the title wraps */
.al-app .al-pageno { font-size: 1.2rem; margin-left: 1rem; white-space: nowrap; flex-shrink: 0; }
.al-app .al-yearline { text-align: center; margin: .8rem 0 0; letter-spacing: .05em; }

.al-app .al-table { width: 100%; border-collapse: collapse; border: 0; margin: .2rem 0 0;
                    background: none; table-layout: auto; }
.al-app .al-table th,
.al-app .al-table td { font-family: inherit; font-weight: normal; font-size: inherit;
                       text-align: left; background: none; border: 0; color: inherit; }
.al-app .al-table th { font-style: italic; padding: .1rem .3rem; }
.al-app .al-table thead tr:last-child th { border-bottom: 2px solid #2a2118; }
.al-app .al-table .al-rankin { border-bottom: 1px solid #2a2118; }

.al-app .al-table td { padding: 0 .3rem; line-height: 1.4; white-space: nowrap; vertical-align: top; }
.al-app .al-group tr:first-child td { padding-top: .8rem; }

/* Column sizing: rank, dates and army columns shrink to fit their text (width: 1% + nowrap),
   so the name column gets all the remaining width and only very long names wrap. */
.al-app .al-table td.c-rank  { width: 1%; vertical-align: middle; white-space: nowrap; padding-right: 1rem; }
.al-app .al-table td.c-brace { width: 16px; min-width: 16px; padding: 0; text-align: center; vertical-align: middle; }
.al-app .al-table td.c-name  { padding-right: .8rem; white-space: normal; }
.al-app .al-table td.c-reg   { width: 1%; padding-right: 1rem; }
.al-app .al-table td.c-army  { width: 1%; border-left: 1px solid #2a2118; padding-left: .6rem; }

/* Curly brace: an SVG stretched to the full height of the rank group.
   background-origin/clip: content-box stop it painting into the group's top padding,
   so the brace starts level with the first name and ends level with the last. */
.al-app .al-table td.has-brace {
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 100' preserveAspectRatio='none'%3E%3Cpath d='M10 1 Q4 1 4 11 L4 39 Q4 50 0 50 Q4 50 4 61 L4 89 Q4 99 10 99' fill='none' stroke='%232a2118' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  background-origin: content-box;
  background-clip: content-box;
}

.al-app .army-rank { display: inline-block; min-width: 3.4em; }
.al-app .pretitle { font-style: italic; }
.al-app .peerrank { font-style: italic; }
.al-app .error { text-align: center; padding: 2rem; }

/* Agent line at the foot of the page */
.al-app .al-agent { margin-top: 1em; text-align: center; }
.al-app .al-agent-label { font-style: italic; }
