:root {
  --ink:#202923;
  --muted:#81867e;
  --paper:#f6f5f0;
  --line:#e6e7df;
  --green:#365743;
  --gold:#b0a175;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:14px/1.5 system-ui,sans-serif;
}
button,input,textarea,select {
  font:inherit;
}
button,a,input,textarea,select {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
}
button:disabled {
  opacity:.5;
  cursor:wait;
}
a {
  color:inherit;
  text-decoration:none;
}
button:focus-visible,a:focus-visible {
  outline:3px solid #9eb48e;
  outline-offset:4px;
}
input,textarea,select {
  width:100%;
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px 12px;
  background:#fff;
  color:var(--ink);
  outline-color:#789174;
}
textarea {
  resize:vertical;
}
label {
  display:block;
  font-size:11px;
  color:#687167;
}
label input,label textarea,label select {
  margin-top:6px;
}
h1,h2,p {
  margin:0;
}
h1,h2 {
  font-family:Georgia,serif;
  font-weight:400;
}
h1 {
  font-size:38px;
  letter-spacing:-1.2px;
}
h2 {
  font-size:24px;
}
.sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:232px;
  background:#1c2520;
  color:#dfe3d7;
  padding:36px 23px;
  display:flex;
  flex-direction:column;
}
.brand {
  display:flex;
  align-items:center;
  gap:13px;
  font-family:Georgia,serif;
  font-size:20px;
  line-height:1.1;
  letter-spacing:2px;
}
.brand-mark {
  color:#c4b582;
  font-size:52px;
}
.brand small {
  display:block;
  font:8px system-ui;
  letter-spacing:1.8px;
  margin-top:10px;
  color:#9ba495;
}
.sidebar-label {
  font-size:9px;
  letter-spacing:1.5px;
  color:#8a978c;
  margin:55px 14px 15px;
}
nav {
  display:grid;
  gap:8px;
}
nav a {
  padding:12px 14px;
  border-radius:5px;
  font-size:12px;
  color:#aeb9ac;
}
nav a span {
  display:inline-block;
  width:24px;
  font-size:17px;
}
nav a.active,nav a:hover {
  background:#344035;
  color:#eeeedd;
}
.sidebar-note {
  margin:auto 10px 36px;
  border-top:1px solid #384037;
  padding-top:25px;
}
.sidebar-note p {
  font:italic 20px/1.6 Georgia,serif;
  color:#b6beac;
  margin:10px 0;
}
.sidebar-note small {
  font-size:8px;
  letter-spacing:1.4px;
  color:#788773;
}
.small-diamond {
  color:#b2a572;
  font-size:25px;
}
.rules-tag {
  border-top:1px solid #384037;
  padding-top:20px;
  font-size:10px;
  display:flex;
  gap:9px;
  align-items:center;
}
.rules-tag>span:last-child {
  font-size:8px;
  color:#929d8f;
  margin-left:auto;
}
.status-dot {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#8baa78;
  flex-shrink:0;
}
main {
  margin-left:232px;
  padding:0 42px;
  max-width:1640px;
}
.topbar {
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  font-size:9px;
  letter-spacing:1px;
  color:var(--muted);
}
.topbar strong {
  font-size:11px;
  font-weight:400;
  letter-spacing:0;
  color:#5d665c;
}
.slash {
  margin:0 16px;
  color:#bbb;
}
.topbar>span:last-child {
  letter-spacing:0;
  display:flex;
  gap:9px;
  align-items:center;
}
.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:35px 0 27px;
}
.eyebrow {
  font-size:9px;
  letter-spacing:1.7px;
  font-weight:600;
  color:#848a76;
  margin-bottom:9px;
}
.page-heading p {
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}
.file-actions {
  display:flex;
  gap:9px;
}
.button {
  border:1px solid transparent;
  border-radius:5px;
  padding:10px 15px;
  font-size:11px;
  white-space:nowrap;
  min-height:40px;
}
.dark {
  background:#293e30;
  color:#f5f4e9;
}
.dark:hover {
  background:#40553b;
}
.quiet {
  background:transparent;
  border-color:#d8dbd0;
}
.parchment {
  background:#eae8d7;
  color:#253628;
  margin-top:23px;
}
.parchment span {
  margin-left:25px;
}
.campaign-banner {
  min-height:252px;
  border-radius:8px;
  background:#283b31;
  color:#f4f1df;
  position:relative;
  overflow:hidden;
  display:flex;
}
.banner-copy {
  padding:29px 32px;
  z-index:1;
  width:64%;
}
.banner-copy .eyebrow {
  color:#b6c09f;
  display:flex;
  align-items:center;
  gap:9px;
}
.banner-copy h2 {
  font-size:36px;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.banner-copy p {
  color:#b8c4b2;
  font:italic 14px Georgia,serif;
  margin-top:13px;
}
.banner-meta {
  display:flex;
  flex-wrap:wrap;
  gap:22px;
  font-size:10px;
  color:#bcc6b5;
  margin-top:22px;
}
.landscape {
  position:absolute;
  inset:0 0 0 52%;
  overflow:hidden;
  background:radial-gradient(ellipse at 67% 35%,#6b795347,transparent 70%);
}
.moon {
  position:absolute;
  width:105px;
  height:105px;
  border:1px solid #c0bb7866;
  border-radius:50%;
  top:30px;
  right:95px;
  box-shadow:0 0 0 12px #b2ba8210,0 0 0 28px #b2ba8208;
  background:#bfc18912;
}
.mountain {
  position:absolute;
  width:100%;
  height:200px;
  bottom:0;
  clip-path:polygon(0 90%,30% 15%,47% 64%,69% 5%,100% 95%);
  background:#51624c;
}
.mountain-front {
  bottom:-44px;
  left:30px;
  background:#182c25;
  transform:scaleX(1.4);
}
.mountain-back {
  opacity:.6;
  bottom:6px;
}
.tower {
  position:absolute;
  background:#142820;
  width:22px;
  height:89px;
  right:118px;
  bottom:38px;
  clip-path:polygon(50% 0,100% 20%,85% 20%,85% 100%,15% 100%,15% 20%,0 20%);
}
.tower-two {
  right:95px;
  height:57px;
  bottom:36px;
}
.stars {
  color:#c6bf8380;
  position:absolute;
  top:29px;
  right:32px;
  font-size:24px;
}
.stars span {
  position:absolute;
  right:245px;
  top:17px;
  font-size:15px;
}
.landscape-caption {
  position:absolute;
  right:23px;
  bottom:17px;
  font-size:7px;
  letter-spacing:2px;
  color:#a7b09a;
}
.stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  margin:22px 0;
  padding:19px 0;
}
.stats>div {
  display:flex;
  align-items:center;
  gap:15px;
  padding:0 23px;
  border-right:1px solid var(--line);
}
.stats>div:last-child {
  border:0;
}
.stat-icon {
  font-size:25px;
  color:#929c7b;
}
.stats strong {
  display:block;
  font:25px Georgia,serif;
}
.stats span:not(.stat-icon) {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:3px;
}
#rules-version {
  font-size:18px;
}
.dashboard-grid {
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);
  gap:22px;
}
.main-column,.side-column {
  display:flex;
  flex-direction:column;
  gap:22px;
  min-width:0;
}
.panel {
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  padding:23px;
}
.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:20px;
}
.panel-heading .eyebrow {
  font-size:8px;
  margin-bottom:5px;
}
.panel h2 {
  font-size:23px;
}
.badge {
  font-size:8px;
  letter-spacing:1px;
  background:#f1f3ea;
  color:#71815c;
  padding:6px 9px;
  border:1px solid #e3e8d9;
  border-radius:4px;
}
.muted {
  color:var(--muted);
}
.encounter-toolbar {
  font-size:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#f7f8f3;
  padding:10px;
  margin-bottom:10px;
  gap:10px;
}
.encounter-toolbar .status-dot {
  margin-right:5px;
}
.text-button {
  border:0;
  background:transparent;
  color:#506946;
  font-size:11px;
  padding:9px 0;
  min-height:36px;
}
.combatant {
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--line);
  padding:13px 0;
}
.combatant.current {
  background:#f4f6ef;
}
.initiative {
  font:20px Georgia,serif;
  min-width:30px;
  text-align:center;
  color:#8c956e;
}
.combatant-info {
  flex:1;
  min-width:0;
}
.combatant-info strong {
  font-size:12px;
  overflow-wrap:anywhere;
}
.combatant-info small {
  display:block;
  font-size:10px;
  color:var(--muted);
}
.hp-controls {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
}
.hp-controls button,.remove-combatant {
  min-width:32px;
  min-height:36px;
  border:1px solid var(--line);
  border-radius:4px;
  background:#fff;
  color:#59654f;
}
.remove-combatant {
  border:0;
  color:#a28677;
}
.combatant-form {
  display:grid;
  grid-template-columns:minmax(110px,1fr) 65px 60px 55px auto;
  gap:8px;
  align-items:end;
  margin-top:20px;
}
.combatant-form input {
  padding:9px 7px;
  font-size:11px;
}
.panel-footnote {
  font:italic 11px Georgia,serif;
  color:#929486;
  margin-top:16px;
}
.empty {
  padding:25px 10px;
  text-align:center;
  color:#909686;
  font-size:12px;
}
.journal textarea {
  min-height:160px;
  background:#fffefb;
  border:0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  border-radius:0;
  font:14px/1.9 Georgia,serif;
  padding:16px 0;
}
.journal-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:9px;
  color:var(--muted);
  margin-top:10px;
}
.dice-display {
  text-align:center;
  padding:2px 0 20px;
}
.die-shape {
  width:89px;
  height:93px;
  margin:0 auto 14px;
  display:grid;
  place-items:center;
  background:#f4f3e8;
  clip-path:polygon(50% 0,95% 24%,95% 75%,50% 100%,5% 75%,5% 24%);
  position:relative;
}
.die-shape:before {
  content:'';
  position:absolute;
  inset:9px;
  background:#e4e6d4;
  clip-path:polygon(50% 0,100% 100%,0 100%);
}
.die-shape span {
  font:36px Georgia,serif;
  z-index:1;
  color:#61724f;
}
.dice-display>span {
  font:italic 11px Georgia,serif;
  color:#959783;
}
.dice-presets {
  display:flex;
  gap:6px;
  margin-bottom:20px;
}
.dice-presets button {
  flex:1;
  min-height:37px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:4px;
  color:#858a7a;
  font-size:10px;
}
.dice-presets button.selected {
  background:#eff2e7;
  border-color:#a8b68f;
  color:#4a6240;
}
#dice-form label {
  font-size:8px;
  letter-spacing:1px;
}
.dice-input {
  display:flex;
  gap:8px;
  margin-top:6px;
}
.dice-input input {
  min-width:0;
  font-family:monospace;
  font-size:12px;
}
#dice-help {
  font-size:9px;
  color:var(--muted);
  display:block;
  margin-top:8px;
}
.roll-entry {
  border-top:1px solid var(--line);
  font-size:10px;
  padding-top:10px;
  margin-top:12px;
  color:#7b846f;
  overflow-wrap:anywhere;
}
.roll-entry strong {
  float:right;
  color:var(--ink);
  font-size:15px;
}
.quest-row {
  display:flex;
  gap:10px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.quest-row input {
  width:16px;
  min-height:20px;
  accent-color:#546b42;
  margin:0;
}
.quest-row span {
  font-size:12px;
  overflow-wrap:anywhere;
}
.quest-row.done span {
  text-decoration:line-through;
  color:#919789;
}
.quests form {
  display:flex;
  gap:8px;
  margin-top:13px;
}
.quests input {
  font-size:11px;
}
.page-footer {
  display:flex;
  justify-content:space-between;
  gap:20px;
  color:#a2a591;
  font-size:9px;
  padding:26px 0;
}
.page-footer span:last-child {
  font-size:7px;
  letter-spacing:1px;
}
dialog {
  border:1px solid var(--line);
  border-radius:10px;
  padding:28px;
  width:420px;
  max-width:calc(100% - 32px);
  color:var(--ink);
  box-shadow:0 20px 80px #0003;
}
dialog::backdrop {
  background:#13231988;
  backdrop-filter:blur(3px);
}
dialog h2 {
  margin-bottom:20px;
}
dialog label {
  margin-top:13px;
}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
}
#toast {
  position:fixed;
  bottom:22px;
  left:50%;
  transform:translateX(-50%);
  background:#263d2f;
  color:white;
  padding:13px 22px;
  border-radius:6px;
  z-index:10;
  max-width:90%;
  box-shadow:0 4px 20px #0002;
  font-size:12px;
}
.logout {
  border:0;
  background:none;
  color:#65745d;
  font-size:10px;
  cursor:pointer;
  margin-left:12px;
}
.login-body {
  min-height:100vh;
  display:grid;
  place-items:center;
  background:#1c2922;
  padding:24px;
}
.login-card {
  width:100%;
  max-width:410px;
  background:#f6f5f0;
  border:1px solid #b9beaa44;
  border-radius:10px;
  padding:40px;
}
.login-card .brand-mark {
  display:block;
  text-align:center;
  margin-bottom:15px;
}
.login-card h1 {
  text-align:center;
  font-size:31px;
}
.login-card>p {
  text-align:center;
  font-size:12px;
  color:#7b8475;
  margin:10px 0 28px;
}
.login-card label {
  margin-top:16px;
}
.login-card .button {
  width:100%;
  margin-top:24px;
}
.login-error {
  color:#974e3c;
  font-size:12px;
  min-height:20px;
  margin-top:12px;
}
.login-footer {
  text-align:center;
  font-size:8px;
  color:#9ba58e;
  letter-spacing:1.5px;
  margin-top:26px;
}
@media(min-width:1500px) {
  main {
    padding-left:60px;
    padding-right:60px;
  }
}
@media(max-width:1150px) {
  .sidebar {
    width:190px;
    padding:30px 16px;
  }
  main {
    margin-left:190px;
    padding:0 24px;
  }
  .brand {
    font-size:17px;
  }
  .brand-mark {
    font-size:40px;
  }
  .page-heading {
    align-items:flex-start;
  }
  h1 {
    font-size:31px;
  }
  .stats>div {
    padding:0 15px;
    gap:10px;
  }
  .combatant-form {
    grid-template-columns:minmax(90px,1fr) 53px 50px 46px;
  }
  .combatant-form button {
    grid-column:1/-1;
  }
  .dashboard-grid {
    gap:16px;
    grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr);
  }
  .panel {
    padding:18px;
  }
  .file-actions {
    flex-direction:column;
  }
  .banner-copy {
    width:75%;
  }
}
@media(max-width:850px) {
  .sidebar {
    position:static;
    width:100%;
    padding:14px 20px;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
  }
  .brand {
    font-size:13px;
  }
  .brand small {
    font-size:6px;
    margin-top:5px;
  }
  .brand-mark {
    font-size:33px;
  }
  .sidebar-label,.sidebar-note,.rules-tag {
    display:none;
  }
  nav {
    display:flex;
    gap:3px;
  }
  nav a {
    font-size:0;
    padding:9px;
  }
  nav a span {
    font-size:20px;
    width:auto;
  }
  main {
    margin:0;
    padding:0 22px;
  }
  .topbar {
    height:54px;
  }
  .page-heading {
    padding:26px 0;
  }
  .dashboard-grid {
    grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr);
  }
  .banner-copy h2 {
    font-size:31px;
  }
}
@media(max-width:640px) {
  main {
    padding:0 16px;
  }
  .topbar {
    font-size:8px;
  }
  .topbar strong {
    font-size:10px;
  }
  .slash {
    margin:0 7px;
  }
  .topbar>span:last-child {
    font-size:8px;
  }
  .page-heading {
    display:block;
  }
  .page-heading h1 {
    font-size:32px;
  }
  .file-actions {
    flex-direction:row;
    margin-top:19px;
  }
  .campaign-banner {
    min-height:260px;
  }
  .banner-copy {
    width:100%;
    padding:25px 22px;
  }
  .banner-copy h2 {
    font-size:31px;
  }
  .banner-copy p {
    max-width:75%;
    line-height:1.5;
  }
  .landscape {
    left:35%;
    opacity:.5;
  }
  .banner-copy .eyebrow {
    font-size:8px;
  }
  .landscape-caption {
    display:none;
  }
  .moon {
    right:25px;
    top:28px;
  }
  .tower-one {
    right:50px;
  }
  .tower-two {
    right:30px;
  }
  .stats {
    grid-template-columns:1fr 1fr;
    gap:22px 0;
    padding:20px 0;
  }
  .stats>div:nth-child(2) {
    border:0;
  }
  .stats strong {
    font-size:24px;
  }
  .dashboard-grid {
    grid-template-columns:1fr;
  }
  .side-column {
    display:contents;
  }
  .dice-panel {
    grid-row:1;
  }
  .main-column {
    gap:18px;
  }
  .combatant-form {
    grid-template-columns:minmax(95px,1fr) 58px 54px 50px;
  }
  .dice-display {
    padding:0 0 14px;
  }
  .dice-display .die-shape {
    width:70px;
    height:75px;
    margin-bottom:8px;
  }
  .dice-panel .panel-heading {
    margin-bottom:10px;
  }
  .dice-presets button {
    min-height:44px;
  }
  .page-footer {
    display:block;
    text-align:center;
  }
  .page-footer span {
    display:block;
    margin-bottom:10px;
  }
  .journal-footer {
    flex-wrap:wrap;
  }
  .login-card {
    padding:30px 25px;
  }
  .hp-controls {
    gap:5px;
  }
  .hp-controls button {
    min-width:34px;
    min-height:44px;
  }
}
.party-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.party-row strong {
  font-size:12px;
}
.party-row small {
  display:block;
  font-size:10px;
  color:var(--muted);
}
.party-form {
  display:grid;
  grid-template-columns:1fr 1fr 55px 60px;
  gap:8px;
  margin-top:16px;
}
.party-form button {
  grid-column:1/-1;
}
.party-form input {
  padding:9px 7px;
  font-size:11px;
}
.login-card {
  margin:0!important;
}
.topbar {
  gap:10px;
}
.topbar #save-status {
  margin-left:auto;
}
.logout {
  min-height:44px;
}
@media(max-width:380px) {
  .party-form {
    grid-template-columns:1fr 1fr;
  }
  .combatant-form {
    grid-template-columns:1fr 1fr;
  }
  .topbar>span:first-child {
    display:none;
  }
}
.login-card>.eyebrow {
  text-align:center;
}
.campaign-switcher {
  display:flex;
  align-items:center;
  gap:14px;
  padding-top:22px;
}
.campaign-switcher label {
  font-size:8px;
  letter-spacing:1px;
  white-space:nowrap;
}
.campaign-switcher select {
  max-width:320px;
  font-size:12px;
}
.adventure-panel {
  margin-top:22px;
}
.adventure-panel>p {
  font-size:11px;
}
.conversation {
  max-height:440px;
  overflow:auto;
  padding:16px 0;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.message {
  padding:16px 20px;
  border-radius:8px;
  background:#f5f6ef;
  white-space:pre-wrap;
  font:15px/1.8 Georgia,serif;
  overflow-wrap:anywhere;
  max-width:94%;
}
.message.user {
  align-self:flex-end;
  background:#e7ecdf;
  font:13px/1.6 system-ui,sans-serif;
}
.message-label {
  display:block;
  font:8px system-ui,sans-serif;
  letter-spacing:1.4px;
  color:#798b66;
  margin-bottom:7px;
}
.chat-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
}
.chat-actions span {
  font-size:9px;
  color:var(--muted);
}
#player-message {
  min-height:80px;
}
#library-dialog {
  width:720px;
}
#library-dialog>p {
  margin:12px 0;
  font-size:12px;
}
.starter-card {
  padding:20px;
  margin-top:12px;
  background:#eef1e7;
  border:1px solid #dfe4d4;
  border-radius:6px;
}
.starter-card h3 {
  font:23px Georgia,serif;
  margin:7px 0;
}
.starter-card p {
  font-size:12px;
  color:#788270;
  margin-bottom:12px;
}
#character-dialog {
  width:660px;
}
.character-fields {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 15px;
}
.ability-fields {
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:8px;
}
fieldset {
  border:1px solid var(--line);
  margin:18px 0;
  padding:12px;
}
legend {
  font-size:11px;
  color:var(--muted);
}
.party-actions {
  display:flex;
  gap:12px;
}
.campaign-switcher+.page-heading {
  padding-top:25px;
}
body.dm-running .main-column input,body.dm-running .main-column textarea {
  opacity:.65;
}
@media(max-width:640px) {
  .campaign-switcher {
    flex-wrap:wrap;
    gap:8px;
  }
  .campaign-switcher label {
    width:100%;
  }
  .campaign-switcher select {
    flex:1;
    min-width:0;
  }
  .adventure-panel {
    padding:18px;
  }
  .chat-actions {
    flex-wrap:wrap;
  }
  .chat-actions .button {
    width:100%;
  }
  .message {
    max-width:100%;
    padding:14px;
    font-size:14px;
  }
  .ability-fields {
    grid-template-columns:repeat(3,1fr);
  }
  .party-actions {
    gap:6px;
    flex-direction:column;
  }
  .party-actions button {
    padding:2px 0;
  }
  .conversation {
    max-height:370px;
  }
}
@media(max-width:640px) {
  .adventure-panel .panel-heading {
    flex-wrap:wrap;
  }
  .sidebar {
    flex-wrap:wrap;
    gap:8px;
  }
  .sidebar nav {
    margin-left:auto;
  }
  .chat-actions span {
    overflow-wrap:anywhere;
  }
  .campaign-switcher .button {
    padding-left:10px;
    padding-right:10px;
  }
}
@media(max-width:380px) {
  .sidebar nav {
    width:100%;
    justify-content:space-between;
  }
  .sidebar .brand {
    margin:auto;
  }
  .panel-heading {
    flex-wrap:wrap;
  }
}
/* Character sheets and the in-app guide share the campaign's visual language. */
.character-sheets, .help-panel { margin: 22px 0; scroll-margin-top: 20px; }
.section-intro { color: #737d6d; font-size: 12px; line-height: 1.7; margin: 0 0 18px; }
.sheet-toolbar { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.sheet-toolbar select { max-width: 320px; flex: 1; min-width: 0; }
.sheet-toolbar label { white-space: nowrap; }
.sheet-identity { display: flex; gap: 18px; align-items: center; margin: 24px 0; }
.hero-monogram { display: grid; place-items: center; width: 60px; height: 60px; flex-shrink: 0; background: #e9eddf; color: #526747; border: 1px solid #d7decb; border-radius: 50%; font: 28px Georgia, serif; }
.sheet-identity h3 { font: 29px Georgia, serif; margin: 0 0 6px; overflow-wrap: anywhere; }
.sheet-identity p { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sheet-vitals { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; padding: 18px; border-radius: 6px; background: #f7f8f2; }
.sheet-vitals dt { font-size: 10px; color: #768269; }
.sheet-vitals dd { margin: 6px 0 0; font: 22px Georgia,serif; overflow-wrap: anywhere; }
.sheet-abilities { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.ability-tile { border: 1px solid var(--line); padding: 16px 8px; border-radius: 6px; text-align: center; }
.ability-tile span { display: block; font-size: 9px; letter-spacing: 1.5px; color: #78866a; }
.ability-tile strong { display: block; font: 28px Georgia,serif; margin: 5px 0; }
.ability-tile small { font-size: 10px; color: #7c8674; }
.sheet-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sheet-block { min-width: 0; padding: 16px 0; border-top: 1px solid var(--line); }
.sheet-block h4 { font: 19px Georgia,serif; margin: 0 0 10px; }
.sheet-block p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.8; color: #68725f; }
.sheet-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-history p { font-size: 12px; overflow-wrap: anywhere; padding: 8px 0; }
.quick-start { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.quick-start a { display: block; border: 1px solid #dfe5d5; border-radius: 6px; background: #f1f4ea; padding: 20px; }
.quick-start a:hover { background: #e8eddf; }
.quick-start span { display: block; font: 24px Georgia,serif; color: #8d9b76; margin-bottom: 12px; }
.quick-start strong { font-size: 13px; font-weight: 500; }
.quick-start p { font-size: 11px; color: #79846e; line-height: 1.8; margin-top: 8px; }
#help-search { margin: 6px 0 10px; }
#help-topics details { border-top: 1px solid var(--line); padding: 4px 0; }
#help-topics summary, .sheet-history summary { padding: 14px 0; cursor: pointer; font-size: 13px; color: #3d5639; }
#help-topics p { max-width: 85ch; font-size: 13px; color: #697360; line-height: 1.9; margin: 0 0 15px; }
#help-topics a { text-decoration: underline; }
#help-topics code { background: #eef1e6; padding: 2px 4px; border-radius: 3px; }
summary:focus-visible { outline: 3px solid #9eb48e; outline-offset: 2px; }
@media(max-width:850px) { .sidebar nav { flex-wrap: wrap; } }
@media(max-width:640px) {
  .character-sheets .panel-heading { flex-wrap: wrap; }
  .sheet-toolbar { flex-wrap: wrap; gap: 10px; }
  .sheet-toolbar label { width: 100%; }
  .sheet-vitals { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .sheet-abilities { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .sheet-detail-grid, .quick-start { grid-template-columns: 1fr; gap: 8px; }
  .sheet-identity h3 { font-size: 25px; }
  .sidebar nav { width: 100%; justify-content: space-between; }
  .sidebar nav a { padding: 9px 7px; }
  #help-topics summary { min-height: 44px; }
}
/* Shared campaign membership and the permanent chronicle. */
[hidden] { display: none !important; }
.members-panel, .activity-panel { margin: 22px 0; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row strong { font-size: 13px; overflow-wrap: anywhere; }
.member-row span { display: block; color: var(--muted); font-size: 11px; }
.inline-form { display: flex; align-items: end; gap: 12px; margin-top: 18px; }
.inline-form label { flex: 1; min-width: 0; }
.visibility-control { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.visibility-control select { font-size: 11px; max-width: 240px; }
.visibility-control label { white-space: nowrap; }
.activity-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 24px 0 14px; }
.activity-toolbar select { min-width: 180px; }
.activity-entry { padding: 18px 0; border-top: 1px solid var(--line); }
.activity-meta { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; font-size: 10px; color: #7d8872; }
.activity-meta strong { color: #4c6244; }
.activity-entry p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; margin-top: 9px; }
.activity-entry summary { font-size: 11px; color: #6e7c62; cursor: pointer; padding: 10px 0; }
.activity-entry pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f6ee; padding: 14px; max-height: 320px; overflow: auto; font-size: 11px; }
#activity-list { max-height: 650px; overflow-y: auto; }
.sidebar { overflow-y: auto; }
@media(max-width:640px) {
 .inline-form { flex-wrap: wrap; }
 .inline-form label { flex-basis: 100%; }
 .inline-form .button { width: 100%; }
 .visibility-control { flex-wrap: wrap; }
 .activity-panel .panel-heading { flex-wrap: wrap; }
 .activity-toolbar { align-items: center; }
 #signed-in-user { display: none; }
 .sidebar nav { justify-content: flex-start; gap: 4px; }
}

/* A readable, numbered path from first login through a completed adventure. */
.walkthrough-steps { padding-left: 28px; margin: 12px 0 20px; }
.walkthrough-steps li { padding: 0 0 10px 10px; }
.walkthrough-steps li::marker { color: #526847; font-weight: 600; }
.walkthrough-steps h3 { font-size: 14px; color: #3d5639; margin: 8px 0; }
#full-walkthrough { background: #f5f6ee; border-radius: 6px; padding: 8px 16px; }
@media (max-width: 600px) {
  #full-walkthrough { padding: 6px 10px; }
  .walkthrough-steps { padding-left: 22px; }
  .walkthrough-steps li { padding-left: 3px; }
}

.action-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.action-options p { grid-column: 1 / -1; }
.action-options button { white-space: normal; text-align: left; overflow-wrap: anywhere; min-height: 48px; line-height: 1.6; }
@media (max-width: 600px) { .action-options { grid-template-columns: 1fr; } }

.character-create-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.creation-workspace { border: 1px solid #dfe5d5; border-radius: 8px; background: #f5f6ee; padding: 22px; margin: 18px 0; scroll-margin-top: 20px; }
.creation-workspace h3 { font: 22px Georgia,serif; margin: 10px 0 16px; color: #3d5639; }
.creation-workspace fieldset { min-width: 0; margin: 18px 0; }
.creation-workspace legend { font-weight: 600; font-size: 15px; padding: 0 6px; }
.creation-workspace label, .custom-campaign label { display: block; margin: 14px 0; }
.creation-workspace textarea { min-height: 95px; }
.creation-explanation { white-space: pre-wrap; line-height: 1.9; font-size: 14px; overflow-wrap: anywhere; }
.creation-workspace .dialog-actions { flex-wrap: wrap; }
.creation-workspace .muted, .custom-campaign .muted { line-height: 1.8; }
.custom-campaign { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.custom-campaign summary { cursor: pointer; padding: 12px 0; color: #3d5639; }
.starter-scope { font-weight: 600; color: #526847; }
#character-required { background: #f5f0df; padding: 12px; border-radius: 6px; }
#character-required a { text-decoration: underline; }
@media (max-width: 600px) {
  .creation-workspace { padding: 12px; }
  .character-create-actions { width: 100%; }
  .character-create-actions button { flex: 1; white-space: normal; min-height: 44px; }
  #characters > .panel-heading { flex-wrap: wrap; gap: 12px; }
  .creation-workspace .dialog-actions button { flex: 1; white-space: normal; min-height: 44px; }
}

/* Separate, addressable workspace pages. */
.workspace-page { max-width: 1160px; margin: 20px auto 0; min-width: 0; }
.workspace-page > .panel { margin: 0 0 22px; }
.workspace-page[data-page="/play"] { display: grid; grid-template-columns: minmax(0,2fr) minmax(260px,1fr); gap: 22px; align-items: start; }
.workspace-page[data-page="/play"] .conversation { max-height: 65vh; min-height: 240px; }
.workspace-page[data-page="/characters"] > #party { margin-top: 24px; }
.character-next { margin: 18px 0; }
.theme-toggle { border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); padding: 8px 12px; white-space: nowrap; min-height: 40px; }
.login-card .theme-toggle { margin-top: 18px; }
#page-title:focus { outline: none; }
:root[data-theme="dark"] {--tone-0:#e5ece6; --tone-1:#a5b3a8; --tone-2:#111916; --tone-3:#34433a; --tone-4:#b0d5b9; --tone-5:#d2c38f; --tone-6:#1b2720; --tone-7:#111c16; --tone-8:#45594a; --tone-9:#223127; --tone-10:#2c4032; --tone-11:#b7c5b9; --tone-12:#bbd6b6; --tone-13:#25372b; --tone-14:#435a49; --tone-15:#45664d; --tone-16:#63876b; --tone-17:#304634; --tone-18:#d2e5cb; --tone-19:#3a3525; --tone-20:#efe1b7; --tone-21:#0c1410; --tone-22:#aab9ac; --tone-23:#28392d; --tone-24:#cad9c7; --tone-25:#ffb4a5;}
:root[data-theme="midnight"] {--tone-0:#e5ecfa; --tone-1:#a8b7d1; --tone-2:#101827; --tone-3:#344560; --tone-4:#a8c8fa; --tone-5:#d7c99b; --tone-6:#19253a; --tone-7:#101c30; --tone-8:#465d80; --tone-9:#23324c; --tone-10:#2c405d; --tone-11:#becbe0; --tone-12:#b7d0f4; --tone-13:#253955; --tone-14:#476081; --tone-15:#405e88; --tone-16:#7190bc; --tone-17:#304669; --tone-18:#d9e7ff; --tone-19:#393525; --tone-20:#efe1b7; --tone-21:#0b1120; --tone-22:#b8c8e0; --tone-23:#263a56; --tone-24:#d0ddf2; --tone-25:#ffb4a5;}
:root[data-theme="ember"] {--tone-0:#f5e8de; --tone-1:#c8b0a3; --tone-2:#211613; --tone-3:#594039; --tone-4:#f0ba91; --tone-5:#dfc184; --tone-6:#30201b; --tone-7:#251814; --tone-8:#79574a; --tone-9:#3b2922; --tone-10:#503529; --tone-11:#d9c1b4; --tone-12:#f0c3a1; --tone-13:#493126; --tone-14:#80604b; --tone-15:#805038; --tone-16:#b9825d; --tone-17:#533b2b; --tone-18:#f8dec4; --tone-19:#423723; --tone-20:#f5e3b6; --tone-21:#170f0d; --tone-22:#d4bcae; --tone-23:#493026; --tone-24:#ead2be; --tone-25:#ffb4a5;}
:root[data-theme="parchment"] {--tone-0:#30281e; --tone-1:#64543f; --tone-2:#f3e7cf; --tone-3:#c5b393; --tone-4:#634626; --tone-5:#795c25; --tone-6:#fff6e4; --tone-7:#fffaf0; --tone-8:#a78b60; --tone-9:#eadbbd; --tone-10:#e1cea9; --tone-11:#594a36; --tone-12:#654620; --tone-13:#ecddbf; --tone-14:#b39a70; --tone-15:#715431; --tone-16:#947344; --tone-17:#e3cfaa; --tone-18:#48371f; --tone-19:#efdfab; --tone-20:#514019; --tone-21:#30281e; --tone-22:#69573e; --tone-23:#493c29; --tone-24:#f8e7c7; --tone-25:#a12e20;}
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) { color-scheme: dark; --ink:var(--tone-0); --muted:var(--tone-1); --paper:var(--tone-2); --line:var(--tone-3); --green:var(--tone-4); --gold:var(--tone-5); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.panel,dialog,.login-card,.campaign-switcher) { background:var(--tone-6); color:var(--ink); border-color:var(--line); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(input,textarea,select) { background:var(--tone-7); color:var(--ink); border-color:var(--tone-8); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.creation-workspace,#full-walkthrough,.sheet-vitals,.ability-tile,.quick-start a,.activity-entry pre,.message,.stat-card,.hero-monogram,.roll-entry) { background:var(--tone-9); color:var(--ink); border-color:var(--line); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .message.user { background:var(--tone-10); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(label,.section-intro,.muted,.sheet-block p,.sheet-vitals dt,.ability-tile small,.ability-tile span,.quick-start p,#help-topics p,.activity-meta,.member-row span,.party-row small,.page-footer,.topbar,.login-card > p,.journal-footer,.panel-footnote,.sheet-history p) { color:var(--tone-11); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.eyebrow,.text-button,.sheet-block h4,.creation-workspace h3,.walkthrough-steps h3,.custom-campaign summary,#help-topics summary,.sheet-history summary,.activity-entry summary,.activity-meta strong,.starter-scope,.message-label) { color:var(--tone-12); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.button.quiet,.button.parchment,.dice-presets button,.starter-card) { background:var(--tone-13); color:var(--tone-0); border-color:var(--tone-14); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.button.dark,.dice-presets button.selected) { background:var(--tone-15); color:#fff; border-color:var(--tone-16); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) :is(.badge,#help-topics code) { background:var(--tone-17); color:var(--tone-18); border-color:var(--tone-14); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) #character-required { background:var(--tone-19); color:var(--tone-20); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .login-body { background:var(--tone-2); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .sidebar { background:var(--tone-21); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .empty { color:var(--tone-22); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .campaign-banner { background:var(--tone-23); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .banner-copy > p { color:var(--tone-24); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .creation-explanation { color:var(--ink); }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .login-error { color:var(--tone-25); }
:root[data-theme="parchment"] { color-scheme:light; }
@media (max-width: 1000px) {
  .workspace-page[data-page="/play"] { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; height: auto; min-height: 64px; padding: 12px 0; }
}
@media (max-width: 600px) {
  .workspace-page { margin-top: 14px; }
  .theme-toggle { font-size: 11px; padding: 8px; }
  #page-title { display: inline; }
}

.mobile-page-nav { display: none; }
@media (max-width: 850px) {
  .sidebar nav { display: none; }
  .sidebar .mobile-page-nav { display: block; margin: 0 0 0 auto; color: #c3d0c3; font-size: 9px; letter-spacing: 1px; min-width: 170px; }
  .mobile-page-nav select { margin-top: 4px; background: #26372b; border-color: #475c4c; color: #edf4ec; font-size: 13px; letter-spacing: normal; }
}
@media (max-width: 380px) {
  .sidebar .mobile-page-nav { width: 100%; }
}

:root :is(.topbar strong,.logout) { color:var(--ink); }

.hero-library,.resource-ledger { margin:20px 0; padding:18px; border:1px solid var(--line); border-radius:8px; }
.hero-library h3 { margin:0 0 12px; }
.hero-library-card { display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid var(--line); padding:14px 0; }
.hero-library-card p { font-size:12px; color:var(--muted); }
.resource-ledger summary { cursor:pointer; padding:8px 0; font-weight:600; }
.resource-ledger label { margin:12px 0; }
@media(max-width:640px){.hero-library-card { flex-wrap:wrap; }.hero-library .dialog-actions { flex-wrap:wrap; }.hero-library .button { white-space:normal; }}

.theme-picker { display:flex; align-items:center; gap:8px; margin:0; color:var(--ink); font-size:12px; }
.theme-picker select { width:auto; margin:0; min-height:44px; }
.login-card .theme-picker { margin-top:18px; }
.login-card .theme-picker select { margin-top:0; }
:root:is([data-theme="dark"],[data-theme="midnight"],[data-theme="ember"],[data-theme="parchment"]) .sidebar .mobile-page-nav { color:#e5dcc8; }
:root .quick-start a > span { color:var(--green); }
