[hidden] {
  display: none !important;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 7px 0 18px;
  background: #090f1b;
  border: 1px solid #43546a;
  border-radius: 4px;
  color: #e6edf5;
  font: inherit;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #efb15e;
  outline-offset: 2px;
}
label {
  display: block;
  margin-top: 17px;
  color: #bbd3e9;
  font-weight: 500;
}
input[type="checkbox"] {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0 10px 0 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 5px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 23px 0;
}
.toolbar .button,
.button:not(.primary) {
  background: #18273a;
  border: 1px solid #3d536c;
  color: #cee3f5;
}
.manage-section {
  margin: 40px 0;
  padding: 30px;
  border: 1px solid #29394d;
  background: #0e1622;
  border-radius: 5px;
}
.manage-section h2 {
  margin-bottom: 20px;
}
.editor {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #33465d;
}
.editor summary {
  cursor: pointer;
  color: #efb15e;
  font-size: 1.05rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.record {
  padding: 20px 0;
  border-bottom: 1px solid #29394d;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}
.record h3 {
  margin-bottom: 8px;
}
.record .toolbar {
  margin: 0;
}
.record img {
  width: 120px;
  max-height: 100px;
  object-fit: cover;
}
.record-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.record p {
  white-space: pre-wrap;
}
.crew-entry {
  padding: 26px;
  margin-top: 24px;
  border: 1px solid #29394d;
  background: #0e1622;
}
.crew-entry p {
  white-space: pre-wrap;
  margin-top: 15px;
  overflow-wrap: anywhere;
}
#notice:not(:empty) {
  margin: 25px 0;
  padding: 18px;
  background: #132d38;
  border: 1px solid #4a8697;
  border-radius: 4px;
}
#notice.error {
  background: #3a1921;
  border-color: #b86471;
  color: #ffd3db;
}
#site-source {
  font-family: Consolas, monospace;
  font-size: 0.9rem;
  tab-size: 2;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.danger {
  color: #ffb1b1 !important;
}
.login-panel h2 {
  font-size: 1.6rem;
}
.login-panel label {
  font-size: 1rem;
}
details[open] {
  background: #111c2b;
}
@media (max-width: 767px) {
  .manage-section {
    padding: 20px 15px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .record {
    flex-wrap: wrap;
  }
  .record .toolbar {
    width: 100%;
    margin-top: 10px;
  }
  .record img {
    width: 85px;
  }
}

/* Login password visibility control */
.password-field {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.password-field input {
  min-width: 0;
  flex: 1;
}
.password-field button {
  flex-shrink: 0;
}
/* Private roster and crew profile */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.roster-card,
.profile-panel {
  border: 1px solid var(--line, #344255);
  background: var(--panel, #131c2b);
  padding: 1.5rem;
  border-radius: 10px;
}
.roster-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
}
.profile-bio {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.profile-panel dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.5rem;
}
.profile-panel dd {
  margin: 0;
}
fieldset {
  border: 1px solid #344255;
  padding: 1rem;
  margin: 1rem 0;
}
legend {
  padding: 0 0.5rem;
}
#site-source {
  tab-size: 2;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
}
@media (max-width: 480px) {
  .password-field {
    flex-wrap: wrap;
  }
  .password-field input {
    flex-basis: 100%;
  }
}

/* Crew profile photos and event review */
.profile-picture {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #efb15e;
  margin-bottom: 1.5rem;
}
.past-events {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #344255;
}

/* Private crew dashboard, contact details and roster portraits */
.roster-picture {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #53647c;
  margin-bottom: 1rem;
}
.profile-contact {
  margin: 1.5rem 0;
  border-top: 1px solid #344255;
  padding-top: 1rem;
  overflow-wrap: anywhere;
}
.profile-contact a {
  color: #a6d9fb;
  text-decoration: underline;
}
.crew-entry p {
  white-space: pre-wrap;
}

/* Closed voting outcomes include text as well as color. */
.vote-pass {
  color: #65e29a;
  font-weight: 700;
}
.vote-fail {
  color: #ff8585;
  font-weight: 700;
}

/* Device preview scales a real browser viewport to fit the administrator's screen. */
#preview-stage {
  width: 100%;
  overflow: hidden;
  position: relative;
}
#device-frame {
  display: block;
  border: 1px solid #53627b;
  max-width: none;
  transform-origin: top left;
  background: #0c111c;
}
.manage-section select {
  max-width: 100%;
}
.crew-entry {
  overflow-wrap: anywhere;
}
@media (max-width: 767px) {
  .toolbar {
    flex-wrap: wrap;
  }
  .record {
    max-width: 100%;
  }
  iframe {
    max-width: 100%;
  }
}

/* Administrator rank assignment and department roster */
.assignment-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.assignment-editor p {
  margin: 0;
  color: var(--muted-foreground, #bac7d9);
}
.rank-picker {
  padding: 0.75rem;
  border: 1px solid #53647c;
  border-radius: 8px;
  min-width: 0;
}
.rank-picker summary {
  cursor: pointer;
  overflow-wrap: anywhere;
}
.rank-picker img,
.rank-insignia {
  width: 126px;
  max-width: 100%;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
}
.rank-picker summary img {
  margin-right: 0.75rem;
}
/* The supplied Monster Maroon insignia are square, unlike the existing strips. */
.rank-picker img[data-rank-style="mm"],
.rank-insignia[data-rank-style="mm"] {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.rank-choices {
  display: grid;
  gap: 0.4rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
  margin-top: 0.75rem;
}
.rank-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.65rem;
  background: #101b2b;
  color: #eef3fa;
  border: 1px solid #53647c;
  border-radius: 6px;
  cursor: pointer;
}
.rank-choice[aria-pressed="true"] {
  border-color: #e8bd64;
  background: #27354a;
}
.rank-choice:focus-visible,
.rank-picker summary:focus-visible {
  outline: 3px solid #e8bd64;
  outline-offset: 2px;
}
.roster-department {
  margin-top: 2rem;
}
.roster-department > h2 {
  border-bottom: 1px solid #53647c;
  padding-bottom: 0.5rem;
}
.roster-card h3 {
  font-size: 1.25rem;
  margin-top: 0;
}
@media (max-width: 480px) {
  .rank-choice {
    flex-wrap: wrap;
  }
  .rank-picker summary img {
    display: block;
    margin-bottom: 0.5rem;
  }
}

/* Department leadership designation, independent of rank. */
.chief-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border: 1px solid #e8bd64;
  border-radius: 5px;
  color: #ffe1a3;
  background: #29261c;
  font-weight: 700;
}

/* Private contribution dashboard */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.analytics-stat,
.analytics-member {
  border: 1px solid #53647c;
  border-radius: 8px;
  padding: 1rem;
  background: #101b2b;
}
.analytics-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.analytics-stat strong {
  color: #ffe1a3;
  font-size: 1.8rem;
}
.analytics-members {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.analytics-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
}
.analytics-counts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
}
.analytics-counts dd {
  margin: 0;
}
.analytics-member {
  overflow-wrap: anywhere;
}

/* Multi-department assignments and clearer leadership guidance. */
.department-membership-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #344255;
}
.department-membership-row label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.department-membership-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: none;
}
.assignment-editor .department-head-help {
  color: #dbe5f5;
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 0.75rem 0 0;
  font-weight: 400;
}
.primary-badge {
  color: #bedafa;
  font-size: 0.8rem;
  font-weight: 600;
}
.command-position {
  color: #ffe1a3;
  font-weight: 700;
}
@media (max-width: 480px) {
  .department-membership-row {
    grid-template-columns: 1fr;
  }
}

/* Ballot selection remains visibly distinct until submission, including on touch screens. */
.button.vote-choice {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.button.vote-choice[aria-pressed="true"] {
  background: #f1ba68;
  border-color: #ffe0ac;
  color: #111827;
  box-shadow: 0 0 0 2px #f1ba6844;
  transform: translateY(-2px);
}
.button.vote-choice[aria-pressed="true"]::before {
  content: "✓ ";
  font-weight: 700;
}
.button.vote-choice:focus-visible {
  outline: 3px solid #b9e4ff;
  outline-offset: 3px;
}
.vote-question,
.vote-question-editor {
  border: 1px solid #43546a;
  border-radius: 6px;
  padding: 20px;
  margin: 24px 0;
  min-width: 0;
}
.vote-question legend,
.vote-question-editor legend {
  color: #c9e3f6;
  padding: 0 8px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.vote-selection {
  color: #ffe0ac;
  font-size: 0.92rem;
}
.vote-outcome {
  color: #b9e4ff;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .button.vote-choice {
    transition: none;
  }
  .button.vote-choice[aria-pressed="true"] {
    transform: none;
  }
}

/* Super Admin permission controls */
.permission-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem 0;
}
.permission-choice input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.1rem;
  margin-top: 0.2rem;
}
.permission-choice strong,
.permission-choice small {
  display: block;
}
.permission-choice small {
  color: #bdc8d9;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}
#permission-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0 1.5rem;
}
