.faction-menu-button { width: 100%; margin: .75rem 0 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.faction-menu-button[hidden] { display: none; }

.fc-modal { height: min(720px, calc(100dvh - 32px)); }
.fc-admin:empty { display: none; }
.fc-admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .1rem 1.1rem .5rem; padding: .45rem .6rem;
  border: 1px dashed rgba(247, 207, 127, .45); border-radius: 3px; background: rgba(247, 207, 127, .06);
}
.fc-admin-tag {
  font-family: "Orbitron", sans-serif; font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--warn);
  padding: .1rem .35rem; border: 1px solid rgba(247, 207, 127, .5); border-radius: 2px;
}
.fc-admin-pick {
  font: inherit; font-size: .9rem; color: var(--text); background: rgba(4, 8, 18, .8);
  border: 1px solid var(--panel-edge); border-radius: 3px; padding: .25rem .4rem; min-width: 180px;
}
.fc-admin-bar .muted { flex: 1 1 200px; font-size: .8rem; }

.fc-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; flex: 1; min-height: 0; }
.fc-body.founding { grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); }
.fc-section, .fc-side, .fc-wizard { display: grid; gap: .65rem; align-content: start; min-width: 0; }
.fc-heading {
  display: flex; align-items: center; gap: .45rem; margin: .2rem 0 0; font-family: "Orbitron", sans-serif; font-size: .7rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
}
.fc-heading.danger { color: #ff8a8a; }
.fc-subheading { margin: .45rem 0 0; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-count-pill { font-family: inherit; color: var(--muted); letter-spacing: .05em; }
.fc-lead { margin: 0; color: #c4d3e6; }
.fc-note { margin: 0; font-size: .88rem; color: var(--muted); }
.fc-note.warn { color: var(--warn); }

.fc-identity { display: grid; gap: .75rem; }
.fc-preview {
  display: flex; align-items: flex-start; gap: .8rem; padding: .75rem .85rem; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--owner) 55%, transparent); border-left: 3px solid var(--owner); border-radius: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--owner) 14%, transparent), rgba(4, 8, 18, .5) 70%);
}
.fc-preview .dp-emblem { flex: none; }
.fc-preview-text { min-width: 0; display: grid; gap: .15rem; }
.fc-preview-name { font-size: 1.35rem; font-weight: 700; color: var(--owner); overflow-wrap: anywhere; text-shadow: 0 0 1px #000, 0 1px 3px rgba(0, 0, 0, .8); }
.fc-preview-sub { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-preview-desc { margin: .2rem 0 0; color: #c4d3e6; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.fc-preview-desc.muted { color: var(--muted); font-style: italic; }

.fc-fields { display: grid; gap: .7rem; }
.fc-field { display: grid; gap: .3rem; min-width: 0; }
.fc-label { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fc-count { font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fc-count.over, .fc-problem { color: var(--bad); }
.fc-problem { font-size: .82rem; min-height: 0; }
.fc-problem:empty { display: none; }
.fc-field input[type="text"], .fc-field textarea, .fc-search {
  width: 100%; box-sizing: border-box; font: inherit; color: var(--text); background: rgba(4, 8, 18, .75);
  border: 1px solid var(--panel-edge); border-radius: 3px; padding: .45rem .55rem;
}
.fc-field textarea { resize: vertical; min-height: 84px; line-height: 1.35; }
.fc-field input:focus-visible, .fc-field textarea:focus-visible, .fc-search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.fc-field [aria-invalid="true"] { border-color: var(--bad); }
.fc-color { display: flex; gap: .45rem; align-items: center; }
.fc-color input[type="color"] { width: 44px; height: 36px; padding: 2px; background: rgba(4, 8, 18, .75); border: 1px solid var(--panel-edge); border-radius: 3px; cursor: pointer; }
.fc-color .fc-hex { width: 7.5em; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.fc-swatches { display: flex; flex-wrap: wrap; gap: .3rem; }
.fc-swatch {
  width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer; background: var(--swatch);
  border: 2px solid rgba(4, 8, 18, .9); box-shadow: 0 0 0 1px rgba(127, 147, 173, .35);
}
.fc-swatch:hover { box-shadow: 0 0 0 1px var(--text); }
.fc-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text), 0 0 10px var(--swatch); }
.fc-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fc-icon-box { display: flex; align-items: center; gap: .75rem; padding: .25rem; border-radius: 4px; }
.fc-icon-box.dragging { outline: 2px dashed var(--accent); background: var(--accent-dim); }
.fc-drop {
  flex: none; width: 84px; height: 84px; display: grid; place-items: center; padding: .3rem; text-align: center; cursor: pointer;
  font: inherit; font-size: .72rem; line-height: 1.2; color: var(--muted); background: rgba(4, 8, 18, .6);
  border: 1px dashed rgba(127, 147, 173, .55); border-radius: 6px;
}
.fc-drop span { display: grid; gap: .2rem; }
.fc-drop small { font-size: .66rem; opacity: .8; }
.fc-drop:hover { border-color: var(--accent); color: var(--text); }
.fc-drop.filled { background: center / cover no-repeat var(--emblem-image); border-style: solid; border-color: var(--panel-edge); }
.fc-icon-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.fc-icon-actions small { flex: 1 1 100%; font-size: .78rem; }

.fc-save { display: flex; justify-content: flex-end; gap: .45rem; padding-top: .3rem; border-top: 1px dashed rgba(127, 147, 173, .2); }

.fc-steps { display: flex; gap: .3rem; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.fc-steps li { flex: 1; }
.fc-steps button {
  width: 100%; display: flex; align-items: center; gap: .45rem; padding: .4rem .5rem; font: inherit; font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: rgba(4, 8, 18, .55);
  border: 1px solid var(--panel-edge); border-bottom-width: 2px; border-radius: 3px 3px 0 0; cursor: pointer;
}
.fc-steps button:disabled { cursor: default; opacity: .6; }
.fc-steps li.done button { color: var(--good); border-bottom-color: var(--good); }
.fc-steps li.current button { color: var(--text); border-bottom-color: var(--accent); background: var(--accent-dim); }
.fc-step-num {
  display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font-size: .75rem;
  border: 1px solid currentColor;
}
.fc-step { display: grid; gap: .75rem; }
.fc-wizard-foot { display: flex; justify-content: space-between; gap: .5rem; padding-top: .5rem; border-top: 1px dashed rgba(127, 147, 173, .2); }
.fc-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem; margin: 0; }
.fc-review div { padding: .35rem .55rem; border: 1px solid rgba(79, 210, 255, .2); border-radius: 2px; background: rgba(79, 210, 255, .05); }
.fc-review dt { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-review dd { margin: 0; display: flex; align-items: center; gap: .4rem; font-weight: 600; overflow-wrap: anywhere; }
.fc-chip { width: 14px; height: 14px; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); }

.fc-invites, .fc-members, .fc-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.fc-results:empty { display: none; }
.fc-invite {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .5rem; padding: .5rem .55rem;
  border: 1px solid color-mix(in srgb, var(--owner) 55%, transparent); border-left: 3px solid var(--owner); border-radius: 3px; background: rgba(4, 8, 18, .5);
}
.fc-invite-text { display: grid; min-width: 0; }
.fc-invite-text strong { color: var(--owner); overflow-wrap: anywhere; }
.fc-invite-text small { color: var(--muted); }
.fc-invite-actions { grid-column: 1 / -1; display: flex; gap: .35rem; }
.fc-invite-actions .wp-btn { flex: 1; }
.fc-person {
  display: flex; align-items: center; gap: .55rem; padding: .35rem .45rem; min-width: 0;
  border: 1px solid rgba(31, 53, 86, .8); border-radius: 3px; background: rgba(4, 8, 18, .45);
}
.fc-person img { flex: none; border-radius: 50%; background: #1b2740; }
.fc-person-text { flex: 1; min-width: 0; display: grid; }
.fc-person-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-person-text small { color: var(--muted); font-size: .78rem; }
.fc-person-state { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; max-width: 9rem; text-align: right; overflow-wrap: anywhere; }
.fc-person .wp-btn { flex: none; }
.fc-danger { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .65rem; border: 1px solid rgba(255, 107, 125, .35); border-radius: 3px; background: rgba(255, 107, 125, .05); }

@media (max-width: 760px) {
  .fc-body, .fc-body.founding { grid-template-columns: 1fr; }
  .fc-steps button { font-size: .72rem; padding: .35rem; }
}
.fc-edicts { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.fc-edict {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border: 1px solid rgba(127, 147, 173, .25);
  border-radius: 6px; background: rgba(8, 14, 24, .45);
}
.fc-edict.current { border-color: var(--accent); }
.fc-edict.next { border-style: dashed; border-color: var(--good); }
.fc-edict-text { display: grid; gap: .1rem; flex: 1; min-width: 0; font-size: .85rem; }
.fc-edict-text small { margin-left: .45rem; font-size: .7rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.fc-edict.next .fc-edict-text small { color: var(--good); }
.fc-edict-up { color: var(--good); }
.fc-edict-down { color: var(--bad); }
.fc-authority { position: relative; height: .5rem; margin: .2rem 0 .6rem; border-radius: 999px; background: var(--line, rgba(127, 127, 127, .25)); overflow: hidden; }
.fc-authority-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; }
.fc-authority.crisis .fc-authority-fill { background: var(--bad); }
.fc-authority-zero { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text, currentColor); opacity: .6; z-index: 1; }
.fc-edict-text select, .fc-power-input { max-width: 100%; }
.fc-power-input { width: 9rem; padding: .3rem .45rem; border-radius: 5px; border: 1px solid rgba(127, 147, 173, .35); background: rgba(8, 14, 24, .6); color: inherit; }
.fc-edict { flex-wrap: wrap; }
.fc-fold > summary { cursor: pointer; }
.fc-fold { margin-bottom: .3rem; }
.fc-edict > .fc-fold { flex-basis: 100%; }

.ai-panel { gap: .8rem; }
.ai-group { display: grid; gap: .45rem; min-width: 0; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ai-field { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.ai-field input {
  font: inherit; font-size: .9rem; color: var(--text); background: rgba(4, 8, 18, .8); width: 8.5rem;
  border: 1px solid var(--panel-edge); border-radius: 3px; padding: .25rem .4rem;
}
.ai-field input.ai-interval { width: 5.5rem; }
.ai-field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.ai-treasury .ai-field { display: grid; grid-template-columns: 4.5rem 8.5rem auto; }
.ai-switch { height: auto; align-self: auto; }
.ai-core-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.ai-status { display: grid; gap: .4rem; padding: .6rem .7rem; border: 1px solid var(--panel-edge); border-radius: 3px; background: rgba(4, 8, 18, .45); }
.ai-status-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.ai-badge {
  font-family: "Orbitron", sans-serif; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .15rem .45rem; border-radius: 2px; border: 1px solid currentColor;
}
.ai-badge.active { color: var(--good); }
.ai-badge.desperation { color: #ff8a8a; }
.ai-badge.dormant { color: var(--muted); }
.ai-badge.paused { color: var(--warn); }
.ai-facts { display: grid; gap: .2rem; margin: 0; font-size: .85rem; }
.ai-facts div { display: flex; justify-content: space-between; gap: .75rem; }
.ai-facts dt { color: var(--muted); }
.ai-facts dd { margin: 0; text-align: right; }
.ai-sectors { display: grid; gap: .3rem; max-width: 260px; }
.ai-sector {
  font: inherit; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; aspect-ratio: 1.6; cursor: pointer;
  border-radius: 3px; border: 1px solid; color: #fff;
}
.ai-sector.open { background: rgba(58, 123, 213, .35); border-color: #3a7bd5; }
.ai-sector.closed { background: rgba(214, 64, 64, .35); border-color: #d64040; }
.ai-sector:hover:not(:disabled) { filter: brightness(1.25); }
.ai-sector:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-modes { display: flex; flex-wrap: wrap; gap: .35rem; }
.ai-treasury { display: grid; gap: .4rem; justify-items: start; }
.ai-entry { border: 1px solid var(--panel-edge); border-radius: 3px; padding: .35rem .55rem; background: rgba(4, 8, 18, .35); font-size: .85rem; }
.ai-entry.dry { border-style: dashed; border-color: rgba(247, 207, 127, .55); }
.ai-entry summary { cursor: pointer; }
.ai-entry ul { margin: .35rem 0; padding-left: 1.1rem; }
.ai-notes { color: var(--muted); }
.ai-refused { color: #ff8a8a; }
.ai-proposal { display: grid; gap: .45rem; padding: .6rem .7rem; border: 1px solid var(--panel-edge); border-radius: 3px; background: rgba(4, 8, 18, .35); min-width: 0; }
.ai-proposal .fc-note { margin: 0; }
.ai-field textarea {
  flex: 1 1 14rem; min-width: 0; padding: .35rem .5rem; border: 1px solid var(--panel-edge); border-radius: 3px;
  background: rgba(4, 8, 18, .6); color: inherit; font: inherit; resize: vertical;
}
.ai-field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.ai-field input[type="text"] { flex: 1 1 12rem; width: auto; }
.ai-field input[type="file"] { width: auto; min-width: 0; max-width: 100%; font-size: .8rem; }
.ai-intel { gap: .6rem; }
.ai-dossier { display: grid; gap: .45rem; }
.ai-dossier > summary { font-weight: 600; }
.ai-dossier .fc-subheading { margin: .35rem 0 0; }
.ai-table-wrap { overflow-x: auto; max-width: 100%; }
.ai-table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.ai-table th, .ai-table td { padding: .2rem .4rem; text-align: right; border-bottom: 1px solid var(--panel-edge); white-space: nowrap; }
.ai-table th:first-child, .ai-table td:first-child { text-align: left; white-space: normal; }
.ai-table th { color: var(--muted); font-weight: 500; }
.ai-good { color: var(--good); }
.ai-bad { color: #ff8a8a; }
.ai-heat { display: grid; gap: .2rem; font-size: .8rem; }
.ai-heat-row { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: .5rem; }
.ai-heat-bar { height: .45rem; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ai-heat-bar i { display: block; height: 100%; background: var(--accent); }
.ai-hours { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 3rem; }
.ai-hours i { display: block; background: var(--accent); border-radius: 1px 1px 0 0; min-height: 2px; }
