:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
  --brand-red: #cf2030;
  --brand-red-dark: #9a0d1a;
  --brand-black: #000000;
  --brand-white: #ffffff;
  --brand-green: #008000;
  --brand-gray: #64666a;
  --brand-gray-light: #f2f2f2;
  --brand-gray-border: #c8c8c8;
  --app-top-padding: 2.5rem;
  background: var(--brand-gray-light);
  color: var(--brand-black);
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  background: var(--brand-gray-light);
  color: var(--brand-black);
}

a {
  color: var(--brand-gray);
}

a:hover {
  color: var(--brand-red-dark);
}

.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gray-light);
  color: var(--brand-black);
  padding: 1.5rem;
  z-index: 2000;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.splash__panel {
  width: 100%;
  height: 100%;
  background: var(--brand-white);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash__content {
  text-align: center;
  display: grid;
  gap: 0.5rem;
  padding: 2rem;
}

.splash__logo {
  width: 140px;
  height: auto;
  margin: 0 auto;
}

.splash__title {
  margin: 0;
  font-size: 1.6rem;
}

.splash__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--brand-gray);
}

.splash__meta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--brand-gray-border);
  padding: 0.5rem;
}

.splash--hide {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: var(--brand-white);
  color: var(--brand-black);
  border: 1px solid var(--brand-gray-border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  font-size: 0.9rem;
  z-index: 1200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  border-color: #bbf7d0;
  color: #166534;
  background: #dcfce7;
}

.toast--info {
  border-color: #dbeafe;
  color: #1d4ed8;
  background: #eff6ff;
}

.toast--error {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fee2e2;
}

body[data-authenticated="false"] #content {
  display: none;
}

body[data-authenticated="false"] #auth-user {
  display: none;
}

body[data-authenticated="false"] #update-banner {
  display: none;
}

body[data-install-banner="visible"] {
  --app-top-padding: 0px;
}

body[data-admin="false"] #admin-card {
  display: none;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--app-top-padding) 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: padding 0.25s ease;
}

.app__header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  position: relative;
}

.notice-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--brand-black);
  margin-left: auto;
  flex: none;
}

.notice-bell:hover {
  background: var(--brand-gray-light);
}

.notice-bell__icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notice-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand-red);
  color: var(--brand-white);
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notice-list {
  display: grid;
  gap: 0.75rem;
}

.notice-item {
  border-radius: 0.6rem;
  border: 1px solid var(--brand-gray-border);
  background: var(--brand-gray-light);
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.notice-item--unread {
  border-color: #fecdd3;
  background: #fff1f2;
}

.notice-item__meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-gray);
}

.notice-item__title {
  font-weight: 600;
  margin: 0;
}

.notice-item__body {
  margin: 0;
  color: var(--brand-gray);
}

.admin-requests {
  display: grid;
  gap: 0.75rem;
}

.admin-requests__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-requests__list {
  display: grid;
  gap: 0.75rem;
}

.admin-request {
  border-radius: 0.75rem;
  border: 1px solid var(--brand-gray-border);
  background: var(--brand-gray-light);
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.admin-request__meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-gray);
}

.admin-request__title {
  font-weight: 600;
  margin: 0;
}

.admin-request__body {
  margin: 0;
  color: var(--brand-gray);
}

.admin-request__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-request__code {
  font-weight: 600;
  color: var(--brand-black);
}

.notice-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.notice-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.notice-modal__content {
  position: relative;
  background: var(--brand-white);
  color: var(--brand-black);
  width: min(92vw, 560px);
  max-height: 80vh;
  overflow: auto;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.notice-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notice-modal__current {
  border-radius: 0.75rem;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  padding: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

.notice-modal__current-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-gray);
}

.notice-modal__current-title {
  font-weight: 600;
}

.notice-modal__current-body {
  color: var(--brand-gray);
}

.notice-modal__current-actions {
  display: flex;
  justify-content: flex-end;
}

.app__footer {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 1.5rem 1.5rem 4rem;
  border-top: 1px solid var(--brand-gray-border);
  color: var(--brand-gray);
}

.app__footer img {
  width: 120px;
  height: auto;
}

.app__footer a {
  display: flex;
  gap: 0.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  width: 100%;
}

.brand-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.brand-logo {
  width: 160px;
  height: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--brand-gray);
  margin: 0 0 0.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
}

h2{
  margin: 0;
  font-size: clamp(18px, 3vw, 24px);
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--brand-gray);
}

small {
  color: var(--brand-gray);
}

.status {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-border);
  font-size: 0.9rem;
  color: var(--brand-gray);
}

#status {
  visibility: hidden;
}

body[data-authenticated="false"] #status {
  display: none;
}

body[data-authenticated="true"][data-data-loaded="true"] #status {
  visibility: visible;
}

body[data-auth-state="checking"] #auth {
  display: none;
}

.status--success {
  background: #e8f5e9;
  color: var(--brand-green);
}

.status--error {
  background: #f9d2d6;
  color: var(--brand-red-dark);
}

.card {
  background: var(--brand-white);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.card.feedback-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-gray-border);
  background: var(--brand-white);
  color: var(--brand-gray);
  margin-bottom: 1.5rem;
}

.update-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.update-meta {
  font-size: 0.8rem;
  color: var(--brand-gray);
}

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0 0 0.75rem 0.75rem;
  background: var(--brand-white);
  color: var(--brand-black);
  margin: 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease,
    padding 0.25s ease;
}

.install-banner--collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  padding-top: 0;
  padding-bottom: 0;
}

.install-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

.install-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.install-dialog__content {
  position: relative;
  background: var(--brand-white);
  color: var(--brand-black);
  width: min(100%, 520px);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  z-index: 1;
}

.install-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.install-dialog__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.install-dialog__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--brand-gray-light);
  margin-bottom: 1rem;
}

.install-dialog__icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
}

.install-dialog__host {
  display: block;
  font-size: 0.85rem;
  color: var(--brand-gray);
  margin-top: 0.15rem;
}

.install-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
  color: var(--brand-gray);
  font-size: 0.95rem;
}

.install-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.install-step-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: var(--brand-gray-light);
  color: var(--brand-black);
}

.install-step-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.install-step-text {
  flex: 1;
}

.install-step-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  margin: 0 0.15rem;
  border-radius: 999px;
  border: 1px solid var(--brand-gray-border);
  background: var(--brand-white);
  font-size: 0.85rem;
  color: var(--brand-black);
  white-space: nowrap;
}

.install-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.install-meta {
  font-size: 0.85rem;
  color: var(--brand-gray);
}

.install-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.button--ghost {
  background: var(--brand-white);
  color: var(--brand-gray);
  border: 1px solid var(--brand-gray-border);
  text-decoration: none;
  text-align: center;
}

.button--ghost:hover {
  background: var(--brand-gray-light);
}

.install-help {
  text-decoration: none;
}

.install-help-panel {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--brand-gray-light);
  color: var(--brand-black);
}

.install-help-panel ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--brand-gray);
}

h2.auth-guest-only {
  grid-column: 1 / -1;
}

body[data-authenticated="true"] .auth-guest-only,
body[data-authenticated="true"] #auth-message {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

body[data-authenticated="true"] .card.grid{
  display: block;
  order: 1;
}

body[data-data-loaded="true"] #member-card {
  order: -1;
}

#admin-card {
  grid-column: 1 / -1;
}

#invite-card {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

label {
  margin-top: 0.5rem;
}

input,
select,
button,
.button--ghost {
  font: inherit;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid var(--brand-gray-border);
}

select {
  width: 100%;
}

button:disabled,
input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input#csv-input{
  max-width: 280px;
}

.autocomplete-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--brand-gray-border);
  border-left: 3px solid var(--brand-red);
  border-radius: 0.75rem;
  background: #f8f8f8;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  max-height: 220px;
  overflow: auto;
}

.autocomplete-title {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-gray);
  padding: 0 0.25rem 0.15rem;
}

.autocomplete-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  text-align: left;
  background: var(--brand-white);
  color: var(--brand-black);
  border: 1px solid transparent;
  border-radius: 0.4rem;
  cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--brand-gray-light);
  border-color: var(--brand-gray-border);
}

button {
  background: var(--brand-red);
  color: var(--brand-white);
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

button:hover {
  background: var(--brand-red-dark);
}

.inline {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.error {
  color: var(--brand-red-dark);
  font-weight: 600;
}

.muted {
  color: var(--brand-gray);
  font-size: 0.95rem;
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-header > div > * {
  margin: 0;
}

.score-pill {
  background: var(--brand-gray-light);
  color: var(--brand-gray);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 700;
}

.score-pill--green {
  background: #dcfce7;
  color: #166534;
}

.score-pill--orange {
  background: #ffedd5;
  color: #c2410c;
}

.score-pill--red {
  background: #fee2e2;
  color: #b91c1c;
}

.score-pill--grey {
  background: var(--brand-gray-light);
  color: var(--brand-gray);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.score-item {
  background: var(--brand-gray-light);
  padding: 0.75rem;
  border-radius: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.score-item--green {
  background: #dcfce7;
  color: #166534;
}

.score-item--orange {
  background: #ffedd5;
  color: #c2410c;
}

.score-item--red {
  background: #fee2e2;
  color: #b91c1c;
}

.score-item--grey {
  background: var(--brand-gray-light);
  color: var(--brand-gray);
}

.detail-heading {
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider {
  border-top: 1px solid var(--brand-gray-border);
  margin: 1.5rem 0;
}

.priority {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.upload-status {
  margin-top: 0.75rem;
  font-weight: 600;
}

.upload-status.success {
  color: #166534;
}

.upload-status.error {
  color: #b91c1c;
}

.request-status {
  margin-top: 0.5rem;
  font-weight: 600;
}

.selection-summary {
  margin: 0.25rem 0 0;
}

.last-updated {
  margin: 0.25rem 0 0;
}

.request-status.error {
  color: var(--brand-red-dark);
}

.request-status.success {
  color: #166534;
}

.invite-code-output {
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--brand-gray-dark);
}

.auth-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}


.auth-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-email {
  font-weight: 600;
}

@media (max-width: 720px) {
  .app__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 40px;
  }

  .update-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .install-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .install-dialog__content {
    padding: 1.25rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  #admin-card {
    grid-column: auto;
  }

  .inline {
    flex-direction: column;
    align-items: stretch;
  }

}
