* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font: 16px/1.55 "DM Sans", system-ui, sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .21em; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--iz-accent); outline-offset: 3px; }
button:disabled { opacity: .6; cursor: wait; }
.wrap { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }
.skip { position: absolute; top: -6rem; left: 1rem; z-index: 3; background: var(--iz-raised); padding: 10px 14px; }
.skip:focus { top: .5rem; }
.mast { border-bottom: 1px solid; }
.mast-inner, .mast nav, .brand, .eyebrow, .doc-meta, .tools, .actions, .listing-title, .footer, .writing-head {
  display: flex; align-items: center; gap: 12px;
}
.mast-inner { min-height: 68px; justify-content: space-between; }
.brand { text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand img { image-rendering: pixelated; border-radius: 6px; }
.brand small { color: var(--iz-accent); font-size: .7em; }
.mast nav { gap: 22px; font-size: .93rem; }
.mast nav a { text-decoration: none; color: var(--iz-muted); }
.mast nav [aria-current], .mast a:hover { color: var(--iz-accent); }
.intro, .doc-head { padding: clamp(32px,5vw,70px) 0 32px; border-bottom: 1px solid var(--iz-edge); }
.eyebrow { color: var(--iz-accent); font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.flag { width: 23px; height: 15px; flex: none; background: linear-gradient(#4381b7 0 33.33%,#669465 33.33% 66.66%,#faf1dd 66.66%); }
h1, h2, h3, h4, .entry strong { overflow-wrap: anywhere; }
h1, .listing h2, dialog h2, .entry strong { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin: .23em 0; font-size: clamp(2.45rem,5vw,4.45rem); line-height: 1.07; letter-spacing: -.045em; }
.intro h1 span { color: var(--iz-muted); font-size: .67em; }
.intro p, .form-intro { max-width: 62ch; color: var(--iz-muted); margin: .7rem 0 0; }
.catalog-layout, .reader-layout {
  display: grid; grid-template-columns: minmax(170px,218px) minmax(0,1fr);
  align-items: start; gap: clamp(22px,4vw,56px); padding: 32px 0 58px;
}
.side { position: sticky; top: 16px; }
.section-nav { border-top: 2px solid var(--iz-accent); margin-top: 3px; }
.section-nav summary { padding: 12px 2px; color: var(--iz-muted); font-weight: 700; }
.kinds, .contents nav { display: grid; gap: 3px; max-height: 55vh; overflow: auto; padding: 3px; }
.kinds button, .contents nav a {
  padding: 9px 12px; min-height: 42px; text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: 6px; line-height: 1.35; text-decoration: none;
}
.kinds button[aria-pressed="true"] { background: var(--iz-raised); border-color: var(--iz-edge); color: var(--iz-accent); font-weight: 750; }
.kinds button:hover, .contents nav a:hover, .outline:hover, .format-tools button:hover { background: var(--iz-raised); }
.listing-title, .writing-head, .footer { justify-content: space-between; }
.listing h2 { margin: 0; font-size: clamp(1.6rem,3vw,2.15rem); line-height: 1.12; }
.count, .draft-status, .doc-meta, .entry small, .footer, .import small, .empty { color: var(--iz-muted); font-size: .9rem; }
.filters, .pair { display: grid; grid-template-columns: minmax(0,2fr) minmax(145px,1fr); gap: 14px; }
.filters { padding: 19px 0; }
label { display: grid; gap: 5px; font-weight: 650; font-size: .92rem; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--iz-edge); border-radius: 7px; background: var(--iz-bg); font-weight: 400;
}
input::placeholder, textarea::placeholder { color: var(--iz-muted); opacity: .82; }
textarea { resize: vertical; }
.solid, .outline, .format-tools button {
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--iz-edge); border-radius: 7px;
  background: var(--iz-surface); font-weight: 650; line-height: 1.3;
}
.solid { background: var(--iz-accent); color: var(--iz-bg); border-color: var(--iz-accent); }
.solid:hover { background: var(--iz-highlight); }
.tools, .actions { flex-wrap: wrap; }
.tools { margin-bottom: 16px; }
.act-list { border: 1px solid var(--iz-edge); border-radius: 12px; background: var(--iz-surface); overflow: clip; }
.entry { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 17px 20px; text-decoration: none; }
.entry + .entry { border-top: 1px solid var(--iz-edge); }
.entry:hover, .entry:focus-visible { background: var(--iz-raised); }
.entry:focus-visible { outline-offset: -3px; }
.details { display: grid; gap: 4px; }
.entry strong { line-height: 1.25; font-size: 1.3rem; }
.entry small { overflow-wrap: anywhere; }
.badge { display: inline-block; border: 1px solid var(--iz-edge); padding: 3px 9px; border-radius: 20px; font-size: .78rem; font-weight: 700; color: var(--iz-muted); }
.badge.project { color: var(--iz-highlight); border-color: #81613d; }
.badge.published { color: var(--iz-success); border-color: #586a43; }
.empty { padding: 0 18px; }
.back { display: inline-block; margin-top: 24px; color: var(--iz-accent); font-weight: 650; }
.doc-head { padding-top: 22px; }
.doc-head h1 { max-width: 25ch; }
.doc-meta { flex-wrap: wrap; margin-top: 12px; }
.doc-head button { margin-top: 15px; }
.contents form { margin: 14px 0 0; }
.contents form div { display: flex; gap: 6px; margin-top: 4px; }
.paper { min-width: 0; background: var(--iz-surface); border: 1px solid var(--iz-edge); border-top: 3px solid var(--iz-accent); border-radius: 9px; padding: clamp(20px,3.5vw,48px); overflow-wrap: anywhere; font: clamp(1.05rem,1.5vw,1.18rem)/1.72 Georgia,serif; }
.paper > * { max-width: 72ch; }
.paper h2, .paper h3, .paper h4 { line-height: 1.22; margin: 1.55em 0 .55em; }
.paper > :first-child { margin-top: 0; }
.paper p, .paper li, .paper code { white-space: pre-line; }
.paper p { margin: .9em 0; }
.paper [id] { scroll-margin-top: 18px; }
.paper :target { background: var(--iz-raised); box-shadow: -3px 0 var(--iz-accent); }
.paper a, .permalink { color: var(--iz-accent); }
.permalink { font: .85em system-ui; text-decoration: none; }
.footer { gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--iz-edge); padding: 22px 0 35px; }
dialog { width: min(820px,94vw); max-height: 91dvh; border-radius: 14px; border: 1px solid var(--iz-edge); padding: clamp(18px,3vw,32px); background: var(--iz-surface); color: var(--iz-text); }
dialog::backdrop { background: #100904cc; }
dialog form { display: grid; gap: 14px; }
.editor-options { border-block: 1px solid var(--iz-edge); padding: 6px 0; }
.editor-options summary { padding: 8px 0; font-weight: 650; color: var(--iz-muted); }
.option-fields { display: grid; gap: 12px; padding: 8px 0; }
dialog h2 { margin: 0; font-size: 2rem; line-height: 1.15; }
.form-intro, .draft-status { margin: 0; }
.draft-status:empty { display: none; }
.import { padding: 12px; background: var(--iz-raised); border-radius: 7px; }
.import input { border: 0; padding: 2px 0; min-height: 34px; background: transparent; }
.import small { font-weight: 400; }
.writing { min-width: 0; }
.writing-head { margin-bottom: 8px; }
.format-tools { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.format-tools button { padding: 5px 11px; font-size: .88rem; }
#actBody { line-height: 1.6; padding: 14px; min-height: 15rem; }
.preview { min-height: 15rem; padding: 18px; background: var(--iz-bg); }
.actions { position: sticky; bottom: -1px; justify-content: flex-end; background: var(--iz-surface); padding-top: 9px; border-top: 1px solid var(--iz-edge); }
.error { color: var(--iz-danger); border-left: 3px solid; padding: 8px 12px; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .catalog-layout, .reader-layout { grid-template-columns: 1fr; gap: 18px; padding-top: 18px; }
  .side { position: static; }
  .section-nav { border: 1px solid var(--iz-edge); border-radius: 8px; background: var(--iz-surface); padding: 0 12px; }
  .section-nav[open] { padding-bottom: 12px; }
  .kinds { display: flex; flex-wrap: wrap; }
  .contents nav { max-height: 35vh; }
  .mast nav { gap: 10px; font-size: .83rem; }
  .entry { padding: 14px; gap: 10px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 500px) {
  .filters, .pair { grid-template-columns: 1fr; gap: 9px; }
  .mast nav > a:first-child { display: none; }
  .mast nav { max-width: 54%; text-align: right; }
  .brand { gap: 6px; }
  .brand small { display: block; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .badge { justify-self: start; }
  .tools > button { flex-grow: 1; }
  dialog { width: 100%; max-width: 100%; max-height: 100dvh; border-radius: 0; padding: 16px; }
  .actions { justify-content: stretch; padding-bottom: env(safe-area-inset-bottom); }
  .actions button { flex: 1; }
}
@media print {
  .mast, .footer, .back, .contents, .tools, #editAct, dialog, .permalink { display: none !important; }
  body, .paper { background: white !important; color: black !important; }
  .wrap { width: auto; }
  .reader-layout { display: block; padding: 0; }
  .doc-head, .paper { padding: 0; border: 0; }
}
