@import url('https://fonts.googleapis.com/css2?family=Alegreya:wght@700&family=Nunito:ital,wght@0,400;0,500;0,700;0,800;1,500&display=swap');

:root { --light-page-bg: #fff; color-scheme: light; font: 16px Nunito, Arial, sans-serif; color: #163737; background: var(--light-page-bg); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
body { margin: 0; min-height: 100vh; scrollbar-gutter: stable; overflow-x: hidden; background: var(--light-page-bg) url('./assets/site-background.jpg') center 60% / cover fixed no-repeat; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #819e8d; border-radius: 10px; background: #f4f5e9; color: #163737; padding: .55rem .8rem; }
button:hover:not(:disabled) { background: #e0ebda; }
button:disabled { opacity: .55; cursor: not-allowed; }
.masthead { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: .5rem; height: 84px; padding: 0 1.5rem; border-bottom: 1px solid rgba(132, 177, 139, .28); background: linear-gradient(115deg, #153f34, #246047 62%, #34735a); box-shadow: 0 5px 22px rgba(0, 19, 13, .2); color: #fff8e8; }
.brand { display: flex; align-items: center; gap: .65rem; min-width: 205px; }
.brand-mark { display: block; width: 2.4rem; height: 2.4rem; object-fit: contain; }
.brand strong { display: block; font: 800 2rem Nunito, Arial, sans-serif; line-height: 1; }
.header-controls { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.mobile-menu-panel { display: contents; }
.account-controls { display: flex; align-items: center; gap: .55rem; margin-left: 0; padding-left: .85rem; border-left: 1px solid rgba(132, 177, 139, .45); }
#sign-out { flex-shrink: 0; white-space: nowrap; }
.theme-control { display: grid; justify-items: center; gap: 3px; margin-left: auto; }
.theme-label { color: #e5eee0; font-size: .58rem; font-weight: 700; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.theme-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; width: 72px; height: 30px; padding: 0 7px; border: 1px solid rgba(242, 248, 235, .58); border-radius: 999px; background: rgba(213, 232, 201, .1); color: #e5eee0; font-size: .55rem; font-weight: 700; cursor: pointer; box-shadow: inset 0 1px 2px rgba(255, 255, 255, .18), 0 2px 5px rgba(20, 49, 38, .14); transition: background .2s ease, border-color .2s ease; }
.theme-toggle:hover:not(:disabled) {
  border-color: rgba(242, 248, 235, .58);
  background: rgba(213, 232, 201, .1);
  color: #e5eee0;
}

.theme-state { position: relative; z-index: 1; margin-left: auto; text-transform: uppercase; }
.theme-knob { position: absolute; z-index: 2; top: 50%; left: 4px; width: 22px; height: 22px; border: 1px solid rgba(255, 255, 255, .82); border-radius: 50%; background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .98), rgba(238, 250, 239, .68) 38%, rgba(173, 215, 189, .42) 100%); box-shadow: 0 2px 7px rgba(20, 49, 38, .3), inset 1px 1px 2px rgba(255, 255, 255, .92), inset -2px -2px 4px rgba(82, 137, 108, .2); transform: translateY(-50%); transition: transform .22s ease, background .22s ease; }
body.dark-mode .theme-knob { transform: translate(42px, -50%); background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .98), rgba(214, 239, 221, .72) 38%, rgba(126, 187, 148, .5) 100%); }
body.dark-mode .theme-state { margin-left: 0; }
#account-name { display: inline-flex; align-items: center; gap: .45rem; text-align: right; }
.masthead nav { display: flex; gap: .3rem; }
.masthead nav button, #sign-out { background: transparent; color: #fff8e8; border-color: transparent; }
.masthead nav button:not(.active):hover:not(:disabled) { border-color: transparent; background: transparent; box-shadow: none; color: #f2c96b; }
.masthead nav button.active { border-color: transparent; background: transparent url('./assets/active-tab-frame.png') center / 100% 100% no-repeat; color: #f2c96b; }
.mobile-menu-toggle { display: none; }
#account-name { margin-left: auto; color: #fff8e8; font-weight: 700; white-space: nowrap; border: 0; background: transparent; padding: .35rem .5rem; }
#account-name:hover:not(:disabled) { background: rgba(255, 248, 232, .14); }
#sign-out { border-color: #749a88; }
.auth-panel { max-width: 460px; margin: 7vh auto; background: #fffdf4; border: 1px solid #c1cbb9; border-radius: 18px; padding: 2rem; box-shadow: 0 8px 32px #23432d18; }
.auth-panel h1, .panel h1, .panel h2 { font-family: Nunito, Arial, sans-serif; font-weight: 800; }
.auth-panel h1 { margin-top: 0; font-size: 2.1rem; }
.auth-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.auth-modal-backdrop,
.auth-modal-backdrop:hover:not(:disabled) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(10, 35, 27, .44) !important; box-shadow: none; transition: none; backdrop-filter: blur(7px) saturate(.9); -webkit-backdrop-filter: blur(7px) saturate(.9); }
.auth-modal-card { position: relative; width: min(100%, 460px); max-height: calc(100vh - 2rem); overflow: auto; background: #fffdf4; border: 1px solid #c1cbb9; border-radius: 18px; padding: 2rem; box-shadow: 0 18px 60px rgba(10, 35, 27, .32); }
.auth-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.auth-modal-card h1 { margin: 0; font-size: 2rem; }
.auth-modal-close { flex: 0 0 auto; padding: .15rem .55rem; border: 0; background: transparent; font-size: 1.7rem; line-height: 1; }
.auth-modal-close:hover:not(:disabled) { background: #e0ebda; }
.auth-error { margin: 1rem 0 -.5rem; color: #a23d35; font-size: .9rem; font-weight: 700; }
.auth-error.success { color: #2f6b4c; }
.auth-text-button { margin-top: .75rem; padding: 0; border: 0; background: transparent; box-shadow: none; color: #265847; text-decoration: underline; }
.auth-text-button:hover:not(:disabled) { background: transparent; box-shadow: none; }
body.dark-mode .auth-text-button { color: #c8dfb8; }
.auth-modal-card :is(input, select)[aria-invalid] { border-color: #a23d35; outline: 2px solid #a23d3533; }
body.auth-modal-open { overflow: hidden; }
form label { display: block; margin: .65rem 0; font-weight: 700; }
input:not([type=checkbox]):not([type=file]), select, textarea { display: block; width: 100%; min-width: 0; margin-top: .25rem; border: 1px solid #a4b6a5; background: #fffefa; color: #163737; border-radius: 8px; padding: .6rem .7rem; }
#card-search, #deck-card-search, #card-search::placeholder, #deck-card-search::placeholder { font-family: Nunito, Arial, sans-serif; }
#card-form select[name="terrain"]:disabled { border-color: #b9c1bb; background: #e3e6e3; color: #6b756f; cursor: not-allowed; opacity: 1; }
select { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select option { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-card-picker { position: relative; margin-top: .25rem; }
.favorite-card-native { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.favorite-card-trigger { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 2.55rem; margin: 0; text-align: left; }
.favorite-card-trigger .card-type-icon, .favorite-card-option .card-type-icon { width: 1.6rem; height: 1.6rem; object-fit: contain; flex: 0 0 auto; }
.favorite-card-option .card-kind-icon { width: 1.6rem; height: 1.6rem; }
.favorite-card-option { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.favorite-card-option:hover:not(:disabled) { background: #e0ebda; }
.favorite-card-option-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-card-option-label.terrain-flow { color: #35758e; }
.favorite-card-option-label.terrain-radiance { color: #a87318; }
.favorite-card-option-label.terrain-symbiosis { color: #784997; }
.favorite-card-option-label.terrain-verdant { color: #488057; }
.favorite-card-menu { position: absolute; z-index: 25; top: calc(100% + .25rem); left: 0; right: 0; max-height: 280px; overflow-y: auto; padding: .25rem; border: 1px solid #a4b6a5; border-radius: 10px; background: #fffefa; box-shadow: 0 10px 24px #16373733; }
.favorite-card-hover-preview { position: fixed; z-index: 60; width: 250px; height: 350px; pointer-events: none; filter: drop-shadow(0 10px 20px #16373755); }
.favorite-card-hover-preview canvas { display: block; width: 100%; height: 100%; border-radius: 12px; background: #ece6d8; }
input[type=file] { display: block; width: 100%; margin-top: .3rem; font-weight: 400; }
input[type=file]::file-selector-button { margin-right: .6rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #163737; padding: .55rem .8rem; font: inherit; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #e0ebda; color: #163737; }
#card-field-modal input[type=file]::file-selector-button { border-color: transparent; background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
#card-field-modal input[type=file]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.06); background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #card-field-modal input[type=file]::file-selector-button { border-color: #416853; background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28); }
body:not(.dark-mode) #card-field-modal input[type=file]::file-selector-button { border-color: transparent; background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2); text-transform: capitalize; }
body:not(.dark-mode) #card-field-modal input[type=file]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #card-field-modal input[type=file]::file-selector-button { border-color: #416853; background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28); text-transform: capitalize; }
body.dark-mode #card-field-modal input[type=file]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#card-field-modal .artwork-file-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
#card-field-modal .artwork-file-button { margin-right: .6rem; }
#card-field-modal .artwork-file-name { font-size: .85rem; overflow-wrap: anywhere; }
body:not(.dark-mode) #card-field-modal .artwork-file-button { border-color: transparent; background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
body:not(.dark-mode) #card-field-modal .artwork-file-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #card-field-modal .artwork-file-button { border-color: #416853; background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
body.dark-mode #card-field-modal .artwork-file-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
textarea { resize: vertical; }
.actions { display: flex; gap: .6rem; margin-top: 1.25rem; }
.actions button:first-child, #save-card, #profile-form button { background: #265847; color: white; border-color: #265847; }
#profile-form .favorite-card-trigger { background: #f4f5e9; color: #163737; border-color: #819e8d; }
#profile-form .favorite-card-option { background: transparent; color: #163737; border-color: transparent; }
#profile-form .favorite-card-option:hover:not(:disabled) { background: #e0ebda; color: #163737; }
#profile-form #delete-account { background: #a23d35; border-color: #a23d35; }
#profile-form #delete-account:hover:not(:disabled) { background: #842f2a; border-color: #842f2a; }
.danger-modal-card { border-color: #d49a91; }
.danger-modal-actions { justify-content: flex-end; }
.danger-modal-actions button:first-child { background: #a23d35; border-color: #a23d35; }
.danger-modal-actions button:first-child:hover:not(:disabled) { background: #842f2a; border-color: #842f2a; }
#new-card, #new-deck { background: #34755a; color: #fff8e8; border-color: #34755a; font-weight: 400; }
#decks-view #new-deck { font-weight: 400; }
#new-card, #new-deck { text-transform: none; }
#new-card:hover:not(:disabled), #new-deck:hover:not(:disabled) { background: #3d805f; }
.form-hint { margin: -0.35rem 0 0.75rem; color: #68756d; font-size: 0.85rem; }
.hint { color: #5a6e64; font-size: .88rem; line-height: 1.35; }
.workspace,
.patrons-workspace {
  background: transparent;
  border: 0;
}
.about-workspace { display: grid; width: 100%; height: calc(100vh - 100px); margin: 0 auto; place-items: center; overflow: hidden; }
.about-panel {
  position: relative;
  width: auto;
  height: calc(100vh - 112px);
  max-width: calc(100vw - 2rem);
  aspect-ratio: 1105 / 730;
  overflow: hidden;
}
.about-scroll-wrap { position: absolute; inset: 16% 18% 20% 13%; min-height: 0; }
.about-content { position: relative; width: calc(100% - 18px); height: 100%; overflow-y: auto; padding: .25rem 2.25rem .75rem .25rem; box-sizing: border-box; scrollbar-width: none; }
.about-content::-webkit-scrollbar { display: none; }
.about-panel .panel-head { display: none; }
.about-panel .about-section { border: 0; background: transparent; }
.about-intro { max-width: 820px; margin: 1.6rem auto 2rem; text-align: center; }
.about-intro p { line-height: 1.65; }
.about-lead { color: #265847; font-size: 1.25rem; font-weight: 700; }
.about-definition { margin: 1rem auto 0; max-width: 760px; color: #68756d; font-size: .9rem; font-style: italic; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.about-section { min-width: 0; padding: 1.2rem 1.35rem; border: 1px solid #c7d3c4; border-radius: 14px; background: rgba(255, 253, 244, .64); overflow-wrap: anywhere; }
.about-section h2 { margin: 0 0 .55rem; color: #265847; font-size: 1.2rem; }
.about-section h3 { margin: 1rem 0 .35rem; color: #265847; font-size: 1.2rem; }
.about-section h3:first-of-type { margin-top: .2rem; }
.vision-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 43%); align-items: start; gap: 1.25rem; }
.vision-board-figure { min-width: 0; width: 100%; max-width: 520px; margin: .15rem auto; }
.vision-board-art { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.vision-copy { min-width: 0; }
.vision-copy .about-faction { font-weight: 800; }
.vision-copy .about-faction-verdant { color: #488057; }
.vision-copy .about-faction-brightworks { color: #a87318; }
.vision-copy .about-faction-flowbound { color: #35758e; }
.vision-copy .about-faction-dreamwardens { color: #784997; }
body.dark-mode .vision-copy .about-faction-verdant { color: #80d991; }
body.dark-mode .vision-copy .about-faction-brightworks { color: #f2c96b; }
body.dark-mode .vision-copy .about-faction-flowbound { color: #75c4ed; }
body.dark-mode .vision-copy .about-faction-dreamwardens { color: #cf9ef5; }
.about-rules { grid-column: 1 / -1; }
.about-principles { grid-column: 1 / -1; }
.rules-layout { display: grid; grid-template-columns: minmax(180px, 28%) minmax(0, 1fr); align-items: start; gap: 1.4rem; }
.terrain-reference { display: block; min-width: 0; min-height: 220px; padding-top: .4rem; background: transparent url('./assets/factions-grid-transparent.png?v=factions-grid-2') center / contain no-repeat; }
.terrain-reference > * { visibility: hidden; }
.terrain-item { display: flex; flex-direction: column; align-items: center; gap: 0; color: #50705e; font-size: .75rem; line-height: 1; text-align: center; }
.terrain-item strong { margin-top: -1.1rem; }
.terrain-icon { display: block; width: 112px; height: 78px; border-radius: 10px; background-image: url('./assets/terrain-types.png'); background-size: 400% auto; background-position-y: center; background-repeat: no-repeat; }
.terrain-flow { background-position: 0 0; }
.terrain-radiance { background-position: 33.333% 0; }
.terrain-symbiosis { background-position: 66.666% 0; }
.terrain-verdant { background-position: 100% 0; }
.rules-copy { min-width: 0; }
.rules-copy h2 { margin-top: 0; }
.about-section p, .about-section li { color: #405b4d; line-height: 1.55; }
.about-section ul, .about-section ol { margin: .55rem 0 0; padding-left: 1.35rem; }
body.dark-mode .about-panel .panel-head { border-color: #265847; }
body.dark-mode .about-section { border-color: #496c58; background: rgba(23, 63, 50, .55); }
body.dark-mode .about-panel .about-section { border: 0; background: transparent; }
body.dark-mode .about-lead, body.dark-mode .about-section h2 { color: #c8dfb8; }
body.dark-mode .about-definition { color: #a8bcae; }
body.dark-mode .about-section h3 { color: #a7c7ad; }
body.dark-mode .about-section p, body.dark-mode .about-section li { color: #d1dfd0; }
.workspace { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); width: 100%; max-width: 1450px; gap: .35rem; margin: 1rem auto; padding: .25rem; }
#cards-view.workspace { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
#decks-view.workspace { grid-template-columns: minmax(320px, 360px) minmax(0, 1fr); }
#decks-view:not(.deck-detail-open) { grid-template-columns: minmax(0, 1fr); }
#decks-view:not(.deck-detail-open) > .editor-panel { display: none; }
#decks-view:not(.deck-detail-open) > .decks-sidebar { width: min(100%, 1100px); justify-self: center; }
#decks-view:not(.deck-detail-open) > .decks-sidebar .panel-head { justify-content: flex-start; }
#decks-view:not(.deck-detail-open) > .decks-sidebar #new-deck { margin-left: .75rem; }
#cards-view .cards-toolbar { grid-column: 1; display: flex; align-items: center; gap: 1.45rem; min-width: 0; padding: 0 .8rem; }
#cards-view .cards-toolbar .panel-head { flex: 0 0 auto; justify-content: flex-start; }
#cards-view .cards-toolbar .panel-head h1 { margin: 0; line-height: 1.2; }
#cards-view .cards-toolbar #new-card { margin-left: .75rem; }
@media (min-width: 851px) and (max-width: 1070px) { #cards-view .cards-toolbar { flex-wrap: wrap; gap: .45rem; } #cards-view .cards-toolbar .cards-summary { flex-basis: 100%; } }
#decks-view:not(.deck-detail-open) #deck-list { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 1rem; }
#decks-view:not(.deck-detail-open) .deck-gallery-section { min-width: 0; }
.deck-gallery-section h2 { margin: 0 0 .65rem; color: #265847; font-size: 1.15rem; }
.deck-gallery-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 210px)); gap: .75rem; }
.deck-gallery-empty { grid-column: 1 / -1; margin: .1rem 0; color: #68756d; }
body.dark-mode .deck-gallery-section h2 { color: #c8dfb8; }
body.dark-mode .deck-gallery-empty { color: #a8bcae; }
#decks-view:not(.deck-detail-open) #deck-list .deck-list-item { width: 100%; height: auto; min-height: 0; align-self: start; }
#decks-view:not(.deck-detail-open) #deck-list .deck-list-title-wrap { padding-left: 0; }
#decks-view:not(.deck-detail-open) #deck-list .deck-list-title,
#decks-view:not(.deck-detail-open) #deck-list .deck-list-owner { justify-content: center; text-align: center; }
#decks-view:not(.deck-detail-open) #deck-list .deck-list-item { border: 1px solid rgba(73, 120, 94, .45); background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(225, 238, 229, .52)); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 4px 14px rgba(10, 35, 27, .12); backdrop-filter: blur(8px); }
#decks-view:not(.deck-detail-open) #deck-list .deck-list-item:hover:not(:disabled) { background: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(204, 224, 210, .7)); }
body.dark-mode #decks-view:not(.deck-detail-open) #deck-list .deck-list-item { border-color: rgba(226, 246, 235, .38); background: linear-gradient(145deg, rgba(185, 220, 200, .24), rgba(65, 111, 88, .2)); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .26), 0 5px 16px rgba(0, 18, 12, .28); }
body.dark-mode #decks-view:not(.deck-detail-open) #deck-list .deck-list-item:hover:not(:disabled) { background: linear-gradient(145deg, rgba(185, 220, 200, .34), rgba(65, 111, 88, .28)); }
#decks-view:not(.deck-detail-open) .deck-table-shell { overflow: visible; }
.back-to-decks { display: none; align-items: center; gap: .3rem; width: max-content; font-family: Nunito, Arial, sans-serif; }
#decks-view.deck-detail-open { grid-template-columns: minmax(0, 1fr); }
#decks-view.deck-detail-open > .decks-sidebar { display: none; }
#decks-view.deck-detail-open > .editor-panel { width: min(100%, 1100px); justify-self: center; }
#decks-view.deck-detail-open > .editor-panel { position: relative; }
#decks-view.deck-detail-open .back-to-decks { display: inline-flex; }
#decks-view.deck-detail-open .deck-detail-toolbar { position: relative; display: grid; grid-template-columns: 96px minmax(0, max-content) minmax(0, 1fr) 360px; align-items: center; gap: .8rem; min-width: 0; padding-top: 1.15rem; }
#decks-view.deck-detail-open .deck-detail-toolbar .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; width: 360px; justify-self: end; margin: 0; white-space: nowrap; }
#decks-view.deck-detail-open .deck-detail-toolbar .actions > button { width: 100%; margin: 0; }
#decks-view.deck-detail-open .deck-detail-toolbar #back-to-decks { position: absolute; top: -.35rem; left: -.35rem; width: auto; padding: .15rem .25rem; border: 0; background: transparent; box-shadow: none; font-size: .8rem; line-height: 1.2; }
#decks-view.deck-detail-open .deck-detail-toolbar #back-to-decks:hover:not(:disabled) { background: transparent; box-shadow: none; text-decoration: underline; }
body.dark-mode #decks-view.deck-detail-open .deck-detail-toolbar #back-to-decks { color: #e5eee0; }
#decks-view.deck-detail-open .deck-detail-toolbar #edit-deck { grid-column: 1; grid-row: 1; }
#decks-view.deck-detail-open .deck-detail-toolbar #duplicate-deck { grid-column: 2; grid-row: 1; }
#decks-view.deck-detail-open .deck-detail-toolbar #download-all-cards { grid-column: 1; grid-row: 2; }
#decks-view.deck-detail-open .deck-detail-toolbar #delete-deck { grid-column: 2; grid-row: 2; }
#decks-view.deck-detail-open .deck-detail-toolbar #deck-download-status { grid-column: 1 / -1; margin: 0; font-size: .75rem; white-space: normal; }
#decks-view.deck-detail-open .deck-detail-toolbar .deck-summary { display: grid; grid-template-columns: minmax(0, 1fr); justify-self: center; width: min(100%, 350px); min-width: 0; min-height: 0; gap: .15rem; margin: 0; padding: .4rem .6rem; box-sizing: border-box; }
#decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .1rem .35rem; min-width: 0; }
#decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-colors .deck-summary-item:last-child { grid-column: 3; grid-row: 1; }
#decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-colors { padding-top: .2rem; border-top: 1px solid rgba(73, 120, 94, .25); }
#decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-item { grid-row: auto; justify-self: start; font-size: .72rem; }
body.dark-mode #decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-colors { border-top-color: rgba(226, 246, 235, .2); }
.deck-detail-cover { display: block; flex: 0 0 96px; width: 96px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #d9e5d7; }
.deck-detail-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
#decks-view.deck-detail-open .deck-detail-title-group { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: .12rem; transform: translateY(-3px); }
#deck-detail-name { min-width: 0; max-width: 260px; margin: 0; font-size: 1.45rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-detail-author { display: flex; align-items: center; min-width: 0; font-size: .85rem; }
.deck-detail-author .author-display { min-width: 0; }
#deck-cover { display: none; }
#deck-cover-button { width: 100%; margin-top: .2rem; }
.deck-cover-status { display: block; margin-top: .25rem; font-size: .75rem; line-height: 1.25; color: #315f4b; }
.deck-cover-status[hidden] { display: none; }
.deck-cover-status.error { color: #a23d35; }
body.dark-mode .deck-cover-status { color: #e5eee0; }
body.dark-mode .deck-cover-status.error { color: #ef9187; }
.deck-edit-card h2 { margin: 0; }
.deck-edit-card #deck-form { display: grid; gap: .8rem; margin-top: 1rem; }
.deck-edit-card #deck-form > label { margin: 0; }
.deck-edit-card #deck-form .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.deck-patron-field { min-width: 0; margin: 0; }
.deck-patron-field select { width: 100%; margin-top: .2rem; }
.patron-picker { position: relative; display: block; width: 100%; margin-top: .2rem; font-weight: 400; }
.deck-patron-field .patron-select-native { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.patron-picker-trigger { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.6rem; padding: .6rem 2rem .6rem .7rem; border: 1px solid #a4b6a5; border-radius: 8px; background: #fffefa; text-align: left; }
.deck-card-filters-row .patron-picker-trigger { height: 2.35rem; min-height: 0; padding: .3rem 2rem .3rem .7rem; font-size: .82rem; }
.patron-picker-trigger::after { position: absolute; right: .8rem; width: .5rem; height: .5rem; border-right: 2px solid #456151; border-bottom: 2px solid #456151; transform: translateY(-.15rem) rotate(45deg); content: ''; }
.patron-picker-menu { position: absolute; z-index: 35; top: calc(100% + .25rem); left: 0; right: 0; max-height: 17rem; overflow-y: auto; padding: .25rem; border: 1px solid #a4b6a5; border-radius: 10px; background: #fffefa; box-shadow: 0 8px 20px rgba(22, 55, 55, .18); }
.patron-picker-option { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .45rem .55rem; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.patron-picker-option:hover:not(:disabled), .patron-picker-option:focus-visible { background: #e0ebda; }
.patron-picker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patron-picker-option .patron-picker-name { white-space: normal; overflow-wrap: anywhere; }
.patron-picker :is(.patron-picker-trigger, .patron-picker-option).is-patron .patron-picker-name { font-weight: 800; }
.patron-picker-icon { display: block; flex: 0 0 auto; width: 1.35rem; height: 1.35rem; background: url('./assets/Type_Patron_Nomads_Arcane.png') center / contain no-repeat; }
.patron-picker-terrain-symbiosis .patron-picker-icon { background-image: url('./assets/Type_Patron_Symbiosis_Arcane.png'); }
.patron-picker-terrain-flow .patron-picker-icon { background-image: url('./assets/Type_Patron_Flow_Arcane.png'); }
.patron-picker-terrain-verdant .patron-picker-icon { background-image: url('./assets/Type_Patron_Verdant_Arcane.png'); }
.patron-picker-terrain-radiance .patron-picker-icon { background-image: url('./assets/Type_Patron_Radiance_Arcane.png'); }
.patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-flow { color: #35758e; }
.patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-radiance { color: #a87318; }
.patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-symbiosis { color: #784997; }
.patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-verdant { color: #488057; }
body.dark-mode .patron-picker-trigger { border-color: #587965; background: #0d2b23; color: #e5eee0; }
body.dark-mode .patron-picker-trigger::after { border-color: #d5e6cf; }
body.dark-mode .patron-picker-menu { border-color: #416853; background: #173f32; }
body.dark-mode .patron-picker-option { background: transparent; color: #e5eee0; }
body.dark-mode .patron-picker-option:hover:not(:disabled), body.dark-mode .patron-picker-option:focus-visible { background: #285944; }
body.dark-mode .patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-flow { color: #77b8d1; }
body.dark-mode .patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-radiance { color: #e0b65a; }
body.dark-mode .patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-symbiosis { color: #bc91dc; }
body.dark-mode .patron-picker :is(.patron-picker-trigger, .patron-picker-option).patron-picker-terrain-verdant { color: #91c99e; }
@media (max-width: 900px) { #decks-view.deck-detail-open .deck-detail-toolbar { grid-template-columns: 96px minmax(0, 1fr) minmax(300px, 360px); } #decks-view.deck-detail-open .deck-detail-toolbar .actions { grid-column: 1 / -1; justify-self: end; } }
@media (max-width: 760px) { #decks-view.deck-detail-open .deck-detail-toolbar { grid-template-columns: minmax(0, 1fr); } #decks-view.deck-detail-open .deck-detail-toolbar .deck-summary { width: min(100%, 350px); } #decks-view.deck-detail-open .deck-detail-toolbar .actions { grid-column: 1; width: min(100%, 360px); } }
@media (max-width: 600px) { #decks-view.deck-detail-open .deck-detail-toolbar .deck-summary-item { font-size: .65rem; } #decks-view.deck-detail-open .deck-detail-toolbar .actions > button { min-height: 2.6rem; padding-inline: .2rem; font-size: .76rem; line-height: 1.15; white-space: normal; } }
.workspace,
.patrons-workspace { width: calc(100% - 2rem); }
.workspace > .panel,
.patrons-workspace > .panel { border: 0; padding: 1rem; }
.panel {
  background: transparent;
  border: solid transparent;
  border-width: 70px;
  border-image-source: url('./assets/panel-frame.png');
  border-image-slice: 100;
  border-image-width: 70px;
  border-image-repeat: stretch;
  border-radius: 0;
  padding: 1rem;
  min-width: 0;
}
.panel.about-panel {
  border: 0;
  border-image: none;
  padding: 0;
  background: transparent url('./assets/about-frame.png') center / contain no-repeat;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.panel-head h1, .panel-head h2 { margin: .2rem 0 .8rem; font-size: 1.7rem; }
#decks-view > .sidebar > .panel-head h1 { margin: 0; line-height: 1.2; }
#decks-view > .sidebar > .panel-head { margin-bottom: .45rem; }
#profile-heading { display: flex; align-items: center; gap: .6rem; }
.tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: #50705e; }
.item-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; }
/* Art-deco scroll rails for the card and deck tables. */
.item-list,
.deck-cards {
  scrollbar-width: none;
}
.item-list::-webkit-scrollbar,
.deck-cards::-webkit-scrollbar { display: none; }
.art-scroll-wrap { position: relative; min-height: 0; }
.art-scroll-wrap.about-scroll-wrap { position: absolute; inset: 16% 18% 20% 13%; min-height: 0; }
.art-scroll-wrap > .item-list,
.art-scroll-wrap > .deck-cards { scrollbar-width: none; width: calc(100% - 18px); padding-right: 2.25rem; box-sizing: border-box; }
.workspace > .sidebar > .art-scroll-wrap { flex: 1 1 auto; overflow: hidden; }
.art-scroll-wrap > .item-list { height: 100%; overflow-y: auto; }
.art-scroll-wrap > .deck-cards { max-height: 480px; overflow-y: auto; }
.art-scroll-rail { position: absolute; z-index: 2; top: .25rem; right: 0; bottom: .25rem; width: 18px; display: flex; justify-content: center; pointer-events: none; }
.art-scroll-rail::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); border-radius: 999px; background: rgba(242, 248, 235, .84); box-shadow: 0 0 5px rgba(242, 248, 235, .28); }
.art-scroll-thumb { position: absolute; top: 0; width: 12px; height: 44px; min-width: 12px; min-height: 32px; appearance: none; border: 1px solid rgba(255, 255, 255, .9); border-radius: 6px; padding: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(215, 240, 221, .72) 48%, rgba(78, 135, 104, .42)); box-shadow: 0 3px 8px rgba(20, 49, 38, .34), inset 2px 2px 3px rgba(255, 255, 255, .95), inset -2px -2px 4px rgba(65, 119, 88, .28); cursor: grab; pointer-events: auto; touch-action: none; }
.art-scroll-thumb:hover:not(:disabled) { background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(215, 240, 221, .84) 48%, rgba(78, 135, 104, .5)); filter: none; }
.art-scroll-thumb:active { cursor: grabbing; }
/* Native scroll areas share the glass palette used by the About rail. */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { border: 1px solid rgba(255, 255, 255, .9); border-radius: 6px; background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(215, 240, 221, .72) 48%, rgba(78, 135, 104, .42)); box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .95), inset -2px -2px 4px rgba(65, 119, 88, .28); }
}
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: #a9cbb5 transparent; }
}
.favorite-card-menu,
.card-search-suggestions,
.auth-modal-card,
.card-field-dialog,
.patron-detail-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(78, 135, 104, .72) transparent;
}
.favorite-card-menu::-webkit-scrollbar,
.card-search-suggestions::-webkit-scrollbar,
.auth-modal-card::-webkit-scrollbar,
.card-field-dialog::-webkit-scrollbar,
.patron-detail-panel::-webkit-scrollbar { width: 12px; }
.favorite-card-menu::-webkit-scrollbar-track,
.card-search-suggestions::-webkit-scrollbar-track,
.auth-modal-card::-webkit-scrollbar-track,
.card-field-dialog::-webkit-scrollbar-track,
.patron-detail-panel::-webkit-scrollbar-track { background: transparent; }
.favorite-card-menu::-webkit-scrollbar-thumb,
.card-search-suggestions::-webkit-scrollbar-thumb,
.auth-modal-card::-webkit-scrollbar-thumb,
.card-field-dialog::-webkit-scrollbar-thumb,
.patron-detail-panel::-webkit-scrollbar-thumb {
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(215, 240, 221, .72) 48%, rgba(78, 135, 104, .42));
  box-shadow: 0 3px 8px rgba(20, 49, 38, .34), inset 2px 2px 3px rgba(255, 255, 255, .95), inset -2px -2px 4px rgba(65, 119, 88, .28);
}
body.dark-mode .favorite-card-menu,
body.dark-mode .card-search-suggestions,
body.dark-mode .auth-modal-card,
body.dark-mode .card-field-dialog,
body.dark-mode .patron-detail-panel { scrollbar-color: rgba(185, 220, 200, .62) transparent; }
body.dark-mode .favorite-card-menu::-webkit-scrollbar-thumb,
body.dark-mode .card-search-suggestions::-webkit-scrollbar-thumb,
body.dark-mode .auth-modal-card::-webkit-scrollbar-thumb,
body.dark-mode .card-field-dialog::-webkit-scrollbar-thumb,
body.dark-mode .patron-detail-panel::-webkit-scrollbar-thumb {
  border-color: rgba(235, 255, 243, .72);
  background: linear-gradient(135deg, rgba(220, 244, 226, .72), rgba(91, 143, 111, .5) 48%, rgba(28, 70, 52, .62));
  box-shadow: 0 3px 8px rgba(0, 18, 12, .38), inset 2px 2px 3px rgba(235, 255, 243, .4), inset -2px -2px 4px rgba(12, 45, 35, .3);
}
@media (min-width: 851px) {
  .masthead nav button.active {
    border-color: rgba(73, 120, 94, .55);
    background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(190, 218, 200, .08));
    background-image: none;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
    backdrop-filter: blur(10px);
  }
  body.dark-mode .masthead nav button.active {
    border-color: rgba(226, 246, 235, .34);
    background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
    box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 2px 8px rgba(0, 18, 12, .22);
  }
  .workspace,
  .patrons-workspace {
    background: transparent;
    border: 0;
    padding: .25rem;
  }
  #cards-view .cards-sidebar {
    border: 1px solid rgba(55, 91, 78, .46);
    border-image: none;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
    padding: .8rem;
    overflow: hidden;
  }
  #about-view > .about-panel {
    width: calc(100% - 8rem);
    height: calc(100vh - 112px);
    max-width: 1200px;
    aspect-ratio: auto;
    border: 1px solid rgba(55, 91, 78, .46);
    border-image: none !important;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
    padding: .8rem;
  }
  #about-view .about-principles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 43%); column-gap: 1.25rem; align-items: start; }
  #about-view .about-principles > h2 { grid-column: 1 / -1; }
  #about-view .about-principles .vision-layout { display: contents; }
  #about-view .about-principles .vision-copy { grid-column: 1; }
  #about-view .about-principles .vision-board-figure { grid-column: 2; grid-row: 2 / span 3; }
  #about-view > .about-panel .about-scroll-wrap { inset: .8rem; }
  #cards-view > .editor-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(55, 91, 78, .46);
    border-image: none;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
    padding: .8rem;
    overflow: hidden;
    font-size: .9rem;
  }
  #cards-view > .editor-panel .card-layout { gap: .8rem; }
  #cards-view > .editor-panel #card-form { display: none; }
  #cards-view.workspace { grid-template-columns: minmax(400px, 500px) minmax(320px, 380px); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; justify-content: center; max-width: 1450px; }
  #cards-view > .cards-sidebar { grid-column: 1; grid-row: 2; }
  #cards-view > .editor-panel { grid-column: 2; grid-row: 1 / 3; }
  #cards-view > .sidebar { display: flex; flex-direction: column; min-height: 0; }
  #cards-view > .sidebar .card-table-shell { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
  #cards-view > .sidebar #card-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  #cards-view > .editor-panel { width: 100%; justify-self: start; }
  #cards-view > .editor-panel .card-layout { display: flex; flex: 1 1 auto; justify-content: center; width: 100%; min-height: 0; }
  #cards-view > .editor-panel .card-preview-shell { align-self: stretch; width: 100%; padding-top: 1.6rem; }
  #cards-view > .editor-panel { overflow: visible; }
  #cards-view > .editor-panel form label { margin: .25rem 0; }
  #cards-view > .editor-panel .actions { margin-top: .65rem; }
  #cards-view > .editor-panel #card-canvas { width: 100%; max-width: none; }
  #cards-view > .editor-panel .card-terrain-aura { width: min(100%, 340px, calc(71.4286dvh - 220px)); }
  #cards-view > .editor-panel textarea { min-height: 82px; }
  #decks-view > .sidebar,
  #decks-view > .editor-panel,
  #profiles-view > .sidebar,
  #profiles-view > .editor-panel {
    border: 1px solid rgba(55, 91, 78, .46);
    border-image: none !important;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
    padding: .8rem;
  }
  #decks-view > .sidebar { overflow: hidden; }
  #decks-view > .editor-panel { display: flex; flex-direction: column; overflow: hidden; font-size: .9rem; }
  #decks-view > .editor-panel .deck-meta-row { gap: .65rem; }
  #decks-view > .editor-panel .deck-meta-row .author-picker { margin: .4rem 0; padding: .55rem; }
  #decks-view > .editor-panel .actions { margin-top: .45rem; }
  #decks-view > .editor-panel .deck-card-layout { flex: 1 1 auto; min-height: 0; gap: .8rem; }
  #decks-view > .editor-panel { overflow: hidden; }
  #cards-view .card-table-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 0;
  }
  #cards-view .card-table-shell > .art-scroll-wrap { flex: 1 1 auto; min-height: 0; }
  #cards-view .card-table-shell > .list-table-head { flex: 0 0 auto; margin-top: .7rem; }
  #cards-view .card-list-head { margin-right: calc(24px + .2rem + .3rem); }
  #cards-view .card-table-shell .art-scroll-wrap > .item-list {
    width: calc(100% - 24px);
    padding-right: 2.5rem;
  }
  #decks-view .deck-table-shell,
  #decks-view .deck-card-table-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  #decks-view .deck-table-shell > .art-scroll-wrap,
  #decks-view .deck-card-table-shell > .art-scroll-wrap { flex: 1 1 auto; min-height: 0; }
  #decks-view .deck-card-table-shell > .art-scroll-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  #decks-view .deck-card-table-shell > .art-scroll-wrap > .art-scroll-rail { transform: translateX(-2.35rem); }
  #decks-view .deck-table-shell > .list-table-head,
  #decks-view .deck-card-table-shell > .list-table-head { flex: 0 0 auto; margin-top: .7rem; }
  #decks-view .deck-table-shell .art-scroll-wrap > .item-list,
  #decks-view .deck-card-table-shell .art-scroll-wrap > .deck-cards {
    width: calc(100% - 24px);
    padding-right: 2.5rem;
  }
  #decks-view .deck-card-table { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  #decks-view .deck-card-layout { grid-template-rows: minmax(0, 1fr) auto; }
  #decks-view .deck-card-preview-shell,
  #decks-view .deck-patron-preview-shell { height: 100%; min-height: 0; overflow: visible; container-type: size; justify-content: flex-end; }
  #decks-view .deck-preview-edit-hint { min-height: 0; margin: .1rem auto 0; align-items: center; }
  #decks-view .deck-card-table { grid-column: 1; grid-row: 1 / 3; }
  #decks-view .deck-card-preview-shell { grid-column: 2; grid-row: 1; }
  #decks-view .deck-patron-preview-shell { grid-column: 3; grid-row: 1; }
  #decks-view .deck-shared-edit-hint { grid-column: 2 / 4; grid-row: 2; justify-self: center; white-space: nowrap; }
  #decks-view .deck-card-table-shell .art-scroll-wrap > .deck-cards { height: 100%; max-height: none; overflow-y: auto; }
}
@media (min-width: 851px) and (max-height: 850px) {
  #cards-view > .editor-panel .card-preview-shell { padding-top: .4rem; }
}
.profile-group-title { margin-top: .9rem; color: #50705e; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.profile-group-title:first-child { margin-top: .2rem; }
.profile-list-entry { display: flex; flex-direction: column; gap: .15rem; }
.profile-list-main { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.profile-favorite-card { color: #456151; font-weight: 700; }
.profile-save-actions { display: flex; align-items: center; gap: .7rem; margin-top: 1.25rem; }
.profile-save-actions button { margin-top: 0; }
.profile-save-status { color: #2f8a58; font-size: .9rem; font-weight: 800; }
.profile-save-status.error { color: #a23d35; }
body.dark-mode .profile-save-status.error { color: #ef9187; }
.user-avatar { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 2rem; height: 2rem; overflow: hidden; border: 1px solid #8eaa98; border-radius: 50%; background: #dceadd; color: #315f4b; font-size: .82rem; font-weight: 800; line-height: 0; vertical-align: middle; }
.user-avatar.small { width: 1.25rem; height: 1.25rem; font-size: .62rem; }
.user-avatar.header-avatar { width: 1.65rem; height: 1.65rem; border-color: #91b8a2; }
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-avatar.has-image { color: transparent; }
.author-display { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem .45rem; min-width: 0; }
.author-person { display: inline-flex; align-items: center; gap: .25rem; min-width: 0; white-space: nowrap; }
.profile-decks-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.profile-decks-head h3 { margin: 0; }
#profile-new-deck { background: #265847; color: white; border-color: #265847; }
#profile-new-deck:hover:not(:disabled) { background: #1d4939; }
.card-filters { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .75rem .45rem; margin-top: .65rem; }
#cards-view > .sidebar > .card-filters { width: min(100%, 700px); margin-top: .65rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.deck-card-filters-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: .65rem; width: 100%; align-self: stretch; margin-top: .65rem; }
.deck-card-filters-row .card-filters { grid-column: 1 / -1; min-width: 0; margin-top: 0; }
.deck-search-patron-row { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(200px, 220px); align-items: end; gap: .65rem; min-width: 0; }
.deck-card-filters-row .deck-patron-field { color: #5a6e64; font-size: .78rem; font-weight: 700; }
body.dark-mode .deck-card-filters-row .deck-patron-field { color: #bfd1be; }
.card-search-field, .deck-card-search-field { position: relative; min-width: 0; }
.deck-card-search-field { grid-column: 1 / -1; width: min(100%, 460px); }
.card-search-field #card-search { margin-top: 0; }
.deck-card-search-label { display: block; margin: 0; color: #5a6e64; font-size: .78rem; font-weight: 700; }
.deck-card-filters-row #deck-card-search { width: 100%; min-width: 0; margin: .2rem 0 0; box-sizing: border-box; }
@media (max-width: 600px) { .deck-search-patron-row { grid-template-columns: minmax(0, 1fr); } }
.card-search-suggestions { position: absolute; z-index: 30; top: calc(100% + .2rem); left: 0; right: 0; max-height: 16rem; overflow-y: auto; padding: .25rem; border: 1px solid #a4b6a5; border-radius: 10px; background: #fffefa; box-shadow: 0 8px 20px rgba(22, 55, 55, .18); }
.card-search-suggestions, .favorite-card-menu { scrollbar-width: none; }
.card-search-suggestions::-webkit-scrollbar, .favorite-card-menu::-webkit-scrollbar { display: none; }
.dropdown-scroll-rail { z-index: 31; right: .35rem; bottom: auto; }
.dropdown-scroll-rail::before { background: rgba(37, 83, 62, .56); box-shadow: 0 0 5px rgba(37, 83, 62, .18); }
.dropdown-scroll-rail .art-scroll-thumb { border-color: rgba(37, 83, 62, .72); background: linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(160, 198, 169, .76) 48%, rgba(37, 83, 62, .72)); box-shadow: 0 3px 8px rgba(20, 49, 38, .3), inset 2px 2px 3px rgba(255, 255, 255, .8), inset -2px -2px 4px rgba(24, 67, 46, .3); }
.dropdown-scroll-rail .art-scroll-thumb:hover:not(:disabled) { background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(160, 198, 169, .86) 48%, rgba(37, 83, 62, .82)); }
.card-search-suggestions .card-search-option { display: grid; grid-template-columns: 1.65rem minmax(0, 1fr); gap: .55rem; align-items: center; width: 100%; padding: .45rem .55rem; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.card-search-suggestions .card-search-option .card-type-icon { width: 1.65rem; height: 1.65rem; }
.card-search-suggestions .card-search-option:hover, .card-search-suggestions .card-search-option:focus-visible { background: #e0ebda; }
.card-search-suggestions .patron-type-icon { display: block; }
.card-search-suggestions .patron-type-icon.terrain-flow { color: #35758e; }
.card-search-suggestions .patron-type-icon.terrain-radiance { color: #a87318; }
.card-search-suggestions .patron-type-icon.terrain-symbiosis { color: #784997; }
.card-search-suggestions .patron-type-icon.terrain-verdant { color: #488057; }
body.dark-mode .card-search-suggestions { border-color: #416853; background: #173f32; color: #e5eee0; }
body.dark-mode .card-search-suggestions .card-search-option:hover, body.dark-mode .card-search-suggestions .card-search-option:focus-visible { background: #285944; }
.card-filters label { margin: 0; color: #5a6e64; font-size: .78rem; font-weight: 700; }
.card-filters .filter-icon-group { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; }
.card-filters [id$="filter-type"] { margin-right: 1.1rem; }
@media (max-width: 429px) { .card-filters [id$="filter-type"] { margin-right: .3rem; } }
.card-filters .filter-author-field { display: grid; grid-column: 1 / -1; grid-template-columns: 3.75rem minmax(0, 1fr); align-items: center; gap: .45rem; min-width: 0; }
.card-filters .card-filter-selects { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(105px, 1fr) minmax(125px, 1.4fr); gap: 1.55rem; min-width: 0; }
.tag-filter-group { display: grid; grid-column: 1 / -1; grid-template-columns: 3.75rem minmax(0, 1fr); align-items: start; gap: .45rem; min-width: 0; }
.tag-filter-options, .card-tags { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.tag-filter-option, .card-tag { min-height: 1.65rem; padding: .2rem .6rem; border: 1px solid #9db9a5; border-radius: 999px; background: #edf4e9; color: #27553f; font-size: .75rem; font-weight: 800; line-height: 1.2; }
.tag-filter-option[aria-pressed="true"] { border-color: #34755a; background: #34755a; color: #fff; }
.tag-filter-empty { color: #68756d; font-size: .78rem; }
body.dark-mode .tag-filter-option, body.dark-mode .card-tag { border-color: #638b6d; background: #285944; color: #e5eee0; }
body.dark-mode .tag-filter-option[aria-pressed="true"] { border-color: #b9dc8c; background: #b9dc8c; color: #153f34; }
body.dark-mode .tag-filter-empty { color: #bfd1be; }
.card-filters .card-filter-selects label { display: flex; grid-column: auto; flex-direction: column; align-items: stretch; gap: .2rem; min-width: 0; }
.filter-icon-label { color: #5a6e64; font-size: .78rem; font-weight: 700; }
.filter-icon-tiles { display: flex; flex-wrap: wrap; gap: .2rem; min-width: 0; }
.card-filters .filter-icon-tile { --tile-color: #68766f; display: grid; place-items: center; flex: 0 0 1.9rem; width: 1.9rem; height: 1.9rem; min-height: 0; margin: 0; padding: 0; border: 2px solid #b8c8b9; border-radius: .6rem; background: #fffdf7; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.card-filters .filter-icon-tile:hover:not(:disabled) { background: #eaf2e8; }
.card-filters .filter-icon-tile[aria-pressed="true"] { border-color: #34755a; background: #d7e8d4; box-shadow: 0 0 0 2px rgba(52, 117, 90, .32), 0 2px 6px rgba(22, 55, 55, .2); }
.card-filters .filter-icon-tile:focus-visible { outline: 2px solid var(--tile-color); outline-offset: 2px; }
.filter-icon-tile .card-kind-icon,
.filter-icon-tile .card-faction-icon { flex: none; width: 1.5rem; height: 1.5rem; }
.filter-icon-tile[data-kind="type"][data-value="Entity"] { --tile-color: #547e63; }
.filter-icon-tile[data-kind="type"][data-value="Event"] { --tile-color: #a7743c; }
.filter-icon-tile[data-kind="type"][data-value="Patron"] { --tile-color: #785d8e; }
.filter-icon-tile[data-kind="type"][data-value="Terrain"] { --tile-color: #518176; }
.filter-icon-tile[data-value="Symbiosis"] { --tile-color: #784997; }
.filter-icon-tile[data-value="Flow"] { --tile-color: #35758e; }
.filter-icon-tile[data-value="Verdant"] { --tile-color: #488057; }
.filter-icon-tile[data-value="Radiance"] { --tile-color: #b88425; }
.filter-icon-tile[data-value="none"] { --tile-color: #707986; }
.card-filters select { display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%; margin-top: 0; padding: .45rem .4rem; font-size: .82rem; }
@media (min-width: 1000px) {
  #cards-view > .sidebar > .card-filters { grid-template-columns: max-content max-content minmax(255px, 1fr); column-gap: 1.55rem; }
  #cards-view #card-filter-type { margin-right: 0; }
  #cards-view .card-filter-selects { grid-column: auto; }
}
@media (min-width: 650px) {
  .deck-card-filters-row .card-filters { grid-template-columns: max-content max-content minmax(260px, 280px); column-gap: .8rem; width: 100%; }
  .deck-card-filters-row #deck-card-filter-type, .deck-card-filters-row #deck-card-filter-terrain { margin-right: 0; }
  .deck-card-filters-row .card-filter-selects { grid-column: auto; }
  .deck-card-filters-row .card-filter-selects { grid-template-columns: minmax(105px, 1fr) minmax(125px, 1.3fr); gap: .75rem; }
  .deck-card-filters-row .filter-author-field { display: flex; grid-column: auto; flex-direction: column; align-items: stretch; gap: .2rem; }
  .deck-card-search-field { grid-column: auto; }
}
@media (min-width: 1100px) {
  .deck-card-filters-row .card-filters { grid-template-columns: max-content max-content minmax(260px, 280px) minmax(0, 1fr); }
  .deck-search-patron-row { grid-column: auto; }
}
.cards-sidebar #card-search,
.deck-card-filters-row #deck-card-search,
.card-filters select { height: 2.35rem; box-sizing: border-box; }
.card-filters select,
.card-filters select::picker(select) { appearance: base-select; }
.card-filters select::picker-icon { flex: 0 0 auto; margin-left: auto; }
.card-filters select::picker(select) {
  margin-top: .3rem;
  padding: .25rem;
  border: 1px solid #a4b6a5;
  border-radius: 10px;
  background: #fffefa;
  box-shadow: 0 8px 20px rgba(22, 55, 55, .18);
}
.card-filters select option { margin: 1px 0; padding: .35rem .55rem; border-radius: 8px; }
.card-filters select option:hover,
.card-filters select option:focus,
.card-filters select option:checked { background: #e0ebda; }
body.dark-mode .card-filters select::picker(select) { border-color: #416853; background: #173f32; color: #e5eee0; }
body.dark-mode .filter-icon-label { color: #bfd1be; }
body.dark-mode .card-filters .filter-icon-tile { border-color: #5a7b68; background: #173f32; box-shadow: inset 0 1px 0 rgba(235, 255, 243, .13); }
body.dark-mode .card-filters .filter-icon-tile:hover:not(:disabled) { background: #285944; }
body.dark-mode .card-filters .filter-icon-tile[aria-pressed="true"] { border-color: #b9dc8c; background: #376c52; box-shadow: 0 0 0 2px rgba(185, 220, 140, .45), 0 2px 7px rgba(0, 18, 12, .35); }
body.dark-mode .card-filters select option:hover,
body.dark-mode .card-filters select option:focus,
body.dark-mode .card-filters select option:checked { background: #285944; }
.item-list button { text-align: left; background: #f7f7ee; border-color: #d9dfd2; }
.item-list button.selected { background: #dceadd; border-color: #6f9c80; }
.item-list small { display: block; color: #6b796d; font-size: .76rem; }
.list-table-head { display: grid; align-items: center; gap: .55rem; margin: .8rem .8rem -.35rem; color: #5a6e64; font-size: .75rem; font-weight: 800; }
.card-list-head { grid-template-columns: 3.5rem minmax(0, 1fr) 6.2rem minmax(5.5rem, auto); }
.card-list-head { margin: .8rem .3rem .15rem; }
.card-list-head span:nth-child(3) { text-align: center; }
#cards-view .card-list-head, #cards-view #card-list .card-list-item { grid-template-columns: 3.5rem minmax(0, 1fr) 5.7rem 7rem; }
.card-list-head span:last-child, .deck-list-head span:last-child { text-align: right; }
.deck-list-head span:last-child { text-align: left; }
.deck-card-list-head { grid-template-columns: 3.5rem minmax(0, 1fr) 5.6rem 5rem; margin: .8rem calc(24px + 2.5rem + .3rem) .3rem .3rem; min-height: 1.15rem; line-height: 1.15; }
.deck-card-list-head span:nth-child(3), .deck-card-list-head span:last-child { justify-self: stretch; text-align: center; }
.deck-list-head { grid-template-columns: minmax(0, 1fr) 7rem; }
.deck-list-head { margin-bottom: .15rem; }
.deck-list-head span:last-child { justify-self: start; }
.card-list-item { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 6.2rem minmax(5.5rem, auto); column-gap: .55rem; align-items: center; }
.card-list-icons { grid-column: 1; display: flex; align-items: center; gap: .22rem; }
.card-faction-icon, .card-kind-icon { display: block; flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem; }
.card-faction-icon { background-position: center; background-size: contain; background-repeat: no-repeat; }
.card-faction-icon.terrain-symbiosis { background-image: url('./assets/Faction_Symbiosis.png'); }
.card-faction-icon.terrain-flow { background-image: url('./assets/Faction_Flow.png'); }
.card-faction-icon.terrain-verdant { background-image: url('./assets/Faction_Verdant.png'); }
.card-faction-icon.terrain-radiance { background-image: url('./assets/Faction_Radiance.png'); }
.card-faction-icon.terrain-event { background-image: url('./assets/Faction_Nomads_Cairn.png'); }
.card-kind-icon { background-position: center; background-size: contain; background-repeat: no-repeat; }
.card-kind-icon.kind-terrain { box-sizing: border-box; width: 1.25rem; height: 1.6rem; border: 2px solid #4d7569; border-radius: 2px; background: linear-gradient(135deg, #93ad83, #5b849c 55%, #d8b46d); }
.terrain-art-thumbnail { display: block; width: 1.18rem; height: 1.65rem; object-fit: cover; }
.card-kind-icon.kind-entity.terrain-symbiosis { background-image: url('./assets/Type_Entity_Symbiosis_Arcane.png'); }
.card-kind-icon.kind-entity.terrain-flow { background-image: url('./assets/Type_Entity_Flow_Arcane.png'); }
.card-kind-icon.kind-entity.terrain-verdant { background-image: url('./assets/Type_Entity_Verdant_Arcane.png'); }
.card-kind-icon.kind-entity.terrain-radiance { background-image: url('./assets/Type_Entity_Radiance_Arcane.png'); }
.card-kind-icon.kind-entity.terrain-event { background-image: url('./assets/Type_Entity_Nomads_Arcane.png'); }
.card-kind-icon.kind-event.terrain-symbiosis { background-image: url('./assets/Type_Event_Symbiosis_Arcane.png'); }
.card-kind-icon.kind-event.terrain-flow { background-image: url('./assets/Type_Event_Flow_Arcane.png'); }
.card-kind-icon.kind-event.terrain-verdant { background-image: url('./assets/Type_Event_Verdant_Arcane.png'); }
.card-kind-icon.kind-event.terrain-radiance { background-image: url('./assets/Type_Event_Radiance_Arcane.png'); }
.card-kind-icon.kind-event.terrain-event { background-image: url('./assets/Type_Event_Nomads_Arcane.png'); }
.card-kind-icon.kind-patron.terrain-symbiosis { background-image: url('./assets/Type_Patron_Symbiosis_Arcane.png'); }
.card-kind-icon.kind-patron.terrain-flow { background-image: url('./assets/Type_Patron_Flow_Arcane.png'); }
.card-kind-icon.kind-patron.terrain-verdant { background-image: url('./assets/Type_Patron_Verdant_Arcane.png'); }
.card-kind-icon.kind-patron.terrain-radiance { background-image: url('./assets/Type_Patron_Radiance_Arcane.png'); }
.card-kind-icon.kind-patron.terrain-event { background-image: url('./assets/Type_Patron_Nomads_Arcane.png'); }
.card-list-item .card-type-icon { grid-column: 1; grid-row: 1; width: 2rem; height: 2rem; object-fit: contain; }
.card-list-item .card-list-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.card-list-item .card-testing-status { grid-column: 3; grid-row: 1; justify-self: center; border: 1px solid #adb5b1; border-radius: 999px; padding: .2rem .5rem; background: #e2e5e3; color: #39433e; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.card-list-item .card-testing-status.ready { border-color: #124b30; background: #17613d; color: #fff; }
.card-list-item .card-list-owner { grid-column: 4; grid-row: 1; display: flex; justify-content: flex-end; min-width: 0; overflow: hidden; text-align: right; }
#cards-view #card-list { gap: 0; margin-top: .55rem; }
#cards-view > .cards-sidebar { display: flex; flex-direction: column; min-height: 0; }
#cards-view .card-table-shell { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
#cards-view .card-table-shell > .art-scroll-wrap { flex: 1 1 auto; min-height: 0; overflow: visible; }
#cards-view .card-table-shell > .art-scroll-wrap > .art-scroll-rail { transform: translateX(-.2rem); }
#cards-view .card-table-shell .art-scroll-wrap > #card-list { height: 100%; min-height: 0; padding-bottom: .7rem; box-sizing: border-box; overflow-y: auto; }
#cards-view #card-list .card-list-item { min-height: 2.25rem; padding: .22rem .3rem; border: 0; border-bottom: 1px solid #e0e5dc; border-radius: 10px; background: transparent; }
#cards-view #card-list .card-list-item:last-child { border-bottom-color: transparent; }
#cards-view #card-list .card-list-item:hover:not(:disabled) { background: #eef3e8; }
#cards-view #card-list .card-list-item.selected { background: #b6dcb9; border-bottom-color: #91bd98; }
#cards-view #card-list .card-type-icon { width: 1.65rem; height: 1.65rem; }
#cards-view #card-list .patron-type-icon { display: block; border-radius: 0; }
#cards-view #card-list .patron-type-icon.terrain-flow { color: #35758e; }
#cards-view #card-list .patron-type-icon.terrain-radiance { color: #a87318; }
#cards-view #card-list .patron-type-icon.terrain-symbiosis { color: #784997; }
#cards-view #card-list .patron-type-icon.terrain-verdant { color: #488057; }
#cards-view #card-list .card-list-title { font-size: .9rem; }
#cards-view .card-list-head span:last-child { text-align: left; }
#cards-view #card-list .card-list-owner { justify-content: flex-start; font-size: .7rem; text-align: left; }
@media (max-width: 600px) {
  #cards-view .card-list-head, #cards-view #card-list .card-list-item { grid-template-columns: 3.5rem minmax(0, 1fr) 6.2rem; }
  #cards-view .card-list-head span:last-child, #cards-view #card-list .card-list-owner { display: none; }
  #decks-view .deck-card-list-head, #decks-view .deck-card-row { grid-template-columns: 2.2rem minmax(0, 1fr) 4.6rem 5rem; column-gap: .35rem; }
  #decks-view .deck-card-row .card-faction-icon, #decks-view .deck-card-row .card-kind-icon { flex-basis: 1rem; width: 1rem; height: 1rem; }
  #decks-view .deck-copy-controls { width: 100%; }
}
.deck-list-item { display: grid; grid-template-columns: 1fr; gap: .35rem; align-items: stretch; }
.deck-tile-cover { display: block; aspect-ratio: 1.9 / 1; overflow: hidden; border-radius: 10px; background: #d9e5d7; }
.deck-tile-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.deck-list-title-wrap { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.deck-list-item .deck-list-title-wrap { padding-left: .45rem; }
.deck-list-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-list-owner { display: flex; justify-content: flex-start; min-width: 0; overflow: hidden; text-align: left; }
#decks-view #deck-list { gap: 0; margin-top: .55rem; }
#decks-view .deck-table-shell .art-scroll-wrap > #deck-list { padding-bottom: .7rem; box-sizing: border-box; }
#decks-view .deck-list-head { margin-left: .3rem; margin-right: calc(24px + 2.5rem + .3rem); }
#decks-view .deck-list-head { margin-right: calc(4px + .5rem + .3rem); }
#decks-view #deck-list .deck-list-item { min-height: 2.75rem; padding: .32rem .3rem; border: 0; border-bottom: 1px solid #e0e5dc; border-radius: 10px; background: transparent; }
#decks-view #deck-list .deck-list-item { min-height: 0; padding: .4rem; }
#decks-view #deck-list .deck-list-item:last-child { border-bottom-color: transparent; }
#decks-view #deck-list .deck-list-item:hover:not(:disabled) { background: #eef3e8; }
#decks-view #deck-list .deck-list-item.selected { background: #dceadd; border-bottom-color: #c6d8c8; }
#decks-view #deck-list .deck-list-item.selected { background: #b6dcb9; border-bottom-color: #91bd98; }
#decks-view #deck-list .deck-list-title { font-size: .9rem; line-height: 1.15; }
#decks-view #deck-list .deck-patron { font-size: .68rem; line-height: 1.15; }
#decks-view #deck-list .deck-list-owner { font-size: .7rem; }
#cards-view #card-list .card-list-owner,
#decks-view #deck-list .deck-list-owner { color: #4b5d52; }
@media (min-width: 851px) {
  #decks-view .deck-table-shell .art-scroll-wrap > #deck-list { width: calc(100% - 4px); padding-right: .5rem; }
}
.deck-patron, .profile-deck-patron { display: block; overflow: hidden; color: #68756d; font-size: .74rem; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.profile-deck-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patron-faction-flowbound { color: #35758e; }
.patron-faction-brightworks { color: #a87318; }
.patron-faction-dreamwardens { color: #784997; }
.patron-faction-verdant { color: #488057; }
:is(.card-list-title, .deck-summary-item).terrain-symbiosis { color: #784997; }
:is(.card-list-title, .deck-summary-item).terrain-flow { color: #35758e; }
:is(.card-list-title, .deck-summary-item).terrain-verdant { color: #488057; }
:is(.card-list-title, .deck-summary-item).terrain-radiance { color: #b88425; }
:is(.card-list-title, .deck-summary-item).terrain-event { color: #4d5b55; }
.card-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px); gap: 1.6rem; }
.card-layout > *, .deck-meta-row > *, .deck-card-layout > * { min-width: 0; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.deck-meta-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, 1fr); gap: .8rem; align-items: start; }
.deck-meta-row .author-picker { margin: .65rem 0; }
#decks-view #deck-form .deck-name-field .actions { margin-top: .45rem; }
#decks-view #deck-form .deck-name-field .actions { width: max-content; max-width: 100%; }
#decks-view #deck-form .deck-name-field .actions button { white-space: nowrap; }
.deck-card-layout { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 230px)); gap: 1rem; align-items: start; }
.deck-card-table { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.deck-card-table h3 { margin: .75rem 0 .1rem; }
.deck-card-preview-shell,
.deck-patron-preview-shell { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding-top: 0; }
.deck-card-preview-shell:not(.is-empty),
.deck-patron-preview-shell:not(.is-empty) { border: 0; background: transparent; box-shadow: none; }
.deck-patron-preview-shell canvas { display: block; }
#decks-view #deck-card-canvas, #decks-view #deck-patron-canvas { cursor: pointer; }
#decks-view .is-empty canvas { display: none; }
#decks-view .card-terrain-aura, #decks-view .deck-empty-preview { width: min(100%, 300px); height: auto; aspect-ratio: 5 / 7; }
@media (min-width: 851px) {
  #decks-view .card-terrain-aura,
  #decks-view .deck-empty-preview {
    flex: 0 0 auto;
    width: min(calc(100% - .8rem), 300px, calc(71.4286cqh - 4rem));
  }
}
@media (min-width: 851px) and (max-width: 1150px) {
  #decks-view .card-terrain-aura,
  #decks-view .deck-empty-preview {
    width: min(95%, 255px, calc(71.4286cqh - 3.8rem));
  }
}
#decks-view .deck-empty-preview { display: none; place-items: center; box-sizing: border-box; padding: 1.5rem; border: 1px solid rgba(255, 255, 255, .72); border-radius: 18px; background: linear-gradient(145deg, rgba(255, 255, 255, .7), rgba(224, 234, 229, .42) 52%, rgba(202, 219, 211, .28)); color: #68756d; text-align: center; font-size: .86rem; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), inset -1px -1px 0 rgba(160, 185, 170, .18), 0 10px 24px rgba(34, 48, 41, .14); backdrop-filter: blur(12px) saturate(.75); -webkit-backdrop-filter: blur(12px) saturate(.75); pointer-events: none; cursor: default; }
#decks-view .is-empty .deck-empty-preview { display: grid; }
body.dark-mode #decks-view .deck-empty-preview { border-color: rgba(226, 246, 235, .3); background: linear-gradient(145deg, rgba(220, 244, 226, .22), rgba(91, 143, 111, .16) 52%, rgba(28, 70, 52, .24)); color: #bfd1be; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .22), inset -1px -1px 0 rgba(5, 30, 21, .2), 0 10px 24px rgba(0, 18, 12, .24); }
#decks-view #deck-card-canvas:focus-visible, #decks-view #deck-patron-canvas:focus-visible { outline: 3px solid #8da97e; outline-offset: 3px; }
.deck-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); flex: 0 0 auto; width: calc(100% - 2.8rem); min-height: 3.5rem; align-self: flex-start; align-items: center; column-gap: 1.25rem; row-gap: .35rem; margin-top: 1rem; padding: .7rem 1rem; border: 1px solid rgba(73, 120, 94, .45); border-radius: 14px; background: linear-gradient(145deg, rgba(255, 255, 255, .68), rgba(210, 229, 216, .42)); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 4px 14px rgba(10, 35, 27, .1); backdrop-filter: blur(8px); }
.deck-summary-group { display: contents; }
.deck-summary-types .deck-summary-item { grid-row: 1; }
.deck-summary-colors .deck-summary-item { grid-row: 2; }
.deck-summary-item { justify-self: center; }
.deck-summary-item { color: #344d42; font-size: .86rem; font-weight: 800; white-space: nowrap; }
.cards-summary.deck-summary { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; flex: 1 1 auto; width: auto; min-width: 0; min-height: 0; align-self: center; gap: .15rem; margin: 0; padding: .3rem .6rem; box-sizing: border-box; }
.cards-summary .deck-summary-group { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; width: 100%; min-width: 0; gap: .1rem .25rem; }
.cards-summary .deck-summary-colors { padding-top: .2rem; border-top: 1px solid rgba(73, 120, 94, .25); }
.cards-summary :is(.deck-summary-types, .deck-summary-colors) .deck-summary-item { grid-row: auto; justify-self: start; font-size: .72rem; }
@media (max-width: 600px) { .cards-summary .deck-summary-group { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.deck-card-preview-close { display: none; }
#deck-card-canvas { width: min(100%, 300px); height: auto; aspect-ratio: 5 / 7; }
.deck-preview-edit-hint { max-width: 24rem; min-height: 2.6rem; display: flex; align-items: flex-end; justify-content: center; margin: .8rem auto 0; color: #68756d; font-size: .95rem; line-height: 1.35; text-align: center; pointer-events: none; }
body.dark-mode .deck-preview-edit-hint { color: #fff; }
.card-preview-shell { align-self: start; display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 0; }
.card-tag-section { width: min(100%, 310px); margin-top: .45rem; padding: .65rem .75rem; border: 1px solid rgba(73, 120, 94, .35); border-radius: 12px; background: rgba(255, 253, 247, .72); }
.card-tag-heading { display: flex; align-items: center; justify-content: flex-start; gap: .5rem; margin-bottom: .45rem; font-size: .83rem; font-weight: 800; }
#edit-card-tags { padding: .55rem .8rem; font-size: 1rem; font-weight: 400; white-space: nowrap; }
.card-tags { color: #68756d; font-size: .78rem; }
body.dark-mode .card-tag-section { border-color: rgba(185, 220, 140, .3); background: rgba(23, 63, 50, .75); }
.mobile-editor-close { display: none; }
.card-preview-shell .card-terrain-aura { width: min(100%, 280px); }
.card-terrain-aura { position: relative; flex: 0 0 auto; isolation: isolate; }
.card-terrain-aura::after { content: ''; position: absolute; z-index: -1; inset: -6%; border-radius: 10%; background: radial-gradient(ellipse, rgba(22, 48, 37, .28) 35%, rgba(22, 48, 37, .12) 64%, transparent 76%); filter: blur(14px); pointer-events: none; }
#decks-view .is-empty .card-terrain-aura { display: none; }
.card-terrain-aura > canvas { position: relative; z-index: 1; display: block; width: 100% !important; height: auto; aspect-ratio: 5 / 7; }
#card-canvas, #deck-card-canvas, #deck-patron-canvas, #patron-card-canvas { border-radius: 0; box-shadow: none; filter: drop-shadow(0 6px 10px rgba(10, 35, 27, .24)); background: transparent; }
body.dark-mode :is(#card-canvas, #deck-card-canvas, #deck-patron-canvas, #patron-card-canvas) { filter: drop-shadow(0 5px 8px rgba(0, 18, 12, .28)); }
#card-canvas { cursor: pointer; }
#cards-view.is-terrain-preview #card-canvas { cursor: default; }
#cards-view.is-terrain-preview :is(#card-form, .card-status-control, .card-tag-section, #card-edit-hint) { display: none !important; }
#card-edit-hint { font-family: Nunito, Arial, sans-serif; }
#card-form > .card-direct-edit-field { display: none; }
.card-field-modal { position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 1rem; }
.card-field-backdrop { position: absolute; inset: 0; background: rgba(8, 38, 31, .65); }
.card-field-dialog { position: relative; width: min(100%, 440px); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.25rem; border: 1px solid #819e8d; border-radius: 18px; background: #fffdf4; box-shadow: 0 18px 60px #00130d66; }
.card-field-dialog .panel-head h2 { margin: 0; }
.card-field-dialog .panel-head button { font-size: 1.5rem; line-height: 1; }
.card-field-dialog #card-field-content { margin: 1rem 0; }
.card-field-dialog #card-field-content > label { display: block; }
.card-field-dialog #card-field-content .two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.card-field-dialog #card-field-content textarea { min-height: 8rem; }
.card-field-dialog #card-field-content fieldset { min-width: 0; }
.card-field-dialog .tag-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; max-height: min(50dvh, 340px); overflow-y: auto; margin: 0; padding: .6rem; border: 1px solid #a4b6a5; border-radius: 10px; }
.card-field-dialog .tag-picker legend { padding: 0 .3rem; font-size: .85rem; font-weight: 800; }
.tag-picker-option { display: flex; align-items: center; gap: .45rem; min-height: 2rem; margin: 0; padding: .25rem .4rem; border: 1px solid #c9d7c6; border-radius: 8px; background: #f3f8ee; font-size: .77rem; font-weight: 700; cursor: pointer; }
.tag-picker-option:has(input:checked) { border-color: #34755a; background: #d7e8d4; }
.tag-picker-option input { flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0; accent-color: #34755a; }
body.dark-mode .tag-picker-option { border-color: #5a7b68; background: #173f32; color: #e5eee0; }
body.dark-mode .tag-picker-option:has(input:checked) { border-color: #b9dc8c; background: #376c52; }
.card-field-dialog #card-field-content .form-hint { margin-top: 1rem; }
.card-field-dialog #card-field-content select,
.card-field-dialog #card-field-content select::picker(select) { appearance: base-select; }
.card-field-dialog #card-field-content select { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .45rem .4rem; font-size: .82rem; }
#card-field-content select[name="terrain"]:disabled { border-color: #b9c1bb; background: #e3e6e3; color: #6b756f; cursor: not-allowed; opacity: 1; }
.card-field-dialog #card-field-content select::picker(select) { margin-top: .3rem; padding: .25rem; border: 1px solid #a4b6a5; border-radius: 10px; background: #fffefa; box-shadow: 0 8px 20px rgba(22, 55, 55, .18); }
.card-field-dialog #card-field-content select option { margin: 1px 0; padding: .35rem .55rem; border-radius: 8px; }
.card-field-dialog #card-field-content select option:hover,
.card-field-dialog #card-field-content select option:focus,
.card-field-dialog #card-field-content select option:checked { background: #e0ebda; }
.card-field-status { margin: 0 0 .75rem; color: #9d3027; font-weight: 600; }
body.dark-mode .card-field-status { color: #ffb5a9; }
body.dark-mode .card-field-dialog #card-field-content select::picker(select) { border-color: #416853; background: #173f32; color: #e5eee0; }
body.dark-mode #card-field-content select[name="terrain"]:disabled { border-color: #4d6255; background: #34453d; color: #aab8af; }
body.dark-mode .card-field-dialog #card-field-content select option:hover,
body.dark-mode .card-field-dialog #card-field-content select option:focus,
body.dark-mode .card-field-dialog #card-field-content select option:checked { background: #285944; }
.card-field-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.card-field-actions #card-field-save { background: #265847; color: #fff; border-color: #265847; }
body.dark-mode .card-field-dialog { border-color: #416853; background: #173f32; color: #e5eee0; }

@media (min-width: 851px) {
  #cards-view > .editor-panel #card-heading,
  #cards-view > .editor-panel #preview-note,
  #cards-view > .editor-panel #save-card,
  #cards-view > .editor-panel #card-form > .hint { display: none; }
  #cards-view > .editor-panel #download-png { margin-top: .65rem; }
}
#preview-note { min-height: 1.5rem; margin: .2rem 0; color: #a04034; text-align: center; }
#card-edit-hint { max-width: 24rem; margin: .35rem auto 0; color: #68756d; font-size: .95rem; line-height: 1.35; text-align: center; }
body.dark-mode #card-edit-hint { color: #fff; }
.card-status-control { display: grid; justify-items: center; gap: 3px; margin: .35rem auto 0; }
.card-status-control[hidden] { display: none; }
.card-status-label { color: #5a6e64; font-size: .58rem; font-weight: 700; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.card-test-status-button { position: relative; display: flex; align-items: center; justify-content: space-between; width: 80px; height: 30px; padding: 0 8px; border: 1px solid #adb5b1; border-radius: 999px; background: #e2e5e3; color: #39433e; font-size: .65rem; font-weight: 800; text-transform: uppercase; box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35), 0 2px 5px rgba(20, 49, 38, .14); transition: background .2s ease, border-color .2s ease; }
.card-test-status-button:hover:not(:disabled) { background: #d3dcd6; }
.card-status-state { position: relative; z-index: 1; margin-left: auto; }
.card-status-knob { position: absolute; z-index: 2; top: 50%; left: 4px; width: 22px; height: 22px; border: 1px solid rgba(255, 255, 255, .82); border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff, #d6e8db 55%, #a6c5ae); box-shadow: 0 2px 7px rgba(20, 49, 38, .3), inset 1px 1px 2px rgba(255, 255, 255, .92); transform: translateY(-50%); transition: transform .22s ease; }
.card-test-status-button[data-status="ready"] { border-color: #124b30; background: #17613d; color: #fff; }
.card-test-status-button[data-status="ready"] .card-status-state { margin-left: 0; }
.card-test-status-button[data-status="ready"] .card-status-knob { transform: translate(48px, -50%); }
.card-test-status-button[data-status="ready"]:hover:not(:disabled) { background: #287b50; color: #fff; }
.card-test-status-button:disabled { cursor: default; opacity: 1; }
body.dark-mode .card-status-label { color: #bfd1be; }
body.dark-mode .card-test-status-button { border-color: #7b8580; background: #4b5751; color: #edf0ee; }
body.dark-mode .card-test-status-button:hover:not(:disabled) { background: #5b6b62; }
body.dark-mode .card-list-item .card-testing-status { border-color: #7b8580; background: #4b5751; color: #edf0ee; }
body.dark-mode .card-test-status-button[data-status="ready"],
body.dark-mode .card-list-item .card-testing-status.ready { border-color: #58a677; background: #216d46; color: #fff; }
body.dark-mode .card-test-status-button[data-status="ready"]:hover:not(:disabled) { background: #34895c; color: #fff; }
#decks-view .card-preview-actions .card-status-control { flex: 0 0 auto; }
#download-png { align-self: center; }
.card-preview-actions { display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: .65rem; }
.card-preview-actions .card-status-control { margin: 0; }
#cards-view .card-preview-actions { gap: .25rem; }
.card-preview-actions > button { height: 2.35rem; min-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.download-png-button {
  width: 2.35rem;
  padding: .45rem;
  overflow: hidden;
  color: transparent !important;
  font-size: 0;
}
.card-preview-actions :is(#download-png, #deck-download-png, #deck-delete-card, #patron-download-png, #patron-delete-card).is-rendering:disabled { opacity: 1; }
.download-png-button::before {
  content: '';
  width: 100%;
  height: 100%;
  background: url('./assets/download-icon.png') center / contain no-repeat;
  filter: invert(1);
}
.delete-card-button {
  width: 2.35rem;
  padding: .45rem;
  overflow: hidden;
  color: transparent !important;
  font-size: 0;
}
.delete-card-button::before {
  content: '';
  width: 100%;
  height: 100%;
  background: url('./assets/delete-icon.png') center / contain no-repeat;
  filter: invert(1);
}
.add-to-deck-button { white-space: nowrap; }
.deck-preview-actions { width: 100%; justify-content: center; }
.deck-preview-actions > button { padding-inline: .5rem; white-space: nowrap; }
.card-preview-actions #download-png { margin-top: 0; }
#cards-view > .editor-panel .card-preview-actions #download-png { margin-top: 0; }
.danger-button { background: #a23d35; border-color: #a23d35; color: #fff; }
.danger-button:hover:not(:disabled) { background: #842f2a; border-color: #842f2a; }
.checkbox-line { display: flex; align-items: center; gap: .5rem; }
.author-picker { margin: .8rem 0; padding: .7rem; border: 1px solid #a4b6a5; border-radius: 8px; }
.author-picker legend { padding: 0 .35rem; font-weight: 700; }
.author-picker > div { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.author-option { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
.author-option input { width: auto; margin: 0; }
.patrons-workspace { max-width: 1100px; margin: 1rem auto; padding: .25rem; }
.patrons-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.patron-list { display: flex; flex-direction: column; gap: 0; margin-top: .55rem; }
.patron-card { display: grid; grid-template-columns: minmax(10rem, .75fr) minmax(11rem, 1fr) minmax(0, 1.4fr); grid-template-rows: auto auto; column-gap: .8rem; align-items: center; padding: .45rem .6rem; border: 0; border-bottom: 1px solid #e0e5dc; border-radius: 10px; background: transparent; }
.patron-card:last-child { border-bottom-color: transparent; }
.patron-card h3 { grid-column: 1; grid-row: 1; margin: 0; color: #265847; }
.patron-card h4 { margin: .25rem 0 .1rem; color: #456151; font-size: .75rem; }
.patron-faction { margin: .15rem 0 0; color: #68756d; font-size: .76rem; }
.patron-card blockquote { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding: .35rem .55rem; border-left: 3px solid #8da97e; background: #eef2e8; color: #385a45; font-size: .82rem; line-height: 1.3; }
.patron-card h4:nth-of-type(1) { grid-column: 3; grid-row: 1; }
.patron-card .patron-scoring { grid-column: 3; grid-row: 2; }
.patron-card h4:nth-of-type(2) { grid-column: 3; grid-row: 3; }
.patron-card .patron-ability { grid-column: 3; grid-row: 4; }
.patron-card p { margin: 0; line-height: 1.3; font-size: .78rem; }
.patron-card:hover { background: #eef3e8; }
@media (max-width: 850px) {
  .patron-card { grid-template-columns: minmax(8rem, .8fr) minmax(0, 1.2fr); grid-template-rows: auto auto auto; row-gap: .25rem; }
  .patron-card blockquote { grid-column: 2; grid-row: 1 / span 2; }
  .patron-card h4:nth-of-type(1), .patron-card .patron-scoring,
  .patron-card h4:nth-of-type(2), .patron-card .patron-ability { grid-column: 1 / -1; }
  .patron-card h4:nth-of-type(1) { grid-row: 3; }
  .patron-card .patron-scoring { grid-row: 4; }
  .patron-card h4:nth-of-type(2) { grid-row: 5; }
  .patron-card .patron-ability { grid-row: 6; }
}
.checkbox-line input { width: 1.1rem; height: 1.1rem; }
.deck-cards { display: flex; flex-direction: column; gap: 0; max-height: 480px; overflow: auto; border-top: 0; }
.deck-card-row { flex: 0 0 auto; grid-template-columns: 3.5rem minmax(0, 1fr) 5.6rem 5rem; min-height: 2.55rem; padding: .22rem .3rem; border: 0; border-bottom: 0; border-radius: 10px; background: transparent; cursor: pointer; transition: none; }
.deck-card-row:last-child { border-bottom-color: transparent; }
.deck-card-row .card-type-icon { width: 1.65rem; height: 1.65rem; }
.deck-card-row .card-list-title { font-size: .9rem; }
.deck-card-row .card-list-owner { display: none; }
.deck-card-row:hover { background: #eef3e8; }
.deck-card-row.selected { background: #b6dcb9; border-bottom-color: #91bd98; }
.deck-card-row.selected:hover { background: #acd6b1; }
#cards-view #card-list .card-list-item.selected:focus-visible,
#decks-view #deck-cards .deck-card-row.selected:focus-visible { outline: none; }
body:not(.dark-mode) #decks-view .deck-card-row.selected { background: #b6dcb9 !important; border-bottom-color: transparent !important; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2) !important; }
body.dark-mode .deck-card-row { border-bottom-color: #355947; background: transparent; }
body.dark-mode .deck-card-row:hover { background: #204b3b; }
body.dark-mode .deck-card-row.selected { border-bottom-color: #416853; background: #285944; }
body.dark-mode .deck-patron-preview-shell { border: 0; background: transparent; box-shadow: none; }
body.dark-mode .deck-summary { border-color: rgba(226, 246, 235, .3); background: linear-gradient(145deg, rgba(185, 220, 200, .2), rgba(45, 88, 68, .18)); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .2), 0 4px 14px rgba(0, 18, 12, .22); }
body.dark-mode .deck-summary-heading { color: #bfd1be; }
body.dark-mode .deck-summary-item:not(.terrain-symbiosis):not(.terrain-flow):not(.terrain-verdant):not(.terrain-radiance):not(.terrain-event) { color: #e5eee0; }
body.dark-mode .cards-summary .deck-summary-colors { border-top-color: rgba(226, 246, 235, .2); }
body.dark-mode #decks-view .deck-card-row.selected { background: #285944 !important; border-bottom-color: transparent !important; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .24), 0 2px 8px rgba(0, 18, 12, .18) !important; }
.deck-copy-controls { display: flex; grid-column: 4; align-items: center; justify-content: center; gap: .2rem; width: 5rem; }
#decks-view .deck-copy-button { display: inline-flex; flex: 0 0 1.5rem; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; font-size: 1rem; font-weight: 700; line-height: 1; }
.deck-copy-count { flex: 0 0 1rem; text-align: center; font-size: .9rem; }
.deck-card-row strong { grid-column: 4; text-align: center; }
@media (min-width: 851px) {
  .about-lead { max-width: 700px; margin-inline: auto; font-size: 1.3rem; white-space: normal; }
  html, body { height: 100%; overflow: hidden; }
  .workspace, .patrons-workspace { height: calc(100vh - 116px); min-height: 0; overflow: hidden; }
  #about-view.about-workspace { height: calc(100vh - 84px); min-height: 0; overflow: hidden; }
  .workspace > .sidebar, .workspace > .editor-panel, .patrons-panel { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; }
  .workspace > .sidebar { display: flex; flex-direction: column; }
  .workspace > .sidebar > .item-list { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; }
  #cards-view > .sidebar #card-list { padding-right: .2rem; }
  .patrons-panel { height: 100%; }
}
/* Active navigation cards use one shared appearance on desktop and mobile. */
.masthead nav button.active,
body.dark-mode .masthead nav button.active,
.masthead nav.mobile-menu-open button.active,
body.dark-mode .masthead nav.mobile-menu-open button.active {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(190, 218, 200, .08)) !important;
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(190, 218, 200, .08)) !important;
  color: #f2c96b !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1) !important;
  backdrop-filter: blur(10px);
}

@media (max-width: 850px) {
  #cards-view .cards-toolbar { flex-wrap: wrap; gap: .45rem; padding: 0 1rem; }
  #cards-view .cards-toolbar .cards-summary { flex-basis: 100%; }
  #cards-view .cards-toolbar .deck-summary-item { font-size: .72rem; }
  #cards-view .card-preview-shell #preview-note:empty { display: none; }
  #cards-view .card-preview-shell #card-edit-hint { display: block; margin: .15rem auto 0; font-size: .95rem; }
  #cards-view > .editor-panel #card-form > .hint { display: none; }
  body { scrollbar-gutter: auto; }
  .about-workspace { display: block; width: 100%; height: calc(100vh - 180px); margin: 0; padding: .5rem; overflow: hidden; }
  .about-panel { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; background-image: none; background-color: #fffdf4; }
  body.dark-mode .panel.about-panel { background-image: none; background-color: transparent; }
  .art-scroll-wrap.about-scroll-wrap { inset: 10% 4% 10% 4%; }
  .about-content { width: 100%; padding-right: .75rem; padding-left: .75rem; }
  .about-lead { font-size: 1.05rem; white-space: normal; }
  .about-intro { margin: 1rem auto 1.4rem; }
  .about-intro p { text-align: justify; }
  .terrain-icon { width: 100px; height: 70px; }
  .workspace,
  .patrons-workspace { background: transparent; border: 0; padding: 0; }
  .workspace,
  .patrons-workspace { margin: 1rem auto; }
  #cards-view > .cards-sidebar { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  #cards-view .card-table-shell { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
  #cards-view #card-list { min-height: 0; overflow-y: auto; scrollbar-width: none; }
  #cards-view #card-list::-webkit-scrollbar { display: none; }
  .workspace > .panel,
  .patrons-workspace > .panel,
  #about-view > .about-panel {
    border: 1px solid rgba(55, 91, 78, .46);
    border-image: none !important;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
  }
  body.dark-mode .workspace > .panel,
  body.dark-mode .patrons-workspace > .panel,
  body.dark-mode #about-view > .about-panel {
    border-color: rgba(226, 246, 235, .34);
    background: linear-gradient(145deg, rgba(185, 220, 200, .22) 0%, rgba(65, 111, 88, .18) 46%, rgba(12, 45, 35, .3) 100%);
    box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), inset -1px -1px 0 rgba(210, 239, 222, .06);
  }
  .art-scroll-rail:not(.play-archive-browser-body .art-scroll-rail) { display: none !important; }
  #decks-view .deck-card-table-shell > .art-scroll-wrap > .art-scroll-rail { display: flex !important; }
  .art-scroll-wrap > .item-list,
  .art-scroll-wrap > .deck-cards { width: 100%; padding-right: 0; }
  .deck-card-layout { grid-template-columns: 1fr; }
  #decks-view .deck-card-table-shell > .art-scroll-wrap { position: relative; max-height: 18rem; overflow: hidden; }
  #decks-view .deck-card-table-shell .art-scroll-wrap > .deck-cards { height: 100%; max-height: 18rem; overflow-y: auto; }
  .deck-card-preview-shell { display: none; }
  body.mobile-card-preview-visible { overflow: hidden; }
  #decks-view.mobile-card-preview-open::before {
    content: '';
    position: fixed;
    z-index: 39;
    inset: 0;
    background: rgba(8, 38, 31, .58);
  }
  #decks-view.mobile-card-preview-open .deck-card-preview-shell {
    display: flex;
    position: fixed;
    z-index: 40;
    inset: .75rem;
    overflow: auto;
    justify-content: flex-start;
    padding: 3.25rem 1rem 1rem;
    border: 1px solid #c4cebc;
    border-radius: 14px;
    background: #fffdf5;
    box-shadow: 0 18px 60px rgba(0, 19, 13, .45);
  }
  #decks-view.mobile-card-preview-open .deck-card-preview-close {
    display: block;
    position: absolute;
    top: .75rem;
    right: .75rem;
    padding: .25rem .6rem;
    font-size: 1.5rem;
    line-height: 1;
  }
  #decks-view.mobile-card-preview-open .card-terrain-aura { width: min(100%, 420px); }
  .workspace,
  #decks-view.workspace { grid-template-columns: 1fr; }
  .card-layout { grid-template-columns: 1fr; }
  #cards-view > .editor-panel { display: none; }
  body.mobile-editor-visible { overflow: hidden; }
  #cards-view.mobile-editor-open::before {
    content: '';
    position: fixed;
    z-index: 39;
    inset: 0;
    background: rgba(8, 38, 31, .58);
  }
  #cards-view.mobile-editor-open > .editor-panel {
    display: block;
    position: fixed;
    z-index: 40;
    inset: .75rem;
    overflow: auto;
    margin: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, .98) 0%, rgba(232, 241, 235, .97) 46%, rgba(215, 229, 221, .96) 100%);
    box-shadow: 0 18px 60px rgba(0, 19, 13, .45);
  }
  #cards-view.mobile-editor-open .card-layout { display: flex; flex-direction: column; }
  #cards-view.mobile-editor-open > .editor-panel > .panel-head { margin-bottom: .8rem; }
  #cards-view.mobile-editor-open .card-preview-shell { order: -1; }
  #cards-view.mobile-editor-open #card-heading,
  #cards-view.mobile-editor-open #save-card { display: none; }
  .mobile-editor-close { display: block; margin-left: auto; padding: .25rem .6rem; font-size: 1.5rem; line-height: 1; }
  .masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem .8rem;
    height: auto;
    min-height: 3.5rem;
    padding: .55rem .8rem .4rem;
  }
  .brand { position: absolute; top: 50%; left: 0; right: 3.15rem; justify-content: center; min-width: 0; transform: translateY(-50%); }
  .header-controls { width: 100%; flex: none; flex-wrap: wrap; justify-content: center; gap: .45rem; white-space: normal; }
  .mobile-menu-panel { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
  .theme-control { margin-left: auto; }
  .theme-label { display: block; }
  .theme-toggle { width: 62px; height: 28px; padding-inline: 6px; font-size: .5rem; }
  .theme-knob { left: 3px; width: 22px; height: 22px; }
  body.dark-mode .theme-knob { transform: translate(34px, -50%); }
  .masthead nav { order: 1; flex: 0 0 100%; justify-content: center; gap: .05rem; }
  .masthead nav button { padding: .55rem .75rem; }
  .mobile-menu-toggle { position: absolute; z-index: 26; top: 50%; right: .65rem; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; padding: 0; transform: translateY(-50%); border-color: rgba(213, 232, 201, .42); background: rgba(213, 232, 201, .08); color: #fff8e8; font-size: 1.35rem; line-height: 1; }
  .mobile-menu-toggle span:last-child { display: none; }
  .mobile-menu-toggle:hover:not(:disabled) { background: rgba(213, 232, 201, .16); }
  .mobile-menu-toggle[aria-expanded="true"] { border-color: #f2c96b; color: #f2c96b; }
  .mobile-menu-panel { position: static; }
  .mobile-menu-panel:not(:has(.mobile-menu-open)) .theme-control,
  .mobile-menu-panel:not(:has(.mobile-menu-open)) .account-controls { display: none; }
  .mobile-menu-panel:has(.mobile-menu-open) { position: absolute; z-index: 25; top: calc(100% + .35rem); left: .65rem; right: .65rem; display: grid; grid-template-columns: 1fr auto; gap: .55rem .75rem; padding: .55rem; border: 1px solid rgba(132, 177, 139, .55); border-radius: 12px; background: #153f34; box-shadow: 0 12px 28px rgba(0, 19, 13, .28); }
  .mobile-menu-panel:has(.mobile-menu-open) .theme-control { grid-column: 2; grid-row: 1; margin: 0; }
  .mobile-menu-panel:has(.mobile-menu-open) .account-controls { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .mobile-menu-panel:has(.mobile-menu-open) { left: auto; right: .65rem; width: max-content; min-width: 12rem; max-width: calc(100% - 1.3rem); display: flex; flex-direction: column; align-items: stretch; gap: .35rem; }
  .mobile-menu-panel:has(.mobile-menu-open) .theme-control { align-self: center; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: .5rem; }
  .mobile-menu-panel:has(.mobile-menu-open) .account-controls { flex-direction: column; align-items: center; justify-content: center; gap: .2rem; }
  .mobile-menu-panel:has(.mobile-menu-open) #account-name { margin-left: 0; }
  .mobile-menu-panel:has(.mobile-menu-open) nav { order: 1; }
  .mobile-menu-panel:has(.mobile-menu-open) .theme-control { order: 2; }
  .mobile-menu-panel:has(.mobile-menu-open) .account-controls { order: 3; }
  .masthead nav { display: none; grid-column: 1; grid-row: 1; flex-direction: column; gap: .15rem; }
  .masthead nav.mobile-menu-open { display: flex; }
  .masthead nav button { width: 100%; text-align: left; padding: .7rem .85rem; }
  .masthead nav.mobile-menu-open button.active { background: transparent; background-image: none; color: #f2c96b; }
  .masthead nav.mobile-menu-open button { text-align: center; }
  .account-controls { order: 2; margin-left: 0; padding-left: 0; border-left: 0; gap: .35rem; }
  body:has(#about-view:not([hidden])) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; scrollbar-gutter: auto; }
  body:has(#about-view:not([hidden])) .masthead { flex: 0 0 auto; }
  body:has(#cards-view:not([hidden])) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
  body:has(#cards-view:not([hidden])) .masthead { flex: 0 0 auto; }
  #cards-view.workspace { flex: 1 1 auto; min-height: 0; height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #cards-view .card-table-shell > .art-scroll-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  #cards-view .card-table-shell .art-scroll-wrap > #card-list { height: calc(100% - .55rem); }
  .about-workspace { flex: 1 1 auto; min-height: 0; width: calc(100% - 2rem); height: auto; margin: 1rem auto; padding: 0; }
  .art-scroll-wrap.about-scroll-wrap { inset: 4%; }
  .about-content { padding-top: 0; padding-bottom: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-principles { display: block; }
  .about-principles > h2 { text-align: center; }
  .about-section h2,
  .about-section h3 { text-align: center; }
  .about-principles .vision-layout { display: grid; row-gap: .35rem; }
  .about-section.about-principles > h3:first-of-type { margin-top: 1.5rem; }
  .about-section p, .about-section li { text-align: justify; }
  .about-rules { padding-top: .35rem; }
  .vision-layout { grid-template-columns: 1fr; }
  .vision-board-figure { max-width: 420px; }
  .rules-layout { grid-template-columns: 1fr; }
  .terrain-reference { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; height: auto; min-height: 0; aspect-ratio: 1.24 / 1; padding-top: 0; background-size: 100% auto; background-position: center; }
  .about-intro { margin: 0 auto; }
  .about-intro p:first-child { margin-top: 0; }
  .about-intro p:first-child { text-align: center; }
}

@media (max-width: 430px) {
  .card-filters { grid-template-columns: max-content minmax(0, 1fr); }
  .deck-meta-row { grid-template-columns: 1fr; }
  .masthead { padding-inline: .65rem; }
  .masthead nav button, #sign-in, #sign-out { padding: .5rem .6rem; }
  .header-controls { gap: .1rem; }
}

@media (display-mode: standalone) {
  .masthead { padding-top: calc(1.65rem + env(safe-area-inset-top)); }
  .theme-control { top: calc(.55rem + env(safe-area-inset-top)); }
}

body.dark-mode { color-scheme: dark; background: #102f27 url('./assets/site-background.jpg') center 60% / cover fixed no-repeat; color: #e5eee0; }
body.dark-mode .panel,
body.dark-mode .auth-panel,
body.dark-mode .auth-modal-card { border-color: #416853; background: #12372c; box-shadow: 0 12px 34px rgba(0, 18, 12, .28); }
body.dark-mode .panel { background: #12372c; }
body.dark-mode .panel.about-panel { background: #12372c url('./assets/about-frame.png') center / contain no-repeat; }
body.dark-mode button { border-color: #587965; background: #173f32; color: #e5eee0; }
body.dark-mode button:hover:not(:disabled) { background: #23503f; }
body.dark-mode .art-scroll-thumb { background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(171, 216, 184, .7) 48%, rgba(42, 94, 65, .46)); }
body.dark-mode .art-scroll-thumb:hover:not(:disabled) { background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(171, 216, 184, .78) 48%, rgba(42, 94, 65, .54)); }
body.dark-mode .masthead nav button,
body.dark-mode #sign-out,
body.dark-mode #account-name { background: transparent; color: #fff8e8; }
body.dark-mode .masthead nav button.active { background: transparent url('./assets/active-tab-frame.png') center / 100% 100% no-repeat; color: #f2c96b; }
body.dark-mode input:not([type=checkbox]):not([type=file]),
body.dark-mode select,
body.dark-mode textarea { border-color: #587965; background: #0d2b23; color: #e5eee0; }
body.dark-mode #card-form select[name="terrain"]:disabled { border-color: #4d6255; background: #34453d; color: #aab8af; }
body.dark-mode .favorite-card-trigger { border-color: #587965; background: #0d2b23; color: #e5eee0; }
body.dark-mode .favorite-card-menu { border-color: #587965; background: #12372c; box-shadow: 0 10px 24px #0008; }
body.dark-mode .favorite-card-option:hover:not(:disabled) { background: #285944; }
body.dark-mode .favorite-card-option-label.terrain-flow { color: #77b8d1; }
body.dark-mode .favorite-card-option-label.terrain-radiance { color: #e0b65a; }
body.dark-mode .favorite-card-option-label.terrain-symbiosis { color: #bc91dc; }
body.dark-mode .favorite-card-option-label.terrain-verdant { color: #91c99e; }
body.dark-mode #profile-form .favorite-card-trigger { border-color: #587965; background: #0d2b23; color: #e5eee0; }
body.dark-mode #profile-form .favorite-card-option { background: transparent; color: #e5eee0; border-color: transparent; }
body.dark-mode #profile-form .favorite-card-option:hover:not(:disabled) { background: #285944; color: #e5eee0; }
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #8fa99b; }
body.dark-mode .item-list button,
body.dark-mode .patron-card { border-color: #355947; background: #173f32; color: #e5eee0; }
body.dark-mode .item-list button:hover:not(:disabled) { background: #204b3b; }
body.dark-mode .item-list button.selected { border-color: #76a889; background: #285944; }
body.dark-mode #cards-view #card-list .card-list-item { border-bottom-color: #355947; background: transparent; }
body.dark-mode #cards-view #card-list .card-list-item:hover:not(:disabled) { background: #204b3b; }
body.dark-mode #cards-view #card-list .card-list-item.selected { border-bottom-color: #416853; background: #285944; }
body.dark-mode #decks-view #deck-list .deck-list-item { border-bottom-color: #355947; background: transparent; }
body.dark-mode #decks-view #deck-list .deck-list-item:hover:not(:disabled) { background: #204b3b; }
body.dark-mode #decks-view #deck-list .deck-list-item.selected { border-bottom-color: #416853; background: #285944; }
body.dark-mode #cards-view #card-list .card-list-owner,
body.dark-mode #decks-view #deck-list .deck-list-owner { color: #9aafa0; }
body.dark-mode .item-list small,
body.dark-mode .hint,
body.dark-mode .tag,
body.dark-mode .list-table-head,
body.dark-mode .card-filters label,
body.dark-mode .profile-group-title,
body.dark-mode #deck-card-preview-note,
body.dark-mode .patron-faction { color: #bfd1be; }
body.dark-mode .author-picker { border-color: #587965; }
body.dark-mode .profile-favorite-card { color: #c7d9c4; }
body.dark-mode .user-avatar { border-color: #76a889; background: #285944; color: #dcebd9; }
body.dark-mode .patron-card h3,
body.dark-mode .patron-card h4 { color: #d5e6cf; }
body.dark-mode .patron-card blockquote { border-left-color: #76a889; background: #0d2b23; color: #c7d9c4; }
body.dark-mode .deck-cards { border-top-color: #416853; }
body.dark-mode .deck-card-row:hover { background: #204b3b; box-shadow: inset 0 0 0 1px #416853; }
body.dark-mode .deck-card-row.selected { background: #285944; box-shadow: inset 0 0 0 1px #76a889; }
body.dark-mode .deck-card-row.selected:hover { background: #30634d; }
body.dark-mode :is(.card-list-title, .deck-summary-item).terrain-symbiosis { color: #c18ad5; }
body.dark-mode :is(.card-list-title, .deck-summary-item).terrain-flow { color: #83bfd1; }
body.dark-mode :is(.card-list-title, .deck-summary-item).terrain-verdant { color: #8fc99a; }
body.dark-mode :is(.card-list-title, .deck-summary-item).terrain-radiance { color: #e2bd70; }
body.dark-mode :is(.card-list-title, .deck-summary-item).terrain-event { color: #c0cec7; }
body.dark-mode #decks-view.mobile-card-preview-open .deck-card-preview-shell { border-color: #416853; background: #12372c; }
body.dark-mode #cards-view .cards-sidebar,
body.dark-mode #cards-view > .editor-panel,
body.dark-mode #about-view > .about-panel,
body.dark-mode #decks-view > .sidebar,
body.dark-mode #decks-view > .editor-panel,
body.dark-mode #profiles-view > .sidebar,
body.dark-mode #profiles-view > .editor-panel {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(185, 220, 200, .22) 0%, rgba(65, 111, 88, .18) 46%, rgba(12, 45, 35, .3) 100%);
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), inset -1px -1px 0 rgba(210, 239, 222, .06);
}
body.dark-mode .patron-card,
body.dark-mode .auth-panel,
body.dark-mode .auth-modal-card,
body.dark-mode .favorite-card-menu {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(185, 220, 200, .22), rgba(65, 111, 88, .18) 46%, rgba(12, 45, 35, .3));
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), inset -1px -1px 0 rgba(210, 239, 222, .06);
  backdrop-filter: blur(10px);
}

/* Shared glass treatment for active and selected controls on every viewport. */
.masthead nav button.active,
.mobile-menu-toggle,
.mobile-menu-panel:has(.mobile-menu-open),
.item-list button.selected,
#cards-view #card-list .card-list-item.selected,
#decks-view #deck-list .deck-list-item.selected,
.deck-card-row.selected {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
  background-image: none;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
  backdrop-filter: blur(10px);
}
body.dark-mode .masthead nav button.active,
body.dark-mode .mobile-menu-toggle,
body.dark-mode .mobile-menu-panel:has(.mobile-menu-open),
body.dark-mode .item-list button.selected,
body.dark-mode #cards-view #card-list .card-list-item.selected,
body.dark-mode #decks-view #deck-list .deck-list-item.selected,
body.dark-mode .deck-card-row.selected {
  border-color: rgba(203, 234, 210, .48);
  background: linear-gradient(145deg, rgba(185, 220, 200, .24), rgba(65, 111, 88, .18));
  background-image: none;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .24), 0 2px 8px rgba(0, 18, 12, .18);
}

body.dark-mode .masthead nav button:not(.active),
body.dark-mode .masthead nav button:not(.active):hover:not(:disabled) {
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 850px) {
  .panel.about-panel,
  body.dark-mode .panel.about-panel {
    background-image: none;
  }
  .mobile-menu-toggle,
  .mobile-menu-toggle:hover:not(:disabled),
  .mobile-menu-panel:has(.mobile-menu-open) {
    border-color: rgba(231, 248, 235, .55);
    background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(175, 215, 189, .12));
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3), 0 3px 12px rgba(0, 25, 16, .16);
    backdrop-filter: blur(12px);
  }
  body.dark-mode .mobile-menu-toggle,
  body.dark-mode .mobile-menu-toggle:hover:not(:disabled),
  body.dark-mode .mobile-menu-panel:has(.mobile-menu-open) {
    border-color: rgba(226, 246, 235, .42);
    background: linear-gradient(145deg, rgba(185, 220, 200, .24), rgba(12, 45, 35, .54));
  }
  .masthead nav.mobile-menu-open button.active,
  .item-list button.selected,
  #cards-view #card-list .card-list-item.selected,
  #decks-view #deck-list .deck-list-item.selected,
  .deck-card-row.selected {
    border-color: rgba(73, 120, 94, .55);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
    backdrop-filter: blur(10px);
  }
  body.dark-mode .item-list button.selected,
  body.dark-mode #cards-view #card-list .card-list-item.selected,
  body.dark-mode #decks-view #deck-list .deck-list-item.selected,
  body.dark-mode .deck-card-row.selected {
    border-color: rgba(203, 234, 210, .48);
    background: linear-gradient(145deg, rgba(185, 220, 200, .24), rgba(65, 111, 88, .18));
    box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .24), 0 2px 8px rgba(0, 18, 12, .18);
  }
  .mobile-menu-panel:has(.mobile-menu-open) {
    border-color: rgba(132, 177, 139, .55);
    background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
    box-shadow: 0 12px 28px rgba(0, 19, 13, .28);
    backdrop-filter: none;
  }
  body.dark-mode .mobile-menu-panel:has(.mobile-menu-open) {
    border-color: rgba(226, 246, 235, .34);
    background: linear-gradient(145deg, #102f27, #173f32 62%, #23503f);
  }
}
body.dark-mode .cards-sidebar,
body.dark-mode #cards-view > .editor-panel,
body.dark-mode #about-view > .about-panel,
body.dark-mode #decks-view > .sidebar,
body.dark-mode #decks-view > .editor-panel,
body.dark-mode #profiles-view > .sidebar,
body.dark-mode #profiles-view > .editor-panel,
body.dark-mode .patrons-workspace > .panel,
body.dark-mode .patron-card,
body.dark-mode .auth-panel,
body.dark-mode .auth-modal-card,
body.dark-mode .favorite-card-menu,
body.dark-mode .mobile-menu-panel:has(.mobile-menu-open) {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
  backdrop-filter: blur(10px);
}
body.dark-mode .masthead nav button.active,
body.dark-mode .item-list button.selected,
body.dark-mode #cards-view #card-list .card-list-item.selected,
body.dark-mode #decks-view #deck-list .deck-list-item.selected,
body.dark-mode .deck-card-row.selected {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 2px 8px rgba(0, 18, 12, .22);
}
body.dark-mode .masthead nav button.active,
body.dark-mode .mobile-menu-toggle,
body.dark-mode .mobile-menu-toggle:hover:not(:disabled),
body.dark-mode .masthead nav.mobile-menu-open button.active {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
  background-image: none;
  color: #f2c96b;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
}

/* Menu frames keep exactly the same appearance in both color modes. */
.masthead nav button.active,
body.dark-mode .masthead nav button.active,
.masthead nav.mobile-menu-open button.active,
body.dark-mode .masthead nav.mobile-menu-open button.active {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
  background-image: none;
  color: #f2c96b;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
  backdrop-filter: blur(10px);
}
.mobile-menu-toggle,
.mobile-menu-toggle:hover:not(:disabled),
body.dark-mode .mobile-menu-toggle,
body.dark-mode .mobile-menu-toggle:hover:not(:disabled) {
  border-color: rgba(231, 248, 235, .55);
  background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(175, 215, 189, .12));
  color: #fff8e8;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3), 0 3px 12px rgba(0, 25, 16, .16);
  backdrop-filter: blur(12px);
}
.mobile-menu-toggle[aria-expanded="true"],
body.dark-mode .mobile-menu-toggle[aria-expanded="true"] {
  border-color: #f2c96b;
  color: #f2c96b;
}
.mobile-menu-panel:has(.mobile-menu-open),
body.dark-mode .mobile-menu-panel:has(.mobile-menu-open) {
  border-color: rgba(132, 177, 139, .55);
  background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
  box-shadow: 0 12px 28px rgba(0, 19, 13, .28);
  backdrop-filter: none;
}

/* Dark mode uses the same deep green glass as the About workspace. */
body.dark-mode .workspace > .panel,
body.dark-mode .patrons-workspace > .panel,
body.dark-mode #cards-view .cards-sidebar,
body.dark-mode #cards-view > .editor-panel,
body.dark-mode #decks-view > .sidebar,
body.dark-mode #decks-view > .editor-panel,
body.dark-mode #profiles-view > .sidebar,
body.dark-mode #profiles-view > .editor-panel,
body.dark-mode .panel.about-panel,
body.dark-mode .patron-card,
body.dark-mode .auth-panel,
body.dark-mode .auth-modal-card,
body.dark-mode .favorite-card-menu,
body.dark-mode #decks-view.mobile-card-preview-open .deck-card-preview-shell,
body.dark-mode .item-list button.selected,
body.dark-mode #cards-view #card-list .card-list-item.selected,
body.dark-mode #decks-view #deck-list .deck-list-item.selected,
body.dark-mode .deck-card-row.selected {
  border-color: #416853 !important;
  background: linear-gradient(145deg, #153f34, #246047 62%, #34735a) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28) !important;
  backdrop-filter: blur(10px);
}
body.dark-mode .workspace,
body.dark-mode .patrons-workspace {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body:not(.dark-mode) #cards-view #card-list .card-list-item.selected,
body:not(.dark-mode) #decks-view #deck-list .deck-list-item.selected {
  border-bottom-color: transparent !important;
  background: #acd6b1 !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2) !important;
}
body:not(.dark-mode) #cards-view #card-list .card-list-item.selected .card-list-owner,
body:not(.dark-mode) #decks-view #deck-list .deck-list-item.selected .deck-list-owner { color: #15241d; }
body.dark-mode #cards-view #card-list .card-list-item.selected .card-list-owner,
body.dark-mode #decks-view #deck-list .deck-list-item.selected .deck-list-owner { color: #fff; }
body:not(.dark-mode) #new-card,
body:not(.dark-mode) #new-card:hover:not(:disabled),
body:not(.dark-mode) #card-field-cancel,
body:not(.dark-mode) #card-field-cancel:hover:not(:disabled),
body:not(.dark-mode) .back-to-decks,
body:not(.dark-mode) .back-to-decks:hover:not(:disabled),
body:not(.dark-mode) #new-deck,
body:not(.dark-mode) #new-deck:hover:not(:disabled),
body:not(.dark-mode) #download-all-cards,
body:not(.dark-mode) #download-all-cards:hover:not(:disabled),
body:not(.dark-mode) #save-deck-edit,
body:not(.dark-mode) #save-deck-edit:hover:not(:disabled),
body:not(.dark-mode) #cancel-delete-card,
body:not(.dark-mode) #cancel-delete-card:hover:not(:disabled),
body:not(.dark-mode) #cancel-delete-deck,
body:not(.dark-mode) #cancel-delete-deck:hover:not(:disabled),
body:not(.dark-mode) #download-png {
  border-color: transparent;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body:not(.dark-mode) #new-card:hover:not(:disabled), body:not(.dark-mode) #card-field-cancel:hover:not(:disabled), body:not(.dark-mode) #new-deck:hover:not(:disabled), body:not(.dark-mode) #download-all-cards:hover:not(:disabled), body:not(.dark-mode) #save-deck-edit:hover:not(:disabled), body:not(.dark-mode) #cancel-delete-card:hover:not(:disabled), body:not(.dark-mode) #cancel-delete-deck:hover:not(:disabled), body:not(.dark-mode) #download-png:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #new-card,
body.dark-mode #new-card:hover:not(:disabled),
body.dark-mode #card-field-cancel,
body.dark-mode #card-field-cancel:hover:not(:disabled),
body.dark-mode .back-to-decks,
body.dark-mode .back-to-decks:hover:not(:disabled),
body.dark-mode #new-deck,
body.dark-mode #new-deck:hover:not(:disabled),
body.dark-mode #download-all-cards,
body.dark-mode #download-all-cards:hover:not(:disabled),
body.dark-mode #save-deck-edit,
body.dark-mode #save-deck-edit:hover:not(:disabled),
body.dark-mode #cancel-delete-card,
body.dark-mode #cancel-delete-card:hover:not(:disabled),
body.dark-mode #cancel-delete-deck,
body.dark-mode #cancel-delete-deck:hover:not(:disabled),
body.dark-mode #download-png {
  border-color: #416853;
  background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body.dark-mode #new-card:hover:not(:disabled), body.dark-mode #card-field-cancel:hover:not(:disabled), body.dark-mode #new-deck:hover:not(:disabled), body.dark-mode #download-all-cards:hover:not(:disabled), body.dark-mode #save-deck-edit:hover:not(:disabled), body.dark-mode #cancel-delete-card:hover:not(:disabled), body.dark-mode #cancel-delete-deck:hover:not(:disabled), body.dark-mode #download-png:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#delete-card, #delete-deck, #profile-form #delete-account {
  border-color: rgba(166, 75, 67, .55);
  background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76) 100%);
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#delete-card:hover:not(:disabled), #delete-deck:hover:not(:disabled), #profile-form #delete-account:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28); }
body.dark-mode #delete-card, body.dark-mode #delete-deck, body.dark-mode #profile-form #delete-account {
  border-color: rgba(224, 143, 132, .5);
  background: linear-gradient(145deg, rgba(84, 20, 21, .72), rgba(137, 35, 31, .66) 46%, rgba(153, 43, 36, .64) 100%);
  color: #fff;
  color: #ffe8e3;
  box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .28), 0 6px 16px rgba(40, 10, 8, .3);
}
body.dark-mode #delete-card:hover:not(:disabled), body.dark-mode #delete-deck:hover:not(:disabled), body.dark-mode #profile-form #delete-account:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .34), 0 6px 16px rgba(40, 10, 8, .38); }
#confirm-delete-deck {
  border-color: rgba(166, 75, 67, .55);
  background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76) 100%);
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#confirm-delete-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28); }
body.dark-mode #confirm-delete-deck {
  border-color: rgba(224, 143, 132, .5);
  background: linear-gradient(145deg, rgba(84, 20, 21, .72), rgba(137, 35, 31, .66) 46%, rgba(153, 43, 36, .64) 100%);
  color: #ffe8e3;
  box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .28), 0 6px 16px rgba(40, 10, 8, .3);
}
body.dark-mode #confirm-delete-deck:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .34), 0 6px 16px rgba(40, 10, 8, .38); }
#confirm-delete-card {
  border-color: rgba(166, 75, 67, .55);
  background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76) 100%);
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#confirm-delete-card:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28); }
body.dark-mode #confirm-delete-card {
  border-color: rgba(224, 143, 132, .5);
  background: linear-gradient(145deg, rgba(84, 20, 21, .72), rgba(137, 35, 31, .66) 46%, rgba(153, 43, 36, .64) 100%);
  color: #ffe8e3;
  box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .28), 0 6px 16px rgba(40, 10, 8, .3);
}
body.dark-mode #confirm-delete-card:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .34), 0 6px 16px rgba(40, 10, 8, .38); }
#delete-card-modal .auth-modal-card,
#delete-deck-modal .auth-modal-card {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(225, 238, 229, .84) 62%, rgba(204, 224, 210, .8)) !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 18px 60px rgba(10, 35, 27, .32) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark-mode #delete-card-modal .auth-modal-card,
body.dark-mode #delete-deck-modal .auth-modal-card {
  border-color: rgba(226, 246, 235, .48) !important;
  background: linear-gradient(145deg, rgba(185, 220, 200, .86), rgba(65, 111, 88, .8) 62%, rgba(32, 82, 61, .76)) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .3), 0 18px 60px rgba(0, 18, 12, .38) !important;
}
#card-field-modal .card-field-backdrop {
  background: rgba(10, 35, 27, .44);
  backdrop-filter: blur(7px) saturate(.9);
  -webkit-backdrop-filter: blur(7px) saturate(.9);
}
#card-field-modal .card-field-dialog {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(225, 238, 229, .84) 62%, rgba(204, 224, 210, .8)) !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 18px 60px rgba(10, 35, 27, .32) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#card-field-modal #card-field-save,
body:not(.dark-mode) #new-card,
body:not(.dark-mode) #download-png {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#card-field-modal #card-field-save:hover:not(:disabled),
body:not(.dark-mode) #new-card:hover:not(:disabled),
body:not(.dark-mode) #download-png:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #card-field-modal .card-field-dialog {
  border-color: rgba(226, 246, 235, .48) !important;
  background: linear-gradient(145deg, rgba(185, 220, 200, .86), rgba(65, 111, 88, .8) 62%, rgba(32, 82, 61, .76)) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .3), 0 18px 60px rgba(0, 18, 12, .38) !important;
}
body.dark-mode #card-field-modal #card-field-save,
body.dark-mode #new-card,
body.dark-mode #download-png {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88));
  color: #eef8ed;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3);
}
body.dark-mode #card-field-modal #card-field-save:hover:not(:disabled),
body.dark-mode #new-card:hover:not(:disabled),
body.dark-mode #download-png:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body:not(.dark-mode) #new-card,
body:not(.dark-mode) #new-deck,
body:not(.dark-mode) #download-all-cards,
body:not(.dark-mode) #save-deck-edit,
body:not(.dark-mode) #download-png { background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88)); color: #fff; }
body.dark-mode #new-card,
body.dark-mode #new-deck,
body.dark-mode #download-all-cards,
body.dark-mode #save-deck-edit,
body.dark-mode #download-png { background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88)); color: #fff; }
body:not(.dark-mode) #new-card:hover:not(:disabled),
body:not(.dark-mode) #new-deck:hover:not(:disabled),
body:not(.dark-mode) #download-all-cards:hover:not(:disabled),
body:not(.dark-mode) #save-deck-edit:hover:not(:disabled),
body:not(.dark-mode) #download-png:hover:not(:disabled) { background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88)); color: #fff; }
body.dark-mode #new-card:hover:not(:disabled),
body.dark-mode #new-deck:hover:not(:disabled),
body.dark-mode #download-all-cards:hover:not(:disabled),
body.dark-mode #save-deck-edit:hover:not(:disabled),
body.dark-mode #download-png:hover:not(:disabled) { background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88)); color: #fff; }
body:not(.dark-mode) .deck-preview-actions > button:first-child { border-color: rgba(73, 120, 94, .55); background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88)); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
body.dark-mode .deck-preview-actions > button:first-child { border-color: rgba(226, 246, 235, .34); background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88)); color: #fff; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3); }
body:not(.dark-mode) .deck-preview-actions > button:first-child:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode .deck-preview-actions > button:first-child:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body:not(.dark-mode) .deck-preview-actions > button:last-child { border-color: rgba(166, 75, 67, .55); background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76)); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
body.dark-mode .deck-preview-actions > button:last-child { border-color: rgba(224, 143, 132, .5); background: linear-gradient(145deg, rgba(84, 20, 21, .72), rgba(137, 35, 31, .66) 46%, rgba(153, 43, 36, .64)); color: #ffe8e3; box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .28), 0 6px 16px rgba(40, 10, 8, .3); }
body:not(.dark-mode) .deck-preview-actions > button:last-child:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28); }
body.dark-mode .deck-preview-actions > button:last-child:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .34), 0 6px 16px rgba(40, 10, 8, .38); }
body:not(.dark-mode) .deck-preview-actions .download-png-button {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body.dark-mode .deck-preview-actions .download-png-button {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3);
}
body:not(.dark-mode) .deck-preview-actions .download-png-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode .deck-preview-actions .download-png-button:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body:not(.dark-mode) #add-to-deck,
body:not(.dark-mode) #deck-add-to-deck,
body:not(.dark-mode) #patron-add-to-deck {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body.dark-mode #add-to-deck,
body.dark-mode #deck-add-to-deck,
body.dark-mode #patron-add-to-deck {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3);
}
body:not(.dark-mode) #add-to-deck:hover:not(:disabled),
body:not(.dark-mode) #deck-add-to-deck:hover:not(:disabled),
body:not(.dark-mode) #patron-add-to-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #add-to-deck:hover:not(:disabled),
body.dark-mode #deck-add-to-deck:hover:not(:disabled),
body.dark-mode #patron-add-to-deck:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body:not(.dark-mode) #auth-submit,
body:not(.dark-mode) #auth-submit:hover:not(:disabled) { background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88)); color: #fff; }
body.dark-mode #auth-submit,
body.dark-mode #auth-submit:hover:not(:disabled) { background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88)); color: #fff; }
body:not(.dark-mode) #auth-submit:hover:not(:disabled), body.dark-mode #auth-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.is-loading { cursor: progress; opacity: .88; }
.is-loading::before { content: ""; display: inline-block; width: .85em; height: .85em; margin-right: .55em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-submit-spin .7s linear infinite; }
@keyframes auth-submit-spin { to { transform: rotate(360deg); } }
#auth-modal .auth-modal-card {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(225, 238, 229, .84) 62%, rgba(204, 224, 210, .8)) !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 18px 60px rgba(10, 35, 27, .32) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark-mode #auth-modal .auth-modal-card {
  border-color: rgba(226, 246, 235, .48) !important;
  background: linear-gradient(145deg, rgba(185, 220, 200, .86), rgba(65, 111, 88, .8) 62%, rgba(32, 82, 61, .76)) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .3), 0 18px 60px rgba(0, 18, 12, .38) !important;
}
#auth-modal #auth-mode-toggle {
  border-color: transparent;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#auth-modal #auth-mode-toggle:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #auth-modal #auth-mode-toggle {
  border-color: #416853;
  background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
}
body.dark-mode #auth-modal #auth-mode-toggle:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body:not(.dark-mode) #sign-out,
body:not(.dark-mode) #edit-card-tags,
body:not(.dark-mode) #deck-cover-button,
body:not(.dark-mode) #edit-deck,
body:not(.dark-mode) #duplicate-deck,
body:not(.dark-mode) #cancel-deck-edit,
body:not(.dark-mode) #sign-out:hover:not(:disabled),
body:not(.dark-mode) #edit-card-tags:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body:not(.dark-mode) #sign-out:hover:not(:disabled), body:not(.dark-mode) #edit-card-tags:hover:not(:disabled), body:not(.dark-mode) #deck-cover-button:hover:not(:disabled), body:not(.dark-mode) #edit-deck:hover:not(:disabled), body:not(.dark-mode) #duplicate-deck:hover:not(:disabled), body:not(.dark-mode) #cancel-deck-edit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #sign-out,
body.dark-mode #edit-card-tags,
body.dark-mode #deck-cover-button,
body.dark-mode #edit-deck,
body.dark-mode #duplicate-deck,
body.dark-mode #cancel-deck-edit,
body.dark-mode #sign-out:hover:not(:disabled),
body.dark-mode #edit-card-tags:hover:not(:disabled) {
  border-color: #416853;
  background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body.dark-mode #sign-out:hover:not(:disabled), body.dark-mode #edit-card-tags:hover:not(:disabled), body.dark-mode #deck-cover-button:hover:not(:disabled), body.dark-mode #edit-deck:hover:not(:disabled), body.dark-mode #duplicate-deck:hover:not(:disabled), body.dark-mode #cancel-deck-edit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#confirm-add-to-deck {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#confirm-add-to-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
#cancel-add-to-deck,
#cancel-add-to-deck:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#cancel-add-to-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #confirm-add-to-deck {
  border-color: rgba(226, 246, 235, .34);
  background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3);
}
body.dark-mode #confirm-add-to-deck:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
body.dark-mode #cancel-add-to-deck,
body.dark-mode #cancel-add-to-deck:hover:not(:disabled) {
  border-color: #416853;
  background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%);
  color: #15241d;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
}
body.dark-mode #cancel-add-to-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#profile-form input[type=file]::file-selector-button {
  margin-right: .6rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%);
  color: #15241d;
  padding: .55rem .8rem;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#profile-form input[type=file]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #profile-form input[type=file]::file-selector-button { border-color: #416853; background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%); color: #15241d; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28); }
body.dark-mode #profile-form input[type=file]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#profile-form .profile-save-actions > button[type=submit],
#profile-new-deck {
  border-color: rgba(73, 120, 94, .55);
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#profile-form .profile-save-actions > button[type=submit]:hover:not(:disabled),
#profile-new-deck:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28); }
body.dark-mode #profile-form .profile-save-actions > button[type=submit],
body.dark-mode #profile-new-deck { border-color: rgba(226, 246, 235, .34); background: linear-gradient(145deg, rgba(47, 92, 64, .86), rgba(42, 94, 65, .84) 52%, rgba(28, 70, 52, .88)); color: #eef8ed; box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 6px 16px rgba(0, 18, 12, .3); }
body.dark-mode #profile-form .profile-save-actions > button[type=submit]:hover:not(:disabled),
body.dark-mode #profile-new-deck:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38); }
#profile-form #delete-account { border-color: rgba(166, 75, 67, .55); background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76) 100%); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
#profile-form #delete-account:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28); }
body.dark-mode #profile-form #delete-account { border-color: rgba(224, 143, 132, .5); background: linear-gradient(145deg, rgba(84, 20, 21, .72), rgba(137, 35, 31, .66) 46%, rgba(153, 43, 36, .64) 100%); color: #ffe8e3; box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .28), 0 6px 16px rgba(40, 10, 8, .3); }
body.dark-mode #profile-form #delete-account:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255, 232, 227, .34), 0 6px 16px rgba(40, 10, 8, .38); }
#cards-view #card-list .card-list-item { border-bottom-color: transparent !important; }
@media (max-width: 850px) {
  body.dark-mode #about-view > .about-panel {
    backdrop-filter: none !important;
    box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28) !important;
  }

  .masthead nav.mobile-menu-open button.active {
    border-color: rgba(73, 120, 94, .55);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
    color: #f2c96b;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
    backdrop-filter: blur(10px);
  }
  body.dark-mode .masthead nav.mobile-menu-open button.active {
    border-color: rgba(73, 120, 94, .55);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(190, 218, 200, .4));
    color: #f2c96b;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 49, 38, .1);
  }
}

/* Patron rows use the same compact table treatment as the Cards list. */
#patrons-view .patron-list { gap: 0; margin-top: .55rem; }
#patrons-view .patron-card {
  display: grid;
  grid-template-columns: minmax(8rem, .65fr) minmax(10rem, 1fr) minmax(0, 1.35fr);
  grid-template-rows: auto auto;
  min-height: 2.25rem;
  padding: .22rem .3rem;
  border: 0;
  border-bottom: 1px solid #e0e5dc;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}
#patrons-view .patron-card:last-child { border-bottom-color: transparent; }
#patrons-view .patron-card:hover { background: #eef3e8; }
#patrons-view .patron-card h3 { font-size: .9rem; }
#patrons-view .patron-card blockquote { font-size: .78rem; }
body.dark-mode #patrons-view .patron-card { border-color: transparent; background: transparent; box-shadow: none; }
body.dark-mode #patrons-view .patron-card:hover { background: #204b3b; }
@media (max-width: 850px) {
  #patrons-view .patron-card { grid-template-columns: minmax(7rem, .75fr) minmax(0, 1.25fr); }
}

#patrons-view.workspace { max-width: 1100px; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr); justify-content: center; }
#patrons-view > .panel {
  border: 1px solid rgba(55, 91, 78, .46);
  border-image: none !important;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
  backdrop-filter: blur(10px);
  padding: .8rem;
}
#patrons-view > .patrons-sidebar { display: flex; flex-direction: column; min-height: 0; }
#patrons-view .patron-table-shell { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
#patrons-view .patron-list-head, #patrons-view .patron-list-item { grid-template-columns: minmax(0, 1fr) minmax(6rem, auto); }
#patrons-view .patron-list-head { margin: .8rem .3rem .15rem; }
#patrons-view #patron-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: .55rem; padding-bottom: .7rem; }
#patrons-view #patron-list .patron-list-item { min-height: 2.25rem; padding: .22rem .3rem; border: 0; border-bottom: 1px solid transparent; border-radius: 10px; background: transparent; font-size: .9rem; }
#patrons-view #patron-list .patron-list-item .card-list-title { padding-left: .4rem; }
#patrons-view #patron-list .patron-faction-flowbound { color: #35758e; }
#patrons-view #patron-list .patron-faction-brightworks { color: #a87318; }
#patrons-view #patron-list .patron-faction-dreamwardens { color: #784997; }
#patrons-view #patron-list .patron-faction-verdant { color: #488057; }
#patrons-view #patron-list .patron-list-item:hover { background: #eef3e8; }
#patrons-view #patron-list .patron-list-item.selected { background: #b6dcb9; border-bottom-color: #91bd98; }
#patrons-view #patron-list .card-list-owner { grid-column: 2; justify-content: flex-start; text-align: left; font-size: .7rem; }
#patrons-view .patron-detail-panel { min-height: 0; overflow-y: auto; }
#patrons-view .patron-detail { display: flex; min-height: 100%; align-items: flex-start; justify-content: center; }
#patrons-view #patron-card-canvas { width: min(100%, 300px); height: auto; aspect-ratio: 5 / 7; border-radius: 0; box-shadow: none; background: transparent; }
#patrons-view .patron-detail h2 { margin: 0; color: #265847; }
#patrons-view .patron-detail h3 { margin: 1.1rem 0 .3rem; color: #456151; font-size: .95rem; }
#patrons-view .patron-detail .patron-faction { margin: .25rem 0 1rem; }
#patrons-view .patron-detail blockquote { margin: 0 0 1rem; padding: .65rem .8rem; border-left: 3px solid #8da97e; background: #eef2e8; color: #385a45; }
#patrons-view .patron-detail p { line-height: 1.5; }
body.dark-mode #patrons-view #patron-list .patron-list-item { border-color: transparent; background: transparent; color: #e5eee0; box-shadow: none; }
body.dark-mode #patrons-view #patron-list .patron-list-item:hover { background: #204b3b; }
body.dark-mode #patrons-view #patron-list .patron-list-item.selected { background: #285944 !important; box-shadow: inset 0 0 0 1px #76a889 !important; }
body.dark-mode #patrons-view .patron-detail h2, body.dark-mode #patrons-view .patron-detail h3 { color: #d5e6cf; }
body.dark-mode #patrons-view .patron-detail blockquote { border-left-color: #76a889; background: #0d2b23; color: #c7d9c4; }
@media (max-width: 850px) {
  #patrons-view.workspace { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
  #patrons-view .patron-detail-panel { overflow: visible; }
  #patrons-view .patron-detail { min-height: 0; }
}

/* Keep every select arrow inside its field and reserve room for truncated labels. */
select {
  max-width: 100%;
  padding-right: 2.25rem !important;
  appearance: base-select !important;
  background-image: linear-gradient(45deg, transparent 50%, #456151 50%), linear-gradient(135deg, #456151 50%, transparent 50%) !important;
  background-position: calc(100% - 1rem) 50%, calc(100% - .7rem) 50% !important;
  background-size: .35rem .35rem !important;
  background-repeat: no-repeat !important;
}
body.dark-mode select {
  background-image: linear-gradient(45deg, transparent 50%, #d5e6cf 50%), linear-gradient(135deg, #d5e6cf 50%, transparent 50%) !important;
}
select::picker-icon { display: none; }
select::picker(select) { appearance: base-select; position-area: block-end; position-try-fallbacks: none; margin-top: .3rem; padding: .25rem; border: 1px solid #a4b6a5; border-radius: 10px; background: #fffefa; box-shadow: 0 8px 20px rgba(22, 55, 55, .18); }
select option { margin: 1px 0; padding: .35rem .55rem; border-radius: 8px; }
select option:hover, select option:focus, select option:checked { background: #e0ebda; }
body.dark-mode select::picker(select) { border-color: #416853; background: #173f32; color: #e5eee0; }
body.dark-mode select option:hover, body.dark-mode select option:focus, body.dark-mode select option:checked { background: #285944; }
@media (max-width: 850px) {
  .deck-card-list-head { margin-right: .3rem; }
  .deck-summary { flex-direction: column; gap: .55rem; }
  .deck-summary-group { flex-wrap: wrap; gap: .45rem .7rem; }
}

@media (min-width: 851px) {
  #cards-view.workspace,
  #profiles-view.workspace,
  #patrons-view.workspace {
    max-width: 1100px;
    justify-content: stretch;
    gap: .8rem;
    padding: .8rem;
    border: 1px solid rgba(55, 91, 78, .46);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9) 0%, rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42) 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
  }
  #cards-view.workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  #profiles-view.workspace { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
  #patrons-view.workspace { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
  #decks-view.workspace { max-width: 1100px; padding: 0; }
  #decks-view > .sidebar,
  #decks-view > .editor-panel { padding: 1.6rem; }
  #about-view.about-workspace { width: calc(100% - 2rem); max-width: 1100px; }
  #about-view.about-workspace > .about-panel { width: 100%; max-width: none; }
  #about-view > .about-panel .about-scroll-wrap { inset: 1.6rem; }
  #cards-view > .cards-sidebar,
  #cards-view > .editor-panel,
  #profiles-view > .sidebar,
  #profiles-view > .editor-panel,
  #patrons-view > .panel {
    width: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.dark-mode #cards-view.workspace,
  body.dark-mode #profiles-view.workspace,
  body.dark-mode #patrons-view.workspace {
    border-color: #416853;
    background: linear-gradient(145deg, #153f34, #246047 62%, #34735a);
    box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28);
  }
  body.dark-mode #cards-view > .cards-sidebar,
  body.dark-mode #cards-view > .editor-panel,
  body.dark-mode #profiles-view > .sidebar,
  body.dark-mode #profiles-view > .editor-panel,
  body.dark-mode #patrons-view > .panel {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* All popup frames share the card editor's frosted glass surface. */
body:not(.dark-mode) .auth-modal .auth-modal-card,
body:not(.dark-mode) #card-field-modal .card-field-dialog {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(225, 238, 229, .84) 62%, rgba(204, 224, 210, .8)) !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 18px 60px rgba(10, 35, 27, .32) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark-mode .auth-modal .auth-modal-card,
body.dark-mode #card-field-modal .card-field-dialog {
  border-color: rgba(226, 246, 235, .48) !important;
  background: linear-gradient(145deg, rgba(185, 220, 200, .86), rgba(65, 111, 88, .8) 62%, rgba(32, 82, 61, .76)) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .3), 0 18px 60px rgba(0, 18, 12, .38) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Public guide pages share the About frame and scroll surface. */
.about-intro h1,
.guide-intro h1 { margin: .15rem 0 .55rem; color: #265847; font: 700 clamp(2rem, 4vw, 3.1rem) Nunito, Arial, sans-serif; }
.about-intro h1 { font-family: Nunito, Arial, sans-serif; font-weight: 800; }
.about-intro .about-lead { margin-bottom: .45rem; }
.info-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.info-actions button,
.faction-footer button { border-color: #8fae98; background: #e9f1e3; font-weight: 800; }
.guide-intro { margin: .35rem 0 1.35rem; text-align: center; }
.guide-intro p { max-width: 760px; margin: .45rem auto; line-height: 1.6; }
.guide-workspace .about-content { padding: .8rem 1.35rem 1.4rem; border-radius: 16px; background: rgba(255, 253, 244, .78); }
.guide-index { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-bottom: 1.35rem; }
.guide-index button,
:is(#about-view, #rules-view) .info-actions button { padding: .42rem .65rem; border: 1px solid #8daf94; border-radius: 999px; background: rgba(216, 236, 216, .94); font-size: .85rem; font-weight: 700; }
.guide-index button:hover:not(:disabled),
:is(#about-view, #rules-view) .info-actions button:hover:not(:disabled) { background: #c3e2c6; }
.guide-section { padding: 1.15rem .15rem 1.3rem; border-top: 1px solid rgba(78, 112, 90, .28); scroll-margin-top: 1rem; }
.guide-section h2,
.faction-card h2 { margin: 0 0 .55rem; color: #265847; font: 700 1.65rem Nunito, Arial, sans-serif; }
.guide-section h3,
.faction-card h3 { margin: .85rem 0 .25rem; color: #265847; font-size: 1.03rem; }
.guide-section p,
.guide-section li,
.guide-section dd,
.faction-card p,
.faction-footer { color: #405b4d; line-height: 1.58; }
.guide-section p { margin: .5rem 0; }
.guide-section ol,
.guide-section ul { margin: .6rem 0 .85rem; padding-left: 1.4rem; }
.guide-section li + li { margin-top: .3rem; }
.guide-pair,
.faction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.guide-pair > div,
.faction-card { padding: .8rem 1rem; border: 1px solid rgba(116, 153, 126, .38); border-radius: 12px; background: rgba(246, 249, 239, .55); }
.guide-glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.25rem; margin: .8rem 0 0; }
.guide-glossary div { padding-bottom: .55rem; border-bottom: 1px solid rgba(78, 112, 90, .2); }
.guide-glossary dt { color: #265847; font-weight: 800; }
.guide-glossary dd { margin: .15rem 0 0; }
.faction-card { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 1.1rem 1.2rem; }
.faction-card > p:first-of-type { align-self: start; }
.faction-card h3 { border-top: 1px solid rgba(78, 112, 90, .22); padding-top: .75rem; }
.faction-traits { margin: .5rem 0 .85rem; padding-left: 1.25rem; color: #405b4d; line-height: 1.5; }
.faction-traits li + li { margin-top: .35rem; }
.faction-terrain { color: #87612b; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.faction-card .faction-note { margin-top: 1rem; font-size: .85rem; font-style: italic; }
.faction-footer { margin: 1.2rem 0 .5rem; text-align: center; }

body.dark-mode .about-intro h1,
body.dark-mode .guide-intro h1,
body.dark-mode .guide-section h2,
body.dark-mode .guide-section h3,
body.dark-mode .guide-glossary dt,
body.dark-mode .faction-card h2,
body.dark-mode .faction-card h3 { color: #c8dfb8; }
body.dark-mode .guide-intro p,
body.dark-mode .guide-section p,
body.dark-mode .guide-section li,
body.dark-mode .guide-section dd,
body.dark-mode .faction-card p,
body.dark-mode .faction-traits,
body.dark-mode .faction-footer { color: #d1dfd0; }
body.dark-mode .guide-pair > div,
body.dark-mode .faction-card { border-color: rgba(168, 201, 173, .27); background: rgba(15, 53, 38, .32); }
body.dark-mode .guide-index button,
body.dark-mode .info-actions button,
body.dark-mode .faction-footer button { border-color: #638b6d; background: #285944; color: #f1f6e9; }
body.dark-mode .guide-index button,
body.dark-mode :is(#about-view, #rules-view) .info-actions button { border-color: #77a783; background: #316e4e; }
body.dark-mode .guide-index button:hover:not(:disabled),
body.dark-mode :is(#about-view, #rules-view) .info-actions button:hover:not(:disabled) { background: #3b805b; }
body.dark-mode .faction-terrain { color: #f2c96b; }
body.dark-mode .guide-workspace .about-content { background: rgba(18, 55, 44, .84); }

@media (min-width: 851px) {
  .guide-workspace.about-workspace { width: calc(100% - 2rem); max-width: 1100px; }
  .guide-workspace.about-workspace > .about-panel { width: 100%; max-width: none; }
  .guide-workspace > .about-panel .about-scroll-wrap { inset: 8% 15% 12% 14%; }
}
@media (max-width: 850px) {
  body:has(.guide-workspace:not([hidden])) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; scrollbar-gutter: auto; }
  body:has(.guide-workspace:not([hidden])) .masthead { flex: 0 0 auto; }
  .guide-workspace.about-workspace { flex: 1 1 auto; min-height: 0; width: calc(100% - 2rem); height: auto; margin: 1rem auto; padding: 0; }
  .guide-workspace.about-workspace > .about-panel { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; background-image: none; background-color: #fffdf4; }
  body.dark-mode .guide-workspace > .about-panel { background-image: none; background-color: transparent; }
  .guide-workspace > .about-panel .about-scroll-wrap { inset: 4%; }
  .guide-workspace .about-content { width: 100%; padding: .4rem .75rem 1rem; }
  .guide-pair,
  .faction-grid,
  .guide-glossary { grid-template-columns: 1fr; }
}

/* Shared action styles: Cancel/Choose uses the light style, Add/Save mirrors Add New Card,
   and Delete mirrors Delete Deck throughout the app. */
body:not(.dark-mode) button:is(.action-cancel, .action-choose) {
  border-color: transparent !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .99) 0%, rgba(240, 246, 242, .84) 46%, rgba(225, 236, 229, .64) 100%) !important;
  color: #15241d !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .58), 0 2px 8px rgba(34, 98, 49, .2) !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body.dark-mode button:is(.action-cancel, .action-choose) {
  border-color: #416853 !important;
  background: linear-gradient(145deg, rgba(220, 244, 226, .4) 0%, rgba(91, 143, 111, .32) 46%, rgba(28, 70, 52, .44) 100%) !important;
  color: #15241d !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28) !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body:not(.dark-mode) button:is(.action-cancel, .action-choose):hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), 0 5px 12px rgba(34, 98, 49, .28) !important; }
body.dark-mode button:is(.action-cancel, .action-choose):hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .34), 0 6px 16px rgba(0, 18, 12, .38) !important; }
button:is(#card-field-cancel, #cancel-deck-edit, #play-cancel-name) {
  background: linear-gradient(145deg, #485d53, #30463c) !important;
  color: #fff !important;
}

#play-game .play-menu-toggle,
body:not(.dark-mode) button.action-add-save,
body.dark-mode button.action-add-save,
body.dark-mode #sign-out {
  border-color: rgba(73, 120, 94, .55) !important;
  background: linear-gradient(145deg, rgba(64, 112, 79, .92), rgba(52, 117, 90, .9) 52%, rgba(38, 88, 71, .88)) !important;
  color: #fff !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(34, 98, 49, .2) !important;
  font-weight: 400;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
#play-game .play-menu-toggle:hover,
#play-game .play-table-menu[open] .play-menu-toggle,
body:not(.dark-mode) button.action-add-save:hover:not(:disabled),
body.dark-mode button.action-add-save:hover:not(:disabled),
body.dark-mode #sign-out:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), 0 5px 12px rgba(34, 98, 49, .28) !important; }

body:not(.dark-mode) button.action-delete,
body.dark-mode button.action-delete {
  border-color: rgba(166, 75, 67, .55) !important;
  background: linear-gradient(145deg, rgba(137, 38, 32, .86), rgba(176, 61, 52, .82) 46%, rgba(183, 65, 55, .76) 100%) !important;
  color: #fff !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72), 0 2px 8px rgba(125, 48, 40, .18) !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
body:not(.dark-mode) button.action-delete:hover:not(:disabled),
body.dark-mode button.action-delete:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .82), 0 5px 12px rgba(125, 48, 40, .28) !important; }

/* Faction cards use the existing faction marks and a restrained glass tint. */
#factions-view .faction-card { border-color: rgba(var(--faction-color), .36); background: linear-gradient(145deg, rgba(var(--faction-color), .29), rgba(var(--faction-color), .12) 78%), rgba(255, 255, 255, .24); backdrop-filter: blur(8px); }
#factions-view .faction-verdant { --faction-color: 62, 160, 85; }
#factions-view .faction-brightworks { --faction-color: 227, 162, 38; }
#factions-view .faction-flowbound { --faction-color: 51, 150, 207; }
#factions-view .faction-dreamwardens { --faction-color: 160, 87, 205; }
.faction-card-head { display: flex; align-items: center; gap: .85rem; min-height: 3.6rem; margin-bottom: .55rem; }
.faction-card-head > div { min-width: 0; }
.faction-card-head h2 { margin: .1rem 0 0; }
.faction-logo { display: block; flex: 0 0 auto; width: 3.5rem; height: 3.5rem; object-fit: contain; }
body.dark-mode #factions-view .faction-card { border-color: rgba(var(--faction-color), .45); background: linear-gradient(145deg, rgba(var(--faction-color), .3), rgba(var(--faction-color), .13) 78%), rgba(15, 53, 38, .38); }

@media (min-width: 851px) and (max-height: 700px) {
  #decks-view:not(.deck-detail-open) #deck-list { gap: .5rem; }
  #decks-view:not(.deck-detail-open) .deck-gallery-section h2 { margin-bottom: .35rem; }
  #decks-view:not(.deck-detail-open) .deck-gallery-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 180px)); gap: .55rem; }
  #decks-view:not(.deck-detail-open) #deck-list .deck-list-item { padding: .3rem; }
  #decks-view:not(.deck-detail-open) .deck-tile-cover { aspect-ratio: 2.2 / 1; }
  #decks-view:not(.deck-detail-open) #deck-list .deck-list-title { font-size: .82rem; }
  #decks-view:not(.deck-detail-open) #deck-list .deck-list-owner { font-size: .65rem; }
}

/* Rules and Factions use the same glass shell as the other workspace views. */
.guide-workspace.about-workspace { width: calc(100% - 2rem); max-width: 1100px; height: calc(100vh - 116px); margin: 1rem auto; }
.guide-workspace.about-workspace > .guide-panel {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  border: 1px solid rgba(55, 91, 78, .46);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42)) !important;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 1), inset -1px -1px 0 rgba(97, 135, 120, .26);
}
.guide-workspace > .guide-panel .about-scroll-wrap { inset: 1rem; }
.guide-workspace .about-content { background: transparent; border-radius: 0; }
body.dark-mode .guide-workspace.about-workspace > .guide-panel {
  border-color: #416853 !important;
  background: linear-gradient(145deg, #153f34, #246047 62%, #34735a) !important;
  box-shadow: inset 1px 1px 0 rgba(235, 255, 243, .28), 0 8px 24px rgba(0, 18, 12, .28) !important;
}
body.dark-mode .guide-workspace .about-content { background: transparent; }

@media (min-width: 1100px) {
  #factions-view.guide-workspace.about-workspace { max-width: 1500px; }
  #factions-view .faction-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
  #factions-view .faction-card { padding: .95rem; }
  #factions-view .faction-card-head { gap: .6rem; }
  #factions-view .faction-logo { width: 2.8rem; height: 2.8rem; flex-basis: 2.8rem; }
  #factions-view .faction-card h2 { font-size: 1.4rem; }
}

@media (max-width: 850px) {
  .guide-workspace.about-workspace { flex: 1 1 auto; min-height: 0; height: auto; }
  .guide-workspace > .guide-panel .about-scroll-wrap { inset: .75rem; }
  .guide-workspace .art-scroll-rail { display: flex !important; }
}

/* About, Rules and Factions share one shell and persistent internal tabs. */
.about-hub {
  display: flex;
  flex-direction: column;
  width: calc(100% - 2rem);
  max-width: 1100px;
  height: calc(100dvh - 116px);
  min-height: 0;
  margin: 1rem auto;
  overflow: hidden;
  border: 1px solid rgba(55, 91, 78, .46);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(224, 234, 229, .66) 46%, rgba(202, 219, 211, .42));
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(97, 135, 120, .26);
}
.about-subtabs { display: flex; flex: 0 0 auto; gap: .4rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(55, 91, 78, .2); }
.about-subtabs button { border-color: transparent; background: transparent; font-weight: 700; }
.about-subtabs button:hover { background: rgba(255, 255, 255, .5); }
.about-subtabs button[aria-selected="true"] { background: #265847; color: #fff8e8; box-shadow: 0 2px 7px #153f3420; }
.about-subtabs button:focus-visible { outline: 2px solid #b17d2e; outline-offset: 2px; }
.about-subtabs { overflow-x: auto; }
.about-subtabs button { flex: 0 0 auto; }
.ideas-content { max-width: 1060px; margin: 0 auto; padding-bottom: 2rem !important; }
.ideas-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.2rem 0 .8rem; padding: 0 .25rem; border-bottom: 1px solid #54735e55; }
.ideas-board-label { color: #41614f; font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
.ideas-count { color: #5b7161; font-size: .82rem; font-weight: 700; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); grid-auto-rows: 185px; gap: .75rem; align-items: stretch; }
.idea-note { --note-bg: #f7f0d5; --note-edge: #bd9d53; position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; padding: .75rem .85rem .7rem; border: 1px solid color-mix(in srgb, var(--note-edge), transparent 35%); border-radius: 6px 13px 7px 12px; background: linear-gradient(145deg, #fffef8, var(--note-bg)); box-shadow: 0 5px 12px #18392819, inset 0 1px #ffffffcc; transform: rotate(-.35deg); }
.idea-note:nth-child(even) { transform: rotate(.4deg); }
.idea-note-1 { --note-bg: #dfece2; --note-edge: #6a9a7e; }
.idea-note-2 { --note-bg: #e4e6f0; --note-edge: #8e91b6; }
.idea-note-3 { --note-bg: #e7eef1; --note-edge: #719ba9; }
.idea-note-pin { position: absolute; top: .55rem; right: .6rem; width: .55rem; height: .55rem; border: 1px solid #ffffffb8; border-radius: 50%; background: var(--note-edge); box-shadow: 0 2px 5px #142d2647; }
.idea-note-number { color: #54705a; font-size: .59rem; font-weight: 900; letter-spacing: .12em; }
.idea-note h2 { margin: .28rem 0 .25rem; color: #23493c; font-size: .98rem; line-height: 1.2; }
.idea-note-body { display: -webkit-box; flex: 1; min-height: 0; margin: 0 0 .55rem; overflow: hidden; color: #385547; font-size: .8rem; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.idea-note-expanded .idea-note-body { display: block; overflow-y: auto; -webkit-line-clamp: unset; }
.idea-note-toggle { align-self: flex-start; margin: -.1rem 0 .4rem; padding: 0; border: 0; background: none; color: #296850; font-size: .72rem; font-weight: 800; text-decoration: underline; }
.idea-author { display: inline-flex; align-items: center; gap: .35rem; color: #375a47; font-size: .72rem; font-weight: 800; }
.idea-note > .idea-author { padding-top: .45rem; border-top: 1px solid #506c553b; }
.user-avatar.idea-avatar { width: 1.35rem; height: 1.35rem; font-size: .65rem; }
.idea-compose { display: grid; gap: .85rem; margin-top: 1.3rem; padding: 1.25rem; border: 1px dashed #6a9980; border-radius: 16px; background: #eef5eabd; }
.idea-compose-head { display: flex; align-items: center; gap: .8rem; }
.idea-compose-head h2 { margin: 0; color: #245540; font-size: 1.15rem; }
.idea-compose-head p { margin: .15rem 0 0; font-size: .85rem; }
.idea-compose-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #d5ead6; color: #265847; font-size: 1.6rem; font-weight: 800; }
.idea-compose label { color: #345746; font-size: .85rem; font-weight: 800; }
.idea-compose textarea { min-height: 6rem; }
.idea-compose-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.idea-compose-footer button, .idea-signin-prompt button { border-color: #265847; background: #265847; color: white; font-weight: 800; }
.idea-form-message { margin: 0; color: #265847; font-weight: 700; }
.idea-form-message.error { color: #a83232; }
.idea-signin-prompt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin-top: 1.3rem; padding: 1rem 1.25rem; border: 1px dashed #6a9980; border-radius: 16px; background: #eef5eabd; font-weight: 800; }
body.dark-mode .ideas-board-head { border-color: #c5e3c344; }
body.dark-mode .ideas-board-label, body.dark-mode .ideas-count { color: #d1e6cf; }
body.dark-mode .idea-note { background: linear-gradient(145deg, #234436, color-mix(in srgb, var(--note-edge), #183b30 68%)); border-color: color-mix(in srgb, var(--note-edge), transparent 22%); box-shadow: 0 8px 20px #071d1659; }
body.dark-mode .idea-note-number, body.dark-mode .idea-note h2, body.dark-mode .idea-note-body, body.dark-mode .idea-author { color: #e5f1df; }
body.dark-mode .idea-note-toggle { color: #c7e8cf; }
body.dark-mode .idea-note > .idea-author { border-color: #e5f1df3d; }
body.dark-mode .idea-compose, body.dark-mode .idea-signin-prompt { border-color: #83af87; background: #163c32c9; color: #e5f1df; }
body.dark-mode .idea-compose-head h2, body.dark-mode .idea-compose label { color: #e5f1df; }
body.dark-mode .idea-compose-mark { background: #3b6b50; color: #e5f1df; }
body.dark-mode .idea-form-message { color: #d4efcd; }
body.dark-mode .idea-form-message.error { color: #ffb8b8; }
@media (max-width: 700px) { .ideas-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); } }
.faction-vision { margin: .5rem 0 .8rem; font-weight: 700; }
.guide-glossary .glossary-wide { grid-column: 1 / -1; }
#about-section > .about-workspace { flex: 1 1 auto; width: 100%; max-width: none; min-height: 0; height: auto; margin: 0; }
#about-section .about-panel { width: 100%; max-width: none; height: 100%; aspect-ratio: auto; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; }
#about-section .about-scroll-wrap { inset: 1rem; }
#about-section .about-content { width: calc(100% - 18px); background: transparent; }
body.dark-mode .about-hub { border-color: #416853; background: linear-gradient(145deg, #153f34, #246047 62%, #34735a); box-shadow: inset 1px 1px 0 #ebfff347, 0 8px 24px #00120c47; }
body.dark-mode .about-subtabs { border-color: #ffffff28; }
body.dark-mode .about-subtabs button { color: #e5eee0; }
body.dark-mode .about-subtabs button:hover { background: #ffffff14; }
body.dark-mode .about-subtabs button[aria-selected="true"] { background: #dbeadb; color: #153f34; }
@media (min-width: 1100px) {
  .about-hub:has(#factions-view:not([hidden])) { max-width: 1500px; }
}
@media (max-width: 850px) {
  .about-hub { flex: 1 1 auto; width: calc(100% - 1rem); height: auto; margin: .5rem auto; border-radius: 18px; }
  .about-subtabs { gap: .25rem; padding: .55rem; }
  .about-subtabs button { flex: 1; min-width: 0; padding: .6rem .4rem; font-size: .9rem; }
  #about-section .about-scroll-wrap { inset: .75rem; }
  #about-section .about-content { padding: .3rem .5rem .8rem .2rem; }
  #about-section .art-scroll-rail { display: flex !important; }
}
@media (max-width: 400px) {
  .about-subtabs button { font-size: .8rem; padding: .55rem .2rem; }
}
@media (max-width: 850px) {
  .about-subtabs button { flex: 0 0 auto; min-width: max-content; padding-inline: .65rem; }
}
