.documents-workspace[hidden],
.documents-workspace [hidden] {
  display: none !important;
}
.documents-open {
  overflow: hidden;
}
.documents-workspace {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  text-align: left;
}
.documents-workspace * {
  box-sizing: border-box;
}
.docs-topbar {
  height: 72px;
  flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
}
.docs-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  display: flex;
  gap: 18px;
  align-items: center;
}
.docs-brand span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
}
.docs-top-actions {
  display: flex;
  gap: 8px;
}
.documents-workspace .docs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font:
    500 12px/1.2 "DM Sans",
    system-ui,
    sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.documents-workspace .docs-button:hover {
  background: var(--surface-hover);
}
.documents-workspace .docs-button-primary {
  background: var(--text);
  color: var(--panel);
  border-color: var(--text);
}
.docs-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}
.docs-sidebar {
  width: 270px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 25px 16px 16px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.docs-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
}
.docs-sidebar-head h2 {
  font-size: 14px;
  letter-spacing: -0.025em;
  margin: 0;
}
.docs-search-label input {
  width: 100%;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--text);
  font: 12px system-ui;
  outline-offset: 2px;
}
.docs-filters {
  display: flex;
  gap: 2px;
  margin: 15px 0 16px;
}
.docs-filters button {
  padding: 7px 12px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: 12px system-ui;
  cursor: pointer;
}
.docs-filters button[aria-pressed="true"] {
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 600;
}
.docs-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.docs-list-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px 11px;
  margin-bottom: 6px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.docs-list-item:hover {
  background: var(--surface-subtle);
}
.docs-list-item.is-current {
  background: var(--surface-muted);
  border-color: var(--line);
}
.docs-list-item strong {
  font: 600 13px system-ui;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-list-item span {
  color: var(--muted);
  font: 12px/1.6 system-ui;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.docs-list-item small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.docs-list-empty {
  padding: 20px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.docs-sidebar-note {
  border-top: 1px solid var(--line);
  padding: 17px 10px 0;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}
.docs-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.docs-mobile-nav {
  display: none;
}
.docs-empty {
  margin: auto;
  max-width: 600px;
  padding: 50px 25px;
  text-align: center;
}
.docs-empty-symbol {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  font-size: 30px;
}
.docs-eyebrow {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.docs-empty h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.045em;
  margin: 20px 0;
}
.docs-empty > p:not(.docs-eyebrow) {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.docs-empty .docs-button {
  margin-top: 25px;
  padding: 13px 20px;
}
.docs-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.docs-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.docs-toolbar button,
.docs-toolbar select {
  border: 0;
  border-radius: 4px;
  min-height: 30px;
  padding: 5px 8px;
  background: transparent;
  color: var(--text);
  font: 12px system-ui;
  cursor: pointer;
}
.docs-toolbar button:hover {
  background: var(--surface-muted);
}
.docs-toolbar select {
  border: 1px solid var(--line);
  background: var(--panel);
  max-width: 120px;
}
.docs-divider {
  height: 19px;
  border-left: 1px solid var(--line);
  margin: 0 4px;
}
.docs-toolbar-spacer {
  flex: 1;
}
.docs-paper-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 40px clamp(22px, 5vw, 80px) 60px;
}
.docs-paper {
  max-width: 850px;
  min-height: 880px;
  margin: auto;
  padding: 65px clamp(30px, 5vw, 76px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 2px 10px #00000003;
}
.docs-title {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 32px;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: var(--text);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 44px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.docs-title::placeholder {
  color: var(--muted);
}
.docs-editor {
  outline: none;
  min-height: 650px;
  color: var(--text);
  font:
    16px/1.9 "DM Sans",
    system-ui,
    sans-serif;
  overflow-wrap: anywhere;
  white-space: normal;
}
.docs-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.docs-editor p {
  margin: 0 0 16px;
}
.docs-editor h1 {
  font-size: 32px;
  line-height: 1.3;
}
.docs-editor h2 {
  font-size: 25px;
  line-height: 1.4;
}
.docs-editor h3 {
  font-size: 20px;
  line-height: 1.5;
}
.docs-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px 0;
  border-radius: 4px;
}
.docs-editor a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.docs-editor blockquote {
  border-left: 2px solid var(--line-strong);
  padding-left: 20px;
  margin-left: 0;
  color: var(--muted);
}
.docs-editor pre {
  padding: 16px;
  border-radius: 5px;
  background: var(--surface-muted);
  white-space: pre-wrap;
}
.docs-editor ul,
.docs-editor ol {
  padding-left: 26px;
}
.docs-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 37px;
  align-items: center;
  padding: 7px 25px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 10px;
  color: var(--muted);
}
.docs-notice {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
}
.docs-notice > span {
  flex: 1;
  min-width: 180px;
}
.documents-workspace :focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.documents-workspace button:disabled {
  opacity: 0.4;
  cursor: default;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1050px) {
  .docs-sidebar {
    width: 240px;
  }
  .docs-toolbar {
    padding: 8px 14px;
  }
  .docs-paper-scroll {
    padding: 24px;
  }
  .docs-paper {
    padding: 45px 35px;
  }
  .docs-toolbar-spacer {
    display: none;
  }
}
@media (max-width: 700px) {
  .docs-topbar {
    height: 60px;
    padding: 0 12px;
    gap: 8px;
  }
  .docs-brand {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .docs-brand span {
    display: none;
  }
  .docs-topbar .docs-button {
    padding: 8px 9px;
    font-size: 11px;
  }
  .docs-top-actions {
    gap: 5px;
  }
  .docs-sidebar {
    display: none;
    position: absolute;
    top: 105px;
    bottom: 0;
    left: 0;
    width: min(320px, 100%);
    z-index: 3;
    box-shadow: 20px 0 40px #0002;
  }
  .docs-browsing .docs-sidebar {
    display: flex;
  }
  .docs-mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 45px;
    flex: none;
    padding: 6px 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .docs-mobile-nav .docs-button {
    min-height: 30px;
    padding: 5px 8px;
    border-color: transparent;
  }
  .docs-toolbar {
    padding: 8px 10px;
    gap: 2px;
  }
  .docs-toolbar button {
    font-size: 11px;
    min-height: 30px;
  }
  .docs-toolbar select {
    font-size: 11px;
    max-width: 100px;
  }
  .docs-divider {
    margin: 0 2px;
  }
  .docs-paper-scroll {
    padding: 0;
    background: var(--panel);
  }
  .docs-paper {
    min-height: calc(100dvh - 220px);
    padding: 30px 22px;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .docs-title {
    font-size: 35px;
    margin-bottom: 24px;
  }
  .docs-editor {
    font-size: 16px;
    min-height: 60dvh;
  }
  .docs-statusbar {
    padding: 7px 13px;
  }
  .docs-empty {
    padding: 35px 24px;
  }
  .docs-empty h1 {
    font-size: 54px;
  }
  .docs-empty-symbol {
    margin-bottom: 22px;
  }
  .docs-notice {
    padding: 12px;
  }
  .docs-notice .docs-button {
    font-size: 10px;
  }
}

.documents-workspace .docs-button.docs-button-primary:hover {
  background: var(--text-subtle-strong);
  color: var(--panel);
}
body.documents-open .page-shell {
  display: none;
}

/* Keep everyday actions in one scrollable row; advanced paragraph tools stay folded. */
.docs-toolbar{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;min-width:0;flex:none}
.docs-toolbar>*{flex-shrink:0}.docs-toolbar [aria-pressed="true"]{background:var(--surface-muted);box-shadow:inset 0 -2px var(--text)}
.docs-format-panel{flex:none;padding:16px 22px;max-height:min(42dvh,300px);overflow:auto;background:var(--panel);border-bottom:1px solid var(--line)}
.docs-format-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;max-width:720px}.docs-format-fields label{display:flex;flex-direction:column;gap:7px;font-size:11px;color:var(--muted)}.docs-format-fields select{font:13px system-ui;min-height:36px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);padding:6px 8px;max-width:100%}.docs-format-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.docs-format-panel>p{font-size:11px;color:var(--muted);line-height:1.7;margin:13px 0 0}.docs-print-title{display:none}
@media(max-width:700px){.docs-format-panel{padding:13px}.docs-format-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.docs-format-fields select{font-size:14px;min-height:38px}.docs-toolbar button,.docs-toolbar select{min-height:36px}.docs-toolbar-spacer{display:none}.docs-toolbar{scroll-padding-inline:12px}.docs-format-actions .docs-button{min-height:36px}}
@media print{body.documents-open{overflow:visible!important;background:#fff!important}body.documents-open>:not(#documentsWorkspace){display:none!important}.documents-open .documents-workspace{position:static!important;height:auto!important;display:block!important;background:#fff!important;color:#000!important}.documents-open .docs-topbar,.documents-open .docs-sidebar,.documents-open .docs-toolbar,.documents-open .docs-format-panel,.documents-open .docs-mobile-nav,.documents-open .docs-statusbar,.documents-open .docs-notice,.documents-open .docs-related,.documents-open .docs-title{display:none!important}.documents-open .docs-layout,.documents-open .docs-main,.documents-open .docs-content,.documents-open .docs-paper-scroll{display:block!important;height:auto!important;overflow:visible!important;padding:0!important}.documents-open .docs-paper{min-height:0;max-width:none;margin:0;border:0;box-shadow:none;padding:0;background:#fff}.documents-open .docs-editor{min-height:0;color:#000}.documents-open .docs-print-title{display:block;font:32px/1.3 Georgia,serif;overflow-wrap:anywhere;margin:0 0 24px} }

.docs-editor:focus-visible,.docs-title:focus-visible{outline:none}
