@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&family=IM+Fell+English:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');
:root {
  --paper:#f6f3eb;
  --sheet:#fffdf7;
  --ink:#21201b;
  --muted:#706764;
  --line:#cec5b8;
  --brand:#901c1e;
  --accent:#b18736;
  --red:#973b2e;
  font-family:Inter,Arial,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-size:13px
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,select,textarea {
  font:inherit;
  color:inherit
}

button,summary {
  cursor:pointer
}

button {
  border:1px solid var(--line);
  background:transparent;
  padding:10px 14px;
  border-radius:4px;
  font-weight:500;
  transition:background .15s
}

button:hover {
  background:#e8e5da
}

button:disabled {
  opacity:.5;
  cursor:wait
}

button.primary {
  background:var(--brand);
  color:#fffdf4;
  border-color:var(--brand)
}

button.primary:hover {
  background:#751719
}

button.quiet {
  border-color:transparent
}

button.danger {
  color:var(--red)
}

input,select,textarea {
  border:1px solid var(--line);
  border-radius:3px;
  padding:9px;
  background:var(--sheet);
  max-width:100%
}

textarea {
  resize:vertical;
  line-height:1.6
}

input:focus-visible,button:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px
}

h1,h2,h3,p {
  margin:0
}

h1 {
  font-family:'IM Fell English',Georgia,serif;
  font-size:24px;
  font-weight:400
}

h2 {
  font-family:'IM Fell English',Georgia,serif;
  font-size:25px;
  font-weight:400
}

h3 {
  font-size:13px
}

small {
  font-size:11px
}

label {
  display:block
}

main {
  max-width:1510px;
  margin:auto;
  padding:40px 48px 0
}

.masthead {
  height:82px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--line);
  padding:0 48px;
  background:#eee7dc
}

.brand {
  display:flex;
  align-items:center;
  gap:13px;
  color:var(--ink);
  text-decoration:none;
  letter-spacing:3px;
  font-family:'IM Fell English',Georgia,serif;
  font-size:25px
}

.brand-mark {
  display:block;
  width:56px;
  height:56px;
  flex-shrink:0;
  object-fit:contain
}

.brand small {
  display:block;
  font:9px Inter,Arial;
  letter-spacing:2px;
  margin-top:5px
}

.header-actions {
  display:flex;
  align-items:center;
  gap:12px
}

#save-status {
  font-size:11px;
  color:var(--muted);
  margin-right:16px
}

#library-count {
  background:#e3dace;
  padding:2px 6px;
  border-radius:3px;
  margin-left:6px
}

.resource-links {
  display:flex;
  flex-wrap:wrap;
  gap:8px 24px;
  margin:-16px 0 26px;
  font-size:12px;
}

.resource-links a {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:6px 0;
  color:var(--brand);
  font-weight:500;
  text-decoration:underline;
  text-decoration-color:var(--accent);
  text-underline-offset:4px;
}

.resource-links a:hover {
  text-decoration-color:currentColor;
}

.resource-links a:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.band-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding-bottom:35px;
  border-bottom:1px solid var(--ink)
}

.band-identity {
  flex:1;
  min-width:0
}

.band-name-print {
  display:none
}

.eyebrow {
  color:var(--muted);
  font-size:9px;
  letter-spacing:2px;
  line-height:1.6;
  margin-bottom:8px
}

.band-name {
  font-family:'IM Fell English',Georgia,serif;
  font-size:46px;
  background:transparent;
  border:0;
  border-radius:0;
  padding:0;
  width:100%;
  min-width:0
}

.band-type-line {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:10px;
  color:var(--muted);
  font-size:12px
}

#band-phase {
  padding:4px 6px;
  font-size:10px;
  background:transparent;
}

.spell-difficulty {
  font-size:11px;
  color:var(--brand);
  margin:5px 0;
}

.editor-details>label {
  margin:10px 0;
}

.editor-details>label select {
  display:block;
  margin-top:6px;
}

.seal {
  color:var(--accent);
  font-size:18px
}

.edition {
  border-left:1px solid var(--line);
  padding-left:12px;
  margin-left:3px;
  font-size:9px;
  letter-spacing:1.5px
}

.totals {
  display:flex;
  flex-shrink:0
}

.totals>div {
  padding:6px 28px;
  border-left:1px solid var(--line);
  min-width:115px
}

.totals>div:last-child {
  padding-right:0
}

.totals span {
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-bottom:8px
}

.totals strong {
  font:38px 'IM Fell English',Georgia,serif
}

.totals small {
  font:13px Inter,Arial
}

.toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:26px 0 20px
}

.toolbar-title,.toolbar-actions {
  display:flex;
  align-items:center;
  gap:12px
}

.section-number {
  font:10px Inter,Arial;
  color:var(--accent);
  margin-right:10px
}

.muted {
  color:var(--muted);
  font-size:11px
}

.export-menu {
  position:relative
}

.export-menu summary {
  padding:10px;
  list-style:none
}

.export-menu>div {
  position:absolute;
  right:0;
  z-index:3;
  min-width:170px;
  padding:5px;
  border:1px solid var(--line);
  background:var(--sheet);
  box-shadow:0 8px 30px #0001
}

.export-menu button {
  width:100%;
  border:0;
  text-align:left
}

.roster-scroll {
  overflow-x:auto;
  padding:2px 1px
}

.fighter-entry {
  display:grid;
  grid-template-columns:32px minmax(850px,1fr);
  gap:8px;
  min-width:890px;
  margin-bottom:13px;
}

.fighter-entry .fighter-row {
  min-width:0;
  margin-bottom:0;
}

.fighter-order {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  position:sticky;
  left:0;
  z-index:1;
  background:var(--paper);
}

.fighter-order button {
  padding:4px 0;
  width:32px;
  min-height:28px;
  font-size:18px;
  line-height:1;
}

.fighter-order button:disabled {
  opacity:.25;
  cursor:default;
}

.fighter-row {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:auto auto;
  background:var(--sheet);
  border:1.5px solid var(--ink);
  border-radius:5px;
  margin-bottom:13px;
  position:relative;
  min-width:850px;
  overflow:hidden
}

.picture-switch {
  display:flex;
  align-items:center;
  gap:7px;
  font-size:11px;
  cursor:pointer;
  white-space:nowrap
}

.picture-switch input {
  appearance:none;
  flex-shrink:0;
  padding:0;
  width:30px;
  height:18px;
  margin:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--line);
  cursor:pointer
}

.picture-switch input::before {
  content:'';
  display:block;
  width:12px;
  height:12px;
  margin:2px;
  border-radius:50%;
  background:var(--sheet)
}

.picture-switch input:checked {
  background:var(--brand);
  border-color:var(--brand)
}

.picture-switch input:checked::before {
  transform:translateX(12px)
}

.picture-switch input:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px
}

.fighter-portrait {
  display:none
}

.pictures-visible .fighter-entry {
  grid-template-columns:32px minmax(980px,1fr);
  min-width:1020px
}

.pictures-visible .fighter-row {
  grid-template-columns:128px repeat(3,minmax(0,1fr))
}

.pictures-visible .fighter-portrait {
  display:flex;
  grid-column:1;
  grid-row:1/3;
  position:relative;
  border-right:1px solid var(--ink);
  padding:0;
  overflow:hidden;
  background:var(--paper)
}

.pictures-visible .fighter-profile {
  grid-column:2
}

.pictures-visible .skills-cell {
  grid-column:3;
  grid-row:1
}

.pictures-visible .equipment-cell {
  grid-column:4;
  grid-row:1
}

.pictures-visible .experience-cell {
  grid-column:2/5
}

.portrait-upload {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  font-weight:400
}

.portrait-upload img,.crop-preview img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:var(--portrait-x,50%) var(--portrait-y,50%);
  transform:scale(var(--portrait-zoom,1));
  transform-origin:var(--portrait-x,50%) var(--portrait-y,50%)
}

.portrait-placeholder {
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  height:100%;
  gap:8px;
  color:var(--muted);
  font-size:28px
}

.portrait-placeholder small,.portrait-caption {
  font:10px Inter,Arial,sans-serif
}

.portrait-caption {
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  padding:8px 3px;
  background:#fffdf7df;
  color:var(--ink)
}

.picture-crop {
  width:min(460px,calc(100vw - 24px))
}

.crop-preview-area {
  display:flex;
  justify-content:center;
  margin:16px 0
}

.crop-preview {
  overflow:hidden;
  background:var(--paper);
  border:1px solid var(--line)
}

.crop-control {
  display:grid;
  grid-template-columns:1fr auto;
  gap:6px;
  margin:14px 0
}

.crop-control input {
  grid-column:1/-1;
  width:100%;
  padding:0;
  accent-color:var(--brand)
}

.crop-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:18px
}

.fighter-portrait .portrait-remove {
  position:absolute;
  top:4px;
  right:4px;
  width:26px;
  height:26px;
  padding:0;
  background:var(--sheet);
  font-size:18px;
  color:var(--red)
}

.fighter-profile {
  grid-row:1;
  border-right:1px solid var(--ink);
  display:flex;
  flex-direction:column
}

.identity-line {
  display:flex;
  align-items:baseline;
  gap:6px;
  padding:5px 8px;
  border-bottom:1px solid var(--line);
  min-height:0
}

.identity-line>span {
  font-family:'IM Fell English',Georgia,serif;
  font-size:16px;
  flex-shrink:0
}

.fighter-name {
  flex:1;
  min-width:3ch;
  cursor:text;
  font-family:'IM Fell English',Georgia,serif;
  font-size:20px;
  line-height:1.15;
  overflow-wrap:anywhere
}

.fighter-name[contenteditable]:hover {
  background:var(--paper)
}

.fighter-name[contenteditable]:focus {
  outline:1px solid var(--accent);
  outline-offset:2px
}

.fighter-type {
  font-size:11px;
  line-height:1.3
}

.row-number {
  font:10px Inter,Arial;
  color:var(--muted);
  margin-left:auto;
  padding-left:6px
}

.paths {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px 6px;
  padding:0 0 6px;
  font:11px 'Barlow Condensed',Arial,sans-serif;
  margin-bottom:6px;
  border-bottom:1px solid var(--line)
}

.path {
  display:flex;
  align-items:center;
  gap:3px;
  white-space:nowrap
}

.path::before {
  content:'';
  width:8px;
  height:8px;
  border:1px solid var(--muted)
}

.path.active::before {
  background:var(--brand);
  box-shadow:inset 0 0 0 1px var(--sheet)
}

.stats {
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  text-align:center
}

.stats th {
  font:11px 'Barlow Condensed',Arial,sans-serif;
  background:var(--ink);
  color:var(--sheet);
  height:15px
}

.stats td {
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  font:21px/1.1 'IM Fell English',Georgia,serif;
  height:29px
}

.stats .stat-input {
  display:block;
  width:100%;
  min-width:0;
  height:100%;
  padding:2px 0;
  border:0;
  border-radius:0;
  background:transparent;
  font:inherit;
  text-align:center
}

.stats .stat-input:hover {
  background:var(--paper)
}

.stats .stat-input:focus {
  outline:2px solid var(--accent);
  outline-offset:-2px;
  background:var(--sheet)
}

.stat-print {
  display:none
}

.stats td:last-child {
  border-right:0
}

.stats tr.maxima td {
  font:11px Inter,Arial;
  height:18px;
  color:var(--muted)
}

.profile-bottom {
  padding:5px 8px;
  display:flex;
  justify-content:space-between;
  gap:7px;
  align-items:center;
  font-size:10px;
  margin-top:0
}

.role-stamp {
  font:10px Inter,Arial;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--brand)
}

.maxima-label {
  font-size:9px;
  color:var(--muted)
}

.row-section {
  padding:8px 10px;
  min-width:0
}

.row-section h3 {
  font:11px 'Barlow Condensed',Arial,sans-serif;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--muted);
  margin-bottom:7px
}

.skills-cell {
  border-right:1px solid var(--ink)
}

.row-content {
  font:13px/1.45 'Barlow Condensed',Arial,sans-serif;
  overflow-wrap:anywhere
}

.row-content .skill-chip {
  display:inline
}

.row-content .skill-chip::after {
  content:' · ';
  color:var(--accent)
}

.row-content .skill-chip:last-child::after {
  content:''
}

.equipment-cell {
  padding-bottom:7px;
  display:flex;
  flex-direction:column
}

.equipment-cell .row-content {
  flex:0
}

.injury-line {
  border-top:1px solid var(--line);
  padding-top:5px;
  margin-top:7px;
  font-size:11px;
  white-space:pre-wrap
}

.injury-line span {
  color:var(--muted);
  margin-right:6px
}

.experience-cell {
  container:experience / inline-size;
  grid-column:1/4;
  grid-row:2;
  border-top:1px solid var(--ink);
  display:flex;
  gap:12px;
  align-items:center;
  padding:6px 8px
}

.experience-grid {
  flex:0 0 auto;
  width:max-content;
  display:grid;
  grid-template-columns:repeat(15,10px);
  gap:2px;
  max-width:100%
}

.experience-half {
  display:contents
}

/* Keep all 90 boxes in equal rows, retaining their physical size. */
@container experience (min-width:482px) {
  .experience-grid { grid-template-columns:repeat(30,10px) }
}

@container experience (min-width:662px) {
  .experience-grid { grid-template-columns:repeat(45,10px) }
}

@container experience (min-width:1202px) {
  .experience-grid { grid-template-columns:repeat(90,10px) }
}

.exp-box {
  padding:0;
  aspect-ratio:1;
  min-width:0;
  border:1px solid #8c8d82;
  border-radius:0;
  background:transparent;
  position:relative
}

.exp-box.earned {
  background:var(--brand);
  box-shadow:inset 0 0 0 1px var(--sheet)
}

.exp-box.advance {
  border:2px solid var(--ink)
}

.experience-total {
  flex:0 0 112px;
  min-width:0;
  margin-left:0;
  order:-1;
  display:flex;
  align-items:baseline;
  gap:6px;
  text-align:left;
  font-size:9px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0
}

.experience-total strong {
  display:block;
  font:20px/1 'IM Fell English',Georgia,serif;
  color:var(--ink)
}

.row-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:9px 0 0;
  gap:6px
}

.row-actions button {
  padding:3px 8px;
  font-size:10px
}

.row-warning {
  color:var(--red);
  font-size:10px
}

.empty-roster {
  min-height:280px;
  display:grid;
  place-content:center;
  text-align:center;
  border:1px solid var(--line);
  background:var(--sheet);
  border-radius:7px;
  padding:40px
}

.empty-roster .empty-logo {
  display:block;
  width:80px;
  height:80px;
  object-fit:contain;
  justify-self:center;
  margin-bottom:15px
}

.empty-roster p {
  color:var(--muted);
  margin-top:10px;
  line-height:1.8
}

.add-row {
  width:100%;
  border:1px dashed #c0c0b1;
  margin:1px 0 25px;
  color:var(--muted);
  font-size:12px;
  padding:14px
}

.ledger {
  display:grid;
  grid-template-columns:1fr 1fr 1.4fr;
  border:1px solid var(--line);
  border-radius:5px;
  background:#eeede3;
  overflow:hidden;
  margin:12px 0 25px
}

.ledger>div {
  padding:17px 20px;
  border-right:1px solid var(--line)
}

.ledger>div:last-child {
  border-right:0
}

.ledger h2 {
  font:19px 'IM Fell English',Georgia,serif;
  margin-bottom:13px
}

.ledger textarea {
  width:100%;
  background:transparent;
  border:0;
  padding:0;
  font-size:12px
}

.ledger label {
  font-size:11px;
  color:var(--muted);
  margin-bottom:8px
}

.ledger input {
  width:66px;
  padding:4px;
  margin:0 5px;
  background:var(--sheet)
}

.rating-line {
  display:flex;
  justify-content:space-between;
  margin:7px 0;
  font-size:12px
}

.rating-line:last-child {
  border-top:1px solid var(--line);
  padding-top:9px;
  font-weight:600
}

.validation {
  border:1px solid var(--line);
  border-radius:4px;
  margin:0 0 30px
}

.validation summary {
  padding:13px 16px;
  font-size:12px
}

.validation-item {
  padding:8px 16px;
  border-top:1px solid #dbdbd1;
  font-size:12px;
  display:flex;
  align-items:center;
  gap:10px
}

.validation-item button {
  padding:4px 8px;
  margin-left:auto;
  font-size:10px
}

.validation-item.error {
  color:var(--red)
}

.validation-item.warning {
  color:#85631c
}

.validation-item.tip {
  color:#49695e
}

.glossary {
  border-top:1px solid var(--ink);
  padding-top:20px
}

.glossary>summary {
  font:24px 'IM Fell English',Georgia,serif;
  list-style:none
}

.glossary>summary::after {
  content:'+';
  float:right
}

.glossary[open]>summary::after {
  content:'−'
}

.print-option {
  margin-top:20px;
  color:var(--muted);
  font-size:12px
}

.print-option input {
  margin-right:7px
}

.glossary-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  margin-top:22px
}

.glossary-entry {
  break-inside:avoid
}

.glossary-entry h3 {
  font:18px 'IM Fell English',Georgia,serif;
  margin-bottom:5px
}

.glossary-entry textarea {
  width:100%;
  min-height:90px;
  font-size:11px;
  background:transparent;
  border-color:transparent;
  padding:0;
  resize:vertical
}

.glossary-entry textarea:hover,.glossary-entry textarea:focus {
  border-color:var(--line);
  background:var(--sheet)
}

footer {
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:9px;
  letter-spacing:1px;
  border-top:1px solid var(--line);
  margin-top:40px;
  padding:20px 0 30px
}

footer>span:nth-child(2) {
  font:italic 14px Georgia,'Times New Roman',serif;
  letter-spacing:0
}

dialog {
  border:1px solid var(--line);
  border-radius:9px;
  padding:26px;
  background:var(--paper);
  color:var(--ink);
  width:590px;
  max-width:calc(100vw - 24px);
  max-height:90vh;
  box-shadow:0 24px 90px #0004
}

dialog::backdrop {
  background:#21201b88;
  backdrop-filter:blur(3px)
}

.dialog-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:22px
}

.icon-button {
  font-size:24px;
  border:0;
  padding:2px 8px
}

.dialog-heading .eyebrow {
  margin-bottom:4px
}

#fighter-search {
  width:100%;
  margin-bottom:15px
}

#template-list {
  max-height:58vh;
  overflow:auto
}

.template-option {
  width:100%;
  text-align:left;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  padding:14px 6px;
  gap:10px
}

.template-option strong {
  font:20px 'IM Fell English',Georgia,serif
}

.template-option small {
  display:block;
  color:var(--muted);
  margin-top:5px
}

.template-option .price {
  color:var(--brand);
  white-space:nowrap;
  font-size:13px
}

.editor {
  width:640px;
  margin:0 0 0 auto;
  max-height:100dvh;
  height:100dvh;
  border-radius:0;
  padding:25px;
  max-width:100vw
}

.editor-field {
  margin:15px 0
}

.editor-field>input,.editor-field>textarea,.editor-field>select {
  width:100%;
  margin-top:6px
}

.editor label {
  font-size:11px;
  color:var(--muted)
}

.editor-stats {
  display:grid;
  grid-template-columns:repeat(9,minmax(0,1fr));
  gap:5px;
  margin:16px 0
}

.editor-stats input {
  width:100%;
  text-align:center;
  padding:9px 0;
  margin-top:5px
}

.editor-stats label {
  text-align:center
}

.editor h3 {
  font:20px 'IM Fell English',Georgia,serif;
  margin:24px 0 10px
}

.editor-pair {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px
}

.editor-footer {
  position:sticky;
  bottom:-25px;
  padding:16px 0 0;
  background:var(--paper);
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
  justify-content:space-between;
  margin-top:25px
}

.editor-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 0;
  border-bottom:1px solid var(--line);
  flex-wrap:wrap
}

.editor-item .entry-name {
  flex:1;
  min-width:150px;
  font-size:12px
}

.editor-item input {
  width:65px;
  padding:5px
}

.editor-item select {
  flex-basis:100%;
  width:100%;
  font-size:12px
}

.editor-item .remove-entry {
  padding:1px 8px;
  border:0;
  font-size:22px
}

.add-entry-form {
  display:flex;
  gap:8px;
  margin:12px 0;
  flex-wrap:wrap
}

.add-entry-form select,.add-entry-form input[type=text] {
  flex:1;
  min-width:170px
}

.add-entry-form input[type=number] {
  width:70px
}

.editor-hint {
  font-size:11px;
  color:var(--muted);
  line-height:1.7;
  margin:10px 0
}

.editor-details {
  margin:20px 0
}

.editor-details summary {
  font-size:12px;
  color:var(--muted)
}

.library-item {
  padding:15px 0;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px
}

.library-item strong {
  font:22px 'IM Fell English',Georgia,serif
}

.library-item small {
  display:block;
  color:var(--muted);
  margin-top:5px
}

.library-item button {
  padding:7px 10px
}

#library-import {
  margin-top:20px
}

#create-band-form label {
  margin-bottom:18px;
  color:var(--muted);
  font-size:12px
}

#create-band-form input,#create-band-form select {
  display:block;
  width:100%;
  margin-top:8px
}

.notice {
  position:relative;
  padding:12px 48px 12px 16px;
  border:1px solid var(--accent);
  background:#f1e8d4;
  margin-bottom:18px;
  line-height:1.6;
  white-space:pre-line
}

.notice-undo {
  margin-left:12px
}

.notice-close {
  position:absolute;
  top:8px;
  right:8px;
  width:28px;
  height:28px;
  padding:0;
  border:0;
  font-size:20px;
  line-height:1
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}

.print-text {
  display:none
}

.share-link {
  margin-top:12px;
  font-size:12px;
  font-weight:600;
}

.share-link input {
  display:block;
  width:100%;
  min-width:0;
  margin-top:5px;
  font-weight:400;
  color:var(--brand);
}

@media(min-width:1600px) {
  main {
    padding-top:48px
  }


}

@media(max-width:1050px) {
  main {
    padding:28px 22px 0
  }

  .masthead {
    padding:0 22px
  }

  .totals>div {
    padding:5px 16px;
    min-width:90px
  }

  .band-name {
    font-size:38px
  }

  .toolbar {
    align-items:flex-start;
    flex-direction:column
  }

  .toolbar-actions {
    width:100%;
    justify-content:flex-end
  }

  .glossary-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }

  #save-status {
    display:none
  }

  .ledger>div {
    padding:14px
  }

}

@media(max-width:650px) {
  .fighter-entry {
    grid-template-columns:32px minmax(780px,1fr);
    min-width:820px;
  }
  main {
    padding:24px 14px 0
  }

  .masthead {
    height:70px;
    padding:0 14px
  }

  .brand {
    font-size:20px;
    gap:9px
  }

  .brand-mark {
    width:40px;
    height:40px
  }

  .brand small {
    font-size:7px;
    letter-spacing:1px
  }

  .header-actions {
    gap:3px
  }

  .header-actions button {
    font-size:10px;
    padding:8px
  }

  #library-count {
    display:none
  }

  .band-heading {
    display:block;
    padding-bottom:20px
  }

  .band-name {
    font-size:38px;
    min-width:0
  }

  .edition {
    font-size:8px
  }

  .totals {
    margin-top:25px
  }

  .totals>div {
    flex:1;
    padding:0 15px;
    min-width:0
  }

  .totals>div:first-child {
    border-left:0;
    padding-left:0
  }

  .totals strong {
    font-size:31px
  }

  .totals span {
    font-size:10px
  }

  .toolbar-title h1 {
    font-size:22px
  }

  .toolbar-actions {
    gap:3px;
    justify-content:space-between;
    flex-wrap:wrap
  }

  .toolbar-actions button,.toolbar-actions summary {
    font-size:10px;
    padding:9px 7px
  }

  .fighter-row {
    min-width:780px
  }

  .roster-scroll {
    margin-right:-14px;
    padding-right:14px
  }

  .ledger {
    grid-template-columns:1fr 1fr
  }

  .ledger>div:nth-child(2) {
    border:0
  }

  .ledger>div:last-child {
    grid-column:1/-1;
    border-top:1px solid var(--line)
  }

  .ledger h2 {
    font-size:17px
  }

  .glossary-grid {
    grid-template-columns:1fr
  }

  footer>span:nth-child(2) {
    display:none
  }

  footer {
    font-size:8px
  }

  .editor {
    padding:20px 15px
  }

  .editor-footer {
    bottom:-20px
  }

  .editor-stats {
    gap:3px
  }

  .editor-stats input {
    font-size:12px
  }

  .editor-footer button {
    padding:9px;
    font-size:11px
  }

}

@page {
  size:A4 portrait;
  margin:10mm
}

@media print {
  .fighter-entry {
    display:block;
    min-width:0;
    margin-bottom:3mm;
    break-inside:avoid;
  }
  * {
    box-shadow:none!important
  }

  body {
    background:white;
    color:black;
    font-size:10px
  }

  .no-print,dialog,.row-actions,.exp-box::after {
    display:none!important
  }

  main {
    padding:0;
    max-width:none
  }

  .band-heading {
    padding-bottom:12px;
    margin-bottom:15px
  }

  .band-name {
    display:none
  }

  .band-name-print {
    display:block;
    font:28px/1.15 'IM Fell English',Georgia,serif;
    overflow-wrap:anywhere
  }

  .eyebrow {
    font-size:7px
  }

  .band-type-line {
    font-size:10px
  }

  .totals>div {
    min-width:60px;
    padding:0 12px
  }

  .totals strong {
    font-size:26px
  }

  .totals span {
    font-size:8px
  }

  .roster-scroll {
    overflow:visible;
    margin:0;
    padding:0
  }

  .fighter-row {
    min-width:0;
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:auto auto;
    margin-bottom:0;
    break-inside:avoid;
    border-radius:4px;
    background:white
  }

  .identity-line {
    padding:3px 5px;
    min-height:0
  }

  .identity-line>span {
    font-size:12px
  }

  .fighter-name {
    outline:0!important;
    background:transparent!important;
    font-size:14px;
    line-height:1.15
  }

  .fighter-type {
    font-size:10px
  }

  .paths {
    padding:0 0 4px;
    margin-bottom:4px;
    gap:3px 4px;
    font-size:8.5px
  }

  .path::before {
    flex-shrink:0;
    width:7px;
    height:7px
  }

  .path.active::before {
    content:'×';
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:transparent!important;
    border-color:#111;
    color:#111;
    font:bold 8px/1 Arial,sans-serif
  }

  .stats th {
    height:11px;
    font-size:8px;
    background:#272c29!important;
    color:white!important;
    print-color-adjust:exact
  }

  .stats td {
    height:20px;
    font-size:16px
  }

  .stats .stat-print {
    display:inline
  }

  .stats tr.maxima td {
    height:12px;
    font-size:8px
  }

  .profile-bottom {
    padding:3px 5px;
    font-size:8px
  }

  .role-stamp {
    font-size:7px
  }

  .maxima-label {
    font-size:6px
  }

  .row-section {
    padding:5px 6px
  }

  .row-section h3 {
    font-size:9px;
    margin-bottom:5px
  }

  .row-content {
    font-size:11px;
    line-height:1.35
  }

  .injury-line {
    font-size:8px;
    margin-top:5px;
    padding-top:3px
  }

  .experience-cell {
    gap:3mm;
    padding:1.4mm 1.5mm
  }

  /* Two equal halves wrap using the actual printable width, without print queries. */
  .experience-grid {
    display:flex;
    flex:1;
    flex-wrap:wrap;
    width:auto;
    min-width:0;
    gap:0.4mm
  }

  .experience-half {
    display:grid;
    flex:0 0 auto;
    grid-template-columns:repeat(45,2mm);
    gap:0.4mm
  }

  .exp-box {
    appearance:none;
    print-color-adjust:exact
  }

  .experience-total {
    font-size:8px;
    flex-basis:25mm;
    min-width:0;
    gap:1.5mm
  }

  .experience-total strong {
    font-size:16px
  }

  .ledger {
    margin:10px 0;
    background:white;
    break-inside:avoid
  }

  .ledger>div {
    padding:9px
  }

  .ledger h2 {
    font-size:14px;
    margin-bottom:8px
  }

  .rating-line {
    font-size:9px;
    margin:5px 0
  }

  .ledger label {
    font-size:8px
  }

  .ledger input {
    width:35px;
    border:0;
    padding:0;
    margin:0 2px
  }

  .ledger textarea {
    font-size:9px
  }

  .ledger input::-webkit-inner-spin-button {
    display:none
  }

  .print-text {
    display:block;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    font-size:9px;
    line-height:1.5
  }

  .ledger textarea,.glossary textarea {
    display:none!important
  }

  footer {
    margin-top:12px;
    padding:8px 0;
    font-size:7px
  }

  .glossary {
    display:none
  }

  body.print-descriptions .glossary {
    display:block;
    break-before:page
  }

  .glossary>summary {
    font-size:22px
  }

  .glossary-grid {
    grid-template-columns:1fr 1fr;
    gap:15px
  }

  .glossary-entry h3 {
    font-size:15px
  }

  .glossary-entry .print-text {
    font-size:9px
  }

  .empty-roster {
    min-height:100px
  }

  input {
    background:transparent!important;
    border:0!important
  }

  footer>span:nth-child(2) {
    font-size:10px
  }

}

/* The row shortcut remains visible while the paper roster scrolls horizontally. */
.row-number {
  border:0;
  padding:3px 0 3px 5px;
  white-space:nowrap;
  flex-shrink:0;
  align-self:center
}

.row-number::after {
  content:' ✎';
  color:var(--accent)
}

.editor {
  position:fixed;
  inset:0 0 0 auto
}

@media print {
  html,body {
    background:white!important
  }

  .row-number::after {
    content:''
  }

}

@media print {
  .pictures-visible .fighter-entry {
    min-width:0
  }

  .pictures-visible .fighter-row {
    grid-template-columns:20mm repeat(3,minmax(0,1fr))
  }

  .pictures-visible .fighter-portrait {
    padding:0;
    background:white
  }

}
