
/* ========================================= */
/* 1. MASTER THEME VARIABLES                 */
/* ========================================= */

:root {
  /* Typography */
  --font-serif: 'Merriweather', serif;
  --font-sans: 'Open Sans', 'Merriweather Sans', sans-serif;
  --transition-speed: 300ms;

  /* Default Theme: (Dark) */
  --bg-base: #121214;
  /* Deepest background */
  --bg-panel: #1e1e24;
  /* Elevated surface (Cards, Sections) */
  --bg-hover: #2a2a35;
  /* Interactive elements */
  --bg-glass: rgba(18, 18, 20, 0.85);

  --text-primary: #f8f9fa;
  /* High contrast text (Headings, data) */
  --text-secondary: #adb5bd;
  /* Muted text (Labels, descriptions) */
  --text-tertiary: #7f8488;
  /* Muted text (Labels, descriptions) */

  --border-subtle: #2d2d36;
  /* Dividers, table borders */
  --border-strong: #495057;
  /* Inputs, active states */

  --accent-primary: #428bca;
  /* Links, Primary Buttons */
  --accent-hover: #3071a9;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}



/* Theme Override: LIGHT MODE (Crisp & Clinical) */
body.theme-light {
  --bg-base: #f4f5f7;
  --bg-panel: #ffffff;
  --bg-hover: #e9ecef;
  --bg-glass: rgba(244, 245, 247, 0.85);

  --text-primary: #212529;
  --text-secondary: #6c757d;

  --border-subtle: #dee2e6;
  --border-strong: #ced4da;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
}

body.theme-sepia {
  --bg-base: #f4eee9;
  --bg-panel: #faf5f0;
  --bg-hover: #ece1d8;
  --bg-glass: rgba(250, 245, 240, 0.85);

  --text-primary: #332218;
  --text-secondary: #8c5838;

  --border-subtle: #e6d7cc;
  --border-strong: #d9b8a3;

  --accent-primary: #c26938;
  --accent-hover: #9e5025;

  --shadow-sm: 0 2px 4px rgba(51, 34, 24, 0.04);
  --shadow-lg: 0 10px 15px rgba(51, 34, 24, 0.07);
}

body.theme-olive {
  --bg-base: #1c2016;
  --bg-panel: #607456;
  --bg-hover: #71876a;
  --bg-glass: rgba(28, 32, 22, 0.85);

  --text-primary: #f2f0e2;
  --text-secondary: #c7cdb4;
  --text-tertiary: #8f9880;

  --border-subtle: #2c3122;
  --border-strong: #4d5a3f;

  --accent-primary: #b8964f;
  --accent-hover: #8f7238;

  --shadow-sm: 0 4px 6px -1px rgba(28, 32, 22, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(28, 32, 22, 0.7);
}

body.theme-darkvanilla {
  --bg-base: #1a140e;
  --bg-panel: #2a2019;
  --bg-hover: #3a2c22;
  --bg-glass: rgba(26, 20, 14, 0.85);

  --text-primary: #f5ead2;
  --text-secondary: #c9b494;
  --text-tertiary: #9c8768;

  --border-subtle: #241b13;
  --border-strong: #5c4a35;

  --accent-primary: #d4a24e;
  --accent-hover: #a8752e;

  --shadow-sm: 0 4px 6px -1px rgba(26, 20, 14, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(26, 20, 14, 0.7);
}

body.theme-coral {
  --bg-base: #fff3ea;
  --bg-panel: #fffaf5;
  --bg-hover: #ffe4d1;
  --bg-glass: rgba(255, 243, 234, 0.85);
  --text-primary: #3a2a24;
  --text-secondary: #8a6f66;
  --text-tertiary: #b6a49b;
  --border-subtle: #ffe0cc;
  --border-strong: #ffb997;
  --accent-primary: #ff6f61;
  --accent-hover: #e14f3d;
  --shadow-sm: 0 2px 4px rgba(58, 42, 36, 0.08);
  --shadow-lg: 0 10px 15px rgba(58, 42, 36, 0.12);
}

body.theme-blueprint {
  --bg-base: #16181a;
  --bg-panel: #202325;
  --bg-hover: #2c3033;
  --bg-glass: rgba(22, 24, 26, 0.85);
  --text-primary: #eef0f1;
  --text-secondary: #9ba1a5;
  --text-tertiary: #6c7275;
  --border-subtle: #1c1f21;
  --border-strong: #454b4e;
  --accent-primary: #2f9bf0;
  --accent-hover: #1f78c2;
  --shadow-sm: 0 4px 6px -1px rgba(22, 24, 26, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(22, 24, 26, 0.7);
}

body.theme-mud {
    --bg-base: #3a2b20;
    --bg-panel: #4a3728;
    --bg-hover: #5a4232;
    --bg-glass: rgba(58, 43, 32, 0.85);
    --text-primary: #f0e4d4;
    --text-secondary: #c2a688;
    --text-tertiary: #937c64;
    --border-subtle: #2f2318;
    --border-strong: #6b503b;
    --accent-primary: #c07847;
    --accent-hover: #9c5f34;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

body.theme-coffee {
  --bg-base: #211712;
  --bg-panel: #2e2119;
  --bg-hover: #3b2a20;
  --bg-glass: rgba(33, 23, 18, 0.85);
  --text-primary: #e8dbc9;
  --text-secondary: #a68f79;
  --text-tertiary: #7d6a5a;
  --border-subtle: #281c15;
  --border-strong: #5c4433;
  --accent-primary: #a8683f;
  --accent-hover: #8a5330;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.45);
}

/* Theme Override: Meadow (Natural & Grounded) */
body.theme-meadow {
  --bg-base: #d2d4c8;
  --bg-panel: #e0e2db;
  --bg-hover: #d5d8cd;
  --bg-glass: rgba(224, 226, 219, 0.85);
  --text-primary: #2e3532;
  --text-secondary: #52605a;
  --text-tertiary: #6c756f;
  --border-subtle: #c3c5b8;
  --border-strong: #7c8178;
  --accent-primary: #8b2635;
  --accent-hover: #641b27;
  --shadow-sm: 0 2px 4px rgba(46, 53, 50, 0.12);
  --shadow-lg: 0 10px 15px rgba(46, 53, 50, 0.18);
}

/* Theme Override: Forest (Deep & Calm) */
body.theme-forest {
  --bg-base: #2e2c2f;
  --bg-panel: #475b63;
  --bg-hover: #729b79;
  --bg-glass: rgba(46, 44, 47, 0.85);
  --text-primary: #eef2ec;
  --text-secondary: #bacdb0;
  --text-tertiary: #96a993;
  --border-subtle: #455256;
  --border-strong: #4c5f66;
  --accent-primary: #818061;
  --accent-hover: #5c7268;
  --shadow-sm: 0 4px 6px -1px rgba(46, 44, 47, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(46, 44, 47, 0.7);
}

/* Theme Override: Retro (Warm & Nostalgic) */
body.theme-retro {
  --bg-base: #eee0cc; 
  --bg-panel: #f8efdf; 
  --bg-hover: #e0c4a7;
  --bg-glass: rgba(238, 224, 204, 0.85);
  --text-primary: #4a2f22; 
  --text-secondary: #8a6e58; 
  --text-tertiary: #a68a6f;
  --border-subtle: #d7bfa3; 
  --border-strong: #ba6a4c;
  --accent-primary: #7b2525; 
  --accent-hover: #5b1b1b;
  --shadow-sm: 0 2px 4px rgba(123, 37, 37, 0.12); 
  --shadow-lg: 0 10px 15px rgba(123, 37, 37, 0.18);
}

body.theme-indigo {
    --bg-base: #12101c;
    --bg-panel: #201c33;
    --bg-hover: #2c2745;
    --bg-glass: rgba(18, 16, 28, 0.85);
    --text-primary: #eae7f5;
    --text-secondary: #a9a3c4;
    --text-tertiary: #756f95;
    --border-subtle: #1c1930;
    --border-strong: #453f6b;
    --accent-primary: #8262c9;
    --accent-hover: #6449a3;
    --shadow-sm: 0 4px 6px -1px rgba(18, 16, 28, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(18, 16, 28, 0.7);
}

/* ========================================= */
/* 2. BASE STYLES & TYPOGRAPHY               */
/* ========================================= */

body {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  /* UI gets Sans by default */
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

body::-webkit-scrollbar {
  width: 0.5rem;
}

body::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-header,
.article-title,
.card-title {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 800;
}

main {
  margin-left: 70px;
  /* padding: 1rem; */
}

.content-section,
.infobox,
.card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed) ease;
}

.content-section {
  padding: 40px 30px;
  margin-bottom: 20px;
}

.list-group-item {
  color: var(--text-secondary);
  background-color: var(--bg-panel);
  border-color: var(--border-subtle);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.jumbotron,
.archive-container {
  background-color: var(--bg-panel);
}

.alert-light {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  border-color: var(--border-subtle);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: 0px !important;
}

h1 {
  font-weight: 800;
}

.bg-steel {
  background-color: #314757;
}

.royal-purple {
  background-color: #7851a9;
}

.dark-blue {
  background-color: #5156a9;
}

.gold {
  background: linear-gradient(to bottom, #cfc09f 27%, #ffecb3 40%, #a67f2f 78%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
  position: relative;
  margin: 0;
}

.gold::after {
  background: none;
  content: attr(data-heading) / "";
  left: 0;
  top: 0;
  z-index: -1;
  position: absolute;
  text-shadow:
    -1px 0 1px #c6bb9f,
    0 1px 1px #c6bb9f,
    5px 5px 10px rgba(0, 0, 0, 0.4),
    -5px -5px 10px rgba(0, 0, 0, 0.4);
}

.gold::marker {
  content: "❤";
  color: #ff0000;
  -webkit-text-fill-color: transparent;
  font-size: 1.2em;
  margin-right: 0.5em;
}

.content-block {
  padding: 4rem 2rem;
}


/* ------------------------ */
/* --------NAV BAR--------- */
/* ------------------------ */

.menu-dropdown .icon svg {
  fill: currentColor;
  height: 2em;
  width: auto;
  transition: fill var(--transition-speed) ease;
}

.menu-dropdown li:hover .icon svg {
  fill: var(--accent-hover);
}

.navbar {
  color: #cbd5db;
  height: 3.5rem;
}

.site-header .navbar-nav .nav-link {
  color: #cbd5db;
  font-family: 'Merriweather', serif;
  font-weight: 800;
  font-size: 1em;
}

.site-header .navbar-nav .nav-link:hover {
  color: #ffffff;
}

.site-header .navbar-nav .nav-link.focus {
  color: #ffffff;
}

.form-control {
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-strong);
}

.form-control:focus {
  color: var(--text-primary);
  background-color: var(--bg-base);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 .2rem rgba(66, 139, 202, .25);
}

.infobox {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  /* Differentiates it slightly from the panel */
  position: relative;
  padding: .75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: .25rem;
  line-height: 1.75;
}

.article-title {
  color: var(--text-primary);
  font-weight: 800;
  text-align: center;
}

.underline {
  position: relative;
}

.underline span {
  pointer-events: none;
}

.underline canvas {
  pointer-events: auto;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--text-primary);
  /*z-index: -1;*/
  user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  cursor: pointer;
}

a.article-title:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.article-content {
  white-space: pre-line;
  padding: 30px 30px 0px 0px;
}

.article-img {
  object-fit: cover;
  max-height: 65px;
  max-width: 65px;
  margin-right: 16px;
}

.article-metadata {
  padding-bottom: 1px;
  margin-bottom: 4px;
}

/*
  .article-metadata a:hover {
    color: #333;
    text-decoration: none;
  }
  */

.article-svg {
  width: 25px;
  height: 25px;
  vertical-align: middle;
}

.profilmeny .profil-bio ul li {
  flex: revert;
  width: 100%;
  padding: 0 10px;
  text-align: left;
  list-style-type: square;
}

.account-img {
  height: 125px;
  width: 125px;
  margin-right: 20px;
  margin-bottom: 16px;
}

.account-heading {
  font-size: 2rem;
}

.card-img-top {
  filter: contrast(80%);
  height: 14rem;
  object-fit: cover;
  object-position: 50% 20%;
  transition: all 0.5s cubic-bezier(.43, .41, .22, .91);
}

.card:hover .card-img-top {
  filter: contrast(100%);
}

.card {
  /* background-color: rgb(0, 0, 0, 0.4); */
  border-radius: 0.25rem;
  box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .5);
  width: 15rem;
}

.card:hover {
  border-radius: 0.25rem;
  box-shadow: 0 30px 40px -16px rgba(0, 0, 0, .5);
  bottom: 2px;
}

.card-body {
  padding: 0rem;
}

.card-title {
  margin-bottom: .5rem;
  font-weight: 800;
  font-size: .8em;
  color: var(--text-primary);
}

.card-title a {
  display: block;
  padding: 1rem;
}

.card a {
  color: var(--text-primary);
}

.card-title a:hover {
  text-decoration: underline;
}

.card-text {
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 400;
  font-size: .8rem;
}

.card-hidden-content {
  display: none;
}

.card-body:hover>.card-hidden-content {
  display: block;
}

.zoom-in {
  cursor: zoom-in;
}

.themed-input {
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-strong) !important;
  transition: all var(--transition-speed) ease-in-out;

}

.themed-input::placeholder {
  color: var(--text-tertiary) !important;
}

.themed-input:focus {
  background-color: var(--bg-panel) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.25rem var(--bg-hover) !important;
}

.themed-label {
  color: var(--text-secondary);
}

.ai-choice-card {
  cursor: pointer;
  background-color: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  border-radius: 0.375rem;
  transition: all var(--transition-speed) ease-in-out;
  opacity: 0.65;
  padding: 1em;
}

.ai-choice-card:hover:not(.locked-card) {
  border-color: var(--border-strong);
  background-color: var(--bg-hover);
  opacity: 0.9;
}

.ai-choice-card.active-choice {
  border-color: var(--accent-primary);
  background-color: var(--bg-hover);
  opacity: 1;
  box-shadow: var(--shadow-sm);
}

/* Card Typography & Badges */
.ai-choice-card .ai-title {
  color: var(--text-primary);
  transition: color var(--transition-speed) ease-in-out;
}

.active-choice .ai-title {
  color: var(--accent-primary);
}

.ai-choice-card .ai-desc {
  color: var(--text-secondary);
}

.ai-choice-card .ai-badge {
  background-color: var(--bg-base);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.75em;
  font-weight: 700;
  transition: all var(--transition-speed) ease-in-out;
}

.active-choice .ai-badge {
  background-color: var(--accent-primary);
  color: var(--bg-panel);
  border-color: var(--accent-primary);
}

.locked-card {
  cursor: not-allowed;
  opacity: 0.4;
  background-color: var(--bg-base);
  filter: grayscale(100%);
}

.locked-text {
  color: var(--accent-hover);
}

.gaudygoldframe {
  border: 20px solid transparent;
  padding: 0px;
  object-fit: cover;
  border-image: url(images/uglyframe.jpg) 50 round;
  box-shadow: 0 5px 7px -5px rgba(0, 0, 0, 5);
  margin-top: 13px;
}

.btn {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  color: white;
}

.btn-primary {
  color: #fff;
  background-color: var(--accent-primary);
  border-color: var(--border-subtle);
}

.btn-primary:hover {
  color: #fff;
  background-color: var(--accent-hover);
  border-color: var(--border-strong);
}

.modal-content {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.table {
  color: var(--text-secondary);
}

.table thead th {
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-strong);
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table td,
.table th {
  border-top: 1px solid var(--border-subtle);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.03);
  /* Works in both light/dark */
}

.table-hover tbody tr:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}


/*  Når tabellen ekspanderes i mobilvisning */

td.child {
  background-color: var(--bg-hover);
  background-image: repeating-linear-gradient(0deg, var(--bg-hover), var(--bg-hover) 2px, var(--bg-panel) 2px, var(--bg-panel) 4px);
  border: 1px solid var(--border-subtle);
  padding: 10px 10px;
  list-style: none;
}

td.child>ul>li {
  list-style: none;
  font-size: .8rem;
}

td.child>ul>li>a>img {
  margin: 0rem !important;
}

td.child>ul {
  margin-bottom: 0rem;
}


/* END DATATABLES */


.page-item.active .page-link {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff !important;
}

.page-item.disabled .page-link {
  background-color: var(--bg-base);
  border-color: var(--border-subtle);
  color: var(--text-secondary) !important;
}

.page-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary) !important;
  border-color: var(--border-strong);
}

.page-link {
  position: relative;
  display: block;
  padding: .5rem .75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: var(--accent-primary);
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-speed) ease;
}

.list-group-item-darker {
  color: var(--text-secondary);
  background-color: var(--bg-hover);
}

.list-group-item-darker:active {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.list-group-item-darker:hover {
  z-index: 1;
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--border-subtle);
}

.archive-picture {
  border-radius: 3px;
  max-width: 1100px;
}

.archive-entry {
  width: max-content;
  margin: 0 auto;
}

.archive-description {
  display: inline-block;
  width: 100%;
}

.fill-height {
  min-height: calc(100vh - 2rem);
}

.galleryimage {
  max-width: 12vw;
}

.index-svg-icons {
  fill: var(--text-primary);
  height: 1.2em;
  vertical-align: bottom;
  margin-right: 0.1em;
  transition: all 0.2s ease-in-out;
  margin-left: 0.8em;
}



hr {
  border-top: 1px dotted var(--border-strong);
  margin-right: 14rem;
  margin-left: 1rem;
}

/* ========================= */
/* -------- MOBILE  -------- */
/* ========================= */

@media (max-width: 768px) {

  main {
    margin-left: 0px;
  }

  .content-block {
    padding: 2rem 15px;
  }

  .archive-entry {
    width: 100%;
  }

  hr {
    margin-right: 1rem;
  }

  .galleryimage {
    max-width: 45%;
    margin-bottom: 10px;
  }

  .infobox,
  .article-content,
  .card-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .primary-nav>.hamburger {
    display: none !important;
  }

  .mobile-bottom-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--bg-glass);
    /* Dynamic Blur Background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    /* Dynamic Text */
    text-decoration: none;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 700;
    width: 100%;
    height: 100%;
    transition: color 0.2s ease;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:active {
    color: var(--accent-primary);
    /* Highlights the icon when tapped */
    text-decoration: none;
  }

  .bottom-nav-item svg {
    height: 24px;
    width: 24px;
    margin-bottom: 4px;
    fill: currentColor;
  }

  main {
    padding-bottom: 90px !important;
  }

  /* Hide the vertical sidebar  */
  .primary-nav {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 10000;
    height: 100vh;
    width: 250px;
  }

  /* When the 'Mer' button is tapped (adds openNav to HTML), slide it in! */
  html.openNav .primary-nav {
    transform: translateX(0);
  }

  /* Add a dark shadow over the site when the menu is open */
  html.openNav body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    z-index: 9999;
    pointer-events: auto;
  }

}

.account-page {
  max-width: 1040px;
}

.account-profile-card,
.account-preferences {
  border-radius: 14px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.account-img {
  display: block;
  margin: 0;
  object-fit: cover;
}

.avatar-picker {
  position: relative;
  display: block;
  flex: 0 0 125px;
  width: 125px;
  height: 125px;
  overflow: hidden;
  border: 3px solid var(--bg-panel);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-primary), var(--shadow-lg);
  cursor: pointer;
}

.avatar-picker:focus-within {
  outline: 3px solid var(--accent-primary);
  outline-offset: 4px;
}

.avatar-picker-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, .68);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.avatar-picker:hover .avatar-picker-overlay,
.avatar-picker:focus-within .avatar-picker-overlay {
  opacity: 1;
}

.avatar-picker-overlay svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.account-eyebrow {
  margin: 0 0 .3rem;
  color: var(--accent-primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.account-heading {
  margin-bottom: .25rem;
}

.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avatar-upload-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-size: .9rem;
}

.avatar-upload-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  border-radius: 50%;
  font-weight: 800;
}

.person-portrait-picker {
  width: min(210px, 100%);
  height: min(210px, 100vw - 4rem);
  margin-inline: auto;
  border-radius: 1rem;
}

.person-portrait-picker .account-img {
  width: 100%;
  height: 100%;
}

.person-portrait-remove {
  max-width: 210px;
  margin-inline: auto;
}

.portrait-crop-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .72);
}

.portrait-crop-dialog[hidden] {
  display: none !important;
}

.portrait-crop-dialog__panel {
  width: min(100%, 34rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 1rem;
  color: var(--text-primary);
  background: var(--bg-panel);
  box-shadow: var(--shadow-lg);
}

.portrait-crop-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
}

.portrait-crop-open {
  overflow: hidden;
}

.portrait-crop-dialog #portrait-crop-canvas {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin-inline: auto;
  cursor: grab;
  touch-action: none;
}

.portrait-crop-dialog #portrait-crop-canvas:active {
  cursor: grabbing;
}

.preferences-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.preference-title {
  margin-bottom: .8rem;
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

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

.selection-card {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .65rem;
  padding: .8rem .7rem;
  color: var(--text-primary);
  text-align: left;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

a.selection-card:hover,
a.selection-card:focus,
button.selection-card:hover,
button.selection-card:focus {
  color: var(--text-primary);
  text-decoration: none;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  outline: none;
}

.selection-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.selection-card.is-selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-sm);
}

.selection-card:disabled {
  cursor: wait;
  opacity: .7;
}

.selection-card-icon,
.theme-swatch {
  display: inline-flex;
  flex: 0 0 2rem;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  border-radius: 8px;
}

.theme-swatch {
  border: 1px solid var(--border-strong);
}

.swatch-dark { background: linear-gradient(135deg, #111827 50%, #3b82f6 50%); }
.swatch-light { background: linear-gradient(135deg, #ffffff 50%, #dbeafe 50%); }
.swatch-sepia { background: linear-gradient(135deg, #fff3e8 50%, #f56a00 50%); }
.swatch-olive { background: linear-gradient(135deg, #607456 50%, #b8964f 50%); }
.swatch-darkvanilla { background: linear-gradient(135deg, #2a2019 50%, #d4a24e 50%); }
.swatch-coral { background: linear-gradient(135deg, #fff3ea 50%, #ff6f61 50%); }
.swatch-blueprint { background: linear-gradient(135deg, #202325 50%, #2f9bf0 50%); }
.swatch-mud { background: linear-gradient(135deg, #4a3728 50%, #c07847 50%); }
.swatch-coffee { background: linear-gradient(135deg, #2e2119 50%, #a8683f 50%); }
.swatch-meadow { background: linear-gradient(135deg, #d3efbd 50%, #8b2635 50%); }
.swatch-forest { background: linear-gradient(135deg, #475b63 50%, #729b79 50%); }
.swatch-retro { background: linear-gradient(135deg, #eee0cc 50%, #7b2525 50%); }
.swatch-custom { background: linear-gradient(135deg, #4b5563 50%, #a855f7 50%); }
.swatch-indigo { background: linear-gradient(135deg, #8262c9 50%, #12101c 50%); }


.selection-card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.selection-card-content strong {
  overflow: hidden;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-card-content small {
  margin-top: .18rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-indicator {
  position: absolute;
  top: -.42rem;
  right: -.42rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  background: var(--accent-primary);
  border: 2px solid var(--bg-panel);
  border-radius: 50%;
}

.preference-status {
  min-height: 1.3rem;
  color: var(--text-secondary);
  font-size: .85rem;
}

@media (max-width: 767.98px) {
  .content-section { padding: 28px 20px; }
  .account-identity { align-items: flex-start; }
  .selection-grid { grid-template-columns: 1fr; }
}

