.workspace { padding-bottom: 0; min-height: 100vh; }
.workspace-frame { width: min(100%, 1300px); margin-inline: auto; padding-inline: clamp(17px, 4vw, 54px); }
.workspace-header { border-bottom: 1px solid var(--rule); }
.workspace-masthead { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.workspace-masthead nav { display: flex; align-items: center; gap: clamp(13px, 3vw, 30px); }
.workspace-brand { padding: 0; }
.workspace-main { padding-block: clamp(26px, 5vw, 58px); }
.workspace-heading { margin-bottom: clamp(20px, 4vw, 39px); }
.workspace-muted { color: var(--muted); }
.workspace-status { padding: 11px 14px; border-inline-start: 2px solid var(--accent); margin-block: 1px 3px; background: var(--panel); }
.workspace-status[data-kind=error] { border-color: var(--coral); }
.workspace-status[data-kind=success] { border-color: var(--good); }
.workspace-form { display: grid; align-content: start; gap: 16px; }
.workspace-field { display: grid; gap: 5px; font-size: 14px; font-weight: 640; min-width: 0; }
.workspace-field :is(input, textarea, select) {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--base); color: var(--ink); font: 400 16px/1.4 var(--body);
}
.workspace-field textarea { resize: vertical; }
.workspace-field input:read-only { color: var(--muted); }
.workspace-field small { color: var(--muted); font-size: 13px; font-weight: 400; }
.workspace-field :is(input, textarea, select):focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.workspace input[type=checkbox] { accent-color: var(--action); }
.workspace button:disabled { opacity: .55; cursor: default; }

.login-layout { min-height: calc(100vh - 67px); display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .85fr); align-items: center; gap: clamp(30px, 6vw, 85px); padding-block: 34px; }
.login-illustration { border-radius: 9px; aspect-ratio: 1.03; overflow: hidden; background: var(--cobalt); }
.login-illustration img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; }
.login-panel { display: grid; gap: 15px; max-width: 405px; }
.login-panel h1 { font: 650 clamp(27px, 3.6vw, 49px)/1.14 var(--title); letter-spacing: -.05em; }
.login-panel .workspace-form { margin-top: 6px; }
.login-panel .button { justify-self: start; min-width: 111px; }
.workspace-account-email { overflow-wrap: anywhere; font-weight: 650; }

.admin-layout { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(0, 1.7fr); align-items: start; gap: clamp(17px, 3vw, 39px); }
.admin-library { min-width: 0; display: grid; gap: 12px; }
.admin-library-head, .admin-sheet-head, .editor-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.admin-library-head h2, .admin-sheet-head h2 { font-size: 22px; line-height: 1.2; }
.admin-list { max-height: min(68vh, 660px); overflow: auto; overscroll-behavior: contain; padding: 0 3px; margin: 3px 0 0; list-style: none; }
.admin-list li { border-top: 1px solid var(--rule); }
.admin-list-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px; width: 100%; padding: 12px 8px; border: 0; background: transparent; text-align: left; }
.admin-list-button strong { grid-column: 1/-1; overflow-wrap: anywhere; line-height: 1.3; }
.admin-list-button :is(span) { font-size: 13px; }
.admin-list-button:is(:hover, [aria-current]) { background: var(--active); }
.admin-list-button:focus-visible { outline-offset: -2px; }
.admin-state.published { color: var(--good); }
.admin-state.draft { color: var(--accent); }
.admin-list-empty { padding: 12px 6px; }
.admin-sheet { min-width: 0; padding: clamp(14px, 3vw, 27px); background: var(--panel); border-radius: 8px; }
.admin-sheet-head { margin-bottom: 16px; }
.editor-fields, .editor-box { min-inline-size: 0; }
.editor-fields { display: grid; gap: 15px; border: 0; margin: 0; padding: 0; }
.editor-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.editor-checkbox { display: flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; }
.editor-checkbox input { width: 18px; height: 18px; }
.editor-group { display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 11px; }
.editor-group .workspace-muted { font-size: 14px; }
.editor-group-head h3 { font-size: 17px; }
.editor-repeat { display: grid; gap: 12px; }
.editor-box { display: grid; gap: 10px; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px 12px; margin: 0; }
.editor-box legend { padding-inline: 5px; color: var(--muted); font-size: 13px; }
.editor-remove { justify-self: start; min-height: 37px; border: 0; background: transparent; padding: 0 2px; color: var(--accent); font-size: 14px; }
.editor-remove:hover { text-decoration: underline; text-underline-offset: 3px; }
.markdown-editor { --editor-height: clamp(300px, 42vh, 420px); min-width: 0; border: 1px solid var(--rule); border-radius: 7px; background: var(--base); }
.markdown-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--rule); }
.markdown-tabs { display: flex; gap: 4px; min-width: 0; }
.markdown-tabs button { min-height: 39px; padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; }
.markdown-tabs button[aria-selected=true] { color: var(--ink); background: var(--active); }
.markdown-kind { color: var(--muted); font-size: 12px; }
#editor-markdown {
  display: block; width: 100%; height: var(--editor-height); min-height: var(--editor-height); padding: clamp(11px, 2.2vw, 20px); resize: vertical;
  border: 0; border-radius: 0 0 7px 7px; background: transparent; color: var(--ink);
  font: 400 16px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}
#editor-markdown:focus-visible { outline-offset: -3px; }
.editor-preview { min-height: var(--editor-height); padding: clamp(11px, 2.6vw, 25px); overflow-wrap: anywhere; }
#editor-preview-title { font-size: clamp(21px, 3vw, 33px); letter-spacing: -.03em; line-height: 1.18; margin-block-end: 8px; }
#editor-preview-excerpt { margin-block-end: 16px; }
#editor-preview-status { margin-top: 12px; }
.markdown-help summary, .editor-settings summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 650; }
.markdown-help ul { margin-block: 8px 0; padding-inline-start: 22px; font-size: 13px; overflow-wrap: anywhere; }
.editor-settings-fields { display: grid; gap: 14px; padding-top: 12px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .login-layout { min-height: auto; grid-template-columns: 1fr; gap: 24px; align-items: start; padding-block: 26px; }
  .login-panel { grid-row: 1; }
  .login-illustration { max-height: 215px; aspect-ratio: 2; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-list { max-height: 275px; }
}
@media (max-width: 420px) {
  .workspace-brand small { display: none; }
  .editor-pair { grid-template-columns: minmax(0, 1fr); }
  .editor-actions .button { flex-grow: 1; }
}
