:root {
  --bg: #ece8de;
  --paper: rgba(250, 247, 239, 0.92);
  --ink: #233126;
  --muted: #55655a;
  --accent: #8b5e34;
  --accent-2: #234634;
  --line: rgba(35, 49, 38, 0.14);
  --danger: #7f2f1f;
  --ok: #2d6a4f;
  --shadow: 0 24px 50px rgba(35, 49, 38, 0.08);
}

/* --- Rounded chevron in circular glass buttons (nav / sort / expand) --- */
.glass-chevron-svg {
  display: block;
  width: 1.12em;
  height: 1.12em;
}

.glass-chevron-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.glass-chevron-icon--up .glass-chevron-svg {
  transform: rotate(0deg);
}

.glass-chevron-icon--down .glass-chevron-svg {
  transform: rotate(180deg);
}

.glass-chevron-icon--left .glass-chevron-svg {
  transform: rotate(-90deg);
}

.glass-chevron-icon--right .glass-chevron-svg {
  transform: rotate(90deg);
}

.glass-chevron-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(34, 46, 56, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.glass-chevron-btn:hover,
.glass-chevron-btn:focus-visible {
  background: rgba(34, 46, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.glass-chevron-btn--on-dark {
  /* Same styling as .glass-chevron-btn, kept for compatibility */
}

.glass-chevron-btn--on-dark:hover,
.glass-chevron-btn--on-dark:focus-visible {
  background: rgba(34, 46, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
}

.glass-chevron-btn--chat-bubble {
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  margin-left: 0.15rem;
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.glass-chevron-btn--chat-bubble:hover,
.glass-chevron-btn--chat-bubble:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.5);
}

button.glass-chevron-btn--chat-bubble {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
}

button.glass-chevron-btn--chat-bubble:hover,
button.glass-chevron-btn--chat-bubble:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.5);
  filter: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(139, 94, 52, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(35, 70, 52, 0.16), transparent 45%),
    var(--bg);
  min-height: 100vh;
}

body.app-site {
  background:
    linear-gradient(180deg, rgba(232, 224, 205, 0.2), rgba(236, 232, 222, 0.92)),
    url("/media/files/Orrspel_104.jpg") center top / cover fixed no-repeat,
    var(--bg);
}

body.app-site::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(247, 243, 234, 0.78), rgba(236, 232, 222, 0.96));
  pointer-events: none;
}

body.app-site > * {
  position: relative;
}

body.app-digga {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(229, 233, 237, 0.8), rgba(214, 220, 226, 0.95)),
    #d9e0e6;
  color-scheme: light dark;
  overflow: hidden;
}

body.app-portal {
  background:
    radial-gradient(circle at top left, rgba(139, 94, 52, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(35, 70, 52, 0.12), transparent 42%),
    var(--bg);
}

body.app-auth {
  background:
    linear-gradient(180deg, rgba(230, 234, 229, 0.8), rgba(236, 232, 222, 0.96)),
    var(--bg);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.5rem;
}

body.app-site .site-header {
  align-items: center;
  padding: 1.8rem 2rem 1rem;
}

body.app-auth .site-header,
body.app-portal .site-header {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.brand-link {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-tag {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

body.app-digga a {
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav a,
.button,
button {
  background: var(--accent-2);
  color: #f7f1e9;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.main-nav a:hover,
.button:hover,
button:hover {
  filter: brightness(1.08);
}

.user-pill {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(35, 70, 52, 0.1);
}

.page-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto 3rem;
}

body.app-site .page-shell {
  margin-top: 0.5rem;
}

.digga-frame {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.digga-top-panel-slot {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
}

.digga-body-scroller {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Minskar att webbläsaren flyttar scroll när lazy-bilder laddas kl ovanför vyn. */
  overflow-anchor: none;
}

.digga-body-scroller.is-touch-scrolling {
  /* Hint så browsern parkerar scrollern på en compositor-layer under touch-scroll. */
  will-change: scroll-position;
}

/* Defensive: if body is accidentally scroll-locked, keep Digga scroller usable. */
body.project-upload-open .digga-body-scroller {
  overflow-y: auto;
}

.digga-topbar {
  position: relative;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(35, 49, 38, 0.1);
  background: rgba(250, 251, 252, 0.86);
  backdrop-filter: blur(12px);
}

.digga-topbar-user {
  flex: 0 1 auto;
  max-width: min(42vw, 16rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.digga-user-menu {
  position: relative;
  flex: 0 1 auto;
}

.glass-user-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(34, 46, 56, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42vw, 16rem);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.glass-user-btn:hover,
.glass-user-btn:focus-visible {
  background: rgba(34, 46, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.digga-user-popup {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(34, 46, 56, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #ffffff;
  animation: user-popup-in 120ms ease-out;
}

.digga-user-popup[hidden] {
  display: none;
}

@keyframes user-popup-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.digga-user-popup-email {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-bottom: 0.35rem;
}

.digga-user-popup-logout {
  display: block;
  padding: 0.4rem 0.6rem;
  margin-top: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 120ms ease;
}

.digga-user-popup-logout:hover {
  background: rgba(255, 255, 255, 0.18);
}

.digga-sidebar {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
  z-index: 121;
}

.digga-sidebar-toggle {
  cursor: pointer;
  list-style: none;
  color: #22313a;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(35, 49, 38, 0.12);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(35, 49, 38, 0.08);
}

.digga-sidebar-toggle::-webkit-details-marker {
  display: none;
}

.digga-sidebar-toggle-icon {
  width: 1.15rem;
  display: inline-grid;
  gap: 0.2rem;
}

.digga-sidebar-toggle-icon-line {
  display: block;
  width: 100%;
  height: 0.14rem;
  border-radius: 999px;
  background: currentColor;
}

.digga-sidebar-toggle-label {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.digga-sidebar-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 0;
  z-index: 3500;
  width: min(24rem, calc(100vw - 2.4rem));
  max-height: calc(100vh - 5.6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: grid;
  gap: 0;
  border: 1px solid rgba(35, 49, 38, 0.1);
  border-radius: 22px;
  background: rgba(250, 251, 252, 0.96);
  box-shadow: 0 24px 46px rgba(35, 49, 38, 0.16);
  scrollbar-width: thin;
}

.digga-sidebar:not([open]) .digga-sidebar-panel {
  display: none;
}

.digga-topbar-brand {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.digga-brand-link {
  display: inline-block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.digga-brand-tag {
  margin: 0;
  color: #56636d;
}

.digga-nav,
.digga-subnav {
  display: grid;
  gap: 0.45rem;
}

.digga-subnav-project {
  display: grid;
  gap: 0.18rem;
}

.digga-subnav-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.digga-subnav-project-link {
  flex: 1 1 auto;
  min-width: 0;
}

.digga-subnav-project-spinner {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.digga-subnav-project-row.is-navigating .digga-subnav-project-spinner {
  opacity: 1;
  visibility: visible;
}

.digga-subnav-project-spinner::after {
  content: "";
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(34, 49, 58, 0.22);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: digga-subnav-spin 0.7s linear infinite;
}

@keyframes digga-subnav-spin {
  to {
    transform: rotate(360deg);
  }
}

.digga-nav a,
.digga-subnav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0;
  color: #22313a;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-decoration: none;
}

.digga-nav a:hover,
.digga-nav a:focus-visible,
.digga-subnav a:hover,
.digga-subnav a:focus-visible {
  background: transparent;
  color: var(--accent-2);
  filter: none;
}

.digga-nav-icon {
  width: 1.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(35, 70, 52, 0.08);
  color: var(--accent-2);
  font-size: 0.92rem;
  line-height: 1;
  font-weight: 700;
}

.digga-sidebar-group {
  margin-top: 1.2rem;
}

.digga-sidebar-footer {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(35, 49, 38, 0.08);
}

.digga-theme-picker {
  position: relative;
}

.digga-theme-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  padding: 0.72rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(35, 49, 38, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: #22313a;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.digga-theme-trigger::-webkit-details-marker {
  display: none;
}

.digga-theme-current {
  color: #56636d;
  font-weight: 600;
  font-size: 0.95rem;
}

.digga-theme-menu {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.55rem;
  padding: 0.35rem;
  border-radius: 20px;
  background: rgba(250, 247, 239, 0.98);
  border: 1px solid rgba(35, 49, 38, 0.08);
  box-shadow: 0 18px 34px rgba(35, 49, 38, 0.12);
}

.digga-theme-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.68rem 0.78rem;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #22313a;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.digga-theme-option::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(35, 49, 38, 0.24);
}

.digga-theme-option:hover,
.digga-theme-option:focus-visible {
  background: rgba(35, 70, 52, 0.08);
  color: var(--accent-2);
}

.digga-theme-option.is-active {
  background: rgba(35, 70, 52, 0.12);
  color: var(--accent-2);
}

.digga-theme-option.is-active::before {
  background: var(--accent-2);
  box-shadow: none;
}

.digga-main-shell {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior: contain;
  padding: 1.2rem 1.2rem 2rem;
}

.digga-top-panel-slot:empty {
  display: none;
}

.hero,
.panel,
.card,
.metric,
.timeline-item,
.chat-thread,
.comment {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 32px;
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.3fr 1fr;
  overflow: hidden;
}

body.app-site .hero {
  background: rgba(250, 247, 239, 0.78);
  backdrop-filter: blur(8px);
}

body.app-digga .hero,
body.app-digga .panel,
body.app-digga .card,
body.app-digga .metric,
body.app-digga .timeline-item,
body.app-digga .chat-thread,
body.app-digga .comment {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(35, 49, 38, 0.06);
}

.hero-media img,
.gallery-grid img,
.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media {
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
}

.dashboard-intro {
  position: relative;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 2rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(204, 107, 44, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 242, 232, 0.92));
}

.dashboard-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(35, 70, 52, 0.03), transparent 42%),
    radial-gradient(circle at bottom left, rgba(161, 132, 84, 0.08), transparent 28%);
  pointer-events: none;
}

.dashboard-intro-copy,
.dashboard-intro-features {
  position: relative;
  z-index: 1;
}

.dashboard-intro-copy {
  display: grid;
  gap: 0.95rem;
  align-content: start;
}

.dashboard-intro-wordmark {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: inherit;
  margin-bottom: 2.2rem;
}

.dashboard-intro-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.08;
  color: #c98c65;
  font-weight: 700;
}

.dashboard-intro-rule {
  width: min(100%, 34rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(161, 77, 51, 0.2), rgba(35, 70, 52, 0.08));
}

.dashboard-intro-lead {
  margin: 0;
  max-width: 32rem;
  font-size: 1.38rem;
  line-height: 1.45;
  color: #22313a;
  font-weight: 700;
}

.dashboard-intro-body {
  margin: 0;
  max-width: 34rem;
  font-size: 1.02rem;
  line-height: 1.75;
  color: #42525f;
  white-space: pre-line;
}

.dashboard-intro-features {
  display: grid;
  gap: 1rem;
  align-content: center;
}

.dashboard-intro-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.3rem 0;
}

.dashboard-intro-feature h2,
.dashboard-intro-feature p {
  margin: 0;
}

.dashboard-intro-feature h2 {
  font-size: 1.28rem;
  color: #29455f;
}

.dashboard-intro-feature p {
  margin-top: 0.2rem;
  color: #4f6070;
  line-height: 1.6;
}

.dashboard-intro-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  min-width: 2.8rem;
  height: 2.8rem;
  border-radius: 16px;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.dashboard-intro-feature-icon-warm {
  background: rgba(219, 163, 82, 0.18);
  color: #b0701c;
}

.dashboard-intro-feature-icon-cool {
  background: rgba(89, 129, 171, 0.16);
  color: #476d97;
}

.dashboard-intro-feature-icon-moss {
  background: rgba(103, 142, 76, 0.18);
  color: #5c8740;
}

.dashboard-intro-feature-icon-earth {
  background: rgba(122, 148, 108, 0.18);
  color: #5f7653;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--muted);
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.1;
}

.section-title {
  margin: 2rem 0 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel,
.metric,
.timeline-item,
.chat-thread,
.comment {
  border-radius: 24px;
  padding: 1.2rem;
}

.card h3,
.panel h2 {
  margin-bottom: 0.5rem;
}

.card p,
.panel p,
.metric p,
.timeline-item p {
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.gallery-grid figure {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  min-height: 140px;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.archive-form-fieldset {
  display: contents;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.archive-field {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

.app-select {
  min-height: 3.25rem;
  border-radius: 18px;
  padding-right: 2.9rem;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 1.25rem) calc(50% - 0.16rem),
    calc(100% - 0.9rem) calc(50% - 0.16rem);
  background-size: 0.38rem 0.38rem, 0.38rem 0.38rem;
  background-repeat: no-repeat;
}

.app-select-wide {
  width: min(18rem, 100%);
}

[data-archive-new-collection][hidden] {
  display: none !important;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.db-env-banner {
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.db-env-banner--test {
  background: #fef3cd;
  color: #664d03;
  border-bottom: 2px solid #e0c36a;
}

.db-env-banner--test a {
  color: #664d03;
  text-decoration: underline;
}

[data-digga-theme-effective="dark"] .db-env-banner--test {
  background: #3d3312;
  color: #fef3cd;
  border-bottom-color: #796622;
}

[data-digga-theme-effective="dark"] .db-env-banner--test a {
  color: #fef3cd;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
}

.flash-success {
  background: rgba(45, 106, 79, 0.12);
  color: var(--ok);
}

.flash-error {
  background: rgba(127, 47, 31, 0.12);
  color: var(--danger);
}

.flash-info {
  background: rgba(35, 70, 52, 0.1);
}

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

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

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.toolbar-grow {
  flex: 1 1 auto;
  min-width: 0;
}

.collection-rename-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.collection-rename-form[hidden] {
  display: none !important;
}

.collection-rename-input {
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 10rem;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.danger-icon-form {
  margin: 0;
}

.danger-icon-button {
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  padding: 0;
  border-radius: 999px;
  background: rgba(159, 47, 47, 0.1);
  color: rgba(159, 47, 47, 0.52);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  line-height: 1;
  box-shadow: none;
  border: 1px solid rgba(159, 47, 47, 0.12);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.danger-icon-button:hover {
  background: rgba(159, 47, 47, 0.18);
  color: rgba(159, 47, 47, 0.82);
  border-color: rgba(159, 47, 47, 0.24);
  filter: none;
}

.danger-icon-button span {
  transform: translateY(-0.02rem);
}

.edit-icon-link,
.post-back-link {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: none;
}

.post-back-link.glass-chevron-btn {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
}

.edit-icon-link {
  background: rgba(31, 76, 111, 0.9);
  color: #f5fbff;
  border: 1px solid rgba(19, 59, 89, 0.42);
  box-shadow: 0 8px 18px rgba(19, 59, 89, 0.18);
}

.edit-icon-link:hover,
.post-back-link:hover,
.post-back-link:focus-visible,
.edit-icon-link:focus-visible {
  filter: none;
}

.edit-icon-link:hover,
.edit-icon-link:focus-visible {
  background: rgba(40, 93, 134, 0.96);
  color: #ffffff;
  border-color: rgba(19, 59, 89, 0.58);
}

.post-back-link {
  margin-bottom: 0.6rem;
}

.post-back-link.glass-chevron-btn--on-dark:hover,
.post-back-link.glass-chevron-btn--on-dark:focus-visible {
  filter: none;
}

.post-detail-actions {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.post-panel {
  overflow: visible;
  max-width: min(52rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

.post-cover-image {
  width: min(100%, 44rem);
  max-height: 26rem;
  margin: 0.9rem auto 1.25rem;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 34px rgba(35, 49, 38, 0.08);
}

.post-like-row,
.comment-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow: visible;
  margin-top: 0.85rem;
  margin-bottom: 0.25rem;
}

.like-form {
  margin: 0;
  overflow: visible;
}

.like-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(0, 214, 255, 0.28), rgba(0, 140, 255, 0.4));
  color: #053b70;
  border: 1px solid rgba(0, 194, 255, 0.65);
  box-shadow:
    0 0 0.45rem rgba(0, 214, 255, 0.34),
    0 0 1.1rem rgba(0, 140, 255, 0.28),
    0 10px 22px rgba(0, 102, 204, 0.18);
  font-weight: 700;
}

.like-heart {
  color: #ffffff;
  line-height: 1;
}

.like-button.is-empty {
  background: linear-gradient(135deg, rgba(126, 138, 150, 0.18), rgba(87, 98, 110, 0.24));
  color: #51606d;
  border-color: rgba(96, 108, 120, 0.34);
  box-shadow: 0 4px 10px rgba(52, 62, 72, 0.08);
}

.like-button.is-active {
  background: linear-gradient(135deg, rgba(236, 255, 79, 0.38), rgba(132, 255, 81, 0.44));
  color: #365700;
  border-color: rgba(150, 255, 77, 0.72);
  box-shadow:
    0 0 0.5rem rgba(196, 255, 65, 0.4),
    0 0 1.2rem rgba(132, 255, 81, 0.3),
    0 10px 22px rgba(84, 158, 36, 0.18);
}

.like-button:hover,
.like-button:focus-visible {
  filter: none;
  background: linear-gradient(135deg, rgba(44, 227, 255, 0.42), rgba(0, 153, 255, 0.54));
  border-color: rgba(44, 227, 255, 0.82);
  box-shadow:
    0 0 0.6rem rgba(44, 227, 255, 0.46),
    0 0 1.45rem rgba(0, 153, 255, 0.34),
    0 12px 24px rgba(0, 102, 204, 0.22);
}

.like-button.is-empty:hover,
.like-button.is-empty:focus-visible {
  background: linear-gradient(135deg, rgba(138, 150, 162, 0.22), rgba(97, 108, 120, 0.28));
  border-color: rgba(108, 120, 132, 0.4);
  box-shadow: 0 6px 14px rgba(52, 62, 72, 0.1);
}

.like-button.is-active:hover,
.like-button.is-active:focus-visible {
  background: linear-gradient(135deg, rgba(245, 255, 101, 0.5), rgba(151, 255, 86, 0.58));
  border-color: rgba(173, 255, 92, 0.9);
  box-shadow:
    0 0 0.7rem rgba(214, 255, 79, 0.5),
    0 0 1.5rem rgba(151, 255, 86, 0.38),
    0 12px 24px rgba(84, 158, 36, 0.22);
}

.like-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.7rem);
  transform: translateX(-50%) translateY(0.2rem);
  min-width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: rgba(24, 31, 37, 0.94);
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1.25;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  white-space: normal;
  z-index: 40;
}

.like-button:hover::after,
.like-button:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.post-markdown {
  display: grid;
  gap: 0.8rem;
}

.post-markdown > * {
  margin: 0;
}

.post-markdown ul,
.post-markdown ol {
  margin: 0;
  padding-left: 1.25rem;
}

.markdown-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.markdown-toolbar .button-small {
  min-width: 2.4rem;
  justify-content: center;
}

.emoji-picker {
  width: auto;
  min-width: 9.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
}

.markdown-editor textarea {
  min-height: 8rem;
}

.form-grid > button,
.form-grid > .actions > button,
.form-grid > .actions > .button {
  width: fit-content;
  justify-self: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(35, 49, 38, 0.1);
}

.status-pill.saved {
  color: var(--ok);
  background: rgba(45, 106, 79, 0.14);
}

.status-pill.unsaved {
  color: var(--danger);
  background: rgba(127, 47, 31, 0.12);
}

.status-pill.dirty {
  color: #a65700;
  background: rgba(245, 158, 11, 0.2);
}

.status-pill-link {
  text-decoration: none;
  width: fit-content;
}

.status-pill-link:hover,
.status-pill-link:focus-visible {
  filter: brightness(1.04);
}

.icon-button {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
}

.danger {
  background: var(--danger);
}

.muted-link {
  color: var(--muted);
}

.narrow {
  max-width: 720px;
  margin: 0 auto;
}

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

.metric-strip {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.9rem;
}

.comment-thread {
  display: grid;
  gap: 0.75rem;
}

.comment.reply {
  margin-left: 2.75rem;
  padding-left: 1rem;
  border-left: 3px solid rgba(35, 70, 52, 0.16);
}

.two-column {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.2fr 0.8fr;
}

.metric-strip + .two-column {
  margin-top: 0.45rem;
}

.dashboard-project-list {
  row-gap: 0.45rem;
}

.dashboard-project-image-count {
  margin-left: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.chat-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 0.9fr 1.1fr;
}

.digga-chat-overlay {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3400;
  display: grid;
  justify-items: end;
  gap: 0.75rem;
}

.digga-chat-bubble-stack {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-bottom: 0.55rem;
}

.digga-chat-bubble {
  --digga-chat-bubble-fill: #1d6fd6;
  --digga-chat-bubble-edge: rgba(39, 109, 207, 0.35);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem 0.55rem;
  border-radius: 1.05rem 1.05rem 0.4rem 1.05rem;
  border: 1px solid var(--digga-chat-bubble-edge);
  background: var(--digga-chat-bubble-fill);
  color: #ffffff;
  box-shadow: none;
  font-size: 0.88rem;
  line-height: 1.25;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 16px rgba(10, 35, 68, 0.26));
}

/* Pratbubblans svans — yttre kant (tydligare kontur mot bakgrund) */
.digga-chat-bubble::before {
  content: "";
  position: absolute;
  right: 0.38rem;
  bottom: -14px;
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid var(--digga-chat-bubble-edge);
  z-index: 0;
}

/* Pratbubblans svans — fyllnad */
.digga-chat-bubble::after {
  content: "";
  position: absolute;
  right: 0.45rem;
  bottom: -12px;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 7px solid transparent;
  border-top: 12px solid var(--digga-chat-bubble-fill);
  z-index: 1;
}

.digga-chat-bubble-label {
  font-weight: 700;
}

.digga-chat-bubble-toggle {
  margin-left: 0.05rem;
  line-height: 0;
  flex-shrink: 0;
}

.digga-chat-overlay.has-unread .digga-chat-bubble {
  --digga-chat-bubble-fill: #2f8f52;
  --digga-chat-bubble-edge: rgba(47, 143, 82, 0.4);
}

.digga-chat-window {
  width: min(28rem, calc(100vw - 2rem));
  max-height: min(82vh, 42rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(18, 31, 39, 0.26);
}

.digga-chat-window[hidden] {
  display: none !important;
}

.digga-chat-header {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.digga-chat-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.digga-chat-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.05rem;
  scrollbar-width: none;
}

.digga-chat-tabs::-webkit-scrollbar {
  display: none;
}

.digga-chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
  border: 1px solid rgba(17, 34, 56, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.digga-chat-tab.is-active {
  background: rgba(63, 106, 88, 0.14);
  border-color: rgba(63, 106, 88, 0.22);
}

.digga-chat-tab.is-unread {
  border-color: rgba(47, 143, 82, 0.32);
}

.digga-chat-tab-button,
.digga-chat-tab-close {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.digga-chat-tab-button {
  height: auto;
  padding: 0.48rem 0.25rem 0.48rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.digga-chat-tab-close {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.2rem;
  border-radius: 999px;
  color: var(--muted);
}

.digga-chat-tab-close:hover,
.digga-chat-tab-close:focus-visible {
  background: rgba(17, 34, 56, 0.08);
  color: var(--ink);
}

.digga-chat-new-button {
  width: 2.4rem;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(47, 143, 82, 0.22);
  background: #2f8f52;
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: 0 14px 24px rgba(47, 143, 82, 0.24);
}

.digga-chat-new-button:disabled {
  background: rgba(128, 144, 155, 0.4);
  border-color: rgba(128, 144, 155, 0.18);
  color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.digga-chat-participant-line {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
}

.digga-chat-participant-line span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.digga-chat-participant-line-icon {
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  flex-shrink: 0;
  color: var(--ink);
  transition: transform 0.18s ease;
}

.digga-chat-participant-line[aria-expanded="true"] .digga-chat-participant-line-icon {
  transform: rotate(180deg);
}

.digga-chat-picker {
  display: grid;
  gap: 0.6rem;
}

.digga-chat-user-list {
  display: grid;
  gap: 0.4rem;
  max-height: 11rem;
  overflow: auto;
}

.digga-chat-user-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 34, 56, 0.08);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
}

.digga-chat-user-option input[type="checkbox"] {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  accent-color: #1d6fd6;
}

.digga-chat-user-copy {
  display: grid;
  gap: 0.15rem;
}

.digga-chat-user-state {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.digga-chat-user-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.digga-chat-online-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #2f8f52;
  box-shadow: 0 0 0 4px rgba(47, 143, 82, 0.12);
}

.digga-chat-online-text {
  color: #2f8f52;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.digga-chat-thread {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.55rem;
  min-height: 0;
  padding: 0.85rem 1rem 0;
}

.digga-chat-invites {
  display: grid;
  gap: 0.5rem;
}

.digga-chat-invite {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(47, 143, 82, 0.18);
  background: rgba(47, 143, 82, 0.08);
}

.digga-chat-invite-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(47, 143, 82, 0.16);
  color: #2f8f52;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.digga-chat-invite-copy {
  min-width: 0;
}

.digga-chat-invite-copy strong,
.digga-chat-invite-copy p {
  display: block;
  margin: 0;
}

.digga-chat-invite-copy p {
  color: var(--muted);
  font-size: 0.85rem;
}

.digga-chat-invite-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.digga-chat-thread-status {
  color: var(--muted);
  font-size: 0.86rem;
}

.digga-chat-messages {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  min-height: 12rem;
  max-height: 23rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.digga-chat-empty {
  display: grid;
  place-items: center;
  min-height: 8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(17, 34, 56, 0.14);
  color: var(--muted);
  text-align: center;
}

.digga-chat-message-row {
  display: grid;
  justify-items: start;
  gap: 0.18rem;
}

.digga-chat-message-row.is-own {
  justify-items: end;
}

.digga-chat-message-sender {
  padding: 0 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.digga-chat-message {
  display: grid;
  gap: 0.3rem;
  max-width: min(85%, 20rem);
  padding: 0.72rem 0.85rem 0.6rem;
  border-radius: 20px 20px 20px 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(18, 31, 39, 0.08);
}

.digga-chat-message-row.is-own .digga-chat-message {
  border-radius: 20px 20px 8px 20px;
  background: rgba(63, 106, 88, 0.16);
}

.digga-chat-message p {
  margin: 0;
}

.digga-chat-message-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.digga-chat-message-row-typing {
  justify-items: start;
}

.digga-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.7rem 0.82rem;
  border-radius: 18px 18px 18px 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(18, 31, 39, 0.08);
}

.digga-chat-typing span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--muted);
  animation: digga-chat-typing-dot 1.05s infinite ease-in-out;
}

.digga-chat-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.digga-chat-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes digga-chat-typing-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-0.18rem);
    opacity: 1;
  }
}

.digga-chat-composer {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

.digga-chat-composer textarea {
  min-height: 4.7rem;
  resize: vertical;
}

.digga-chat-compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.archive-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: 0.95fr 1.3fr 0.8fr;
  margin-top: 1rem;
  align-items: start;
}

.archive-preview-panel {
  position: sticky;
  top: 1rem;
}

.archive-preview-toolbar {
  align-items: center;
}

.archive-preview-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.archive-preview-tools {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: nowrap;
}

.archive-leave-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.archive-leave-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 14, 18, 0.58);
}

.archive-leave-modal-panel {
  position: relative;
  width: min(28rem, calc(100vw - 2rem));
  margin: 18vh auto 0;
  padding: 1rem 1rem 1.05rem;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(35, 49, 38, 0.22);
  display: grid;
  gap: 0.8rem;
}

.archive-leave-modal-panel p {
  margin: 0;
}

.archive-leave-modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button-secondary {
  background: rgba(35, 49, 38, 0.1);
  color: var(--ink);
}

.archive-clipboard-button {
  position: relative;
  background: rgba(35, 70, 52, 0.1);
  color: var(--accent-2);
  box-shadow: none;
}

.archive-clipboard-button:hover,
.archive-clipboard-button:focus-visible {
  filter: none;
  background: rgba(35, 70, 52, 0.16);
}

.archive-clipboard-button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
}

.archive-clipboard-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(0.2rem);
  min-width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: rgba(24, 31, 37, 0.94);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  white-space: nowrap;
  z-index: 5;
}

.archive-clipboard-button:hover::after,
.archive-clipboard-button:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.archive-preview-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  max-height: min(65vh, 34rem);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.8);
}

.archive-preview-image-button {
  display: block;
  width: 100%;
  position: relative;
}

.archive-faces-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.archive-faces-layer:not([hidden]) {
  display: block;
}

.archive-face-box {
  position: absolute;
  border: 2px solid rgba(255, 220, 100, 0.85);
  background: rgba(255, 220, 100, 0.08);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.archive-face-box:hover,
.archive-face-box:focus-within {
  background: rgba(255, 220, 100, 0.18);
  border-color: rgba(255, 220, 100, 1);
}
.archive-face-box.is-named {
  border-color: rgba(120, 220, 140, 0.9);
  background: rgba(120, 220, 140, 0.08);
}
.archive-face-box.is-named:hover {
  background: rgba(120, 220, 140, 0.22);
}

.archive-face-label {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 2px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.archive-face-box:hover .archive-face-label,
.archive-face-box.is-named .archive-face-label {
  opacity: 1;
}

.archive-face-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  min-width: 18rem;
  max-width: min(22rem, calc(100vw - 1rem));
  background: rgba(247, 250, 255, 0.98);
  color: var(--ink);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  box-shadow: 0 18px 32px rgba(35, 49, 38, 0.18);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  cursor: default;
}
.archive-face-popover-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.archive-face-popover-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 10px;
}
.archive-face-popover-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(35, 70, 52, 0.15);
}
.archive-face-popover-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  align-items: center;
}
.archive-face-popover-save,
.archive-face-popover-cancel {
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  border: 0;
}
.archive-face-popover-save {
  background: var(--accent-2);
  color: #f7f1e9;
}
.archive-face-popover-cancel {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.archive-face-popover-save:hover,
.archive-face-popover-cancel:hover {
  filter: brightness(1.08);
}
.archive-face-popover-status {
  font-size: 0.75rem;
  color: var(--muted, #6b6b6b);
  min-height: 1em;
}
.archive-face-popover-hint {
  font-size: 0.75rem;
  color: var(--muted, #6b6b6b);
  line-height: 1.35;
}
.archive-face-popover-hint a {
  color: var(--accent-2);
  text-decoration: underline;
}

html[data-digga-theme-effective="sunset"] body.app-digga .archive-face-popover {
  background: rgba(44, 31, 39, 0.98);
  border-color: rgba(247, 237, 231, 0.1);
  box-shadow: 0 18px 32px rgba(12, 7, 11, 0.32);
}
html[data-digga-theme-effective="sunset"] body.app-digga .archive-face-popover-input {
  background: rgba(20, 12, 15, 0.5);
  border-color: rgba(247, 237, 231, 0.18);
}
html[data-digga-theme-effective="sunset"] body.app-digga .archive-face-popover-cancel {
  border-color: rgba(247, 237, 231, 0.2);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-face-popover {
  background: rgba(13, 21, 31, 0.96);
  border-color: rgba(96, 165, 250, 0.2);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}
html[data-digga-theme-effective="dark"] body.app-digga .archive-face-popover-input {
  background: rgba(8, 14, 22, 0.6);
  border-color: rgba(96, 165, 250, 0.25);
}
html[data-digga-theme-effective="dark"] body.app-digga .archive-face-popover-cancel {
  border-color: rgba(96, 165, 250, 0.25);
}

.archive-faces-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.archive-faces-toggle {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
}
.archive-faces-toggle:hover {
  filter: brightness(1.08);
}
.archive-faces-toggle.is-active {
  background: var(--accent-2);
  color: #f7f1e9;
  border-color: var(--accent-2);
}
.archive-faces-toggle[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.archive-faces-count {
  color: var(--muted, #6b6b6b);
  font-size: 0.85rem;
}

html[data-digga-theme-effective="sunset"] body.app-digga .archive-faces-toggle {
  border-color: rgba(247, 237, 231, 0.2);
}
html[data-digga-theme-effective="dark"] body.app-digga .archive-faces-toggle {
  border-color: rgba(96, 165, 250, 0.25);
}

.archive-faces-add {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
}
.archive-faces-add:hover {
  filter: brightness(1.08);
}
.archive-faces-add.is-active {
  background: var(--accent-2);
  color: #f7f1e9;
  border-color: var(--accent-2);
}
html[data-digga-theme-effective="sunset"] body.app-digga .archive-faces-add {
  border-color: rgba(247, 237, 231, 0.2);
}
html[data-digga-theme-effective="dark"] body.app-digga .archive-faces-add {
  border-color: rgba(96, 165, 250, 0.25);
}

.people-page-lead {
  color: var(--muted, #6b6b6b);
  margin: 0.5rem 0 0;
}
.people-list-panel {
  margin-top: 1rem;
}
.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.people-table th,
.people-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}
.people-table th {
  font-weight: 600;
  color: var(--muted, #6b6b6b);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.people-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}
.people-col-count {
  text-align: right;
  width: 8rem;
  font-variant-numeric: tabular-nums;
}
.people-col-actions {
  width: 8rem;
  text-align: right;
}
.people-name-button {
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px dashed transparent;
}
.people-name-button:hover {
  border-bottom-color: rgba(37, 99, 235, 0.4);
  filter: none;
}
.people-merge-button {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.people-merge-button:hover {
  filter: brightness(1.08);
}
html[data-digga-theme-effective="sunset"] body.app-digga .people-merge-button,
html[data-digga-theme-effective="sunset"] body.app-digga .people-name-button:hover {
  border-color: rgba(247, 237, 231, 0.2);
}
html[data-digga-theme-effective="dark"] body.app-digga .people-merge-button,
html[data-digga-theme-effective="dark"] body.app-digga .people-name-button:hover {
  border-color: rgba(96, 165, 250, 0.25);
}

.archive-preview-image-button.is-drawing-face {
  cursor: crosshair;
}
.archive-preview-image-button.is-drawing-face .archive-faces-layer {
  pointer-events: auto;
}
.archive-preview-image-button.is-drawing-face img {
  pointer-events: none;
}
.archive-face-box.is-drawing {
  border-style: dashed;
  border-color: rgba(120, 220, 140, 1);
  background: rgba(120, 220, 140, 0.15);
  cursor: crosshair;
  pointer-events: none;
}

.archive-map-block {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.archive-map-preview-shell {
  position: relative;
  min-height: 13.5rem;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(218, 228, 235, 0.88), rgba(196, 210, 219, 0.84));
  border: 1px solid rgba(46, 71, 86, 0.16);
}

.archive-map-preview {
  width: 100%;
  min-height: 13.5rem;
}

.archive-map-open-button {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.8rem;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.archive-map-open-button[disabled] {
  cursor: default;
}

.archive-map-open-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 2rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(17, 24, 31, 0.76);
  color: #f6fbff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(7, 13, 18, 0.22);
}

.archive-map-unavailable {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.7rem 0.9rem 0.8rem;
  background: rgba(17, 24, 31, 0.78);
  color: #f4f8fb;
  font-size: 0.92rem;
  line-height: 1.35;
}

.archive-map-helper,
.archive-map-overlay-helper {
  color: var(--muted);
}

.archive-map-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.archive-map-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  font-weight: 600;
  grid-auto-flow: column;
  justify-content: start;
}

.archive-map-lock input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #1d6fd6;
}

.archive-map-lock span {
  white-space: nowrap;
}

.archive-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: grid;
  place-items: center;
}

.archive-map-overlay[hidden] {
  display: none !important;
}

body.archive-map-overlay-open {
  overflow: hidden;
}

.archive-map-overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 11, 16, 0.74);
  padding: 0;
  cursor: pointer;
}

.archive-map-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(62rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(248, 245, 238, 0.98);
  box-shadow: 0 28px 64px rgba(5, 8, 12, 0.36);
}

.archive-map-overlay-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.archive-map-overlay-close {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1;
}

.archive-map-overlay-stage {
  min-height: min(34rem, calc(100vh - 12rem));
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(218, 228, 235, 0.92), rgba(196, 210, 219, 0.9));
}

.archive-preview-nav {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.archive-preview-nav .button {
  justify-self: center;
}

.archive-nav-button {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
}

.archive-nav-button:hover,
.archive-nav-button:focus-visible {
  filter: none;
}

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

.archive-mode-switch {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(35, 49, 38, 0.08);
  width: fit-content;
}

.archive-mode-option {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.archive-mode-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.archive-mode-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.8rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
}

.archive-mode-option input:checked + span {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(35, 49, 38, 0.08);
}

.archive-form-span {
  grid-column: 1 / -1;
}

.archive-document-panel {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(35, 49, 38, 0.04);
}

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

.archive-document-pages-panel {
  display: grid;
  gap: 0.55rem;
}

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

.archive-document-page {
  display: grid;
  grid-template-columns: auto 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.archive-document-page input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #1d6fd6;
  flex: 0 0 auto;
}

.archive-document-page-thumb-shell {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
}

.archive-document-page-preview {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: zoom-in;
}

.archive-document-page-preview:hover,
.archive-document-page-preview:focus-visible {
  filter: none;
  background: transparent;
}

.archive-document-page-thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(35, 49, 38, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.archive-document-page-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.archive-document-page-copy {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.archive-document-page span {
  min-width: 0;
  word-break: break-word;
}

.archive-transcription-field {
  min-height: 12rem;
}

.archive-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
}

.archive-date-approx {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  font-weight: 600;
  white-space: nowrap;
}

.archive-date-approx input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #1d6fd6;
  flex: 0 0 auto;
}

.archive-people-helper {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
}

.archive-people-fields {
  display: grid;
  gap: 0.95rem;
}

.archive-person-entry {
  position: relative;
}

.archive-row-offset {
  margin-top: 0.8rem;
}

.archive-person-suggestions {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.98);
  box-shadow: 0 16px 30px rgba(35, 49, 38, 0.14);
  z-index: 12;
}

.archive-person-suggestions[hidden] {
  display: none;
}

.archive-person-suggestion {
  width: 100%;
  padding: 0.2rem;
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem;
  align-items: center;
  background: transparent;
  color: var(--ink);
}

.archive-person-suggestion:hover,
.archive-person-suggestion:focus-visible,
.archive-person-suggestion.is-active {
  filter: none;
  background: rgba(35, 70, 52, 0.12);
}

.archive-person-suggestion-label {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  justify-self: stretch;
}

.archive-person-suggestion-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  max-width: 1.7rem;
  padding: 0;
  border-radius: 999px;
  align-self: center;
  justify-self: end;
  background: rgba(159, 47, 47, 0.1);
  color: #c93a3a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  flex: 0 0 auto;
}

.archive-person-suggestion-delete:hover,
.archive-person-suggestion-delete:focus-visible {
  filter: none;
  background: rgba(159, 47, 47, 0.18);
}

.archive-index-list {
  max-height: 70vh;
  overflow: auto;
}

.archive-index-item {
  padding: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.archive-index-item.current {
  border-color: rgba(35, 70, 52, 0.34);
  background: rgba(35, 70, 52, 0.08);
}

.archive-index-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
}

.archive-index-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.archive-index-thumb-shell {
  position: relative;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
}

.archive-index-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(35, 49, 38, 0.1);
}

.archive-index-state-dot {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.archive-index-state-dot.saved {
  background: #2ea44f;
}

.archive-index-state-dot.unsaved {
  background: #d73a49;
}

.archive-meta-grid {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.archive-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.archive-filter-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border-radius: 14px;
  padding: 1rem;
}

.archive-filter-panel h2 {
  margin-bottom: 0.2rem;
}

.archive-filter-panel .form-grid {
  gap: 0.85rem;
}

.archive-filter-panel label {
  font-size: 0.95rem;
}

.archive-filter-panel input,
.archive-filter-panel select {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.archive-filter-panel .actions {
  margin-top: 0.25rem;
}

.archive-filter-panel .button,
.archive-filter-panel button {
  justify-content: center;
}

.archive-results-header {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.6rem;
}

.archive-results-header .eyebrow,
.archive-results-header h1 {
  margin: 0;
}

.archive-browser-controls {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0.9rem;
}

.archive-visibility-controls,
.archive-density-controls,
.archive-sort-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.archive-controls-label {
  font-weight: 500;
  color: var(--ink);
}

.archive-visibility-controls label,
.archive-density-controls label,
.archive-sort-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.archive-visibility-controls input[type="checkbox"],
.archive-sort-controls input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.archive-density-controls input[type="range"] {
  width: min(280px, 100%);
}

.archive-density-labels {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.archive-sort-direction {
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-header-inline-controls .archive-sort-controls {
  gap: 0.4rem;
  flex: 0 0 auto;
  min-width: 0;
}

.project-header-filter-controls {
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 22rem;
}

.project-header-sort-controls {
  position: relative;
  padding-right: 0.35rem;
  flex: 0 1 12.25rem;
  min-width: 0;
}

.project-header-flag-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: 0.2rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: nowrap;
}

.project-header-flag-controls .archive-controls-label {
  white-space: nowrap;
}

.project-header-saved-controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 0.2rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.material-saved-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.85rem;
  padding: 0 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #1a2832;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 6px 22px rgba(24, 38, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.material-saved-toggle:hover,
.material-saved-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.55);
  outline: none;
}

.material-saved-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(212, 160, 58, 0.95), rgba(186, 130, 40, 0.95));
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(140, 88, 24, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-saved-toggle,
html[data-digga-theme-effective="sunset"] body.app-digga .material-saved-toggle {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #e8eef3;
  box-shadow:
    0 10px 24px rgba(12, 18, 26, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-saved-toggle:hover,
html[data-digga-theme-effective="dark"] body.app-digga .material-saved-toggle:focus-visible,
html[data-digga-theme-effective="sunset"] body.app-digga .material-saved-toggle:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .material-saved-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-saved-toggle[aria-pressed="true"],
html[data-digga-theme-effective="sunset"] body.app-digga .material-saved-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(212, 160, 58, 0.95), rgba(186, 130, 40, 0.95));
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.project-material-filter-spinner {
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(200, 220, 255, 0.92);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.project-material-filter-spinner.is-active {
  animation: project-material-filter-spin 0.7s linear infinite;
  opacity: 1;
}

@keyframes project-material-filter-spin {
  to {
    transform: rotate(360deg);
  }
}

.project-header-inline-controls .archive-sort-controls .archive-controls-label {
  margin-right: 0.05rem;
}

.project-sort-picker-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.project-header-inline-controls .project-sort-picker-row .app-select-wide {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.project-header-inline-controls .archive-sort-direction {
  width: 2.85rem;
  height: 2.85rem;
  min-width: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #1a2832;
  box-shadow:
    0 6px 22px rgba(24, 38, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  line-height: 1;
}

.project-header-inline-controls .archive-sort-direction:hover,
.project-header-inline-controls .archive-sort-direction:focus-visible {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.55);
  filter: none;
}

html[data-digga-theme-effective="dark"] body.app-digga .project-header-inline-controls .archive-sort-direction,
html[data-digga-theme-effective="sunset"] body.app-digga .project-header-inline-controls .archive-sort-direction {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #e8eef3;
  box-shadow:
    0 10px 24px rgba(12, 18, 26, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-header-inline-controls .archive-sort-direction:hover,
html[data-digga-theme-effective="dark"] body.app-digga .project-header-inline-controls .archive-sort-direction:focus-visible,
html[data-digga-theme-effective="sunset"] body.app-digga .project-header-inline-controls .archive-sort-direction:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .project-header-inline-controls .archive-sort-direction:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
}

.project-header-inline-controls .archive-density-controls {
  gap: 0.55rem;
  flex: 0 0 auto;
  min-width: 0;
}

.project-header-density-controls {
  margin-left: 0.2rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 10.25rem;
}

.project-header-density-controls .archive-controls-label {
  white-space: nowrap;
}

.project-header-inline-controls .archive-density-controls input[type="range"] {
  width: 5.5rem;
  flex: 0 0 auto;
}

.archive-gallery-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
  min-width: 0;
}

.archive-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border-radius: 12px;
  overflow: hidden;
  align-content: start;
  min-width: 0;
}

.archive-card h3,
.archive-card p {
  margin: 0;
}

.archive-card-body {
  display: grid;
  gap: 0.35rem;
}

.archive-gallery-grid[data-archive-density="1"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-gallery-grid[data-archive-density="2"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-gallery-grid[data-archive-density="3"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.archive-gallery-grid[data-archive-density="4"] {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.archive-gallery-grid[data-archive-show-image="0"] [data-archive-part="image"],
.archive-gallery-grid[data-archive-show-title="0"] [data-archive-part="title"],
.archive-gallery-grid[data-archive-show-description="0"] [data-archive-part="description"],
.archive-gallery-grid[data-archive-show-date="0"] [data-archive-part="date"],
.archive-gallery-grid[data-archive-show-place="0"] [data-archive-part="place"] {
  display: none;
}

.archive-gallery-grid[data-archive-density="4"] .toolbar,
.archive-gallery-grid[data-archive-density="4"] .archive-card-body,
.archive-gallery-grid[data-archive-density="4"] .archive-meta-grid {
  display: none;
}

.archive-gallery-grid[data-archive-density="4"] .archive-card {
  padding: 0.45rem;
  gap: 0.45rem;
  border-radius: 14px;
}

.archive-gallery-grid[data-archive-density="4"] .archive-thumb-image {
  aspect-ratio: 1 / 1;
}

.archive-load-state {
  margin-top: 0.9rem;
}

.archive-load-sentinel {
  width: 100%;
  height: 1px;
}

.digga-scroll-top-fab {
  width: 2.95rem;
  height: 2.95rem;
  padding: 0;
  cursor: pointer;
  transition: transform 140ms ease;
  flex-shrink: 0;
}

.digga-scroll-top-fab:hover,
.digga-scroll-top-fab:focus-visible {
  transform: translateY(-1px);
}

.digga-scroll-top-fab[hidden] {
  display: none !important;
}

.archive-empty-state {
  grid-column: 1 / -1;
}

.archive-thumb-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}

.media-loading-shell {
  position: relative;
  overflow: hidden;
  background: rgba(214, 220, 226, 0.42);
}

.media-loading-skeleton {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 48%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, rgba(162, 175, 187, 0.24), rgba(210, 218, 226, 0.38));
  background-size: 220px 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: media-skeleton-shimmer 1.35s linear infinite;
}

.media-loading-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  opacity: 1;
  transition: opacity 180ms ease;
}

.media-loading-shell.is-loading.is-managed .media-loading-image {
  opacity: 0;
}

.media-loading-skeleton {
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.media-loading-shell.is-loading.is-managed .media-loading-skeleton {
  opacity: 1;
  transition: opacity 180ms ease;
}

.archive-thumb-image {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.archive-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5, 8, 12, 0.96);
}

.archive-viewer[hidden] {
  display: none !important;
}

body.archive-viewer-open {
  overflow: hidden;
}

.archive-viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.archive-viewer-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
  cursor: grab;
}

.archive-viewer-image.dragging {
  cursor: grabbing;
}

.archive-viewer-nav {
  position: absolute;
  z-index: 2;
  border-radius: 10px;
}

.archive-viewer-prev,
.archive-viewer-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3.1rem;
  height: 3.1rem;
  min-width: 3.1rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.archive-viewer-prev {
  left: 1rem;
}

.archive-viewer-next {
  right: 1rem;
}

.archive-viewer-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.45rem 0.9rem 0.55rem;
  background: rgba(85, 89, 94, 0.88);
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.3;
}

.archive-viewer-led {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.archive-viewer-led::before,
.archive-viewer-led::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.45rem;
  height: 0.18rem;
  border-radius: 999px;
  background: #ffffff;
}

.archive-viewer-led::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.archive-viewer-led::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.archive-viewer-led:hover,
.archive-viewer-led:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.36);
}

.project-meta-grid {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.1rem;
  flex-wrap: nowrap;
  margin: 1rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.project-meta-grid p {
  margin: 0;
  white-space: nowrap;
}

.project-post-card {
  position: relative;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.project-post-card:hover,
.project-post-card:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(35, 49, 38, 0.1);
  border-color: rgba(35, 49, 38, 0.2);
}

.project-post-stretch-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.project-post-card .toolbar,
.project-post-card .danger-icon-form {
  position: relative;
  z-index: 2;
}

.project-post-card .toolbar {
  pointer-events: none;
}

.project-post-card .danger-icon-form,
.project-post-card .danger-icon-form * {
  pointer-events: auto;
}

.project-header-panel {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.2rem 1rem;
  border: 0;
  border-bottom: 1px solid rgba(35, 49, 38, 0.1);
  border-radius: 0;
  box-shadow: none;
  background: rgba(248, 250, 252, 0.985);
  overflow: visible;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.project-page-top-panel {
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.2rem 1rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.project-page-top-band {
  width: 100%;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(35, 49, 38, 0.1);
  background: rgba(248, 250, 252, 0.985);
}

.project-import-panel {
  display: block;
  padding: 0.85rem 1.05rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.project-import-grid {
  display: flex;
  align-items: center;
  gap: 0.8rem 1rem;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.project-import-grid::-webkit-scrollbar {
  height: 0.45rem;
}

.project-import-grid::-webkit-scrollbar-thumb {
  background: rgba(68, 86, 99, 0.26);
  border-radius: 999px;
}

.project-import-grid::-webkit-scrollbar-track {
  background: transparent;
}

.project-import-form {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  min-width: 0;
  flex: 0 0 auto;
}

.project-import-options,
.project-import-form-options {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.project-import-options label,
.project-import-form-options label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.project-import-options-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-import-mode-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-import-option-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.2;
  cursor: pointer;
}

.project-import-option-chip input {
  margin: 0;
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: block;
  flex: 0 0 1rem;
  accent-color: #1d6fd6;
}

.project-import-option-chip span {
  white-space: nowrap;
  font-weight: 600;
}

.project-import-options-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.project-import-button {
  display: inline-flex;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  width: auto;
  min-height: 0;
  padding-inline: 1.15rem;
}

.project-import-button span {
  pointer-events: none;
}

.project-import-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.project-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.project-upload-overlay[hidden] {
  display: none !important;
}

body.project-upload-open {
  overflow: hidden;
}

body.project-upload-open .digga-chat-overlay {
  display: none;
}

.project-upload-overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(248, 190, 82, 0.2), transparent 42%),
    rgba(6, 10, 15, 0.76);
  backdrop-filter: blur(6px);
}

.project-upload-panel {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.1rem 1.2rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(9, 14, 18, 0.38);
}

.project-upload-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-upload-panel-head .eyebrow {
  margin: 0;
}

.project-upload-panel h2 {
  margin: 0;
}

.project-upload-source-target {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  word-break: break-all;
}

.project-upload-source-target:empty {
  display: none;
}

.project-upload-close {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  padding: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, var(--ink) 12%);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
}

.project-upload-close:hover,
.project-upload-close:focus-visible {
  background: rgba(229, 223, 209, 0.98);
}

.project-upload-phase,
.project-upload-name {
  margin: 0;
}

.project-upload-phase {
  color: var(--muted);
}

.project-upload-processing {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent 35%);
  background: color-mix(in srgb, var(--paper) 82%, var(--ink) 18%);
  color: var(--ink);
  font-weight: 650;
}

.project-upload-processing[hidden] {
  visibility: hidden;
}

.project-upload-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--ink) 22%, transparent 78%);
  border-top-color: color-mix(in srgb, var(--accent) 75%, var(--ink) 25%);
  animation: tg-spin 750ms linear infinite;
}

@keyframes tg-spin {
  to {
    transform: rotate(360deg);
  }
}

.project-upload-name {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 86%, var(--ink) 14%);
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.84rem;
  word-break: break-word;
}

.project-upload-meter {
  position: relative;
  height: 1rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, var(--paper) 84%);
}

.project-upload-meter-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #244455, #c6892f 92%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
  transition: width 140ms ease;
}

.project-upload-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.84rem;
}

.project-upload-actions {
  display: flex;
  justify-content: flex-end;
}

.project-header-details {
  display: grid;
  gap: 0;
}

.project-header-collection-form {
  display: none;
}

.project-header-summary {
  list-style: none;
  cursor: default;
  padding-right: 0;
}

.project-header-toggle.glass-chevron-btn {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  border-width: 2px;
  /* Use the global glass-chevron styling */
}

.project-header-toggle.glass-chevron-btn:hover,
.project-header-toggle.glass-chevron-btn:focus-visible {
  /* Use the global glass-chevron styling */
}

.project-header-toggle .project-header-caret {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.project-header-summary::-webkit-details-marker {
  display: none;
}

.project-header-summary-copy > .eyebrow {
  margin: 0 0 0.2rem;
}

.project-header-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  width: 100%;
}

.project-header-title-main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 0 1 auto;
}

.project-header-control-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  margin-top: 0.75rem;
}

.project-header-controls-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  line-height: 1;
  cursor: pointer;
}

.project-header-controls-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.project-header-controls-toggle:hover,
.project-header-controls-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.project-header-controls-inline {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
}

.project-header-title-row h1 {
  margin: 0;
}

.project-header-collection-control {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 min(22rem, 50vw);
  max-width: min(22rem, 50vw);
  margin-left: 0;
}

.project-header-collection-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 238, 243, 0.82);
}

.project-header-collection-control .app-select-wide {
  width: 100%;
}

.project-header-collection-control .app-select {
  min-height: 2.4rem;
  height: 2.4rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.12);
  background-color: rgba(34, 46, 56, 0.88);
  color: #f3f6f8;
  box-shadow: 0 8px 18px rgba(24, 34, 42, 0.18);
}

.project-header-collection-meta {
  font-size: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  align-self: flex-end;
  line-height: 2.4rem;
  flex: 0 0 auto;
}

.project-header-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  min-width: 2.05rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f3f6f8;
  box-shadow:
    0 8px 20px rgba(12, 18, 26, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  line-height: 0;
  transition: transform 140ms ease;
}

.project-header-details[open] .project-header-caret {
  transform: rotate(180deg);
}

.project-header-content {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
}

.project-header-description {
  margin: 0;
  max-width: 58rem;
}

.project-stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 28rem;
}

.project-access-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-stat-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.project-stat-card strong {
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.project-access-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.project-access-panel-copy {
  max-width: 54rem;
}

.project-access-panel-copy .eyebrow,
.project-access-panel-copy h2,
.project-access-panel-copy p {
  margin: 0;
}

.project-access-form {
  display: grid;
  gap: 0.9rem;
}

.project-access-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.project-access-summary-row .meta {
  margin: 0;
}

.project-access-dialog {
  width: min(56rem, calc(100vw - 2rem));
  max-height: min(85vh, 52rem);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(9, 14, 18, 0.34);
}

.project-access-dialog::backdrop {
  background:
    radial-gradient(circle at top, rgba(248, 190, 82, 0.14), transparent 36%),
    rgba(6, 10, 15, 0.62);
  backdrop-filter: blur(5px);
}

.project-access-dialog-shell {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.project-access-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.project-access-dialog-head .eyebrow,
.project-access-dialog-head h3,
.project-access-dialog-head p {
  margin: 0;
}

.project-access-dialog-close {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(29, 39, 47, 0.14);
  background: rgba(238, 233, 221, 0.92);
  color: #1d2730;
  font-size: 1.7rem;
  line-height: 1;
}

.project-access-dialog-close:hover,
.project-access-dialog-close:focus-visible {
  background: rgba(229, 223, 209, 0.98);
}

.directory-import-dialog,
.import-confirm-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(88vh, 56rem);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(9, 14, 18, 0.34);
}

.directory-import-dialog::backdrop,
.import-confirm-dialog::backdrop {
  background:
    radial-gradient(circle at top, rgba(248, 190, 82, 0.14), transparent 36%),
    rgba(6, 10, 15, 0.62);
  backdrop-filter: blur(5px);
}

.directory-import-dialog-shell {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: min(86vh, 54rem);
}

.directory-import-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.directory-import-dialog-head .eyebrow,
.directory-import-dialog-head h3,
.directory-import-dialog-head p {
  margin: 0;
}

.directory-import-dialog-close {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(29, 39, 47, 0.14);
  background: rgba(238, 233, 221, 0.92);
  color: #1d2730;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.directory-import-dialog-close:hover,
.directory-import-dialog-close:focus-visible {
  background: rgba(229, 223, 209, 0.98);
}

.directory-import-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.directory-import-form fieldset legend {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.directory-import-subdir-collections {
  padding-left: 1.2rem;
}

.directory-import-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.import-confirm-summary {
  display: grid;
  grid-template-columns: minmax(0, 11rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
}

.import-confirm-summary dt {
  font-weight: 600;
  margin: 0;
  color: var(--muted);
}

.import-confirm-summary dd {
  margin: 0;
  word-break: break-word;
}

.import-confirm-dialog .directory-import-dialog-head h3 {
  margin: 0;
}

.project-tools-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0.75rem;
}

.project-tools-bar--in-header {
  padding: 0.35rem 0 0;
}

.duplicate-scope-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.button-active {
  background: var(--accent);
  color: #fff;
}

.duplicate-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.duplicate-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.duplicate-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.duplicate-badge--name {
  background: #e3f2fd;
  color: #1565c0;
}

.duplicate-badge--hash {
  background: #fff3e0;
  color: #e65100;
}

.duplicate-badge--both {
  background: #fce4ec;
  color: #c62828;
}

.duplicate-key {
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  color: var(--muted);
}

.duplicate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.duplicate-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
}

.duplicate-thumb {
  width: 100%;
  max-height: 10rem;
  object-fit: cover;
  border-radius: 6px;
}

.duplicate-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6rem;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  border-radius: 6px;
}

.duplicate-card-info strong {
  display: block;
  word-break: break-all;
}

.duplicate-card-action {
  padding-top: 0.25rem;
}

.duplicate-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.project-access-visibility {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-access-visibility legend {
  margin-bottom: 0;
  font-weight: 700;
  color: var(--ink);
}

.project-access-visibility-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.project-access-visibility-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.project-access-visibility-option input[type="radio"] {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  accent-color: #1d6fd6;
  flex: 0 0 auto;
}

.project-access-visibility-option span {
  font-weight: 700;
}

.project-access-visibility-option:has(input:checked) {
  border-color: rgba(126, 214, 164, 0.34);
  background: rgba(87, 140, 117, 0.16);
}

.project-access-user-list {
  display: grid;
  gap: 0.55rem;
  max-height: 23rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.project-access-user-option {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.project-access-user-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.project-access-user-main input {
  margin-top: 0.15rem;
  width: auto;
  min-width: 0;
  padding: 0;
}

.project-access-user-main strong,
.project-access-user-state {
  color: var(--ink);
}

.project-access-user-main .meta {
  display: block;
}

.project-access-user-state {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.project-access-empty {
  margin: 0;
}

.project-access-actions {
  display: flex;
  justify-content: flex-end;
}

.project-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.5rem;
}

.project-info-popover p {
  margin: 0;
}

.project-material-controls {
  margin-bottom: 1rem;
}

.project-header-content .project-material-controls {
  margin: 0;
}

.project-header-inline-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  margin: 0;
}

.project-header-export-form {
  flex: 0 0 auto;
  margin: 0;
  align-self: flex-end;
}

.project-header-export-form .button {
  white-space: nowrap;
}

.project-header-inline-controls .archive-visibility-controls,
.project-header-inline-controls .archive-sort-controls,
.project-header-inline-controls .archive-density-controls {
  flex-wrap: nowrap;
}

.project-material-filter-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.project-material-filter-input {
  width: 100%;
  min-width: 0;
  padding-right: 2rem;
  box-sizing: border-box;
}

.project-material-filter-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: 50%;
  color: inherit;
  opacity: 0.55;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.project-material-filter-clear:hover,
.project-material-filter-clear:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

html[data-digga-theme-effective="dark"] .project-material-filter-clear:hover,
html[data-digga-theme-effective="dark"] .project-material-filter-clear:focus-visible,
html[data-digga-theme-effective="sunset"] .project-material-filter-clear:hover,
html[data-digga-theme-effective="sunset"] .project-material-filter-clear:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.project-header-inline-controls .archive-density-controls input[type="range"] {
  width: 5.5rem;
  flex: 0 0 auto;
}

.material-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  overflow: visible;
  min-width: 0;
}

.material-grid[data-project-density="1"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.material-grid[data-project-density="2"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-grid[data-project-density="3"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.material-grid[data-project-density="4"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.material-grid[data-project-density="5"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.material-grid[data-project-density="6"] {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.material-grid[data-project-density="7"] {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  /* Hjul/trackpad ska scrolla huvudcontainern, inte fastna på täta länkar/miniatyrer. */
  touch-action: pan-y;
}

/* Låt hjul träffa länken, inte img — förbättrar scrollkedja på desktop vid täta miniatyrer. */
body.app-digga .material-grid[data-project-density="7"] .material-thumb-button img {
  pointer-events: none;
}

.material-card {
  display: grid;
  gap: 2px;
  position: relative;
  overflow: visible;
  min-width: 0;
  padding: 2px;
}

.material-card.is-focused {
  outline: 2px solid var(--accent, rgba(212, 160, 58, 0.85));
  outline-offset: 2px;
  border-radius: 18px;
}

@media (max-width: 900px) {
  .material-card.is-focused {
    outline: none;
  }
}

.material-grid[data-project-density="7"] .material-card {
  padding: 2px;
  gap: 2px;
  border-radius: 14px;
}

.material-grid[data-project-density="7"] .material-card-body {
  display: none;
}

.material-card.is-popover-open {
  z-index: 260;
}

.material-media-shell {
  position: relative;
  overflow: visible;
  display: grid;
  justify-items: center;
  margin: 0 auto;
  width: 100%;
  padding-top: 2px;
}

.material-thumb-button {
  display: block;
  width: 100%;
  border-radius: 18px;
  transition: filter 160ms ease, transform 160ms ease;
}

.material-thumb-button:hover,
.material-thumb-button:focus-visible {
  filter: brightness(1.04) contrast(1.02);
  transform: translateY(-1px);
}

/* Global .cover-image sätter height:100%, vilket i material-grid (särskilt tätast läge)
   ger instabila höjder mot grid/aspect-ratio och kan störa scroll när vyn fylls av miniatyrer. */
body.app-digga .material-grid .cover-image {
  height: auto;
}

.material-image {
  border-radius: 18px;
  aspect-ratio: 4 / 3;
}

.material-status-led {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 4;
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(8, 12, 18, 0.18), 0 6px 14px rgba(8, 12, 18, 0.28);
}

.material-status-led.saved {
  background: #2ea44f;
}

.material-status-led.unsaved {
  background: #d73a49;
}

.material-status-led::after,
.material-card-action::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 3800;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.88);
  color: #f6f9fb;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.15rem);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.material-status-led::after {
  top: calc(100% + 0.35rem);
  left: 0;
}

.material-card-action::after {
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translate(-50%, 0.15rem);
}

.material-status-led:hover::after,
.material-status-led:focus-visible::after,
.material-card-action:hover::after,
.material-card-action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.material-card-action:hover::after,
.material-card-action:focus-visible::after {
  transform: translate(-50%, 0);
}

.material-card-actions {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(8, 12, 18, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.material-card.is-popover-open .material-card-actions {
  z-index: 260;
}

.material-card-action,
.material-card-actions .edit-icon-link,
.material-card-actions .danger-icon-button,
.material-card-actions .material-info-trigger {
  position: relative;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  border-radius: 999px;
  box-shadow: none;
}

.material-card-actions .edit-icon-link {
  background: rgba(255, 255, 255, 0.72);
  color: rgba(31, 76, 111, 0.96);
  border-color: rgba(255, 255, 255, 0.48);
  font-size: 0.78rem;
}

.material-card-actions .edit-icon-link .material-card-action-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.material-card-actions .edit-icon-link:hover,
.material-card-actions .edit-icon-link:focus-visible {
  background: #ffffff;
  color: rgba(19, 59, 89, 1);
  border-color: rgba(255, 255, 255, 0.92);
}

.material-card-actions .danger-icon-button {
  background: rgba(255, 255, 255, 0.72);
  color: rgba(159, 47, 47, 0.88);
  border-color: rgba(255, 255, 255, 0.48);
}

.material-card-actions .danger-icon-button:hover,
.material-card-actions .danger-icon-button:focus-visible {
  background: #ffffff;
  color: rgba(159, 47, 47, 1);
  border-color: rgba(255, 255, 255, 0.92);
}

.material-flag-picker {
  position: relative;
}

.material-flag-picker--filter .material-flag-button {
  width: 2.85rem;
  height: 2.85rem;
  min-width: 2.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.material-flag-picker--filter .material-flag-dot {
  width: 1.2rem;
  height: 0.9rem;
}

.material-flag-button {
  --material-flag-red: #d73a49;
  --material-flag-orange: #f97316;
  --material-flag-yellow: #facc15;
  --material-flag-green: #2ea44f;
  --material-flag-blue: #2563eb;
  --material-flag-purple: #9333ea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(31, 76, 111, 0.96);
}

.material-flag-button:hover,
.material-flag-button:focus-visible,
.material-flag-button[aria-expanded="true"] {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.92);
}

.material-flag-dot {
  position: relative;
  display: block;
  width: 0.95rem;
  height: 0.72rem;
  margin-left: 0.12rem;
  border-radius: 0.13rem 0.16rem 0.16rem 0.13rem;
  border: 1px solid rgba(8, 12, 18, 0.24);
  background: var(--material-flag-color, rgba(255, 255, 255, 0.48));
  box-shadow: inset 0 0 0 1px rgba(8, 12, 18, 0.05);
}

.material-flag-dot::before {
  content: "";
  position: absolute;
  left: -0.2rem;
  top: -0.12rem;
  width: 0.12rem;
  height: 1.12rem;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.52);
}

.material-flag-button[data-material-flag-color="red"] .material-flag-dot,
.material-flag-option-icon--red {
  background: #d73a49;
}

.material-flag-button[data-material-flag-color="orange"] .material-flag-dot,
.material-flag-option-icon--orange {
  background: #f97316;
}

.material-flag-button[data-material-flag-color="yellow"] .material-flag-dot,
.material-flag-option-icon--yellow {
  background: #facc15;
}

.material-flag-button[data-material-flag-color="green"] .material-flag-dot,
.material-flag-option-icon--green {
  background: #2ea44f;
}

.material-flag-button[data-material-flag-color="blue"] .material-flag-dot,
.material-flag-option-icon--blue {
  background: #2563eb;
}

.material-flag-button[data-material-flag-color="purple"] .material-flag-dot,
.material-flag-option-icon--purple {
  background: #9333ea;
}

.material-flag-menu {
  position: fixed;
  left: var(--material-flag-menu-left, 0.5rem);
  top: var(--material-flag-menu-top, 0.5rem);
  z-index: 3600;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 2.25rem;
  gap: 0.28rem;
  width: 7.6rem;
  min-height: 5.2rem;
  padding: 0.42rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 18, 0.92);
  color: #f6f9fb;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.material-flag-menu[hidden] {
  display: none;
}

.material-flag-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: inherit;
}

.material-flag-option:hover,
.material-flag-option:focus-visible,
.material-flag-option.is-selected {
  background: rgba(255, 255, 255, 0.13);
  filter: none;
}

.material-flag-option-icon {
  position: relative;
  display: block;
  width: 1.15rem;
  height: 0.9rem;
  border-radius: 0.16rem 0.18rem 0.18rem 0.16rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38), 0 5px 10px rgba(0, 0, 0, 0.18);
}

.material-flag-option-icon::before {
  content: "";
  position: absolute;
  left: -0.18rem;
  top: -0.1rem;
  width: 0.12rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(246, 249, 251, 0.88);
}

@keyframes media-skeleton-shimmer {
  from {
    background-position: -220px 0, 0 0;
  }
  to {
    background-position: calc(100% + 220px) 0, 0 0;
  }
}

.material-grid[data-project-density="7"] .material-image {
  aspect-ratio: 1 / 1;
}

.material-file-preview {
  min-height: 210px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(35, 70, 52, 0.06), rgba(139, 94, 52, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  width: 100%;
}

.material-grid[data-project-density="7"] .material-file-preview {
  min-height: auto;
  aspect-ratio: 1 / 1;
  font-size: 0.9rem;
}

.material-card-body {
  display: grid;
  gap: 0;
  padding: 0 0.35rem 0.2rem;
}

.material-card-body strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.material-card-body a {
  text-decoration: none;
}

.material-move-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.material-move-bar--top {
  position: relative;
  top: auto;
  z-index: 1;
  margin-top: 0.35rem;
  margin-bottom: 0;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border) 45%);
  box-shadow: 0 10px 24px rgba(9, 14, 18, 0.12);
}

.material-move-bar form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.material-move-bar select {
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

.material-select-check {
  cursor: pointer;
  display: none;
  align-items: center;
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  z-index: 6;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(8, 12, 18, 0.12);
  box-shadow: 0 6px 16px rgba(8, 12, 18, 0.16);
}

body.material-move-mode .material-select-check {
  display: flex;
}

.material-select-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.material-move-bar--top {
  display: grid;
  gap: 0.5rem;
}

.material-move-start {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.material-move-start label {
  margin: 0;
  font-weight: 600;
}

.material-info {
  position: relative;
  z-index: 2;
}

.material-card-actions .material-info {
  position: static;
}

.material-info-trigger {
  width: 1.7rem;
  height: 1.7rem;
  min-width: 1.7rem;
  padding: 0;
  border-radius: 999px;
  background: rgba(247, 250, 255, 0.92);
  color: rgba(24, 78, 177, 0.92);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(35, 49, 38, 0.16);
}

.material-info-trigger:hover,
.material-info-trigger:focus-visible {
  background: rgba(240, 246, 255, 1);
  color: rgba(19, 61, 141, 1);
  border-color: rgba(37, 99, 235, 0.32);
  filter: none;
}

.material-info-popover {
  position: absolute;
  width: min(20rem, calc(100vw - 2rem));
  max-height: min(22rem, calc(100vh - 3rem));
  overflow: auto;
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(247, 250, 255, 0.98);
  box-shadow: 0 18px 32px rgba(35, 49, 38, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.2rem);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
  z-index: 6;
}

.material-info-popover[data-popover-placement="up-left"] {
  right: calc(100% + 0.55rem);
  bottom: 0;
}

.material-info-popover[data-popover-placement="up-right"] {
  left: calc(100% + 0.55rem);
  bottom: 0;
}

.material-info-popover[data-popover-placement="down-left"] {
  right: calc(100% + 0.55rem);
  top: 0;
}

.material-info-popover[data-popover-placement="down-right"] {
  left: calc(100% + 0.55rem);
  top: 0;
}

.material-info-popover[data-popover-placement^="up-"] {
  transform: translateY(0.2rem);
}

.material-info-popover[data-popover-placement^="down-"] {
  transform: translateY(-0.2rem);
}

.material-info-popover p {
  margin: 0;
  color: var(--ink);
}

.material-info:hover .material-info-popover,
.material-info:focus-within .material-info-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.material-info-popover--portal {
  position: fixed;
  left: var(--material-popover-left, 0.5rem);
  top: var(--material-popover-top, 0.5rem);
  right: auto !important;
  bottom: auto !important;
  z-index: 3600;
  transform: translateY(0.2rem);
}

.material-info-popover--portal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-card-actions .edit-icon-link {
  background: rgba(20, 30, 42, 0.78);
  color: rgba(236, 243, 248, 0.96);
  border-color: rgba(236, 243, 248, 0.26);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-card-actions .edit-icon-link:hover,
html[data-digga-theme-effective="dark"] body.app-digga .material-card-actions .edit-icon-link:focus-visible {
  background: rgba(236, 243, 248, 0.94);
  color: rgba(10, 16, 22, 0.96);
  border-color: rgba(236, 243, 248, 0.58);
}

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

.chat-invite-menu {
  margin-bottom: 1rem;
}

.chat-menu-toggle {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.chat-menu-toggle::-webkit-details-marker {
  display: none;
}

.chat-invite-menu[open] .list-clean {
  margin-top: 0.75rem;
}

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

.button-small {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

body.app-auth.admin-tui {
  --bg: #06110a;
  --paper: rgba(9, 20, 12, 0.96);
  --ink: #f5f7fb;
  --muted: #b8c6d8;
  --field-ink: #aee7ff;
  --edit-ink: #ffad47;
  --line: rgba(133, 228, 148, 0.18);
  --accent-2: #12391c;
  --danger: #ff7e74;
  --ok: #8ef0a0;
  font-family: "Courier New", Courier, monospace;
  color-scheme: dark;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 4px),
    radial-gradient(circle at top left, rgba(106, 228, 126, 0.12), transparent 28%),
    #040904;
  color: var(--ink);
}

body.app-auth.admin-tui .site-header,
body.app-auth.admin-tui .page-shell {
  width: min(1380px, calc(100vw - 2rem));
}

body.app-auth.admin-tui .site-header {
  padding-top: 0.8rem;
  padding-bottom: 0.55rem;
  align-items: center;
}

body.app-auth.admin-tui .brand-link,
body.app-auth.admin-tui .brand-tag,
body.app-auth.admin-tui .main-nav a,
body.app-auth.admin-tui .user-pill,
body.app-auth.admin-tui .button,
body.app-auth.admin-tui button,
body.app-auth.admin-tui input,
body.app-auth.admin-tui textarea,
body.app-auth.admin-tui select,
body.app-auth.admin-tui .panel,
body.app-auth.admin-tui .card,
body.app-auth.admin-tui .meta,
body.app-auth.admin-tui code {
  font-family: inherit;
}

body.app-auth.admin-tui .brand-tag,
body.app-auth.admin-tui .meta,
body.app-auth.admin-tui .card p,
body.app-auth.admin-tui .panel p {
  color: var(--muted);
}

body.app-auth.admin-tui h1,
body.app-auth.admin-tui h2,
body.app-auth.admin-tui h3,
body.app-auth.admin-tui strong,
body.app-auth.admin-tui th,
body.app-auth.admin-tui td,
body.app-auth.admin-tui label,
body.app-auth.admin-tui .brand-link,
body.app-auth.admin-tui .admin-console-nav a,
body.app-auth.admin-tui .admin-db-table-link,
body.app-auth.admin-tui .eyebrow,
body.app-auth.admin-tui code {
  color: var(--ink);
}

body.app-auth.admin-tui .main-nav a,
body.app-auth.admin-tui .button,
body.app-auth.admin-tui button {
  background: rgba(18, 57, 28, 0.94);
  border: 1px solid rgba(133, 228, 148, 0.26);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
}

body.app-auth.admin-tui .user-pill {
  border: 1px solid rgba(133, 228, 148, 0.16);
  border-radius: 10px;
  background: rgba(18, 57, 28, 0.5);
}

body.app-auth.admin-tui input,
body.app-auth.admin-tui textarea,
body.app-auth.admin-tui select {
  border-radius: 10px;
  border-color: rgba(255, 173, 71, 0.34);
  background: rgba(5, 14, 8, 0.96);
  color: var(--field-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 173, 71, 0.08);
  caret-color: var(--edit-ink);
}

body.app-auth.admin-tui input::placeholder,
body.app-auth.admin-tui textarea::placeholder {
  color: rgba(174, 231, 255, 0.52);
}

body.app-auth.admin-tui input:focus,
body.app-auth.admin-tui textarea:focus,
body.app-auth.admin-tui select:focus {
  outline: 1px solid rgba(255, 173, 71, 0.48);
  border-color: rgba(255, 173, 71, 0.56);
}

body.app-auth.admin-tui .button,
body.app-auth.admin-tui button,
body.app-auth.admin-tui .button-small,
body.app-auth.admin-tui .danger-icon-button,
body.app-auth.admin-tui .admin-db-table-link strong,
body.app-auth.admin-tui .admin-console-stat strong,
body.app-auth.admin-tui .eyebrow {
  color: var(--edit-ink);
}

body.app-auth.admin-tui .panel,
body.app-auth.admin-tui .card {
  border-radius: 12px;
  background: rgba(6, 14, 9, 0.96);
  border-color: rgba(133, 228, 148, 0.16);
  box-shadow: 0 0 0 1px rgba(133, 228, 148, 0.05), 0 18px 38px rgba(0, 0, 0, 0.28);
}

body.app-auth.admin-tui .panel,
body.app-auth.admin-tui .card,
body.app-auth.admin-tui .flash {
  padding: 0.95rem;
}

body.app-auth.admin-tui .flash {
  border: 1px solid rgba(133, 228, 148, 0.16);
  border-radius: 10px;
}

body.app-auth.admin-tui .flash-success {
  background: rgba(20, 58, 28, 0.78);
}

body.app-auth.admin-tui .flash-error {
  background: rgba(63, 20, 20, 0.8);
}

.admin-console-shell {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.admin-console-header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.admin-console-copy {
  max-width: 56rem;
}

.admin-console-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: min(32rem, 55%);
}

.admin-console-stat {
  border: 1px solid rgba(133, 228, 148, 0.16);
  border-radius: 10px;
  background: rgba(7, 18, 10, 0.94);
  padding: 0.65rem 0.75rem;
  display: grid;
  gap: 0.2rem;
}

.admin-console-stat span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-console-stat strong {
  font-size: 0.92rem;
}

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

.admin-console-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(133, 228, 148, 0.16);
  background: rgba(7, 18, 10, 0.86);
  text-decoration: none;
  font-size: 0.86rem;
}

.admin-console-nav a.is-current {
  background: rgba(20, 58, 28, 0.96);
}

.admin-workspace {
  align-items: start;
}

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

.admin-form-pane {
  max-width: none;
}

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

.admin-record-card {
  gap: 0.65rem;
}

.admin-user-log-preview {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(133, 228, 148, 0.12);
  display: grid;
  gap: 0.45rem;
}

.admin-user-log-list {
  display: grid;
  gap: 0.35rem;
}

.admin-user-log-list li {
  display: grid;
  gap: 0.1rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(7, 18, 10, 0.72);
  border: 1px solid rgba(133, 228, 148, 0.1);
}

.admin-log-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-log-filter-actions {
  grid-column: 1 / -1;
  align-self: end;
}

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

.admin-log-prune {
  align-items: center;
  flex-wrap: wrap;
}

.admin-log-table-wrap {
  overflow-x: auto;
}

.admin-log-table {
  min-width: 1100px;
}

.admin-log-table td {
  vertical-align: top;
}

.admin-log-metadata summary {
  cursor: pointer;
  color: var(--muted);
}

.admin-log-metadata pre {
  margin: 0.45rem 0 0;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(7, 18, 10, 0.78);
  overflow: auto;
  font-size: 0.8rem;
}

.admin-db-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.admin-db-sidebar {
  position: sticky;
  top: 1rem;
}

.admin-db-table-link {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(133, 228, 148, 0.16);
  background: rgba(7, 18, 10, 0.82);
  text-decoration: none;
}

.admin-db-table-link.is-current {
  background: rgba(20, 58, 28, 0.96);
}

.admin-db-main {
  display: grid;
  gap: 0.8rem;
}

.admin-db-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-db-create-menu {
  position: relative;
}

.admin-db-create-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 173, 71, 0.26);
  background: rgba(255, 173, 71, 0.08);
  color: var(--edit-ink);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.admin-db-create-toggle::-webkit-details-marker {
  display: none;
}

.admin-db-create-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(42rem, calc(100vw - 4rem));
  padding: 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(133, 228, 148, 0.16);
  background: rgba(6, 14, 9, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.admin-db-create-popover h3 {
  margin-bottom: 0.65rem;
}

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

.admin-db-form textarea,
.admin-db-span {
  grid-column: 1 / -1;
}

.admin-db-table-wrap {
  overflow: auto;
}

.admin-db-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-db-table th,
.admin-db-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.52rem 0.58rem;
  border-bottom: 1px solid rgba(133, 228, 148, 0.12);
  white-space: nowrap;
  font-size: 0.88rem;
}

.admin-db-table th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-db-table td {
  color: var(--ink);
}

.admin-db-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 173, 71, 0.26);
  background: rgba(255, 173, 71, 0.08);
  color: var(--edit-ink);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
}

.admin-db-edit-link:hover {
  background: rgba(255, 173, 71, 0.16);
}

.admin-db-table tr.is-current {
  background: rgba(20, 58, 28, 0.42);
}

body.app-auth.admin-tui .danger-icon-button {
  border-radius: 8px;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
}

@media (max-width: 1180px) {
  .archive-preview-panel {
    position: static;
  }

  .archive-preview-image {
    max-height: min(52vh, 28rem);
  }
}

@media (max-width: 900px) {
  body.app-digga {
    overflow: hidden;
  }

  .digga-frame {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .digga-body-scroller {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
  }

  .digga-topbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .digga-sidebar-panel {
    width: min(24rem, calc(100vw - 2rem));
    max-height: calc(100vh - 5rem);
  }

  .digga-main-shell {
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0.85rem 0.85rem 5.75rem;
  }

  .hero,
  .two-column,
  .chat-layout,
  .archive-layout,
  .archive-workspace,
  .admin-db-layout,
  .portal-grid,
  .metric-strip,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

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

  .archive-preview-image {
    max-height: min(46vh, 22rem);
  }

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

  .archive-document-pages {
    grid-template-columns: 1fr;
  }

  .archive-filter-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .archive-layout > .panel,
  .project-header-panel,
  #project-material.panel {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .project-header-panel {
    width: 100%;
    padding: 0.85rem;
    margin: 0;
    border-radius: 0;
  }

  .project-header-controls-toggle {
    display: inline-flex;
  }

  .project-header-control-row {
    display: none;
  }

  .project-header-control-row.is-controls-open {
    display: flex;
    flex-wrap: wrap;
  }

  /* Touch-events ska träffa länken, inte img — förbättrar scrollkedja på mobil. */
  body.app-digga .material-grid .material-thumb-button img {
    pointer-events: none;
  }

  /* På mobil byter vi pilknapparna i bildvisaren mot swipe-gester. */
  .archive-viewer-prev,
  .archive-viewer-next {
    display: none;
  }

  .project-page-top-panel {
    width: 100%;
    margin: 0;
    padding: 0.85rem;
  }

  .archive-browser-controls,
  .project-material-controls,
  .archive-results-header,
  .archive-visibility-controls,
  .archive-density-controls,
  .archive-sort-controls {
    min-width: 0;
  }

  .archive-gallery-grid {
    gap: 0.7rem;
  }

  .archive-gallery-grid[data-archive-density="1"],
  .archive-gallery-grid[data-archive-density="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-gallery-grid[data-archive-density="3"],
  .archive-gallery-grid[data-archive-density="4"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .archive-card {
    padding: 0.55rem;
    gap: 0.5rem;
  }

  .material-grid {
    gap: 0.75rem;
  }

  .material-grid[data-project-density="1"],
  .material-grid[data-project-density="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-grid[data-project-density="3"],
  .material-grid[data-project-density="4"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .material-grid[data-project-density="5"],
  .material-grid[data-project-density="6"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .material-grid[data-project-density="7"] {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .material-card {
    gap: 0.4rem;
  }

  .material-grid[data-project-density="7"] .material-card {
    padding: 0.35rem;
  }

  .material-image,
  .material-grid[data-project-density="7"] .material-image,
  .archive-thumb-image,
  .archive-gallery-grid[data-archive-density="4"] .archive-thumb-image {
    aspect-ratio: 1 / 1;
  }

  .material-file-preview {
    min-height: auto;
    aspect-ratio: 1 / 1;
  }

  .project-import-grid {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .dashboard-intro {
    grid-template-columns: 1fr;
    padding: 1.4rem;
  }

  .project-header-summary {
    padding-right: 0;
  }

  .project-header-title-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .project-header-title-main {
    width: 100%;
    flex-basis: 100%;
  }

  .project-header-control-row {
    flex-wrap: wrap;
  }

  .project-header-inline-controls {
    flex-wrap: wrap;
  }

  .project-header-collection-control {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .project-header-collection-control .app-select-wide {
    width: 100%;
  }

  .project-header-density-controls {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

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

  .project-access-summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-access-dialog {
    width: min(100vw - 1rem, 56rem);
  }

  .digga-chat-overlay {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .digga-chat-bubble-stack {
    width: auto;
    justify-content: flex-end;
  }

  .digga-chat-bubble {
    flex: 0 0 auto;
  }

  .digga-chat-window {
    width: 100%;
    max-height: min(86vh, 46rem);
  }

  .digga-chat-invite {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .digga-chat-invite-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .digga-chat-compose-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-access-user-option {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-access-user-state {
    text-align: left;
  }

  .project-info-popover {
    width: min(22rem, calc(100vw - 3rem));
    right: 0;
  }

  .archive-filter-panel {
    position: static;
  }

  .site-header {
    flex-direction: column;
  }

  .admin-console-header,
  .admin-console-stats,
  .admin-form-grid,
  .admin-log-filter-grid,
  .admin-db-form {
    grid-template-columns: 1fr;
  }
}

/* Vårsol: ljus vårpalett (samma beteende som ljust för logotyper m.m.) */
html[data-digga-theme-effective="varsol"] body.app-digga {
  --bg: #c9e3cd;
  --paper: rgba(244, 252, 238, 0.94);
  --ink: #1f3a2c;
  --muted: #4a6b5a;
  --accent: #d4a03a;
  --accent-2: #2f6b47;
  --line: rgba(47, 107, 71, 0.22);
  --danger: #a33c2a;
  --ok: #2d6a4f;
  --shadow: 0 22px 48px rgba(45, 90, 62, 0.14);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 232, 168, 0.45), transparent 40%),
    radial-gradient(circle at 88% 6%, rgba(150, 215, 165, 0.55), transparent 40%),
    linear-gradient(180deg, rgba(228, 244, 230, 0.97), rgba(196, 226, 200, 0.95)),
    #c9e3cd;
  color-scheme: light;
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-topbar {
  background: rgba(244, 252, 238, 0.9);
  border-bottom-color: rgba(47, 107, 71, 0.18);
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-sidebar-footer {
  border-top-color: rgba(47, 107, 71, 0.14);
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-theme-menu {
  background: rgba(244, 252, 238, 0.98);
  border-color: rgba(47, 107, 71, 0.14);
  box-shadow: 0 18px 34px rgba(45, 90, 62, 0.16);
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-theme-option:hover,
html[data-digga-theme-effective="varsol"] body.app-digga .digga-theme-option:focus-visible {
  background: rgba(212, 160, 58, 0.14);
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-theme-option.is-active {
  background: rgba(47, 107, 71, 0.12);
}

html[data-digga-theme-effective="varsol"] body.app-digga .digga-theme-option.is-active::before {
  background: var(--accent);
}

html[data-digga-theme-effective="sunset"] body.app-digga {
  --bg: #271d25;
  --paper: rgba(56, 41, 49, 0.94);
  --ink: #f7ede7;
  --muted: #d5bbb0;
  --accent: #f29b6b;
  --accent-2: #6f8d83;
  --line: rgba(247, 237, 231, 0.12);
  --danger: #ff9a87;
  --ok: #8fd9af;
  --shadow: 0 18px 42px rgba(12, 7, 11, 0.34);
  background:
    radial-gradient(circle at top left, rgba(255, 166, 116, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(216, 104, 111, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(60, 39, 50, 0.96), rgba(30, 21, 28, 1)),
    var(--bg);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-topbar {
  background: rgba(32, 23, 30, 0.88);
  border-bottom-color: rgba(247, 237, 231, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .project-header-panel,
html[data-digga-theme-effective="sunset"] body.app-digga .project-page-top-band {
  background:
    linear-gradient(180deg, rgba(42, 29, 37, 0.985), rgba(30, 21, 28, 0.985));
  border-bottom-color: rgba(247, 237, 231, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-sidebar {
  color: var(--ink);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-sidebar-panel {
  background: rgba(35, 25, 32, 0.96);
  border-color: rgba(247, 237, 231, 0.08);
  box-shadow: 0 24px 46px rgba(12, 7, 11, 0.36);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-sidebar-toggle,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-topbar-brand,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-brand-link,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-nav a,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-subnav a,
html[data-digga-theme-effective="sunset"] body.app-digga .project-header-description,
html[data-digga-theme-effective="sunset"] body.app-digga .project-meta-grid p,
html[data-digga-theme-effective="sunset"] body.app-digga .project-meta-grid strong,
html[data-digga-theme-effective="sunset"] body.app-digga .project-stat-card strong,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-panel-copy h2 {
  color: var(--ink);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-sidebar-toggle,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-trigger,
html[data-digga-theme-effective="sunset"] body.app-digga .chat-menu-toggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(247, 237, 231, 0.1);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(12, 7, 11, 0.2);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-brand-tag,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-current,
html[data-digga-theme-effective="sunset"] body.app-digga .project-import-options-label,
html[data-digga-theme-effective="sunset"] body.app-digga .project-stat-card .eyebrow,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-panel-copy .eyebrow,
html[data-digga-theme-effective="sunset"] body.app-digga .project-stat-card .meta,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-panel-copy p.meta,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-user-main .meta,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-user-state,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-mode-option span {
  color: var(--muted);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-nav a,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-subnav a {
  background: transparent;
  border-color: transparent;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-nav a:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-nav a:focus-visible,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-subnav a:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-subnav a:focus-visible {
  color: #fff6f0;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-subnav-project-spinner::after {
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: #f29b6b;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-nav-icon,
html[data-digga-theme-effective="sunset"] body.app-digga .project-info-trigger,
html[data-digga-theme-effective="sunset"] body.app-digga .material-info-trigger {
  background: rgba(242, 155, 107, 0.16);
  color: #ffd6bf;
  border-color: rgba(242, 155, 107, 0.22);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-menu,
html[data-digga-theme-effective="sunset"] body.app-digga .project-info-popover,
html[data-digga-theme-effective="sunset"] body.app-digga .material-info-popover,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-person-suggestions {
  background: rgba(44, 31, 39, 0.98);
  border-color: rgba(247, 237, 231, 0.1);
  box-shadow: 0 18px 32px rgba(12, 7, 11, 0.32);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option,
html[data-digga-theme-effective="sunset"] body.app-digga .material-info-popover p,
html[data-digga-theme-effective="sunset"] body.app-digga .material-info-popover strong,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-person-suggestion,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-dialog-head .eyebrow,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-dialog-head h3,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-dialog-head p,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-summary-row .meta,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-empty,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-user-main strong {
  color: var(--ink);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option::before {
  box-shadow: inset 0 0 0 1.5px rgba(247, 237, 231, 0.24);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option:focus-visible,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-person-suggestion:hover,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-person-suggestion:focus-visible,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-person-suggestion.is-active {
  background: rgba(242, 155, 107, 0.12);
  color: #fff8f4;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option.is-active {
  background: rgba(242, 155, 107, 0.18);
  color: #fff3ea;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-theme-option.is-active::before {
  background: #f29b6b;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-window,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-dialog-shell {
  background: rgba(50, 36, 44, 0.98);
  border-color: rgba(247, 237, 231, 0.08);
  box-shadow: 0 24px 46px rgba(12, 7, 11, 0.38);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-header,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-composer {
  border-color: rgba(247, 237, 231, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro {
  background:
    radial-gradient(circle at top right, rgba(242, 155, 107, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(64, 43, 54, 0.98), rgba(43, 30, 37, 0.98));
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-title {
  color: #ffbc92;
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-rule {
  background: linear-gradient(90deg, rgba(255, 188, 146, 0.34), rgba(143, 217, 175, 0.1));
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-lead {
  color: #fff1e8;
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-body,
html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-feature p {
  color: #dfc5b8;
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-feature h2 {
  color: #fce6da;
}

html[data-digga-theme-effective="sunset"] body.app-digga .dashboard-intro-feature-icon {
  box-shadow: inset 0 0 0 1px rgba(247, 237, 231, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .project-import-panel,
html[data-digga-theme-effective="sunset"] body.app-digga .project-stat-card,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-panel,
html[data-digga-theme-effective="sunset"] body.app-digga .hero,
html[data-digga-theme-effective="sunset"] body.app-digga .panel,
html[data-digga-theme-effective="sunset"] body.app-digga .card,
html[data-digga-theme-effective="sunset"] body.app-digga .metric,
html[data-digga-theme-effective="sunset"] body.app-digga .timeline-item,
html[data-digga-theme-effective="sunset"] body.app-digga .chat-thread,
html[data-digga-theme-effective="sunset"] body.app-digga .comment {
  background:
    linear-gradient(180deg, rgba(62, 45, 54, 0.96), rgba(49, 36, 43, 0.96));
  border-color: rgba(247, 237, 231, 0.1);
  box-shadow: var(--shadow);
}

html[data-digga-theme-effective="sunset"] body.app-digga input,
html[data-digga-theme-effective="sunset"] body.app-digga textarea,
html[data-digga-theme-effective="sunset"] body.app-digga select,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-preview-image,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-index-item,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-document-panel,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-document-page,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-filter-panel input,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-filter-panel select,
html[data-digga-theme-effective="sunset"] body.app-digga .user-pill,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-user-option,
html[data-digga-theme-effective="sunset"] body.app-digga .project-access-dialog-close,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-tab,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-user-option,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-message,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-empty,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-mode-switch,
html[data-digga-theme-effective="sunset"] body.app-digga .status-pill,
html[data-digga-theme-effective="sunset"] body.app-digga .flash-info {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(247, 237, 231, 0.1);
}

html[data-digga-theme-effective="sunset"] body.app-digga .archive-mode-option input:checked + span {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  box-shadow: none;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-tab.is-active,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-message-row.is-own .digga-chat-message,
html[data-digga-theme-effective="sunset"] body.app-digga .archive-index-item.current {
  background: rgba(242, 155, 107, 0.14);
  border-color: rgba(242, 155, 107, 0.28);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-tab.is-unread,
html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-invite {
  border-color: rgba(143, 217, 175, 0.24);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-new-button {
  border-color: rgba(143, 217, 175, 0.22);
  background: #5c8f7a;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-new-button:disabled {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(247, 237, 231, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-invite-badge {
  background: rgba(143, 217, 175, 0.14);
  color: #a8f0c3;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-online-text {
  color: #a8f0c3;
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-typing {
  background: rgba(255, 255, 255, 0.08);
}

html[data-digga-theme-effective="sunset"] body.app-digga .digga-chat-typing span {
  background: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga {
  --bg: #0f171d;
  --paper: rgba(17, 25, 32, 0.94);
  --ink: #ecf3f8;
  --muted: #a8bbc8;
  --accent: #c59357;
  --accent-2: #3f6a58;
  --line: rgba(236, 243, 248, 0.12);
  --danger: #ff8c73;
  --ok: #7ed6a4;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  background:
    radial-gradient(circle at top left, rgba(197, 147, 87, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(18, 31, 39, 0.96), rgba(11, 18, 24, 1)),
    var(--bg);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-topbar {
  background: rgba(10, 16, 22, 0.86);
  border-bottom-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-header-panel {
  background: rgba(8, 13, 18, 0.985);
  border-bottom-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-page-top-band {
  background: rgba(8, 13, 18, 0.985);
  border-bottom-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-sidebar {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-sidebar-panel {
  background: rgba(10, 16, 22, 0.96);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.38);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-sidebar-toggle,
html[data-digga-theme-effective="dark"] body.app-digga .digga-topbar-brand,
html[data-digga-theme-effective="dark"] body.app-digga .digga-brand-link,
html[data-digga-theme-effective="dark"] body.app-digga .digga-nav a,
html[data-digga-theme-effective="dark"] body.app-digga .digga-subnav a {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-sidebar-toggle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-brand-tag {
  color: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-nav a,
html[data-digga-theme-effective="dark"] body.app-digga .digga-subnav a {
  background: transparent;
  border-color: transparent;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-trigger {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(236, 243, 248, 0.08);
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-current {
  color: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-menu {
  background: rgba(13, 21, 31, 0.98);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.32);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option::before {
  box-shadow: inset 0 0 0 1.5px rgba(236, 243, 248, 0.22);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option:hover,
html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option.is-active {
  background: rgba(126, 214, 164, 0.14);
  color: #d9f5e7;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-theme-option.is-active::before {
  background: #7ed6a4;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-nav a:hover,
html[data-digga-theme-effective="dark"] body.app-digga .digga-nav a:focus-visible,
html[data-digga-theme-effective="dark"] body.app-digga .digga-subnav a:hover,
html[data-digga-theme-effective="dark"] body.app-digga .digga-subnav a:focus-visible {
  color: #ffffff;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-subnav-project-spinner::after {
  border-color: rgba(236, 243, 248, 0.22);
  border-top-color: #7ed6a4;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-nav-icon {
  background: rgba(96, 165, 250, 0.14);
  color: rgba(191, 219, 254, 0.95);
}

html[data-digga-theme-effective="dark"] body.app-digga .chat-menu-toggle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(236, 243, 248, 0.08);
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-window {
  background: rgba(17, 25, 32, 0.98);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro {
  background:
    radial-gradient(circle at top right, rgba(197, 147, 87, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(18, 27, 34, 0.98), rgba(14, 21, 27, 0.98));
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-title {
  color: #d9a07a;
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-rule {
  background: linear-gradient(90deg, rgba(223, 154, 108, 0.28), rgba(126, 214, 164, 0.1));
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-lead {
  color: #ecf3f8;
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-body,
html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-feature p {
  color: #b8c7d1;
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-feature h2 {
  color: #d6e2ea;
}

html[data-digga-theme-effective="dark"] body.app-digga .dashboard-intro-feature-icon {
  box-shadow: inset 0 0 0 1px rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-header,
html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-composer {
  border-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-tab {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: none;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-tab.is-active {
  background: rgba(87, 140, 117, 0.2);
  border-color: rgba(126, 214, 164, 0.24);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-tab.is-unread {
  border-color: rgba(126, 214, 164, 0.36);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-new-button {
  border-color: rgba(126, 214, 164, 0.24);
  background: #3a9460;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-new-button:disabled {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-user-option,
html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-message,
html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-empty {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-invite {
  background: rgba(126, 214, 164, 0.08);
  border-color: rgba(126, 214, 164, 0.14);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-invite-badge {
  background: rgba(126, 214, 164, 0.16);
  color: #7ed6a4;
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-message-row.is-own .digga-chat-message {
  background: rgba(87, 140, 117, 0.18);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-typing {
  background: rgba(255, 255, 255, 0.06);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-typing span {
  background: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .digga-chat-online-text {
  color: #7ed6a4;
}

html[data-digga-theme-effective="dark"] body.app-digga .project-import-options-label {
  color: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-import-option-chip {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-import-panel {
  background: rgba(17, 25, 32, 0.88);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: var(--shadow);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-stat-card,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-panel {
  background:
    linear-gradient(180deg, rgba(26, 36, 44, 0.98), rgba(20, 29, 36, 0.98));
  border-color: rgba(236, 243, 248, 0.12);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-stat-card strong,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-panel-copy h2,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-summary-row .meta,
html[data-digga-theme-effective="dark"] body.app-digga .project-header-description,
html[data-digga-theme-effective="dark"] body.app-digga .project-meta-grid p,
html[data-digga-theme-effective="dark"] body.app-digga .project-meta-grid strong {
  color: #ecf3f8;
}

html[data-digga-theme-effective="dark"] body.app-digga .project-stat-card .eyebrow,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-panel-copy .eyebrow {
  color: #b7c9d4;
}

html[data-digga-theme-effective="dark"] body.app-digga .project-stat-card .meta,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-panel-copy p.meta,
html[data-digga-theme-effective="dark"] body.app-digga .project-meta-grid p {
  color: #c7d4dc;
}

html[data-digga-theme-effective="dark"] body.app-digga .hero,
html[data-digga-theme-effective="dark"] body.app-digga .panel,
html[data-digga-theme-effective="dark"] body.app-digga .card,
html[data-digga-theme-effective="dark"] body.app-digga .metric,
html[data-digga-theme-effective="dark"] body.app-digga .timeline-item,
html[data-digga-theme-effective="dark"] body.app-digga .chat-thread,
html[data-digga-theme-effective="dark"] body.app-digga .comment {
  background: rgba(17, 25, 32, 0.94);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: var(--shadow);
}

html[data-digga-theme-effective="dark"] body.app-digga input,
html[data-digga-theme-effective="dark"] body.app-digga textarea,
html[data-digga-theme-effective="dark"] body.app-digga select {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(236, 243, 248, 0.12);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-preview-image,
html[data-digga-theme-effective="dark"] body.app-digga .archive-index-item,
html[data-digga-theme-effective="dark"] body.app-digga .archive-document-panel,
html[data-digga-theme-effective="dark"] body.app-digga .archive-document-page,
html[data-digga-theme-effective="dark"] body.app-digga .archive-filter-panel input,
html[data-digga-theme-effective="dark"] body.app-digga .archive-filter-panel select,
html[data-digga-theme-effective="dark"] body.app-digga .user-pill {
  background: rgba(255, 255, 255, 0.06);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-mode-switch {
  background: rgba(255, 255, 255, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-mode-option span {
  color: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-mode-option input:checked + span {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  box-shadow: none;
}

html[data-digga-theme-effective="dark"] body.app-digga .project-info-trigger {
  background: rgba(96, 165, 250, 0.14);
  color: rgba(191, 219, 254, 0.95);
  border-color: rgba(96, 165, 250, 0.22);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-shell {
  background: rgba(17, 25, 32, 0.98);
  border-color: rgba(236, 243, 248, 0.08);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.42);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-head .eyebrow,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-head h3,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-head p,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-summary-row .meta,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-empty,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-user-main strong {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-user-main .meta,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-user-state {
  color: var(--muted);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-user-option {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(236, 243, 248, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-close {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(236, 243, 248, 0.08);
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-close:hover,
html[data-digga-theme-effective="dark"] body.app-digga .project-access-dialog-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

html[data-digga-theme-effective="dark"] body.app-digga .project-info-popover {
  background: rgba(13, 21, 31, 0.96);
  border-color: rgba(96, 165, 250, 0.2);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-info-trigger {
  background: rgba(96, 165, 250, 0.14);
  color: rgba(191, 219, 254, 0.95);
  border-color: rgba(96, 165, 250, 0.22);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-info-popover {
  background: rgba(13, 21, 31, 0.96);
  color: var(--ink);
  border-color: rgba(96, 165, 250, 0.2);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}

html[data-digga-theme-effective="dark"] body.app-digga .material-info-popover p,
html[data-digga-theme-effective="dark"] body.app-digga .material-info-popover strong {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-person-suggestions {
  background: rgba(13, 21, 31, 0.98);
  border-color: rgba(236, 243, 248, 0.1);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-person-suggestion {
  color: var(--ink);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-person-suggestion:hover,
html[data-digga-theme-effective="dark"] body.app-digga .archive-person-suggestion:focus-visible,
html[data-digga-theme-effective="dark"] body.app-digga .archive-person-suggestion.is-active {
  background: rgba(96, 165, 250, 0.14);
}

html[data-digga-theme-effective="dark"] body.app-digga .archive-index-item.current {
  background: rgba(126, 214, 164, 0.12);
  border-color: rgba(126, 214, 164, 0.34);
}

html[data-digga-theme-effective="dark"] body.app-digga .status-pill {
  background: rgba(255, 255, 255, 0.08);
}

html[data-digga-theme-effective="dark"] body.app-digga .flash-info {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
