/* 32-refinements-and-shared-controls.css
   Later Rotations refinements plus shared controls: roster, imports, cursor rules, demo banner.
   Files in css/ load in filename order and the cascade depends on it: see docs/CSS.md. */

/* =========================================
   PHONE PORTRAIT — mini-card adjustments
========================================= */
body[data-layout="phone-portrait"] .mini-card-wrapper {
  margin-top: -10px; /* tighten spacing if you want */
}

body[data-layout="phone-portrait"] .mini-card {
  width: 100% !important; /* full width */
  margin: 0 !important; /* remove right offset */
  grid-template-columns: 1fr auto auto; /* name | X button | timer */
  gap: 6px; /* adjust spacing inside */
  height: 42px; /* tweak as needed */
  padding: 6px 10px;
  margin-right: 24px !important;
}

/* Smaller, mobile-friendly name */
body[data-layout="phone-portrait"] .mini-card .mini-name {
  font-size: 10px; /* 🔥 tweak smaller or bigger */
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   Replace "End Cover" with a square X button
========================================= */
body[data-layout="phone-portrait"] .mini-card .mini-end-btn {
  width: 20px; /* 🔥 square size (tweak) */
  height: 20px;
  padding: 0;
  position: relative;
  color: transparent !important; /* hide original "End Cover" text */
  font-size: 0 !important; /* neutralize text height */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* X replacement (visible) */
body[data-layout="phone-portrait"] .mini-card .mini-end-btn::before {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px; /* 🔥 X size */
  font-weight: 900;
  color: #fff;
}

/* Mini timer size */
body[data-layout="phone-portrait"] .mini-card .mini-timer {
  font-size: 12px;
  margin-right: 0;
}

/* =========================================
   PHONE PORTRAIT — tighten inside/outside column gap
========================================= */
body[data-layout="phone-portrait"] .column {
  padding: 0 4px !important; /* reduce space BETWEEN the two columns */
}

/* =========================================
   PHONE PORTRAIT — tighter card padding
   without exposing delete background
========================================= */
body[data-layout="phone-portrait"] .card {
  min-height: 0;
  height: auto;
  padding-top: 0; /* outer shell has NO vertical padding */
  padding-bottom: 0;
}

/* The sliding inner card controls visual padding */
body[data-layout="phone-portrait"] .card-inner {
  min-height: 0;
  height: auto;

  /* 🔥 tighten these values */
  padding-top: 4px;
  padding-bottom: 0px; /* VERY tight bottom padding */
}

/* Prevent flex spacing from creating artificial height */
body[data-layout="phone-portrait"] .card-main {
  justify-content: flex-start;
}

/* Final thermometer alignment override */
.thermometer-scale {
  height: 92px;
}
.thermometer-scale::before {
  top: 40px;
}
.thermometer-boundary {
  top: 26px;
}
.thermometer-labels,
.thermometer-values {
  position: absolute;
  left: 0;
  right: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  pointer-events: none;
}
.thermometer-labels {
  top: 0;
  height: 28px;
  align-items: end;
}
.thermometer-values {
  top: 68px;
  height: 18px;
  align-items: start;
}
.thermometer-labels span,
.thermometer-labels span.staggered,
.thermometer-values span,
.thermometer-values span.staggered {
  position: static;
  width: auto;
  transform: none;
  text-align: center;
}
.thermometer-labels span,
.thermometer-labels span.staggered {
  top: auto;
  color: #b5bac1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}
.thermometer-values span,
.thermometer-values span.staggered {
  top: auto;
  color: #f2f3f5;
  font-size: 11px;
  font-weight: 800;
}
.thermometer-endpoints {
  margin-top: -2px;
}
@media (max-width: 700px) {
  .thermometer-labels span,
  .thermometer-labels span.staggered {
    font-size: 8px;
  }
  .thermometer-values span,
  .thermometer-values span.staggered {
    font-size: 9px;
  }
}

/* Zone names center within their live temperature sections. */
.thermometer-labels,
.thermometer-values {
  display: block;
}

.thermometer-labels span,
.thermometer-values span {
  position: absolute;
  width: auto;
  transform: translateX(-50%);
  white-space: nowrap;
}

.thermometer-labels span {
  color: #b5bac1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.thermometer-values span {
  color: #f2f3f5;
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="light"] .thermometer-labels span {
  color: #5f6670;
}
:root[data-theme="light"] .thermometer-values span {
  color: #20242a;
}

@media (max-width: 700px) {
  .thermometer-labels span {
    font-size: 7px;
  }
  .thermometer-values span {
    font-size: 9px;
  }
}

.thermometer-labels span[data-zone-index="0"] {
  color: #6f83df;
}
.thermometer-labels span[data-zone-index="1"] {
  color: #8b70df;
}
.thermometer-labels span[data-zone-index="2"] {
  color: #4699e3;
}
.thermometer-labels span[data-zone-index="3"] {
  color: #4fa56b;
}
.thermometer-labels span[data-zone-index="4"] {
  color: #d39a2c;
}
.thermometer-labels span[data-zone-index="5"] {
  color: #dc7835;
}
.thermometer-labels span[data-zone-index="6"] {
  color: #df5660;
}

:root[data-theme="light"] .thermometer-labels span[data-zone-index="0"] {
  color: #445bb8;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="1"] {
  color: #684caf;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="2"] {
  color: #176eaf;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="3"] {
  color: #247847;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="4"] {
  color: #956500;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="5"] {
  color: #a94f16;
}
:root[data-theme="light"] .thermometer-labels span[data-zone-index="6"] {
  color: #b72f40;
}

.settings-card-heading {
  margin-bottom: 14px;
}

.settings-card-heading h4 {
  margin: 0;
}

.settings-section-reset {
  padding: 3px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #949ba4;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.settings-section-reset:hover {
  background: #404249;
  color: #f2f3f5;
}

:root[data-theme="light"] .settings-section-reset {
  color: #68707a;
}

:root[data-theme="light"] .settings-section-reset:hover {
  background: #e1e4e8;
  color: #20242a;
}

.role-exposure-toggle {
  position: relative;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid #3f4147;
  border-radius: 6px;
  background: #1e1f22;
}

.role-exposure-slider {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 4px;
  background: #5865f2;
  transform: translateX(calc(var(--exposure-index) * 100%));
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.role-exposure-toggle[data-exposure-state="half"] .role-exposure-slider {
  background: #a87400;
}

.role-exposure-toggle[data-exposure-state="none"] .role-exposure-slider {
  background: #4e5058;
}

.role-exposure-toggle button {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #949ba4;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.15s ease;
}

.role-exposure-toggle button.active {
  color: #fff;
}

:root[data-theme="light"] .role-exposure-toggle {
  border-color: #c4ccd5;
  background: #e4e8ed;
}

:root[data-theme="light"] .role-exposure-toggle button {
  color: #5f6670;
}

:root[data-theme="light"] .role-exposure-toggle button.active {
  color: #fff;
}

@media (max-width: 700px) {
}

.role-settings-header {
  display: grid;
  grid-template-columns: 32px minmax(110px, 1fr) 48px 145px 42px;
  gap: 8px;
  align-items: center;
  min-height: 22px;
  padding: 0 8px 7px;
  color: #949ba4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.role-settings-header span {
  display: flex;
  align-items: center;
  min-height: 18px;
  line-height: 1;
}

.role-settings-header span:nth-child(3) {
  justify-content: center;
  text-align: center;
}

.role-settings-header span:nth-child(4) {
  justify-content: center;
  text-align: center;
}

:root[data-theme="light"] .role-settings-header {
  color: #68707a;
}

@media (max-width: 700px) {
  .role-settings-header {
    grid-template-columns: 26px minmax(0, 1fr) 48px;
    row-gap: 5px;
  }

  .role-settings-header span:nth-child(4) {
    grid-column: 2 / 4;
    text-align: center;
  }

  .role-settings-header span:nth-child(5) {
    display: none;
  }
}

/* Keep role headings and role rows on one shared column grid. */
.position-setting-row,
.role-settings-header {
  grid-template-columns: 32px minmax(110px, 1fr) 48px 145px 42px;
}

@media (max-width: 700px) {
  .position-setting-row,
  .role-settings-header {
    grid-template-columns: 26px minmax(0, 1fr) 48px;
  }
}

.role-exposure-help {
  margin: 0 0 12px;
}

.exposure-formula {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #232428;
}

.exposure-formula span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dbdee1;
  font-size: 12px;
  font-weight: 700;
}

.exposure-formula span b {
  font-size: 16px;
}
.exposure-formula > i {
  color: #80848e;
  font-style: normal;
  font-weight: 800;
}
.exposure-formula-result {
  color: #fff !important;
}

.exposure-guide-tables {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
}

.exposure-guide-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid #3f4147;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  color: #dbdee1;
  font-size: 13px;
}

.exposure-guide-table caption {
  padding: 0 0 7px;
  color: #b5bac1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
}

.exposure-guide-table th,
.exposure-guide-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #3f4147;
}
.exposure-guide-table tr:last-child th,
.exposure-guide-table tr:last-child td {
  border-bottom: 0;
}
.exposure-guide-table th {
  font-weight: 600;
  text-align: left;
}
.exposure-guide-table td {
  width: 52px;
  color: #fff;
  font-weight: 800;
  text-align: right;
}

.exposure-zone-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
}
.exposure-zone-dot.safe {
  background: #43b581;
}
.exposure-zone-dot.mild {
  background: #4da3ff;
}
.exposure-zone-dot.caution {
  background: #faa61a;
}
.exposure-zone-dot.extreme {
  background: #ed4245;
}

.exposure-symbol-key,
.exposure-cover-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #232428;
  color: #b5bac1;
  font-size: 12px;
}
.exposure-symbol-key span {
  color: #dbdee1;
  font-weight: 700;
}
.exposure-symbol-key b {
  margin-right: 3px;
  font-size: 16px;
}
.exposure-symbol-key strong,
.exposure-cover-note strong {
  margin-left: auto;
  color: #dbdee1;
}
.exposure-cover-note span {
  padding: 4px 7px;
  border: 1px solid #4f545c;
  border-radius: 5px;
  color: #dbdee1;
  font-size: 10px;
  font-weight: 800;
}
.exposure-cover-note b {
  color: #b5bac1;
}
.exposure-reset-note {
  margin: 10px 0 0;
  color: #949ba4;
  font-size: 12px;
}

@media (max-width: 700px) {
  .exposure-formula {
    flex-wrap: wrap;
  }
  .exposure-guide-tables {
    grid-template-columns: 1fr;
  }
  .exposure-symbol-key,
  .exposure-cover-note {
    flex-wrap: wrap;
  }
  .exposure-symbol-key strong,
  .exposure-cover-note strong {
    width: 100%;
    margin-left: 0;
  }
}

:root[data-theme="light"] .exposure-formula,
:root[data-theme="light"] .exposure-symbol-key,
:root[data-theme="light"] .exposure-cover-note {
  background: #f2f3f5;
}
:root[data-theme="light"] .exposure-formula span,
:root[data-theme="light"] .exposure-formula-result,
:root[data-theme="light"] .exposure-guide-table,
:root[data-theme="light"] .exposure-guide-table td,
:root[data-theme="light"] .exposure-symbol-key span,
:root[data-theme="light"] .exposure-symbol-key strong,
:root[data-theme="light"] .exposure-cover-note strong,
:root[data-theme="light"] .exposure-cover-note span {
  color: #20242a !important;
}
:root[data-theme="light"] .exposure-guide-table,
:root[data-theme="light"] .exposure-guide-table th,
:root[data-theme="light"] .exposure-guide-table td {
  border-color: #d9dee5;
}

.team-leadership-settings {
  display: grid;
  gap: 12px;
}

.team-leadership-settings .settings-field {
  margin-bottom: 0;
}

.team-leadership-overview,
.team-off-soon-overview {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(300px, 1.2fr);
  gap: 26px;
  align-items: center;
}
.settings-card.team-leadership-overview {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 0;
}
.settings-card.team-off-soon-overview {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 20px;
  padding-bottom: 14px;
  border-top: 1px solid #3f4147;
  border-bottom: 0;
}
.settings-card.off-soon-preview-section {
  padding-top: 0;
  border-top: 0;
}
.settings-card-heading.off-soon-preview-heading {
  justify-content: flex-start;
  width: min(100%, 520px);
  margin: 0 auto 9px;
}
.off-soon-preview-heading .source-status {
  margin-left: 0;
}
.team-leadership-overview .settings-switch-row,
.team-off-soon-overview .settings-switch-row,
.team-leadership-overview .settings-field {
  margin: 0;
}
.team-setting-column {
  min-width: 0;
}
.team-sort-column,
.off-soon-time-group {
  padding-left: 24px;
  border-left: 1px solid #3f4147;
}
.team-setting-label {
  margin-bottom: 9px;
  color: #949ba4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-single-action {
  margin-bottom: 20px;
}

.settings-action-chevron {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #949ba4;
  pointer-events: none;
  transition:
    transform 0.16s ease,
    color 0.16s ease;
}

.settings-action-chevron svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-action-row.active .settings-action-chevron {
  transform: rotate(90deg);
  color: #dbdee1;
}

.off-soon-time-group.disabled,
.off-soon-preview-section.disabled {
  opacity: 0.42;
  pointer-events: none;
  filter: grayscale(0.35);
}

.off-soon-time-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.off-soon-time-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid #4a4d54;
  border-radius: 7px;
  background: #35373c;
  color: #b5bac1;
  cursor: pointer;
  text-align: center;
}
.off-soon-time-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.off-soon-time-option strong {
  font-size: 18px;
}
.off-soon-time-option span {
  font-size: 11px;
  font-weight: 800;
}
.off-soon-time-option.selected {
  border-color: #d85b91;
  background: rgba(216, 91, 145, 0.16);
  color: #ffacd0;
  box-shadow: inset 0 0 0 1px rgba(216, 91, 145, 0.18);
}

.settings-off-soon-card-preview {
  width: min(100%, 520px);
  margin: 0 auto;
  pointer-events: none;
}
.settings-off-soon-card-preview .secondary-status-bar {
  display: flex;
}
.settings-off-soon-card-preview .icon-btn {
  cursor: default;
}
.settings-off-soon-card-preview .timer-value {
  white-space: nowrap;
}

:root[data-theme="light"] .settings-action-row.active .settings-action-chevron {
  color: #20242a;
}
:root[data-theme="light"] .team-sort-column,
:root[data-theme="light"] .off-soon-time-group {
  border-color: #d9dde3;
}
:root[data-theme="light"] .settings-card.team-off-soon-overview {
  border-top-color: #d9dde3;
}
:root[data-theme="light"] .off-soon-time-option {
  border-color: #c8cdd4;
  background: #f3f4f6;
  color: #5f6670;
}
:root[data-theme="light"] .off-soon-time-option.selected {
  border-color: #bd4b7d;
  background: #f9e8f0;
  color: #842d55;
}

@media (max-width: 720px) {
  .team-leadership-overview,
  .team-off-soon-overview {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .team-sort-column,
  .off-soon-time-group {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid #3f4147;
    border-left: 0;
  }
  :root[data-theme="light"] .team-sort-column,
  :root[data-theme="light"] .off-soon-time-group {
    border-top-color: #d9dde3;
  }
}

@media (max-width: 700px) {
  .role-exposure-help {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #232428;
    line-height: 1.4;
  }

  .role-settings-header {
    display: none;
  }

  .position-setting-row {
    grid-template-columns: 28px minmax(0, 1fr) 56px 38px !important;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 12px;
  }

  .position-setting-row .position-name-input {
    grid-column: 2;
  }

  .position-setting-row .visual-color-picker {
    grid-column: 3;
    justify-self: center;
  }

  .position-setting-row .role-exposure-toggle {
    grid-column: 1 / -1 !important;
    width: 100%;
  }

  .position-setting-row .position-delete {
    grid-column: 4;
    grid-row: 1;
    width: 38px;
    height: 42px;
  }
}

:root[data-theme="light"] .role-exposure-help {
  background: #f2f3f5;
}

/* Final settings button normalization. Several older settings passes define
   footer buttons, so keep this near the end as the source of truth. */
.settings-footer {
  min-height: 64px;
  padding: 11px 20px;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #3f4147;
  background: #2b2d31;
}

.settings-footer button,
.settings-save-inline {
  min-height: 40px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.settings-footer button {
  min-width: 118px;
  padding: 0 14px;
  border: 0;
}

.settings-cancel {
  background: #404249;
  color: #f2f3f5;
}

.settings-cancel:hover {
  background: #4e5058;
  text-decoration: none;
}

.settings-save,
.settings-save-inline {
  border: 0;
  background: #5865f2;
  color: #fff;
}

.settings-save:hover,
.settings-save-inline:hover {
  background: #4752c4;
}

.settings-save:disabled,
.settings-save:disabled:hover {
  background: #404249;
  color: #949ba4;
  cursor: not-allowed;
  opacity: 0.72;
}

:root[data-theme="light"] .settings-save:disabled,
:root[data-theme="light"] .settings-save:disabled:hover {
  background: #d5d8dc;
  color: #7a8088;
}

/* Floating roster and short-lived undo controls. */
#tools-home-btn {
  position: fixed;
  right: 82px;
  bottom: 20px;
  min-width: 96px;
  height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #2d3552;
  border-radius: 25px;
  background: #1a1f33;
  color: #cbd8ef;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  z-index: 9998;
}
#tools-home-btn:hover {
  background: #252c46;
}
.tools-home-icon {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 2px;
}
.tools-home-icon i {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
}
#debug-open-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:root[data-theme="light"] #tools-home-btn {
  border-color: #c8ced8;
  background: #fff;
  color: #252a32;
  box-shadow: 0 8px 22px rgba(40, 48, 60, 0.12);
}
:root[data-theme="light"] #tools-home-btn:hover {
  background: #eef1f5;
}

#roster-open-btn {
  right: 190px;
  bottom: 20px;
  width: auto;
  min-width: 108px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

#roster-open-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

#undo-action-btn {
  position: fixed;
  right: 20px;
  bottom: 82px;
  min-width: 104px;
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #3f4b70;
  border-radius: 10px;
  background: #242b43;
  color: #f2f3f5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 9999;
}

#undo-action-btn.hidden {
  display: none;
}
#undo-action-btn:hover {
  background: #303a5a;
}
#undo-action-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}
.undo-action-icon {
  font-size: 24px;
  line-height: 1;
}
.undo-action-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.undo-action-copy strong {
  font-size: 13px;
}
.undo-action-copy small {
  color: #aebbd4;
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="light"] #undo-action-btn {
  border-color: #c8ced8;
  background: #fff;
  color: #252a32;
  box-shadow: 0 8px 22px rgba(40, 48, 60, 0.16);
}
:root[data-theme="light"] #undo-action-btn:hover {
  background: #eef1f5;
}
:root[data-theme="light"] .undo-action-copy small {
  color: #687180;
}

#inside-column {
  display: flex;
  flex-direction: column;
}
#inside-list {
  order: 1;
  padding-bottom: 0;
}
#add-member-open-btn {
  order: 2;
  width: 100%;
  min-height: 72px;
  margin: 8px 0 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #3f4b70;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 12px;
}
#add-member-open-btn.hidden {
  display: none;
}
#add-member-open-btn:hover {
  border-color: #5865f2;
  background: color-mix(in srgb, var(--card) 88%, #5865f2);
}
.add-member-card-plus {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid #5865f2;
  border-radius: 50%;
  background: rgba(88, 101, 242, 0.18);
  color: #aeb7ff;
}
.add-member-card-plus::before,
.add-member-card-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.add-member-card-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
:root[data-theme="light"] #add-member-open-btn {
  border-color: #9aa8c8;
  background: rgba(255, 255, 255, 0.72);
}

.custom-select.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35);
}

.shift-import-instructions {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  color: var(--muted);
}
.shift-import-instructions strong {
  color: var(--text);
}
.shift-import-instructions p {
  margin: 5px 0 0;
}
.shift-import-instructions ol {
  margin: 10px 0 0;
  padding-left: 20px;
}
.shift-import-instructions li + li {
  margin-top: 6px;
}

@media (max-width: 520px) {
  #tools-home-btn {
    right: 82px;
    min-width: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
  }
  #tools-home-btn > span:last-child {
    display: none;
  }
  #roster-open-btn {
    right: 144px;
    min-width: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
  }
  #roster-open-btn span {
    display: none;
  }
}

:root[data-theme="light"] .settings-footer {
  border-color: #d9dde3;
  background: #f2f3f5;
}

:root[data-theme="light"] .settings-cancel {
  background: #e1e4e8;
  color: #252a31;
}

:root[data-theme="light"] .settings-cancel:hover {
  background: #d6dce3;
}

/* Shift importing */
.shift-source-list {
  display: grid;
  gap: 9px;
}
.shift-source-option {
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #42454d;
  border-radius: 8px;
  background: #313338;
  cursor: pointer;
}
.shift-source-option:hover {
  border-color: #67709a;
  background: #35383e;
}
.shift-source-option.selected {
  border-color: #7482ff;
  background: #34384c;
}
.shift-source-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.shift-source-option small,
.csv-drop-zone small {
  display: block;
  margin-top: 4px;
  color: #b5bac1;
}
.shift-source-option > i {
  width: 15px;
  height: 15px;
  border: 2px solid #777d87;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #313338;
}
.shift-source-option.selected > i {
  border-color: #8791ff;
  background: #8791ff;
}
.shift-source-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #25272b;
  color: #dfe2ff;
  font-size: 17px;
  font-weight: 900;
}
.settings-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.source-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #41444a;
  color: #c6c9cf;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.source-status.active {
  background: #244f3a;
  color: #8de0ae;
}
.shift-import-detail {
  margin-top: 12px;
}
.shift-import-notice,
.shift-import-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #2e405f;
  color: #dbe8ff;
  font-size: 12px;
  font-weight: 700;
}
.shift-import-detail > .shift-import-notice {
  margin: 8px 0 0;
}
.shift-import-warning {
  margin-top: 10px;
  background: #574321;
  color: #ffe0a2;
}
.shift-import-shared-notice {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  border: 1px solid #d4a24855;
  background: #d4a24814;
  color: #e9c88b;
  line-height: 1.5;
}
.shift-import-shared-notice strong {
  font-size: 14px;
}
.shift-import-shared-notice span {
  font-size: 13px;
}
.csv-drop-zone {
  margin-top: 12px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px dashed #65708a;
  border-radius: 8px;
  cursor: pointer;
}
.csv-drop-zone:hover {
  background: #363941;
}
.csv-drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.settings-inline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.settings-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.settings-secondary {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: #404249;
  color: #f2f3f5;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.settings-save-inline {
  min-height: 40px;
  padding: 0 14px;
}
.settings-save-inline:disabled {
  background: #404249;
  color: #949ba4;
  cursor: not-allowed;
}
.hs-setup-hidden {
  display: none !important;
}
.hs-connection-card.initialized .hs-credential-grid {
  display: none;
}
.hs-jobs-card {
  padding: 12px !important;
}
.hs-job-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.hs-job-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #2b2d31;
  cursor: pointer;
}
.hs-job-toggle:has(input:checked) {
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.2);
}
.hs-job-toggle input {
  accent-color: #7b86ff;
}
.hs-job-toggle strong {
  font-size: 12px;
}
.hs-job-toggle small {
  display: block;
  margin-top: 2px;
  color: #949ba4;
  font-size: 10px;
}
.shift-import-status-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 0;
}
.shift-import-status-card dl div {
  padding: 9px;
  border-radius: 6px;
  background: #2b2d31;
}
.shift-import-status-card dt {
  color: #aeb2b9;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.shift-import-status-card dd {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 800;
}

:root[data-theme="light"] .shift-source-option {
  border-color: #d4d8df;
  background: #fff;
}
:root[data-theme="light"] .shift-source-option:hover {
  background: #f6f7f9;
}
:root[data-theme="light"] .shift-source-option.selected {
  border-color: #5865f2;
  background: #eef0ff;
}
:root[data-theme="light"] .shift-source-icon,
:root[data-theme="light"] .hs-job-toggle,
:root[data-theme="light"] .shift-import-status-card dl div {
  background: #eef0f3;
  color: #353b48;
}
:root[data-theme="light"] .shift-source-option > i {
  box-shadow: inset 0 0 0 3px #fff;
}
:root[data-theme="light"] .settings-secondary {
  background: #e1e4e8;
  color: #252a31;
}
:root[data-theme="light"] .hs-job-toggle:has(input:checked) {
  border-color: #5865f2;
  background: #e8eaff;
}

.store-pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 9, 12, 0.72);
}
.store-pin-dialog {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid #444852;
  border-radius: 12px;
  background: #1e1f22;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}
.store-pin-dialog h4 {
  margin: 0 0 6px;
  font-size: 18px;
}
.store-pin-dialog p {
  margin: 0 0 14px;
  color: #b5bac1;
  font-size: 13px;
}
.store-pin-dialog input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #464a54;
  border-radius: 7px;
  background: #111214;
  color: #fff;
  font-size: 17px;
}
.store-pin-dialog > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
:root[data-theme="light"] .store-pin-dialog {
  border-color: #d4d8df;
  background: #fff;
}
:root[data-theme="light"] .store-pin-dialog input {
  border-color: #ccd1d8;
  background: #f2f3f5;
  color: #20242a;
}

@media (max-width: 720px) {
  .settings-inline-grid,
  .hs-job-list,
  .shift-import-status-card dl {
    grid-template-columns: 1fr;
  }
}

.account-session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.admin-preview-active {
  padding-top: 48px;
}
.admin-preview-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 11000000;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 5px 124px;
  border-bottom: 1px solid rgba(36, 21, 0, 0.22);
  background: #f0a72f;
  color: #241500;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.admin-preview-title {
  display: grid;
  place-items: center;
  gap: 0;
  text-align: center;
  line-height: 1;
}
.admin-preview-banner strong {
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.admin-preview-banner span {
  font-size: 16px;
  font-weight: 900;
}
.admin-preview-banner button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(36, 21, 0, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: #241500;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
}
.admin-preview-banner button:hover {
  border-color: rgba(36, 21, 0, 0.6);
  background: rgba(255, 255, 255, 0.65);
}
.admin-preview-banner.hidden {
  display: none;
}
.demo-mode-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 11000000;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 4px 112px;
  border-bottom: 1px solid rgba(11, 43, 64, 0.28);
  background: #67b8e8;
  color: #10263a;
  box-shadow: 0 4px 18px #0004;
}
.demo-mode-banner[hidden] {
  display: none;
}
.demo-mode-banner strong {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.demo-mode-banner button {
  position: absolute;
  right: 8px;
  top: 50%;
  padding: 5px 10px;
  transform: translateY(-50%);
  border: 1px solid #17365366;
  border-radius: 999px;
  background: #ffffff75;
  color: #10263a;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.demo-mode-banner button:hover {
  border-color: #173653aa;
  background: #ffffffa8;
}
body.demo-mode {
  padding-top: 40px;
}
body.demo-mode .tool-launcher-screen,
body.demo-mode .tool-workspace-screen {
  inset: 40px 0 0;
}
body.demo-mode #settings-modal,
body.demo-mode #roster-modal {
  inset: 40px 0 0;
}
.demo-mode-banner-error {
  background: #ed8179;
  color: #32120f;
}
@media (max-width: 700px) {
  .demo-mode-banner {
    min-height: 36px;
    padding: 3px 92px;
  }
  .demo-mode-banner strong {
    font-size: 10px;
  }
  .demo-mode-banner button {
    right: 6px;
    padding: 4px 8px;
    font-size: 9px;
  }
  body.demo-mode {
    padding-top: 36px;
  }
  body.demo-mode .tool-launcher-screen,
  body.demo-mode .tool-workspace-screen {
    inset: 36px 0 0;
  }
  body.demo-mode #settings-modal,
  body.demo-mode #roster-modal {
    inset: 36px 0 0;
  }
}
.admin-preview-active #settings-modal,
.admin-preview-active #roster-modal {
  inset: 48px 0 0;
}
.admin-preview-active .tool-launcher-screen {
  inset: 48px 0 0;
}
.admin-preview-active #roster-modal {
  padding: 10px 0;
  box-sizing: border-box;
}
.admin-preview-active #roster-modal .roster-box {
  max-height: min(760px, calc(100dvh - 68px));
}
@media (max-width: 520px) {
  .admin-preview-banner {
    min-height: 48px;
    padding: 5px 96px;
  }
  .admin-preview-active {
    padding-top: 48px;
  }
  .admin-preview-title {
    justify-self: center;
  }
  .admin-preview-banner button {
    right: 7px;
    padding: 7px 9px;
  }
}
.account-session-card h4 {
  margin: 5px 0 0;
  font-size: 18px;
}
.settings-danger {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #7d3340;
  border-radius: 6px;
  background: #4a252c;
  color: #ffd9df;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.settings-danger:hover {
  background: #62303a;
}

/* App-style cursor behavior: keep one stable arrow across every surface,
   including the borders and editable centers of form fields. */
html,
body,
body * {
  cursor: default !important;
}
.settings-danger:disabled {
  opacity: 0.65;
  cursor: wait;
}
:root[data-theme="light"] .settings-danger {
  border-color: #e0abb4;
  background: #fff0f2;
  color: #9d2338;
}
@media (max-width: 520px) {
  .account-session-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Keep the shared Tools and Settings controls visually identical in every app. */
:root[data-theme="dark"] .equipment-settings-open-btn {
  border-color: #35383e;
  background: #1c1e21;
  color: #d7d9dc;
}
:root[data-theme="light"] .equipment-settings-open-btn {
  border-color: #c3ceda;
  background: #fff;
  color: #32445a;
  box-shadow: 0 4px 14px rgba(35, 52, 73, 0.16);
}
