:root {
  --paper: #fbf8f0;
  --panel: #fffdf7;
  --ink: #25241f;
  --muted: #625f55;
  --line: #bdb7aa;
  --blue: #143ec5;
  --error: #9a3023;
  font: 16px/1.45 'Golos Text', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, .portal-brand {
  font-family: 'Roboto Condensed', 'Golos Text', sans-serif;
  line-height: 1.1;
}
h1 { font-size: clamp(2.35rem, 6vw, 4.2rem); margin: 0 0 .5rem; }
h2 { font-size: 1.75rem; margin: 0 0 .65rem; }
h3 { font-size: 1.35rem; margin: 0 0 .55rem; }
p { margin: .45rem 0; overflow-wrap: anywhere; }
a { color: var(--blue); text-underline-offset: .2em; }
button, input, select, textarea { color: inherit; font: inherit; }
button {
  min-height: 2.75rem;
  border: 1px solid var(--ink);
  background: transparent;
  padding: .56rem .85rem;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: .55rem .65rem;
}
input[type="checkbox"] { display: inline-block; width: 1.15rem; min-height: 0; }
textarea { min-height: 6.75rem; resize: vertical; }
label { display: block; font-size: .9rem; font-weight: 500; min-width: 0; }
label > :is(input, select, textarea) { margin-top: .35rem; }
.portal-main, .portal-header { width: min(95%, 1120px); margin: auto; }
.portal-header {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 4.75rem;
  border-bottom: 1px solid var(--ink);
}
.portal-brand { font-size: 2rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.portal-brand span { color: var(--blue); }
.portal-product { border-left: 1px solid var(--line); padding-left: .9rem; }
#logout { margin-left: auto; }
.portal-main { padding: 1rem 0 3rem; }
#status { margin: 0 0 1rem; }
#status:empty { display: none; }
#status[data-level="error"] { color: var(--error); }
.portal-auth {
  max-width: 34rem;
  border: 1px solid var(--ink);
  background: var(--panel);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  margin: 3rem auto;
}
.portal-auth h1 { font-size: clamp(2rem, 5vw, 3rem); }
.portal-auth form { display: grid; gap: 1rem; margin: 1.4rem 0; }
.portal-auth button { justify-self: start; }
.portal-primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.portal-quiet { border-color: transparent; text-decoration: underline; text-underline-offset: .2em; }
.portal-muted { color: var(--muted); font-size: .9rem; }
.portal-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
}
.portal-branch { max-width: 38rem; margin-bottom: 1rem; }
.portal-state { border-block: 1px solid var(--ink); padding: 1rem 0; }
.portal-layout { display: grid; grid-template-columns: minmax(12.5rem, 1fr) minmax(0, 3fr); gap: 2rem; }
#sections { align-self: start; display: grid; padding-top: 1rem; }
#sections button {
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  height: auto;
}
#sections button[aria-current="true"] { color: var(--blue); background: var(--panel); font-weight: 600; }
#editor { min-width: 0; padding: 1.5rem 0; }
.portal-fields { display: grid; gap: .9rem; margin-block: 1rem; }
.portal-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.portal-collection { display: grid; gap: .8rem; margin: .65rem 0; }
.portal-row { display: grid; gap: .85rem; border: 1px solid var(--line); background: var(--panel); padding: .85rem; }
.portal-row > label > :is(input, textarea, select) { background: var(--paper); }
.portal-button-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.portal-actions { padding: 1rem 0; border-top: 1px solid var(--ink); }
.portal-actions p { margin-bottom: .8rem; }
.portal-day { border-top: 1px solid var(--line); padding: .8rem 0; }
.portal-day legend { font-weight: 600; }
.portal-preview-toolbar strong { margin-right: auto; }
dialog {
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 1rem;
  background: var(--paper);
  width: min(94vw, 850px);
  max-height: 90dvh;
}
dialog::backdrop { background: #25241f88; }
#preview-content { margin: 1rem auto 0; }
#preview-content.is-mobile { max-width: 390px; }
#preview-content iframe { width: 100%; height: 67dvh; border: 1px solid var(--line); background: var(--panel); }
.portal-gallery-preview { width: min(100%, 280px); max-height: 160px; object-fit: contain; object-position: left; }
@media (max-width: 670px) {
  .portal-main, .portal-header { width: calc(100% - 2rem); }
  .portal-layout { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  #sections { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .portal-hero { display: block; }
  .portal-hero a { display: inline-block; margin-top: .7rem; }
  .portal-pair { grid-template-columns: minmax(0, 1fr); }
  .portal-product { font-size: .8rem; }
}
