@font-face {
  font-family: "Cinzel";
  src: url("/static/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --crest-navy: #1e3a8a;
  --crest-navy-dark: #172e6e;
  --crest-gold: #d4a017;
  --crest-gold-light: #f3d27a;
  --crest-parchment: #f4f1ea;
  --sidebar-w: 240px;
  --bs-primary: var(--crest-navy);
  --bs-primary-rgb: 30, 58, 138;
  --bs-link-color: var(--crest-navy);
  --bs-link-color-rgb: 30, 58, 138;
  --bs-link-hover-color: var(--crest-navy-dark);
}

body {
  background: var(--crest-parchment);
}

.btn-primary {
  --bs-btn-bg: var(--crest-navy);
  --bs-btn-border-color: var(--crest-navy);
  --bs-btn-hover-bg: var(--crest-navy-dark);
  --bs-btn-hover-border-color: var(--crest-navy-dark);
  --bs-btn-active-bg: #142860;
  --bs-btn-active-border-color: #142860;
  --bs-btn-disabled-bg: var(--crest-navy);
  --bs-btn-disabled-border-color: var(--crest-navy);
}

.brand-word {
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--crest-gold-light);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 1030;
  display: flex;
  flex-direction: column;
  background: var(--crest-navy);
  border-right: 3px solid var(--crest-gold);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.brand .brand-word {
  font-size: 1.25rem;
}

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-link.locked,
.side-link.locked:hover {
  background: none;
  color: rgba(255, 255, 255, 0.88);
  cursor: not-allowed;
  opacity: 0.4;
}

.side-link.active {
  background: rgba(255, 255, 255, 0.14);
  border-left-color: var(--crest-gold);
  color: #fff;
}

.side-foot {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.version {
  cursor: help;
  padding: 0 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem;
}

.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--crest-gold);
  color: #3a2a00;
  font-weight: 700;
}

.user-text {
  min-width: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-email {
  overflow: hidden;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: rgba(255, 255, 255, 0.88);
}

.signout:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.content {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem;
}

.content > * {
  max-width: 62rem;
}

.hero {
  margin: 1rem auto 0;
  text-align: center;
}

.hero-word {
  margin: 0 0 0.5rem;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--crest-navy);
}

.hero-crest {
  width: min(300px, 70vw);
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
}

.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem auto 0;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 112px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--crest-navy);
  text-decoration: none;
}

.tile-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tile-box .icon {
  width: 44px;
  height: 44px;
  stroke-width: 1.75;
}

.tile:hover .tile-box {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.tile.locked {
  cursor: not-allowed;
  opacity: 0.45;
}

.cards-grid {
  justify-content: flex-start;
}

.cards-grid .tile {
  overflow-wrap: anywhere;
  text-align: center;
}

.cards-grid .tile-box img {
  width: 100%;
  height: 100%;
  padding: 0.5rem;
  object-fit: contain;
  border-radius: inherit;
}

.card-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
}

.card-side {
  min-width: 0;
}

.card-picture {
  display: block;
  max-width: 100%;
  height: auto;
}

.card-display {
  width: 100%;
  margin-inline: auto;
}

.card-display.card-sized {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-sized .card-picture {
  width: var(--card-size, 100%);
}

.tile.locked:hover .tile-box {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transform: none;
}

.page-title {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  color: var(--crest-navy);
}

.sms-body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sms-code {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.topbar,
.backdrop {
  display: none;
}

@media (max-width: 767.98px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--crest-navy);
    border-bottom: 3px solid var(--crest-gold);
  }

  .topbar-btn {
    display: flex;
    padding: 0.25rem;
    color: #fff;
    cursor: pointer;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  #nav-toggle:checked ~ .app .sidebar {
    transform: none;
  }

  .backdrop {
    position: fixed;
    inset: 0;
    z-index: 1025;
    display: block;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  #nav-toggle:checked ~ .app .backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    margin-left: 0;
    padding: 1.25rem 1rem;
  }
}

.pickle-body {
  max-height: 14rem;
  overflow: auto;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.photo-card {
  min-width: 0;
  position: relative;
}

.photo-tile {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.photo-tag-button {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #171717;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.photo-tag-picker {
  width: min(94vw, 32rem);
  max-width: 94vw;
  padding: 1.25rem;
  border: 0;
  border-radius: 0.5rem;
}

.photo-tag-picker::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.photo-tag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.photo-tag-add {
  display: flex;
  min-width: 0;
  gap: 0.35rem;
}

.photo-tag-add .form-control {
  width: 9rem;
  padding: 0.25rem 0.5rem;
}

.photo-tag-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.photo-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 50vh;
  overflow: auto;
}

.photo-tag-option {
  cursor: pointer;
}

.photo-tag-option span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid #adb5bd;
  border-radius: 999px;
  background: #fff;
  color: #343a40;
}

.photo-tag-option:hover span {
  border-color: var(--crest-navy);
}

.photo-tag-option input:checked + span {
  border-color: var(--crest-navy);
  background: var(--crest-navy);
  color: #fff;
}

.photo-tag-option input:focus-visible + span {
  outline: 0.2rem solid rgba(30, 58, 138, 0.35);
  outline-offset: 0.1rem;
}

.photo-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: #e4e1da;
  text-align: center;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-caption {
  display: block;
  padding: 0.5rem;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer {
  width: min(96vw, 100rem);
  max-width: 96vw;
  max-height: 96vh;
  padding: 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: #171717;
  color: #fff;
}

.photo-viewer::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.photo-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.photo-viewer-caption,
.photo-viewer-error {
  margin: 0.75rem 0;
  overflow-wrap: anywhere;
  text-align: center;
}

.photo-viewer-image {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.photo-viewer-image[hidden],
.photo-thumb img[hidden] {
  display: none;
}
