/* Player portal layout — mobile-first, top nav + tabs */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--ft);
  min-height: 100vh;
}

/* ── Login screen (shared styles with admin, scoped here for independence) ── */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.login-title {
  font-family: var(--fh);
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 2px;
}

.login-sub {
  font-family: var(--fl);
  font-size: 12px;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 6px;
}

.login-desc {
  color: var(--txt2);
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.5;
}

.login-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--discord-bg);
  color: var(--txt-on-dark);
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-family: var(--fl);
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}

.login-discord-btn:hover { background: var(--discord-bg-hover); }

.login-error {
  color: var(--err);
  margin-top: 16px;
  font-size: 13px;
  min-height: 1.2em;
}

/* ── App shell ── */

#player-app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */

#sidebar {
  width: clamp(180px, 16vw, 220px);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surf);
  border-right: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--bdr);
}

.sidebar-title {
  font-family: var(--fh);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 1px;
}

.sidebar-sub {
  font-family: var(--fl);
  font-size: 13px;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.char-selector {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--surf2);
  color: var(--txt);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: var(--ft);
  font-size: 13px;
  cursor: pointer;
}

.char-selector:focus { outline: 1px solid var(--gold); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.sidebar-btn {
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--txt2);
  font-family: var(--fl);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 20px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-btn:hover { background: var(--surf2); color: var(--txt); }

/* Cycle open indicator */
.sidebar-btn.cycle-open::after {
  content: '\00B7 Open';
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.85;
  font-family: var(--fl);
  letter-spacing: 0.3px;
}

.sidebar-btn.on {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surf2);
}

/* ── Sidebar collapse ── */

.sb-close-btn {
  position: absolute;
  top: 22px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--bdr);
  border-radius: 4px;
  color: var(--txt3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.sb-close-btn:hover { color: var(--accent); border-color: var(--accent); }

.sb-open-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 36px;
  height: 36px;
  background: var(--surf2);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.sb-open-btn:hover { background: var(--surf); }

.sidebar-header { position: relative; }

#sidebar { transition: width 0.2s ease, min-width 0.2s ease, opacity 0.15s ease; }

.sb-collapsed #sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.sb-collapsed .sb-open-btn { display: flex; }

@media (max-width: 1024px) {
  .sb-open-btn { display: flex; }
  #sidebar { position: fixed; z-index: 1050; height: 100vh; }
  .sb-collapsed #sidebar { width: 0; }
  #player-app:not(.sb-collapsed) .sb-open-btn { display: none; }
}

/* ── Content area ── */

#content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* ── Profile modal ── */
.sidebar-avatar-click { cursor: pointer; transition: opacity 0.15s; }
.sidebar-avatar-click:hover { opacity: 0.8; }

/* Floating dialog shell (scoped to player app — admin.html has its own .plm-* rules) */
.plm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
  animation: plm-fade-in 0.15s ease-out;
}
@keyframes plm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.plm-dialog {
  background: var(--surf);
  border: 1px solid var(--bdr2);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--gold-a20) inset;
  width: 640px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--txt);
  animation: plm-rise 0.18s ease-out;
}
@keyframes plm-rise {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.plm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bdr);
}
.plm-header h3 {
  margin: 0;
  font-family: var(--fh);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.plm-dialog .cd-close {
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.plm-dialog .cd-close:hover { color: var(--accent); background: var(--gold-a20); }

.plm-dialog .plm-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surf2);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  color: var(--txt);
  font-family: var(--ft);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.plm-dialog .plm-input::placeholder { color: var(--txt3); opacity: 0.7; }
.plm-dialog .plm-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surf3, var(--surf2));
}
.plm-dialog textarea.plm-input { resize: vertical; min-height: 64px; font-family: var(--ft); }

.plm-loading { color: var(--txt3); font-size: 13px; margin: 0; }
.plm-error   { color: var(--crim2); font-size: 13px; margin: 0; }

/* Buttons inside the profile dialog (.dt-btn lives in admin.css — redefine locally) */
.plm-dialog .dt-btn {
  padding: 8px 18px;
  background: var(--gold-a8, var(--gold-a20));
  border: 1px solid var(--gold);
  border-radius: 5px;
  color: var(--gold2);
  font-family: var(--fl);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.plm-dialog .dt-btn:hover { background: var(--gold); color: var(--bg); }
.plm-dialog #profile-cancel {
  background: transparent;
  border-color: var(--bdr2);
  color: var(--txt3);
}
.plm-dialog #profile-cancel:hover {
  background: var(--surf2);
  border-color: var(--txt3);
  color: var(--txt);
}

.prof-readonly { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--bdr); }
.prof-readonly .prof-field { min-width: 180px; }
.prof-readonly .prof-field > span:not(.prof-label) { color: var(--txt); font-size: 13px; }
.prof-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.prof-wide { grid-column: 1 / -1; }
.prof-field { display: flex; flex-direction: column; gap: 4px; }
.prof-label { font-family: var(--fl); font-size: 11px; color: var(--txt3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.prof-privacy { font-size: 11px; font-style: italic; color: var(--txt3); margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--bdr); }
.prof-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; justify-content: flex-end; }

/* ── Tab panels ── */

.tab-panel { display: none; }
.tab-panel.active { display: flex; flex-direction: column; }
#tab-downtime.active { display: flex; flex-direction: column; overflow: hidden; }

/* Tab panels fill the content area */
.tab-panel:not(#tab-sheet) {
  padding: 24px clamp(16px, 2.5vw, 32px);
}

/* Sheet tab: full width with side breathing room */
#tab-sheet {
  padding: 16px 50px;
}

/* ── Sidebar footer nav ── */

.sidebar-footer-nav {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-link-btn {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--bdr2);
  border-radius: 4px;
  color: var(--label-secondary);
  font-family: var(--fl);
  font-size: 11px;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  box-sizing: border-box;
}

.sb-link-btn:hover {
  background: var(--surf2);
  color: var(--txt);
  border-color: var(--accent-a25);
}

/* ── Sidebar user (bottom) ── */

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-username {
  font-size: 13px;
  color: var(--txt2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 0;
  width: 100%;
  text-align: left;
}

.sidebar-logout:hover { color: var(--err); }

.placeholder-msg {
  color: var(--txt3);
  font-size: 14px;
  text-align: center;
  padding: 40px 16px;
}

/* ── XP Log ── */

.xpl-panel {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.xpl-cols {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.xpl-col {
  flex: 1;
  min-width: 160px;
}

.xpl-col-head {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 8px;
}

.xpl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.xpl-table td {
  padding: 3px 0;
  color: var(--txt2);
}

.xpl-table td.xpl-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--txt);
  padding-left: 16px;
  white-space: nowrap;
}

.xpl-table tr.xpl-total td {
  border-top: 1px solid var(--bdr);
  margin-top: 4px;
  padding-top: 6px;
  color: var(--txt);
  font-weight: 500;
}

.xpl-table tr.xpl-bonus td {
  color: var(--accent);
}

.xpl-table tr.xpl-sub td {
  color: var(--txt3);
  font-size: 12px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.xpl-paid { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .5px; padding: 1px 5px; border-radius: 3px; background: rgba(106,170,106,.2); color: var(--green2); margin-left: 6px; vertical-align: middle; }
.xpl-dim { color: var(--txt3); font-size: 11px; }

.xpl-none {
  color: var(--txt3);
  font-style: italic;
}

.xpl-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}

.xpl-bal-lbl {
  font-family: var(--fl);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
}

.xpl-bal-val {
  font-family: var(--fl);
  font-size: 15px;
  font-weight: 600;
}

.xpl-ok .xpl-bal-val { color: var(--green2); }
.xpl-over .xpl-bal-val { color: var(--crim2); }

.xpl-log { padding: 20px; }
.xpl-log-cols { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.xpl-log-col { flex: 1; min-width: 240px; }
.xpl-over-warn { margin: 6px 0 0; font-size: 12px; color: var(--crim2); }

/* ── Ordeals ── */

.ordeal-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ordeals-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ordeals-heading {
  font-family: var(--fl);
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.ordeals-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ordeal-card {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  transition: border-color .2s;
}

/* Horizontal summary row inside card */
.ordeal-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ordeal-card.done     { border-color: var(--green); }
.ordeal-card.pending  { border-color: var(--gold); }
.ordeal-card.in_review { border-color: var(--gold); }

.ordeal-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.ordeal-card.done .ordeal-icon     { color: var(--green2); }
.ordeal-card.pending .ordeal-icon  { color: var(--accent); }
.ordeal-card.in_review .ordeal-icon { color: var(--accent); }
.ordeal-card.incomplete .ordeal-icon { color: var(--txt3); }

.ordeal-info {
  flex: 1;
  min-width: 0;
}

.ordeal-label {
  font-family: var(--fl);
  font-size: 13px;
  color: var(--txt);
  font-weight: 600;
}

.ordeal-desc {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 2px;
  line-height: 1.4;
}

.ordeal-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 2px;
}

.ordeal-state {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ordeal-card.done .ordeal-state      { color: var(--green2); }
.ordeal-card.pending .ordeal-state   { color: var(--accent); }
.ordeal-card.in_review .ordeal-state { color: var(--accent); }
.ordeal-card.draft .ordeal-state     { color: var(--txt2); }
.ordeal-card.incomplete .ordeal-state { color: var(--txt3); }

.ordeal-card.draft    { border-color: var(--bdr2); }
.ordeal-card.draft .ordeal-icon { color: var(--txt2); }

.ordeal-xp {
  font-size: 11px;
  color: var(--green2);
  font-weight: 500;
}

.ordeal-card[data-form] { cursor: pointer; }
.ordeal-card[data-form]:hover { border-color: var(--gold); }

.ordeal-action {
  font-family: var(--fl);
  font-size: 11px;
  color: var(--gold);
  opacity: .6;
  transition: opacity .2s;
}

.ordeal-card[data-form]:hover .ordeal-action { opacity: 1; }

/* ST feedback — shown when marking is complete */
.ordeal-feedback {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ordeal-fb-overall {
  font-size: 13px;
  color: var(--txt2);
  font-style: italic;
  line-height: 1.5;
}

.ordeal-fb-answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ordeal-fb-item {
  background: var(--surf);
  border-left: 3px solid var(--bdr);
  border-radius: 0 4px 4px 0;
  padding: 7px 10px;
}
.ordeal-fb-item.or-result-yes   { border-left-color: var(--green2); }
.ordeal-fb-item.or-result-close { border-left-color: var(--accent); }
.ordeal-fb-item.or-result-no    { border-left-color: var(--crim); }

.ordeal-fb-q {
  font-size: 12px;
  color: var(--txt3);
  margin-bottom: 3px;
  line-height: 1.4;
}

.ordeal-fb-result {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  background: rgba(255,255,255,0.06);
  color: var(--txt3);
}
.or-result-yes  .ordeal-fb-result { background: var(--result-succ-bg); color: var(--green2); }
.or-result-close .ordeal-fb-result { background: var(--accent-a8); color: var(--accent); }
.or-result-no   .ordeal-fb-result { background: var(--crim-a22); color: var(--result-pend); }

.ordeal-fb-text {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.5;
}

/* .qf-back-btn rule lives in components.css (shared with game app) */

/* Downtime form component CSS moved to components.css */
/* ── Influence tab ── */

.influence-wrap { max-width: 560px; margin: 0 auto; }
.influence-title { font-family: var(--fl); font-size: 18px; color: var(--accent); margin-bottom: 8px; }
.influence-desc { font-size: 13px; color: var(--txt3); margin-bottom: 16px; line-height: 1.5; }

/* ── Character Creator Wizard ── */

#wizard-container { padding: 20px 16px; max-width: 700px; margin: 0 auto; }

.wiz-wrap { display: flex; flex-direction: column; gap: 24px; }

.wiz-progress { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wiz-step { display: flex; align-items: center; gap: 6px; opacity: 0.4; }
.wiz-step.active { opacity: 1; }
.wiz-step.done { opacity: 0.7; }
.wiz-step-n { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--bdr2); font-family: var(--fl); font-size: 12px; color: var(--txt3); background: var(--surf2); }
.wiz-step.active .wiz-step-n { border-color: var(--gold); color: var(--gold); background: var(--gold-a8); }
.wiz-step.done .wiz-step-n { background: var(--gold-a8); border-color: var(--gold); color: var(--gold); }
.wiz-step-lbl { font-size: 12px; color: var(--txt3); }
.wiz-step.active .wiz-step-lbl { color: var(--txt2); }
.wiz-step + .wiz-step::before { content: '›'; color: var(--txt3); opacity: 0.5; margin-right: 0; }

.wiz-title { font-family: var(--fl); font-size: 20px; color: var(--accent); margin-bottom: 6px; }
.wiz-hint { font-size: 13px; color: var(--txt3); margin-bottom: 16px; line-height: 1.5; }

.wiz-fields { display: flex; flex-direction: column; gap: 14px; }
.wiz-field { display: flex; flex-direction: column; gap: 5px; }
.wiz-label { font-size: 13px; color: var(--txt2); }
.wiz-input { background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; padding: 8px 10px; color: var(--txt); font-size: 14px; font-family: var(--ft); width: 100%; }
.wiz-input:focus { outline: none; border-color: var(--bdr2); }
.wiz-input-sm { width: 80px; }
.wiz-select { background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; padding: 8px 10px; color: var(--txt); font-size: 14px; font-family: var(--ft); width: 100%; cursor: pointer; }
.wiz-select:disabled { opacity: 0.4; cursor: default; }

/* Priority pickers */
.wiz-pri-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.wiz-pri-col { display: flex; flex-direction: column; gap: 6px; }
.wiz-pri-cat { font-family: var(--fl); font-size: 13px; color: var(--txt2); text-align: center; }

/* Category blocks */
.wiz-cat-block { margin-bottom: 20px; }
.wiz-cat-head { font-family: var(--fl); font-size: 14px; color: var(--txt2); margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; }

/* Budget indicator */
.wiz-budget { font-family: var(--ft); font-size: 12px; color: var(--txt3); }
.wiz-budget.over { color: var(--crim); }
.wiz-budget-bar { font-size: 13px; color: var(--txt3); margin-bottom: 14px; }
.wiz-budget-bar.over { color: var(--crim); }

/* Dot allocator rows */
.wiz-alloc-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bdr); }
.wiz-alloc-label { flex: 1; font-size: 14px; color: var(--txt2); }
.wiz-alloc-btn { width: 26px; height: 26px; background: var(--surf3); border: 1px solid var(--bdr); border-radius: 4px; color: var(--txt2); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.wiz-alloc-btn:disabled { opacity: 0.3; cursor: default; }
.wiz-dots { font-size: 14px; color: var(--gold); letter-spacing: 1px; min-width: 60px; text-align: center; }
.wiz-dots-empty { color: var(--bdr2); }

/* Merits */
.wiz-merit-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.wiz-merit-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; }
.wiz-merit-name { flex: 1; font-size: 14px; color: var(--txt); }
.wiz-merit-rating-adj { display: flex; align-items: center; gap: 6px; }
.wiz-merit-dots { font-size: 13px; color: var(--gold); min-width: 50px; text-align: center; }
.wiz-merit-adj { width: 22px; height: 22px; background: var(--surf3); border: 1px solid var(--bdr); border-radius: 3px; color: var(--txt2); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.wiz-merit-remove { background: none; border: none; color: var(--txt3); font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; }
.wiz-merit-remove:hover { color: var(--crim); }
.wiz-merit-empty { font-size: 13px; color: var(--txt3); margin-bottom: 12px; }
.wiz-merit-search-wrap { margin-bottom: 12px; }
.wiz-merit-search { width: 100%; }
.wiz-merit-results { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.wiz-merit-result { padding: 10px; background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; position: relative; }
.wiz-merit-result-dup { opacity: 0.5; }
.wiz-merit-result-name { font-size: 14px; color: var(--txt); margin-bottom: 3px; }
.wiz-merit-result-desc { font-size: 12px; color: var(--txt3); line-height: 1.4; margin-bottom: 4px; }
.wiz-merit-result-req { font-size: 11px; color: var(--accent); }
.wiz-merit-add { position: absolute; top: 10px; right: 10px; background: var(--surf3); border: 1px solid var(--bdr2); border-radius: 4px; color: var(--gold); font-size: 12px; padding: 3px 8px; cursor: pointer; }
.wiz-merit-add:hover { background: var(--gold-a8); }

/* Disciplines */
.wiz-disc-list { display: flex; flex-direction: column; }

/* Navigation */
.wiz-nav { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--bdr); }
.wiz-btn { padding: 10px 20px; border-radius: 5px; font-family: var(--fl); font-size: 14px; cursor: pointer; border: 1px solid var(--bdr2); letter-spacing: .04em; }
.wiz-back { background: var(--surf2); color: var(--txt2); }
.wiz-next, .wiz-submit { background: var(--gold-a8); border-color: var(--gold); color: var(--gold); }
.wiz-next:hover, .wiz-submit:hover { background: var(--gold); color: var(--bg); }
.wiz-btn:disabled { opacity: 0.5; cursor: default; }

/* Error */
.wiz-error { min-height: 20px; color: var(--crim); font-size: 13px; text-align: center; }

/* Review */
.wiz-review { display: flex; flex-direction: column; gap: 16px; }
.wiz-review-section { background: var(--surf2); border: 1px solid var(--bdr); border-radius: 6px; overflow: hidden; }
.wiz-review-head { background: var(--surf3); padding: 8px 14px; font-family: var(--fl); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.wiz-review-row { display: flex; gap: 12px; padding: 6px 14px; border-bottom: 1px solid var(--bdr); }
.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-key { font-size: 12px; color: var(--txt3); min-width: 160px; }
.wiz-review-val { font-size: 13px; color: var(--txt); }
.wiz-review-note { font-size: 12px; color: var(--txt3); text-align: center; padding: 8px; }

/* Pending approval */
#pending-container { display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.pending-msg { text-align: center; max-width: 400px; }
.pending-title { font-family: var(--fl); font-size: 20px; color: var(--accent); margin-bottom: 12px; }
.pending-body { font-size: 14px; color: var(--txt2); line-height: 1.6; }

/* ── Story tab ── */

#tab-story { padding: 24px 32px; }

.story-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.story-left,
.story-right { display: flex; flex-direction: column; gap: 16px; }

.story-pane-title {
  font-family: var(--fl);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 4px;
  border-bottom: 1px solid rgba(201,169,98,.15);
  padding-bottom: 8px;
}

.story-placeholder { margin-top: 0; }

/* Chronicle entries */
.story-feed { display: flex; flex-direction: column; gap: 20px; }
.story-entry { background: var(--surf2); border: 1px solid var(--bdr); border-radius: 8px; overflow: hidden; }
.story-cycle-label { background: var(--surf3); padding: 8px 16px; font-family: var(--fl); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--bdr); }
.story-narrative { padding: 16px; font-size: 14px; color: var(--txt2); line-height: 1.7; }
.story-narrative p { margin: 0 0 10px; }
.story-narrative p:last-child { margin-bottom: 0; }
.story-section { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--bdr); }
.story-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.story-section-head { font-family: var(--fl); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.story-section-mech { background: var(--surf3); padding: 10px; border-radius: 4px; }
.story-pre { font-family: monospace; font-size: 12px; white-space: pre-wrap; margin: 0; color: var(--txt3); }

/* DTSR-4: ST inline edit on historical chronicle entries */
.story-section-header { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.story-section-header .story-section-head { margin: 0; }
.story-section-edit {
  margin-left: auto;
  padding: 2px 8px;
  font-family: var(--fl);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt3);
  background: transparent;
  border: 1px solid var(--bdr);
  border-radius: 3px;
  cursor: pointer;
}
.story-section-edit:hover { color: var(--accent); border-color: var(--accent); }
.story-section-editing { background: var(--surf2); padding: 8px; border-radius: 4px; }
.story-section-edit-ta {
  width: 100%;
  min-height: 80px;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.6;
  padding: 8px;
  background: var(--surf);
  color: var(--txt);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}
.story-section-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.story-section-save, .story-section-cancel {
  padding: 4px 10px;
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--bdr);
  border-radius: 3px;
  background: transparent;
  color: var(--txt2);
  cursor: pointer;
}
.story-section-save { color: var(--accent); border-color: var(--accent); }
.story-section-save:disabled { opacity: .5; cursor: default; }
.story-section-edit-status { font-size: 11px; color: var(--txt3); font-style: italic; }
.story-section-rumours li[data-section-key] { display: flex; align-items: baseline; gap: 8px; }
.story-section-rumours li[data-section-key] .story-section-edit { margin-left: auto; }

/* ── DTSR-8: Player section flag affordance ── */
.story-section-flag-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--bdr2);
  border-radius: 3px;
  color: var(--txt3);
  cursor: pointer;
  font-family: var(--ft);
  font-size: 11px;
  padding: 2px 8px;
}
.story-section-flag-btn:hover { color: var(--crim); border-color: var(--crim); }
.story-section-flagged {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid rgba(139, 0, 0, 0.4);
  border-radius: 3px;
  font-size: 11px;
}
.story-section-flagged-label { color: var(--crim); font-weight: 600; }
.story-section-flag-recall {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--txt3);
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
}
.story-section-flag-recall:hover { color: var(--crim); border-color: var(--crim); }
.story-section-flag-form {
  margin: 4px 0 8px;
  padding: 8px 10px;
  background: var(--surf2);
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--crim);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.story-section-flag-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.story-section-flag-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--txt2);
  cursor: pointer;
}
.story-section-flag-reason {
  background: var(--surf);
  border: 1px solid var(--bdr2);
  border-radius: 3px;
  color: var(--txt);
  font-family: var(--ft);
  font-size: 12px;
  padding: 4px 8px;
  resize: vertical;
}
.story-section-flag-actions { display: flex; gap: 6px; align-items: center; }
.story-section-flag-submit {
  background: var(--crim);
  border: 1px solid var(--crim);
  border-radius: 3px;
  color: var(--txt1);
  cursor: pointer;
  font-family: var(--ft);
  font-size: 12px;
  padding: 4px 12px;
  font-weight: 600;
}
.story-section-flag-submit:disabled { opacity: 0.4; cursor: default; }
.story-section-flag-cancel {
  background: transparent;
  border: 1px solid var(--bdr2);
  border-radius: 3px;
  color: var(--txt2);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 10px;
}
.story-section-flag-status { color: var(--txt3); font-size: 11px; font-style: italic; }

/* Downtime form component CSS moved to components.css */
/* ── Document cards ── */

.doc-card {
  border: 1px solid var(--bdr);
  border-radius: 8px;
  overflow: hidden;
}

.doc-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surf2);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}

.doc-card-toggle:hover { background: var(--surf3); }

.doc-card-header-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.doc-card-eyebrow {
  font-family: var(--fl);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc-card-title {
  font-family: var(--fl);
  font-size: 15px;
  color: var(--txt);
}

.doc-card-subtitle {
  font-family: var(--ft);
  font-size: 12px;
  color: var(--txt3);
  font-style: italic;
}

.doc-card-chevron {
  color: var(--txt3);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .2s;
}

.doc-card-toggle[aria-expanded="true"] .doc-card-chevron {
  transform: rotate(180deg);
}

/* Dossier body — parchment reading pane */

.doc-card-body {
  border-top: 1px solid var(--bdr);
  padding: 16px;
  background: var(--parchment, #EAE0CC);
  color: var(--rp-txt);
  font-family: var(--ft);
  font-size: 13px;
  line-height: 1.65;
}

/* History card body */
.doc-history-body p {
  margin: 0 0 0.9em;
}
.doc-history-body p:last-child { margin-bottom: 0; }
.doc-history-body h1, .doc-history-body h2, .doc-history-body h3 {
  font-family: var(--fl);
  color: var(--rp-txt);
  margin: 1em 0 0.4em;
}

/* Identity strip */
.dos-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139,0,0,.15);
}

.dos-identity-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--rp-txt);
}

.dos-identity-item img {
  filter: sepia(1) saturate(8) hue-rotate(320deg) brightness(0.65);
}

.dos-bloodline { color: var(--rp-txt3); font-style: italic; }

.dos-archetypes {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--rp-brown-mid);
}

.dos-archetypes em { font-style: normal; color: var(--rp-accent); font-weight: 600; }

.dos-stats {
  width: 100%;
  font-size: 12px;
  color: var(--rp-txt3);
  font-style: italic;
}

/* Dossier sections */
.dos-section {
  border-bottom: 1px solid rgba(139,0,0,.1);
  margin-bottom: 2px;
}

.dos-section:last-of-type { border-bottom: none; }

.dos-section-title {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rp-accent);
  padding: 8px 0 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.dos-section-title::marker,
.dos-section-title::-webkit-details-marker { display: none; }

.dos-section-title::before {
  content: '▾ ';
  font-size: 10px;
}

.dos-section[open] .dos-section-title::before { content: '▴ '; }

.dos-section-body { padding-bottom: 10px; }

/* Dossier fields */
.dos-field { margin-bottom: 10px; }
.dos-field:last-child { margin-bottom: 0; }

.dos-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--rp-txt3);
  margin-bottom: 2px;
}

.dos-field-value {
  color: var(--rp-txt);
  white-space: pre-line;
}

/* Family entries */
.dos-family-entry {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(139,0,0,.2);
}

.dos-family-name { font-weight: 600; color: var(--rp-brown-dark); font-size: 12px; }
.dos-family-desc { color: var(--rp-txt); }

/* ── Archive tab ── */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 4px 0;
}

.archive-card {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.archive-card:hover {
  border-color: var(--accent);
  background: var(--surf2);
}

.archive-card-name {
  font-family: var(--fl);
  font-size: 14px;
  color: var(--txt);
  font-weight: 600;
}

.archive-card-meta {
  font-size: 12px;
  color: var(--txt3);
}

.archive-card-bp {
  font-size: 11px;
  color: var(--txt3);
}

.archive-badge {
  font-family: var(--ft);
  font-size: 10px;
  font-weight: 600;
  color: var(--txt3);
  background: var(--surf3);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
  align-self: flex-start;
  margin-top: 4px;
}

.archive-detail {
  display: flex;
  flex-direction: column;
}

/* ── Archive documents ── */

.arc-docs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.arc-section-title {
  font-family: var(--fl);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin: 16px 16px 4px;
}

.arc-doc-group {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  overflow: hidden;
}

.arc-doc-group-title {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt-dim);
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--bdr);
}

.arc-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--bdr);
  transition: background .15s;
}
.arc-doc-item:last-child { border-bottom: none; }
.arc-doc-item:hover { background: var(--surf2); }

.arc-doc-title {
  flex: 1;
  font-size: 14px;
  color: var(--txt);
}

.arc-doc-meta {
  font-size: 12px;
  color: var(--txt-dim);
}

.arc-doc-arrow {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

/* Document detail */

.arc-detail {
  display: flex;
  flex-direction: column;
  padding: 0 16px 24px;
}

.arc-detail-header {
  padding: 8px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arc-detail-title {
  font-family: var(--fl);
  font-size: 16px;
  color: var(--accent);
}

.arc-detail-body {
  margin-top: 8px;
}

.arc-retired { padding: 0 0 16px; }

/* Downtime form component CSS moved to components.css */
/* ── City tab ── */

.city-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.city-whos-who {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.city-panel {
  border-bottom: 1px solid var(--bdr);
  padding: 12px 14px;
}

.city-panel-title {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-bottom: 8px;
}

/* Court */
.city-office-list { display: flex; flex-direction: column; gap: 4px; }
.city-office-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; padding: 3px 0;
  border-bottom: 1px solid var(--bdr);
}
.city-office-row:last-child { border-bottom: none; }
.city-office-name { color: var(--txt); }
.city-office-position { font-family: var(--fl); font-size: 11px; color: var(--accent); letter-spacing: .04em; }

/* Map */
.city-map-wrap { overflow: hidden; background: var(--ink-black); }
.city-map { width: 100%; display: block; touch-action: pinch-zoom; }

/* Regents */
.city-regent-list { display: flex; flex-direction: column; gap: 2px; }
.city-regent-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; padding: 4px 0;
  border-bottom: 1px solid var(--bdr);
}
.city-regent-row:last-child { border-bottom: none; }
.city-regent-territory { color: var(--txt-dim); font-size: 12px; }
.city-regent-name { color: var(--txt); text-align: right; }

/* Who's Who */
.city-cov-group {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  overflow: hidden;
}
.city-cov-heading {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-family: var(--fl); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--bdr);
  background: var(--surf2);
}
.city-char-list { padding: 2px 0; }
.city-char-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-bottom: 1px solid var(--bdr);
}
.city-char-row:last-child { border-bottom: none; }
.city-char-name { font-size: 13px; color: var(--txt); }
.city-char-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-dim); }
.city-char-position { font-family: var(--fl); font-size: 11px; color: var(--accent); letter-spacing: .04em; }
.city-char-player { font-size: 11px; color: var(--txt3); font-style: italic; }
.city-placeholder { font-size: 12px; margin: 0; }

/* ── Status tab ─ ranked clan / covenant standing ─────────────────────────── */

#tab-status.active { overflow-y: auto; }

.status-split {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
}

/* ST view: group heading between city and multi-split sections */
.status-group-head {
  font-family: var(--fh);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--txt3);
  padding: 12px 16px 4px;
}

/* ST view: wrapping grid of all clans / all covenants */
.status-multi-split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 16px 16px;
  align-items: flex-start;
}

.status-multi-split .status-col {
  flex: 1;
  min-width: 280px;
}

.status-col {
  flex: 1;
  min-width: 0;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  overflow: hidden;
}

.status-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--fl);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--surf2);
  border-bottom: 1px solid var(--bdr);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bdr);
}
.status-row:last-child { border-bottom: none; }

.status-row-me {
  background: rgba(224, 196, 122, 0.10);
  box-shadow: inset 3px 0 0 var(--accent);
}
.status-row-me .status-name { color: var(--accent); }

.status-rank {
  width: 22px;
  text-align: right;
  font-family: var(--fl);
  font-size: 12px;
  color: var(--txt-dim);
  flex-shrink: 0;
}

.status-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surf2);
  object-fit: cover;
}

.status-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-name {
  font-size: 13px;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-player {
  font-size: 11px;
  color: var(--txt3);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dots {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.status-val {
  width: 20px;
  text-align: right;
  font-family: var(--fl);
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.status-empty { padding: 14px; font-size: 12px; margin: 0; }

@media (max-width: 720px) {
  .status-split { flex-direction: column; }
}

/* ── CR-3: slot architecture ─────────────────────────────────────────────── */

.status-city-section {
  padding: 16px;
  border-bottom: 1px solid var(--bdr);
}

.status-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.status-section-title {
  font-family: var(--fl);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

.status-section-caps {
  font-size: 11px;
  color: var(--txt3);
  font-style: italic;
}

/* Apex slot */
.status-apex-row { margin-bottom: 10px; }

.status-apex {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surf2);
  border: 1px solid var(--gold2);
  border-radius: 6px;
  min-height: 72px;
}

.status-apex.status-vacant {
  justify-content: center;
  border-style: dashed;
  border-color: var(--bdr);
  opacity: .6;
}

.status-apex-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surf3);
  object-fit: cover;
}

.status-apex-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-apex-name {
  font-family: var(--fl);
  font-size: 15px;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-apex-title {
  font-size: 11px;
  color: var(--gold2);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-apex-player {
  font-size: 11px;
  color: var(--txt3);
  font-style: italic;
}

.status-apex-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.status-apex-dots { letter-spacing: 1.5px; font-size: 12px; }

.status-apex-val {
  font-family: var(--fl);
  font-size: 18px;
  color: var(--accent);
}

/* High seat slots */
.status-high-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.status-high {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  min-height: 52px;
}

.status-high.status-vacant {
  justify-content: center;
  border-style: dashed;
  opacity: .5;
}

.status-high-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surf3);
  object-fit: cover;
}

.status-high-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-high-name {
  font-family: var(--fl);
  font-size: 13px;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-high-title  { font-size: 10px; color: var(--gold2); letter-spacing: .04em; text-transform: uppercase; }
.status-high-player { font-size: 10px; color: var(--txt3); font-style: italic; }

.status-high-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.status-high-dots { letter-spacing: 1.5px; font-size: 11px; }

.status-high-val {
  font-family: var(--fl);
  font-size: 15px;
  color: var(--accent);
}

/* Open floor */
.status-floor {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  overflow: hidden;
}

/* ── Bracket grouping (floor below high seats) ───────────────────────────── */
.status-brackets {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-bracket {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  overflow: hidden;
}

.status-bracket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surf2);
  border-bottom: 1px solid var(--bdr);
}

.status-bracket-dots {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
}

.status-bracket-val {
  font-family: var(--fh);
  font-size: 11px;
  color: var(--txt3);
  letter-spacing: .06em;
}

.status-bracket-appellation {
  font-family: var(--fl);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--txt2);
  margin-left: 8px;
  text-transform: uppercase;
  align-self: center;
}

.status-bracket-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surf2);
  border: 1px solid var(--bdr);
  border-radius: 20px;
  padding: 3px 10px 3px 3px;
}

.status-chip-me {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.status-chip-me .status-chip-name { color: var(--accent); }

.status-chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.status-chip-name {
  font-size: 12px;
  font-family: var(--fl);
  color: var(--txt);
  white-space: nowrap;
}

/* Vacant placeholder inside a fixed-tier bracket row */
.status-vacant-chip {
  font-size: 11px;
  color: var(--txt3);
  font-style: italic;
}

/* Chips inside column (clan/cov) get slightly more compact */
.status-col .status-brackets { margin: 10px; }

/* Slot highlight for active character */
.status-slot-me {
  background: rgba(224, 196, 122, .10);
  box-shadow: inset 3px 0 0 var(--accent);
}
.status-slot-me .status-apex-name,
.status-slot-me .status-high-name { color: var(--accent); }

/* Vacant label */
.status-vacant-label {
  font-size: 12px;
  color: var(--txt3);
  font-style: italic;
  letter-spacing: .04em;
}

/* Composite city dot colours */
.status-dot-innate { color: var(--accent); }
.status-dot-bonus  { color: var(--gold2); opacity: .65; }
.status-dot-empty  { color: var(--txt3); }

/* Clan/covenant apex card scaled down inside column */
.status-apex-row--col .status-apex-avatar { width: 36px; height: 36px; }
.status-apex-row--col .status-apex-name   { font-size: 13px; }
.status-apex-row--col .status-apex-val    { font-size: 15px; }

/* Slot caps label inside column header */
.status-col-head .status-section-caps { margin-left: auto; font-size: 10px; }

/* Slot content padding inside .status-col */
.status-col .status-apex-row,
.status-col .status-high-row,
.status-col .status-floor,
.status-col .status-brackets { margin: 10px; }
.status-col .status-apex-row { margin-bottom: 0; }
.status-col .status-high-row { margin-top: 8px; }

@media (max-width: 720px) {
  .status-high-row { flex-direction: column; }
}

/* ── Primer ─────────────────────────────────────────────────────────────────── */

#tab-primer.active { overflow-y: auto; }

.primer-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  min-height: 100%;
}

.primer-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 4px 0;
}

.primer-toc-title {
  font-family: var(--fl);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--txt3);
  margin-bottom: 10px;
}

.primer-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.primer-toc-item { padding: 0; }
.primer-toc-h2 { padding-left: 0; }
.primer-toc-h3 { padding-left: 14px; }

.primer-toc-link {
  display: block;
  font-size: 12px;
  color: var(--txt3);
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 3px;
  line-height: 1.4;
  transition: color .15s, background .15s;
}

.primer-toc-link:hover { color: var(--txt); background: var(--surf); }
.primer-toc-link.primer-toc-active { color: var(--accent); background: var(--surf); }

.primer-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* ── Tickets tab ── */
.tk-tab { }
.tk-layout { display: flex; gap: 0; align-items: start; }
.tk-panel-form { flex: 0 0 340px; padding-right: 24px; border-right: 1px solid var(--bdr); }
.tk-panel-list { flex: 1; min-width: 0; padding-left: 24px; }
.tk-submit-form { background: var(--surf); border: 1px solid var(--bdr); border-radius: 6px; padding: 16px; }
.tk-submit-form h4 { font-family: var(--fl); font-size: 14px; color: var(--accent); margin: 0 0 12px; }
.tk-form-row { margin-bottom: 10px; }
.tk-form-label { display: block; font-size: 12px; color: var(--txt3); margin-bottom: 4px; }
.tk-select, .tk-input { width: 100%; background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; color: var(--txt1); padding: 7px 10px; font-size: 13px; box-sizing: border-box; }
.tk-textarea { width: 100%; background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; color: var(--txt1); padding: 7px 10px; font-size: 13px; box-sizing: border-box; resize: vertical; }
.tk-btn-submit { background: none; border: 1px solid var(--accent); color: var(--accent); font-family: var(--fl); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 18px; border-radius: 4px; cursor: pointer; margin-top: 6px; }
.tk-btn-submit:hover { background: var(--accent-a8); }
.tk-error { color: var(--crim); font-size: 12px; margin-top: 6px; }
.tk-list { display: flex; flex-direction: column; gap: 8px; }
.tk-item { background: var(--surf); border: 1px solid var(--bdr); border-radius: 6px; padding: 12px 14px; }
.tk-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.tk-item-title { font-weight: 600; font-size: 14px; color: var(--txt1); flex: 1; }
.tk-item-meta { font-size: 11px; color: var(--txt3); }
.tk-item-body { font-size: 13px; color: var(--txt2); margin-top: 6px; white-space: pre-wrap; }
.tk-empty { color: var(--txt3); font-style: italic; font-size: 13px; padding: 20px 0; }
.tk-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; }
.tk-badge-open { background: var(--accent-a8); color: var(--accent); }
.tk-badge-in_progress { background: rgba(80,140,200,0.2); color: var(--tk-inprog-fg); }
.tk-badge-resolved { background: rgba(80,180,100,0.2); color: var(--tk-resolved-fg); }
.tk-badge-closed { background: rgba(120,120,120,0.15); color: var(--txt3); }
.tk-badge-bug { background: rgba(180,60,60,0.2); color: var(--tk-bug-fg); }
.tk-badge-feature { background: var(--tk-feature-bg); color: var(--tk-feature-fg); }
.tk-badge-question { background: var(--tk-question-bg); color: var(--tk-question-fg); }
.tk-badge-sheet { background: rgba(200,150,50,0.2); color: var(--tk-sheet-fg); }
.tk-badge-other { background: rgba(120,120,120,0.15); color: var(--txt3); }
.tk-item-toggle { cursor: pointer; user-select: none; }
.tk-item-toggle:hover .tk-item-title { color: var(--accent); }
.tk-item-chevron { font-size: 13px; color: var(--txt3); margin-left: auto; }
.tk-item-expanded { border-color: var(--accent); }
.tk-detail { border-top: 1px solid var(--bdr); padding-top: 12px; margin-top: 8px; }
.tk-item-body-full { font-size: 13px; color: var(--txt2); white-space: pre-wrap; }
.tk-edit-error { color: var(--crim); font-size: 12px; margin: 6px 0; }
.tk-btn-save { background: none; border: 1px solid var(--accent); color: var(--accent); font-family: var(--fl); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 16px; border-radius: 4px; cursor: pointer; margin-top: 6px; }
.tk-btn-save:hover { background: var(--accent-a8); }
.tk-edit-hint { font-family: var(--fl); font-size: 10px; letter-spacing: .04em; color: var(--accent); opacity: .6; }

/* ── Responsive ── */

@media (min-width: 600px) {
  #player-header { padding: 14px 24px; }
  .header-brand { font-size: 18px; }
  .tab-panel:not(#tab-sheet) { padding: 24px clamp(16px, 2.5vw, 32px); }
  .tab-btn { font-size: 13px; padding: 12px 16px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE: TABLET ≤900px / MOBILE ≤600px
   Phase 1 — pure-CSS mobile adjustments. No JS touched,
   no sheet.js inline styles removed. Scope: collapse two-pane
   splits, tighten padding, and rework the feeding grid to
   stack on phones. Sidebar drawer already handles ≤1024px.
   ══════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Sheet tab: desktop reserves 50px gutters — too fat for tablet */
  #tab-sheet { padding: 12px 16px; }

  /* Generic two-pane splits (Downtime, Feeding, Ordeals) stack vertically */

  /* City: left-panel (map/officers) stacks above right-panel (regents/who's who) */
  .city-split {
    flex-direction: column;
    align-items: stretch;
  }
  .city-left {
    border-right: none;
    border-bottom: 1px solid var(--bdr);
  }

  /* Primer: fixed 220px TOC becomes a flowing index above the content */
  .primer-layout {
    flex-direction: column;
    gap: 16px;
  }
  .primer-toc {
    position: static;
    width: 100%;
    max-height: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bdr);
  }
  .primer-toc-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .primer-toc-h3 { padding-left: 0; }

  /* Wizard primary-category picker: 3-col grid becomes auto-fit */
  .wiz-pri-row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  /* Reclaim horizontal space — tabs were padding 24px + clamped */
  .tab-panel:not(#tab-sheet) { padding: 16px 12px; }
  #tab-sheet { padding: 8px 10px; }
  #tab-story { padding: 16px 12px; }

  /* Status tab tighter gaps */
  .status-split { padding: 12px; gap: 12px; }

  /* Feeding territory grid — turn each row into a stacked card with
     inline labels on the radios so the "Resident / Poacher / Not
     feeding" header row can be hidden without losing meaning */
  /* City panels */
  .city-right { padding: 12px; gap: 10px; }
  .city-panel { padding: 10px 12px; }

  /* Tickets */
  .tk-tab { padding: 12px; }

  /* Profile modal fills the small-screen viewport with tighter padding */
  .plm-dialog { padding: 16px 16px 14px; gap: 12px; }
  .prof-form { grid-template-columns: 1fr; }
  .prof-readonly { gap: 10px; }
}

/* ══════════════════════════════════════════
   PARCHMENT THEME OVERRIDES
   Fixes thin Cinzel strokes, hardcoded dark colours,
   and contrast issues on the light (parchment) theme.
   Uses html:not([data-theme="dark"]) so dark mode is unaffected.
   ══════════════════════════════════════════ */

/* Cinzel weight floor: 600 minimum on parchment */
html:not([data-theme="dark"]) .prof-label,
html:not([data-theme="dark"]) .wiz-btn,
html:not([data-theme="dark"]) .wiz-step-n,
html:not([data-theme="dark"]) .wiz-pri-cat,
html:not([data-theme="dark"]) .wiz-cat-head,
html:not([data-theme="dark"]) .wiz-review-head,
html:not([data-theme="dark"]) .wiz-title,
html:not([data-theme="dark"]) .pending-title,
html:not([data-theme="dark"]) .city-office-position,
html:not([data-theme="dark"]) .city-char-position { font-weight: 600; }

/* Ticket status badges — dark-mode colours unreadable on cream */
html:not([data-theme="dark"]) .tk-badge-in_progress { background: rgba(26,74,122,.12); color: var(--info); }
html:not([data-theme="dark"]) .tk-badge-resolved   { background: var(--green-a15);     color: var(--green3); }
html:not([data-theme="dark"]) .tk-badge-closed     { background: var(--gold-a10);       color: var(--txt2); }
html:not([data-theme="dark"]) .tk-badge-bug        { background: var(--crim-a12);       color: var(--crim); }

/* ── Office tab ── */

.office-tab { padding: 20px; max-width: 680px; }
.office-header { margin-bottom: 20px; }
.office-title { font-family: var(--fh); font-size: 22px; color: var(--gold); letter-spacing: .06em; }
.office-role  { font-family: var(--fl); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt2); margin-top: 2px; }

.office-section { margin-bottom: 24px; }
.office-section-hd { font-family: var(--fl); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); border-bottom: 1px solid var(--bdr); padding-bottom: 4px; margin-bottom: 12px; }

.office-status-power { font-family: var(--fb); font-size: 14px; color: var(--txt); line-height: 1.7; padding: 14px 16px; background: rgba(224,196,122,.06); border: 1px solid var(--gold2); border-radius: 6px; }

.office-manoeuvre-list { display: flex; flex-direction: column; gap: 10px; }
.office-manoeuvre { padding: 10px 14px; background: var(--surf2); border-radius: 5px; }
.office-manoeuvre-name { font-family: var(--fl); font-size: 13px; color: var(--accent); letter-spacing: .04em; margin-bottom: 4px; }
.office-manoeuvre-effect { font-family: var(--fb); font-size: 13px; color: var(--txt2); line-height: 1.5; }

.office-merit-list { display: flex; flex-wrap: wrap; gap: 6px; }
.office-merit-chip { font-family: var(--fl); font-size: 12px; color: var(--txt2); background: var(--surf2); border: 1px solid var(--bdr); border-radius: 4px; padding: 3px 8px; }
html:not([data-theme="dark"]) .tk-badge-sheet      { background: var(--gold-a12);       color: var(--gold); }

/* ── Responsive character sheet — collapse 3-col grids on mobile ── */
@media (max-width: 768px) {
  .sh-attr-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .skill-grid   { grid-template-columns: 1fr !important; gap: 12px; }
  .sh-body { padding: 0 8px 20px; }
  .sh-sec  { margin-top: 12px; }
}
