body { display: block; }
#workspace-shell { display: flex; width: 100%; min-height: 100vh; }
#workspace-shell .sidebar { padding-top: 28px; overflow-y: auto; }
#workspace-shell .nav-label { margin-top: 30px; margin-bottom: 12px; }
#workspace-shell .nav-item { min-height: 63px; padding-block: 9px; }
#workspace-shell .side-note { display: none; }
.new-document { width: calc(100% - 10px); margin: 22px 5px 26px; font-size: 14px; }
.library-nav-label { margin: 0 15px 9px; }
.library-nav { display: grid; gap: 5px; }
.library-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: 56px; border: 1px solid transparent; border-radius: 13px; background: none; text-align: left; font-size: 14px; font-weight: 600; }
.library-nav-item .artwork { width: 33px; height: 33px; }
.library-nav-item:hover { background: #f0f5ed; }
.library-nav-item.active { background: #e9f2e7; border-color: #d5e4d0; color: #176949; }
.nav-count { margin-left: auto; color: #5c7666; font-size: 12px; font-weight: 500; }
#workspace-shell .sidebar-footer { padding: 24px 5px 0; }
.account-entry { display: flex; align-items: center; width: 100%; gap: 9px; background: #f1f5ed; border: 1px solid #dce6d7; border-radius: 14px; padding: 12px 9px; text-align: left; }
.account-avatar { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 35px; border-radius: 10px; color: #137060; background: #dfede0; font-weight: 700; }
.account-entry strong { display: block; font-size: 12px; font-weight: 700; }
.account-entry small { display: block; font-size: 10px; color: #5f7464; margin-top: 3px; }
.account-entry>span:last-child { margin-left: auto; }
.mobile-account { display: none; }
.document-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 4px; margin: 0 0 18px; }
.document-name { flex: 1; min-width: 0; }
.document-name input { display: block; width: 100%; font: inherit; font-size: 18px; font-weight: 650; letter-spacing: -.3px; color: #274d3c; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 6px 5px; outline-color: #229180; }
.document-name input:hover { background: #eaf0e7; }
.document-name input:focus { background: white; }
.document-name>span { display: block; padding-left: 6px; margin-top: 2px; color: #5d7461; font-size: 12px; }
.document-bar-actions { display: flex; gap: 7px; align-items: center; }
.document-bar-actions .button { min-height: 43px; padding: 9px 14px; font-size: 14px; }
.document-bar-actions .icon { width: 18px; height: 18px; }
[aria-pressed=true].favorite-toggle .icon svg, #favorite-document[aria-pressed=true] .icon svg { fill: #edce92; stroke: #967744; }
.style-hint { font-size: 12px; color: #61765e; }
#storage-warning { background: #fff2df; border: 1px solid #d6ac77; color: #6d441e; padding: 16px 20px; border-radius: 12px; line-height: 1.7; font-size: 14px; margin-bottom: 24px; }
.library-intro { display: flex; align-items: center; justify-content: space-between; min-height: 188px; gap: 24px; margin-bottom: 22px; }
.library-intro h1 { font-size: clamp(30px,3vw,43px); margin: 13px 0; line-height: 1.25; }
.library-intro h1>span { color: var(--teal); }
.library-intro p:not(.eyebrow) { color: #60746a; font-size: 16px; line-height: 1.7; margin: 0; }
.library-hero { width: 125px; height: 125px; transform: rotate(-5deg); margin-right: 14px; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.search-field { display: flex; align-items: center; gap: 10px; background: white; border: 1px solid #dce5d8; padding: 0 15px; border-radius: 13px; min-height: 50px; width: 360px; max-width: 100%; color: #688771; }
.search-field:focus-within { outline: 2px solid #21998d; outline-offset: 3px; }
.search-field input { font: inherit; font-size: 14px; width: 100%; min-width: 0; border: 0; outline: none; color: var(--ink); background: transparent; padding-block: 12px; }
.search-field input::placeholder { color: #65786c; }
#library-summary { font-size: 13px; line-height: 1.5; color: #587362; text-align: right; }
.document-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.document-card { background: linear-gradient(150deg,#fff 70%,#f8faf4); border: 1px solid #dce6d8; border-radius: 21px; padding: 22px 24px 16px; box-shadow: 0 12px 28px -22px #31583b50; min-width: 0; transition: border-color .18s,box-shadow .18s; }
.document-card:hover { border-color: #adc8b1; box-shadow: 0 15px 30px -22px #31583b70; }
.document-card-top { display: flex; align-items: center; justify-content: space-between; }
.document-card-top>.artwork { width: 52px; height: 52px; }
.document-kind { color: #7e6545; font-size: 12px; padding: 6px 9px; border-radius: 7px; background: #fbf0dc; }
.document-card h2 { margin: 18px 0 12px; color: #214c38; font-size: 20px; font-weight: 650; line-height: 1.5; letter-spacing: -.4px; overflow-wrap: anywhere; }
.document-excerpt { color: #58705f; font-size: 15px; line-height: 1.85; margin: 0; min-height: 83px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.document-date { margin: 19px 0 14px; font-size: 12px; color: #5f7562; }
.document-card-actions { border-top: 1px solid #e7ede2; padding-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.document-card-actions .button { font-size: 13px; min-height: 44px; padding: 9px 14px; }
.text-button { background: none; border: 0; color: #087865; font-size: 14px; font-weight: 700; min-height: 44px; padding: 9px 0; display: inline-flex; gap: 8px; align-items: center; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger { color: #9a4c37; font-size: 13px; }
.text-button .icon { width: 18px; height: 18px; }
.library-empty { text-align: center; background: #f9fbf6; border: 1px dashed #bfd2bd; border-radius: 24px; padding: 55px 24px; margin-top: 10px; }
.library-empty>.artwork { width: 100px; height: 100px; }
.library-empty h2 { font-size: 25px; letter-spacing: -.6px; line-height: 1.5; margin: 23px 0 11px; }
.library-empty p { color: #5b7460; font-size: 15px; line-height: 1.8; max-width: 380px; margin: 0 auto 20px; }
.history-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 13px; }
.history-card { display: flex; align-items: center; gap: 18px; padding: 22px; border: 1px solid #dce6d8; border-radius: 18px; background: white; min-width: 0; }
.history-card>.artwork { width: 50px; height: 50px; }
.history-details { flex: 1; min-width: 0; }
.history-details h2 { font-size: 17px; line-height: 1.5; margin: 0 0 5px; overflow-wrap: anywhere; }
.history-details p { font-size: 12px; line-height: 1.7; color: #5e7663; margin: 0; }
.history-details .history-excerpt { margin-top: 5px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card .button { font-size: 13px; flex-shrink: 0; }
#document-dialog { border: 1px solid #ccddce; border-radius: 25px; max-width: min(540px,calc(100vw - 32px)); padding: 0; color: var(--ink); box-shadow: 0 25px 100px #173e3540; }
#document-dialog::backdrop { background: #183e305a; backdrop-filter: blur(5px); }
.dialog-content { padding: 30px; }
.dialog-content>.artwork { width: 63px; height: 63px; }
.dialog-content h2 { font-size: 25px; letter-spacing: -.7px; line-height: 1.4; margin: 20px 0 12px; }
.dialog-content p { color: #5b7261; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
#dialog-preview { background: #f1f6ee; border: 1px solid #e0e8d8; border-radius: 13px; padding: 18px; font: inherit; font-size: 16px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32vh; overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; flex-wrap: wrap; }
@media (min-width:1600px) { .document-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width:1050px) {
  #workspace-shell { display: block; }
  #workspace-shell .sidebar { overflow: visible; padding-top: 22px; }
  #workspace-shell .nav-label, .library-nav-label { display: none; }
  .new-document { position: absolute; top: 87px; right: 28px; margin: 0; width: auto; min-height: 50px; padding-inline: 16px; }
  #workspace-shell .tool-nav { padding-right: 185px; }
  #workspace-shell .nav-item { min-height: 58px; }
  .library-nav { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid #dce6d7; padding-bottom: 10px; }
  .library-nav-item { flex: 1; justify-content: center; padding: 7px 10px; min-height: 48px; font-size: 14px; gap: 7px; }
  .library-nav-item .artwork { width: 29px; height: 29px; }
  .nav-count { margin-left: 3px; }
  .mobile-account { display: block; background: none; border: 0; color: #276f58; font-size: 12px; min-height: 44px; padding: 4px 0; }
  .workspace-footer>span { display: none; }
}
@media (max-width:700px) {
  #workspace-shell .tool-nav { padding-right: 0; margin-top: 22px; }
  #workspace-shell .tool-nav .nav-item { padding-inline: 8px; gap: 6px; }
  #workspace-shell .tool-nav .nav-item>span { white-space: nowrap; }
  .new-document { position: static; width: 100%; margin: 14px 0 2px; min-height: 43px; }
  .library-nav-item { padding: 8px 3px; flex-direction: column; gap: 3px; font-size: 12px; }
  .library-nav-item .artwork { width: 30px; height: 30px; }
  .nav-count { display: none; }
  .library-nav { margin-top: 8px; gap: 3px; }
  .library-intro { min-height: 0; gap: 5px; margin-block: 5px 25px; }
  .library-intro h1 { font-size: 32px; letter-spacing: -1px; }
  .library-intro p:not(.eyebrow) { font-size: 15px; }
  .library-hero { width: 76px; height: 76px; margin: 0; }
  .library-toolbar { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 20px; }
  .search-field { width: 100%; }
  #library-summary { text-align: left; font-size: 12px; }
  .document-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .document-card { padding: 18px 22px 14px; }
  .document-card h2 { font-size: 19px; }
  .document-bar { gap: 9px; }
  .document-name input { font-size: 16px; }
  .document-bar-actions { gap: 3px; }
  .document-bar-actions .button { padding: 8px 11px; font-size: 13px; }
  .document-bar-actions .button .icon { display: none; }
  .document-bar-actions .icon-button { width: 33px; }
  .document-name>span { font-size: 11px; }
  .history-card { padding: 17px; gap: 11px; flex-wrap: wrap; }
  .history-card>.artwork { width: 40px; height: 40px; }
  .history-details { flex-basis: calc(100% - 55px); }
  .history-card>.button { margin-left: 51px; }
  .dialog-content { padding: 23px; }
  .workspace-footer { align-items: flex-start; flex-direction: column; gap: 1px; }
  .style-hint { display: none; }
}
@media (max-width:360px) {
  .library-nav-item { font-size: 11px; }
  .library-hero { display: none; }
  .document-bar-actions .icon-button { width: 28px; }
}
