/* Palette, typography and shape from the API's lightThemeCustom and darkThemeCustom. */
:root {
  color-scheme: light;
  --primary: #80cc00;
  --primary-hover: #65a300;
  --secondary: #ffb7a0;
  --background: #f8f9fa;
  --paper: #fff;
  --text: #343a40;
  --muted: #5c636a;
  --divider: rgb(0 0 0 / 8%);
  --outline: rgb(0 0 0 / 20%);
  --selected: rgb(128 204 0 / 12%);
  --hover: rgb(0 0 0 / 4%);
  --focus: #426d00;
  --danger: #a12b21;
  --radius: 4px;
  font: 14px Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #212529;
  --paper: #343a40;
  --text: #f8f9fa;
  --muted: #adb5bd;
  --divider: rgb(255 255 255 / 12%);
  --outline: rgb(255 255 255 / 25%);
  --hover: rgb(255 255 255 / 6%);
  --focus: #a6e54d;
  --danger: #ffb7a0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--background); }
.app-bar, .brand, .actions, .panel-heading, .editor-toolbar { display: flex; align-items: center; gap: .75rem; }
.app-bar { justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--divider); padding: .8rem max(1rem, calc((100vw - 100rem) / 2)); }
.brand img { width: 125px; max-height: 40px; object-fit: contain; }
.logo-dark, [data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1rem; }
p { line-height: 1.5; }
main { max-width: 102rem; margin: auto; padding: 1rem; }
#status:empty { margin: 0; }
#status:not(:empty) { padding: .75rem 1rem; margin: 0 0 1rem; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--paper); overflow-wrap: anywhere; }
#login { max-width: 28rem; margin: 4rem auto; }
#workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--divider); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.panel-heading, .editor-toolbar { justify-content: space-between; flex-wrap: wrap; }
.editor-toolbar { margin-bottom: 1rem; }
.editor-toolbar h2 { margin-bottom: .3rem; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(17rem, 1fr); align-items: start; gap: 1rem; }
.archive-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.archive-toolbar h2 { margin-right: auto; align-self: center; }
.archive-toolbar label { width: min(100%, 21rem); margin: 0; }
#guides { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
#guides p { margin: 0; }
.guide-item { text-align: left; display: grid; gap: .3rem; overflow-wrap: anywhere; }
.muted, .guide-item small { color: var(--muted); }
.actions { flex-wrap: wrap; gap: .45rem; }
.section-nav { display: flex; gap: .35rem; flex-wrap: wrap; margin: .85rem 0 1rem; border-bottom: 1px solid var(--divider); padding-bottom: .85rem; }
.section-nav button { overflow-wrap: anywhere; max-width: 100%; }
label { display: block; margin: .75rem 0; }
label input[type="checkbox"] { accent-color: var(--primary); margin-right: .4rem; }
.theme-picker { margin: 0; display: flex; align-items: center; gap: .4rem; }
.theme-picker select { margin: 0; width: auto; }
input:not([type="checkbox"]), select, textarea {
  display: block; width: 100%; min-height: 2.35rem; margin-top: .3rem; padding: .48rem .6rem;
  border: 1px solid var(--outline); border-radius: var(--radius); background: var(--paper); color: inherit; font: inherit;
}
input[type="file"] { overflow: hidden; }
textarea { min-height: 6rem; resize: vertical; }
button { font: inherit; padding: .48rem .75rem; min-height: 2.35rem; border: 1px solid var(--outline); background: transparent; color: inherit; border-radius: var(--radius); cursor: pointer; }
button:hover:not(:disabled) { background: var(--hover); }
button.primary { background: var(--primary); color: #000; border-color: transparent; }
button.primary:hover:not(:disabled) { background: var(--primary-hover); }
button[aria-pressed="true"] { background: var(--selected); border-color: var(--primary-hover); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
fieldset { min-width: 0; border: 1px solid var(--divider); margin: 1rem 0 0; border-radius: var(--radius); }
legend { color: var(--muted); }
.media-thumb { width: min(16rem, 100%); display: block; margin-bottom: .6rem; border-radius: var(--radius); }
audio { display: block; width: 100%; max-width: 26rem; }
.preview { position: sticky; top: 1rem; }
.preview .panel-heading { margin-bottom: 1rem; }
.preview label { margin: 0; }
.preview select { margin-top: .25rem; }
@media (max-width: 1050px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
}
@media (max-width: 670px) {
  .archive-toolbar label { flex: 1 1 12rem; }
  .app-bar, .brand { flex-wrap: wrap; }
  .brand img { width: 100px; }
}
.header-image-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--divider); }
.header-image-row img { width: 6rem; margin: 0; }
#header-image-hint { font-size: .85rem; }
#family-preview {
  width: min(100% - 1.5rem, 34rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 1rem;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
}
#family-preview::backdrop { background: rgb(0 0 0 / 55%); }

.visitor-frame { display: block; width: min(100%, 25rem); height: min(70dvh, 48rem); margin-inline: auto; border: 0; border-radius: .8rem; background: #34383e; }
