/*!
Slabacus / Laurel Vega
Copyright (c) 2026 Matthew Gilham. All rights reserved.
SPDX-License-Identifier: LicenseRef-LaurelVega-Proprietary
See SLABACUS-LICENSE.txt. Authorised owner maintenance is permitted.
Third-party material retains its own ownership and licence terms.
*/

:root {
  color-scheme: dark;
  font: 1rem/1.5 Inter, system-ui, sans-serif;
  color: #f4f7fb;
  background: #101723;
  --surface: #1b2535;
  --border: #3b4d65;
  --muted: #b2c1d4;
  --accent: #79e3e8;
  --gold: #f2c773;
  --field: #111a29;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 15% 0, #1b3241, #101723 36rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 5vw, 2.35rem); line-height: 1.13; letter-spacing: -.035em; }
h2 { font-size: 1.35rem; line-height: 1.2; }

.masthead { padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--border); background: #111a29e8; }
.masthead-content, main { width: min(100% - 2rem, 54rem); margin-inline: auto; }
.masthead-content { min-height: 4.6rem; display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.brand { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.brand svg { width: 1.9rem; height: 1.9rem; }
.brand strong { font-size: clamp(1.12rem, 4vw, 1.45rem); font-style: italic; text-transform: uppercase; letter-spacing: .035em; }
.account-controls { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; min-width: 0; }
.account-controls span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .86rem; }
.account-controls button { flex-shrink: 0; }
main { padding-block: clamp(1.5rem, 7vw, 3.5rem) calc(2rem + env(safe-area-inset-bottom)); }

button, input, textarea { font: inherit; color: inherit; }
button { min-height: 2.75rem; padding: .48rem .85rem; border: 1px solid var(--border); border-radius: .6rem; font-weight: 650; cursor: pointer; }
button:disabled { opacity: .62; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { color: #211707; background: var(--gold); border-color: var(--gold); }
.primary:hover:not(:disabled) { background: #ffd999; }
.quiet { background: var(--surface); }
.quiet:hover:not(:disabled) { border-color: var(--accent); }
.text-button { display: block; margin: .35rem auto 0; border: 0; color: var(--accent); background: transparent; }
.text-button:hover { text-decoration: underline; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: .95rem; }
.auth { width: min(100%, 26rem); padding: clamp(1.2rem, 5vw, 2rem); margin-inline: auto; box-shadow: 0 1rem 3.5rem #070b155c; }
.auth h1 { margin-bottom: 1.15rem; }
.profile-email { display: grid; gap: .25rem; margin-bottom: 1.1rem; overflow-wrap: anywhere; }
.profile-email span { color: var(--muted); font-size: .9rem; }
form label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 600; }
form input, form textarea { display: block; width: 100%; padding: .62rem .72rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--field); }
form input { min-height: 2.85rem; }
.password-input { position: relative; margin-bottom: .85rem; }
.password-input input { margin-bottom: 0; padding-right: 4.7rem; }
.password-input .password-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  min-height: 2.05rem; padding: .2rem .5rem; margin: 0; border: 0;
  color: var(--accent); background: transparent; font-size: .78rem;
}
.password-input .password-toggle:hover { text-decoration: underline; }
input, textarea { margin-bottom: .85rem; }
textarea { resize: vertical; }
.auth form > button { width: 100%; }
.status, .session-status, .field-help { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.status:empty, .session-status:empty { display: none; }
.status { margin-block: .65rem; }
.field-help { margin: -.45rem 0 .85rem; }
[data-error="true"] { color: #ffabbb; }

.collection-header, .actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.collection-header { justify-content: space-between; margin-bottom: .9rem; }
.collection-count { color: var(--muted); font-size: .9rem; }
.assets { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.asset { padding: .75rem .85rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.asset-main { flex: 1; min-width: 0; }
.asset img { border-radius: .3rem; background: var(--field); width: 2.7rem; height: 3.5rem; object-fit: contain; }
.asset-description, .asset-meta { overflow-wrap: anywhere; }
.asset-description { font-weight: 700; }
.asset-meta { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.asset button { flex-shrink: 0; }
.empty { padding: 1rem; color: var(--muted); }
.load-more { display: block; margin: 1rem auto 0; }

dialog { width: min(100% - 2rem, 30rem); max-height: calc(100% - 2rem); padding: 1.1rem; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: .95rem; }
dialog::backdrop { background: #070b15bd; }
dialog h2 { margin-bottom: .95rem; }
.editor-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.6rem, .4fr); gap: .65rem; }
.editor-actions { justify-content: flex-end; }
.photo-fields { margin: 0; padding: 0; border: 0; }
.photo-fields legend { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.photo-picker { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: .6rem; min-height: 2.75rem; padding: .48rem .78rem; }
.photo-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-picker input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.photo-fields .field-help { margin: 0; }
.photo-fields .field-help:empty { display: none; }
.photo-fields .status { margin: .45rem 0 0; }
.photo-fields .status:empty { display: none; }
.camera-panel { display: grid; gap: .55rem; margin-top: .65rem; }
.camera-panel video, .selected-photo { display: block; width: 100%; border: 1px solid var(--border); border-radius: .6rem; background: var(--field); object-fit: contain; }
.camera-panel video { aspect-ratio: 4 / 3; max-height: 39vh; }
.selected-photo { width: 6rem; height: 7rem; margin-top: .55rem; }

@media (max-width: 32rem) {
  .masthead-content { min-height: 3.9rem; }
  .account-controls span { display: none; }
  .collection-header { align-items: flex-start; }
  .collection-header .actions { margin-top: .15rem; }
}
