* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --page: #fef1e8;
  --surface: #fff;
  --surface-soft: #f4f4f5;
  --surface-profile: #dcfce7;
  --surface-info: #e2ffe7;
  --surface-conversation: #e6f6eb;
  --surface-message-own: #dbeafe;
  --surface-message-other: #f4f4f5;
  --text: #171717;
  --text-strong: #27272a;
  --text-muted: #52525b;
  --text-faint: #71717a;
  --border: #d4d4d8;
  --border-soft: #e4e4e7;
  --accent: #166534;
  --focus: #2563eb;
  --top-bar: #ffd68a;
  background: var(--surface);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #18181b;
  --surface: #27272a;
  --surface-soft: #3f3f46;
  --surface-profile: #193f29;
  --surface-info: #193f29;
  --surface-conversation: #203a2b;
  --surface-message-own: #1e3a5f;
  --surface-message-other: #3f3f46;
  --text: #f4f4f5;
  --text-strong: #f4f4f5;
  --text-muted: #d4d4d8;
  --text-faint: #a1a1aa;
  --border: #52525b;
  --border-soft: #3f3f46;
  --accent: #4ade80;
  --focus: #60a5fa;
  --top-bar: #7c4a18;
}

html, body { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--text); }
html.front-page-active,
body.front-page-active {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body.front-page-active { display: flex; flex-direction: column; }
body.front-page-active .top-bar { flex: 0 0 4rem; }
a { color: inherit; text-decoration: none; }
.top-bar { position: sticky; top: 0; z-index: 20; height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border-soft); background: var(--top-bar); padding: 0 1.5rem; }
.brand-row { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand { color: var(--text-strong); font-size: 1.5rem; font-weight: 700; line-height: 1.5rem; }
.notice-brand { display: flex; align-items: center; gap: .25rem; color: #b91c1c; }
.notice-brand img { width: 3.75rem; height: 3.75rem; object-fit: contain; }
.hamburger { position: relative; display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; flex-direction: column; gap: .375rem; border: 0; background: transparent; border-radius: .25rem; cursor: pointer; }
.hamburger:hover, .close-button:hover { background: var(--surface-soft); }
.hamburger span { width: 1.25rem; height: 2px; background: var(--text-strong); border-radius: 99px; }
.hamburger .badge { position: absolute; right: .125rem; bottom: .125rem; margin: 0; }
.hamburger .badge.attention { right: auto; left: .125rem; }
.close-button { float: right; border: 1px solid #d4d4d8; background: rgb(255, 153, 153); color: #3f3f46; font-size: 1.25rem; border-radius: .5rem; padding: 1.5rem .75rem; cursor: pointer; }
.overlay { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.overlay.open { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed;
  inset: 5% auto 0 0;
  z-index: 40;
  width: 16rem;
  height: 90%;
  transform: translateX(-100%);
  transition: transform .2s ease;
  border-radius: 10px;
  border: 5px solid #ffffff;
  background: #e29d88;
  padding: 1rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .15);
  background-image: url("/images/menu-images/pattern_3.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.sidebar.open { transform: translateX(0); }

.sidebar-title {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: #09090b;
  font-size: 1.125rem;
  font-weight: 700;
}

.nav-links { display: flex; flex-direction: column; gap: .5rem; }
.nav-links a, .nav-links .disabled {
  border-radius: .25rem;
  padding: .5rem .75rem;
  text-align: left;
  color: #1d4ed8;
  font-size: 1.5rem;
  font-weight: 300;
  font-family: arial, helvetica, sans-serif;
  background: rgb(255 164 103 / 0.85);
  /* #ffa467 */
}
.nav-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; }

.nav-links .disabled { display: block; }
.nav-links a:hover { background: rgb(255 113 42 / 0.85); color: #1e40af; text-decoration: none; }
/* #ff712a */
.nav-links .active { background: rgb(255 211 182 / 0.85); color: #000000; font-weight: 700; text-decoration: none; }
/* #ffd3b6 */
.nav-links .disabled { cursor: not-allowed; opacity: .4; }
.badge { display: inline-grid; place-items: center; min-width: 1rem; height: 1rem; padding: 0 .25rem; margin-left: .5rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .625rem; line-height: 1; font-style: normal; font-weight: 700; vertical-align: middle; }
.badge.attention { background: #f97316; color: #111827; }
.nav-links .badge { justify-self: end; min-width: 2rem; height: 2rem; margin-left: 0; padding: 0 .45rem; font-size: 1rem; }
.page { min-height: calc(100vh - 4rem); padding: 1.5rem; background: var(--page); }
.container { max-width: 64rem; }
.messages-container { max-width: 80rem; height: calc(100vh - 7rem); min-height: 28rem; }
.chat-frame { display: flex; flex-direction: column; min-height: 0; height: calc(100% - 3.25rem); background: transparent; overflow: visible; }
.messages-grid > .space > * + * { margin-top: 0; }
.narrow { max-width: 48rem; }
h1 { margin: 0 0 1rem; font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
h2 { margin: 0 0 .75rem; font-size: 1.25rem; }
h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
p { color: var(--text-muted); }
.space > * + * { margin-top: 1rem; }
.forgot-password-section { margin-top: 2rem; }
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-4 { grid-template-columns: 1fr; }
.messages-grid { display: grid; flex: 1 1 auto; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); align-items: stretch; width: 100%; min-height: 0; border: 1px solid var(--accent); border-radius: 0 0 .375rem .375rem; background: var(--surface); padding: 1rem; }
.conversation-list-scroll { min-height: 0; overflow-y: auto; padding-right: .25rem; }
#thread { min-height: 0; overflow: hidden; }
.profile-thread { height: calc(100vh - 10.25rem); min-height: 28rem; }
.profile-thread:empty { height: 0; min-height: 0; overflow: visible; }
.profile-chat-active { display: flex; flex-direction: column; height: calc(100vh - 7rem); min-height: 28rem; overflow: hidden; }
.profile-chat-active > .tabs { flex: 0 0 auto; }
.profile-chat-active #chat-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.profile-chat-active .profile-thread { flex: 1 1 auto; height: auto; min-height: 0; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .messages-grid { grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); } }
@media (max-width: 639px) { .page { padding: 1rem; } .messages-container { height: calc(100vh - 6rem); min-height: 24rem; } .messages-grid { display: flex; flex-direction: column; grid-template-columns: 1fr; } .messages-grid.no-thread .conversation-list-scroll { flex: 1 1 auto; } .messages-grid.no-thread #thread { flex: 0 0 auto; } .messages-grid.has-thread .conversation-list-scroll { display: none; } .messages-grid.has-thread #thread { flex: 1 1 auto; } .profile-thread { height: calc(100vh - 9.25rem); min-height: 24rem; } .profile-chat-active { height: calc(100vh - 6rem); min-height: 24rem; } #message-text { min-height: 6rem; } .message-panel h3 { margin-bottom: .25rem; } .message-panel.space > h3 + .message-scroll { margin-top: .5rem; } .carousel-row { grid-template-columns: 1fr; } .carousel-arrow { width: 100%; } }
label { display: block; color: var(--text-strong); font-size: .875rem; font-weight: 600; }
.big-label { font-size: 1.125rem; }
.password-requirement { display: flex; align-items: center; gap: .375rem; margin-top: .25rem; color: var(--text-muted); font-weight: 400; }
.password-requirement img { display: block; width: 1.25rem; height: 1.25rem; object-fit: contain; }
input, select, textarea { width: 100%; margin-top: .25rem; border: 1px solid var(--border); border-radius: .25rem; background: var(--surface); color: var(--text); padding: .5rem; font: inherit; }
textarea { min-height: 9rem; resize: vertical; }
.message-editor {
  width: 100%;
  min-height: 5.5rem;
  max-height: 12rem;
  overflow-y: auto;
  margin-top: .25rem;
  border: 1px solid var(--border);
  border-radius: .25rem;
  background: var(--surface);
  color: var(--text);
  padding: .5rem;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-editor:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.message-editor:empty::before { content: attr(data-placeholder); color: var(--text-faint); pointer-events: none; }
.message-editor img.composer-inline-emoji { width: 1.6875em; height: 1.6875em; object-fit: contain; vertical-align: -.4em; margin: 0 .08em; }
input.profile, select.profile, textarea.profile { background: var(--surface-profile); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-soft); color: var(--text-faint); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.credential-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .75rem; }
.right { display: flex; justify-content: flex-end; gap: .75rem; }
.button { border: 0; border-radius: .25rem; padding: .5rem 1rem; color: #fff; cursor: pointer; font: inherit; font-weight: 500; }
.button:disabled { cursor: not-allowed; background: var(--border); color: var(--text-faint); }
.icon-button { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; line-height: 1; }
.icon-button img { width: 2.25rem; height: 2.25rem; object-fit: contain; display: block; }
.image-button img { transform: translate(.08rem, .08rem); }
.send-button { width: 5.5rem; }
.send-button img { width: 3.375rem; height: 3.375rem; transform: translateY(-.26rem); }
.blue { background: #2563eb; }
.blue:hover { background: #1d4ed8; }
.grey { background: #6b7280; }
.grey:hover { background: #4b5563; }
.green { background: #16a34a; }
.green:hover { background: #15803d; }
.deep-green { background: #166534; }
.amber { background: #b45309; }
.amber:hover { background: #92400e; }
.danger { background: #b91c1c; }
.danger:hover { background: #991b1b; }
.dark { background: #18181b; }
.dark:hover { background: #3f3f46; }
.button:disabled, .button:disabled:hover { background: var(--border); color: var(--text-faint); cursor: not-allowed; }
.outline { border: 1px solid var(--border); background: var(--surface); color: var(--text-strong); }
.danger-outline { border: 1px solid #fca5a5; background: var(--surface); color: #ef4444; }
.status { color: var(--text-muted); font-size: .875rem; }
.chip { display: inline-flex; border-radius: .375rem; background: #166534; color: #fff; padding: .5rem .75rem; }
.profile-text { width: 100%; white-space: pre-wrap; border-radius: .375rem; background: #166534; color: #fff; padding: .75rem 1rem; }
.gallery, .image-editor, .message-panel, .list-empty, .info-field, .conversation-card, .search-result, .document-panel { border: 1px solid var(--border-soft); border-radius: .375rem; background: var(--surface); padding: 1rem; }
.list-empty, .info-field { margin: 0; border: 1px solid var(--text); color: var(--text-muted); text-align: center; }
.info-field { text-align: left; }
.list-empty { background: transparent; }
.info-field { background: var(--surface-info); }
.billing-test-notice { border-color: #d97706; background: #fef3c7; color: #78350f; }
.billing-product { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; margin: .75rem 0; }
.membership-panel.space > * + * { margin-top: 1.5mm; }
.membership-panel .info-field + h3 { margin-top: 4.5mm; }
.membership-panel .billing-product { margin-right: 0; margin-bottom: 0; margin-left: 0; }
.image-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .25rem; background: #000; }
.image-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.profile-image { max-width: 42rem; }
.profile-gallery { display: grid; gap: 1rem; max-width: 54rem; }
.thumbnail-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.thumbnail-button { width: 5rem; height: 5rem; border: 2px solid transparent; border-radius: .25rem; background: var(--surface); padding: .125rem; cursor: pointer; }
.thumbnail-button.active { border-color: var(--accent); }
.thumbnail-button img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: .125rem; }
.carousel-row { display: grid; grid-template-columns: auto minmax(0, 42rem) auto; align-items: center; gap: .75rem; }
.carousel-arrow { border: 1px solid var(--border); border-radius: .25rem; background: var(--surface); color: var(--text-strong); padding: .75rem .5rem; cursor: pointer; font: inherit; font-weight: 700; }
.tabs { display: grid; grid-template-columns: repeat(var(--tab-count, 2), minmax(0, 1fr)); gap: .35rem; background: transparent; }
.tab { position: relative; border: 1px solid var(--accent); border-bottom: 1px solid var(--accent); border-radius: .375rem .375rem 0 0; background: var(--surface-soft); color: var(--text-strong); padding: .75rem 1rem; font-weight: 700; cursor: pointer; }
a.tab { display: block; text-align: center; text-decoration: none; }
.tab.active { top: 1px; border-bottom: 0; background: #166534; color: #fff; }
.account-onboarding-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: .375rem;
  background: var(--surface);
  padding: .65rem .75rem;
}
.account-onboarding-stage { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; color: var(--text-strong); font-size: .875rem; font-weight: 600; }
.account-onboarding-stage img { display: block; width: 1.25rem; height: 1.25rem; object-fit: contain; }
.onboarding-message-field {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  border: 1px solid #c2410c;
  border-radius: .375rem;
  background: #fb923c;
  color: #111827;
  padding: .45rem .75rem;
  text-align: left;
  white-space: pre-line;
  line-height: 1.25;
  font-size: .95rem;
  font-weight: 600;
}
.promotion-code-section { margin-top: 1rem; }
.promotion-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem; margin-top: .25rem; }
.promotion-code-row input { margin-top: 0; }
.promotion-code-row .button { justify-self: end; }
.profile-view-tab { font-size: 1.125rem; }
.profile-tab-panel { min-width: 0; min-height: 0; border: 1px solid var(--accent); border-radius: 0 0 .375rem .375rem; background: var(--surface); padding: 1rem; }
.tabs + .profile-tab-panel { margin-top: 0; }
.profile-tab-panel + .account-onboarding-status { margin-top: 1.5mm; }
.account-onboarding-status + .onboarding-message-field { margin-top: 1.5mm; }
.account-data-actions { display: grid; gap: 1.5mm; margin-top: 1.5mm; }
.account-data-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  border: 1px solid;
  border-radius: .375rem;
  padding: .75rem;
}
.account-data-action h3 { margin: 0 0 .2rem; font-size: 1rem; }
.account-data-action p { margin: 0; color: inherit; line-height: 1.35; }
.account-data-action .button { justify-self: end; white-space: nowrap; }
.account-data-download { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.account-data-delete {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  border-color: #dc2626;
  background: #fecaca;
  color: #7f1d1d;
}
.account-data-delete-login { display: grid; justify-items: center; align-content: center; gap: .5rem; text-align: center; font-size: .875rem; font-weight: 700; }
.account-data-delete-button { display: grid; align-items: center; justify-items: end; }
.account-data-delete-button .button { width: 100%; max-width: 10rem; white-space: normal; }
.toggle-switch { position: relative; display: inline-block; width: 3rem; height: 1.65rem; cursor: pointer; }
.toggle-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.toggle-track { position: absolute; inset: 0; border: 1px solid #991b1b; border-radius: 999px; background: #f8fafc; transition: background .15s ease; }
.toggle-track::after { content: ""; position: absolute; top: .18rem; left: .2rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #7f1d1d; transition: transform .15s ease; }
.toggle-switch input:checked + .toggle-track { background: #dc2626; }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(1.32rem); background: #fff; }
.toggle-switch input:focus-visible + .toggle-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.profile-tab-panel.hidden + .profile-tab-panel { margin-top: 0; }
.document-panel { border-color: var(--accent); border-radius: 0 0 .375rem .375rem; color: var(--text-strong); line-height: 1.65; }
.tabs + .document-panel { margin-top: 0; }
.document-panel h1, .document-panel h2, .document-panel h3 { color: var(--text-strong); }
.document-panel blockquote { margin: 1rem 0; border-left: 4px solid var(--accent); padding-left: 1rem; color: var(--text-muted); }
.document-panel ul { padding-left: 1.5rem; }
.agreement-actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.support-form { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.conversation-card { width: 100%; margin-bottom: .35rem; text-align: left; color: var(--text-strong); background: var(--surface-conversation); }
.conversation-card-open { display: block; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; padding: 0; font: inherit; }
.conversation-card-open:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.conversation-card-actions { display: flex; justify-content: flex-end; margin-top: .5rem; }
.block-user-button { font-size: .875rem; padding: .4rem .65rem; }
.blocked-user-card p { margin: .25rem 0 0; color: var(--text-muted); }
.conversation-card p { overflow-wrap: anywhere; }
.conversation-card img.inline-emoji { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -.25em; margin: 0 .06em; }
.conversation-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.message-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.message-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding-right: .5rem; }
.message-scroll.space > * + * { margin-top: .5rem; }
.message-card { max-width: 80%; min-width: 0; border-radius: .5rem; padding: .25rem .5rem; overflow-wrap: anywhere; }
.message-card.own { margin-left: auto; background: var(--surface-message-own); }
.message-card.other { margin-right: auto; background: var(--surface-message-other); }
.message-card p { margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.message-card small { display: block; margin-top: .125rem; line-height: 1.2; overflow-wrap: anywhere; }
.message-actions { display: flex; justify-content: flex-end; gap: .35rem; margin-top: .35rem; }
.message-actions .button { padding: .3rem .55rem; font-size: .8rem; }
.reported-flag { width: 1.8rem; height: 1.8rem; object-fit: contain; display: inline-block; }
.message-attachment-button { display: block; width: 100%; border: 0; border-radius: .25rem; background: transparent; padding: 0; cursor: zoom-in; }
.message-attachment-button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.message-card img.message-attachment { display: block; max-height: 16rem; width: 100%; object-fit: contain; border-radius: .25rem; background: #fff; }
.admin-reported-message { max-width: 100%; }
.message-card img.inline-emoji { width: 1.6875em; height: 1.6875em; object-fit: contain; vertical-align: -.4em; margin: 0 .08em; background: transparent; border-radius: 0; }
.message-done { margin-left: auto; }
.message-preview { display: flex; align-items: center; gap: .75rem; }
.emoji-picker { position: relative; max-height: 22rem; border: 1px solid var(--accent); border-radius: .375rem; background: var(--surface); overflow: hidden; }
.emoji-search-label { padding: .5rem .5rem .25rem; font-size: .8rem; }
.emoji-search { margin-top: .2rem; }
.emoji-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); padding: .35rem; }
.emoji-tab { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .12rem; width: 2.6rem; height: 2.4rem; border: 1px solid transparent; border-radius: .25rem; background: var(--surface-soft); color: var(--text-strong); padding: .25rem; cursor: pointer; font: inherit; font-size: .8rem; }
.emoji-tab.active { border-color: #166534; background: #166534; color: #fff; }
.emoji-tab img { width: 1.35rem; height: 1.35rem; object-fit: contain; display: block; }
.emoji-tab img + img { width: 1.05rem; height: 1.05rem; }
.emoji-tab-fallback { font-weight: 700; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr)); gap: .25rem; max-height: 14rem; overflow-y: auto; padding: .5rem; }
.emoji-empty { grid-column: 1 / -1; margin: 0; padding: .5rem; }
.emoji-option { position: relative; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid transparent; border-radius: .25rem; background: var(--surface); cursor: pointer; padding: .2rem; }
.emoji-option:hover { border-color: var(--accent); background: var(--surface-profile); }
.emoji-option img { width: 1.65rem; height: 1.65rem; object-fit: contain; display: block; }
.emoji-variant-mark { position: absolute; right: .2rem; bottom: .2rem; width: .35rem; height: .35rem; border-radius: 999px; background: #166534; }
.emoji-variant-popup { position: absolute; right: .5rem; bottom: .5rem; z-index: 2; display: flex; gap: .25rem; border: 1px solid var(--accent); border-radius: .375rem; background: var(--surface); padding: .35rem; box-shadow: 0 10px 20px rgb(0 0 0 / .18); }
.search-result { display: flex; gap: 1rem; align-items: flex-start; }
.online-status { display: inline-flex; align-items: center; gap: .35rem; margin: .25rem 0; font-size: .95rem; color: var(--text-muted); }
.online-status img { width: 1rem; height: 1rem; object-fit: contain; }
.avatar { width: 5rem; height: 5rem; flex: 0 0 5rem; border-radius: .375rem; object-fit: cover; background: var(--border-soft); }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgb(0 0 0 / .45); padding: 1rem; }
.modal.hidden { display: none; }
.modal-panel { width: 100%; max-width: 28rem; border-radius: .375rem; background: var(--surface); color: var(--text); padding: 1.25rem; box-shadow: 0 20px 25px -5px rgb(0 0 0 / .25); }
.image-viewer-modal { z-index: 70; background: rgb(0 0 0 / .78); }
.image-viewer-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-out; }
.image-viewer-panel { position: relative; z-index: 1; display: flex; max-width: min(96vw, 90rem); max-height: 92vh; flex-direction: column; gap: .75rem; align-items: flex-end; }
.image-viewer-close { flex: 0 0 auto; }
.image-viewer-panel img { display: block; max-width: 100%; max-height: calc(92vh - 3.5rem); object-fit: contain; border-radius: .375rem; background: #fff; box-shadow: 0 20px 25px -5px rgb(0 0 0 / .35); }
.strong { font-weight: 700; }
.hidden { display: none !important; }
.settings-page h1, .settings-page h2 { margin-bottom: .35rem; }
.settings-section { border: 1px solid var(--border); border-radius: .5rem; background: var(--surface); padding: 1rem; }
.admin-page { max-width: 80rem; }
.admin-tabs + .admin-tab-panel,
.admin-tabs + .admin-report-panel { margin-top: 0; }
.admin-tab-panel { border-radius: 0 0 .5rem .5rem; }
.admin-report-panel .messages-grid { height: min(32rem, calc(100vh - 12rem)); min-height: 20rem; }
.admin-databases { border-color: var(--accent); }
.admin-db-usage { display: grid; grid-template-columns: max-content max-content minmax(8rem, 1fr); align-items: center; gap: .75rem; font-size: .875rem; }
.admin-db-usage-track { height: 1rem; border: 1px solid var(--accent); border-radius: .5rem; background: var(--surface-soft); overflow: hidden; }
.admin-db-usage-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.admin-db-execute-row { display: flex; align-items: flex-end; gap: .75rem; }
.admin-db-execute-row label { flex: 1 1 auto; }
.admin-db-execute-row .button { flex: 0 0 auto; }
.admin-db-log-row { display: flex; justify-content: flex-end; }
.admin-db-log-row label { width: min(100%, 28rem); }
.admin-db-output { min-height: 16rem; overflow-y: scroll; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.settings-help { margin: 0; color: var(--text-muted); font-size: .9rem; }
.settings-options { display: grid; gap: .65rem; border: 1px solid var(--border-soft); border-radius: .375rem; padding: .8rem 1rem 1rem; }
.settings-options legend { padding: 0 .25rem; color: var(--text-strong); font-size: .875rem; font-weight: 700; }
.settings-options label, .settings-check { display: flex; align-items: center; gap: .6rem; }
.settings-options input, .settings-check input { width: auto; margin: 0; }
.settings-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.settings-links .button { text-decoration: none; }
.front-page-shell {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: #102f22;
}
.front-page { height: 100%; overflow: hidden; }
.front-page-picture { position: absolute; inset: 0; display: block; }
.front-page-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.front-page-scene {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #102f22;
}

.front-page-copy {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 40rem;
  padding: 1rem 1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.front-page-copy p {
  margin: 0;
}

.front-page-request {
  margin-top: auto;
  color: #eb8918;
}

.front-page-copy h1 { margin: 0.75rem 0 0.75rem; color: #fff; font-size: 2.5rem; line-height: 1.08; }
.front-page-copy p { max-width: 32rem; color: #f8fafc; font-size: 1.125rem; line-height: 1.7; }
.brand-mark { display: inline-flex; align-items: center; gap: .75rem; font-weight: 700; letter-spacing: 0; }
.brand-mark img { width: 3rem; height: 3rem; border-radius: .75rem; box-shadow: 0 12px 30px rgb(0 0 0 / .25); }

@media (max-width: 639px) {
  .admin-db-usage { grid-template-columns: max-content 1fr; }
  .admin-db-usage-track { grid-column: 1 / -1; }
  .front-page-scene,
  .front-page-copy {
    height: 100%;
  }
  .front-page-copy h1 { font-size: 2rem; }
  .front-page-image {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    object-fit: cover;
    object-position: 55% center;
  }
}
