:root {
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  color: #1c303b;
  background: #f5f6f3;
  --ink: #172e39;
  --muted: #64757a;
  --line: #d6dedc;
  --accent: #086c61;
  --mint: #c9f4df;
  --paper: #fff;
  --sheet-bar-height: 39px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.file {
  cursor: pointer;
}
button,
.file,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
button,
.file {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 550;
}
button:hover,
.file:hover {
  border-color: #77a89e;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
a {
  color: inherit;
}
h1,
h2,
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #42ad9a;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.top {
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  padding: 5px 18px;
  font-size: 13px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 730;
  letter-spacing: 0.05em;
  text-decoration: none;
  font-size: 20px;
}
.brand i {
  width: 22px;
  height: 23px;
  background: var(--mint);
  clip-path: polygon(
    0 20%,
    60% 0,
    100% 17%,
    100% 78%,
    40% 100%,
    0 82%,
    0 66%,
    40% 84%,
    84% 68%,
    84% 52%,
    40% 68%,
    0 50%
  );
}
.divider {
  height: 22px;
  width: 1px;
  background: #51636a;
}
.shelf {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 82px) clamp(16px, 5vw, 64px);
}
.library-head,
.actions,
.sheet-bar,
.dialog-head,
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.library-head h1 {
  font-size: clamp(36px, 5vw, 65px);
  letter-spacing: -0.055em;
  font-weight: 570;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.library-head .muted {
  margin: 8px 0 0;
}
.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.actions button,
.file {
  padding: 11px 15px;
}
.primary,
.top .export {
  background: var(--mint);
  border-color: #9ed2c1;
  color: #10483e;
}
.file {
  position: relative;
  overflow: hidden;
}
.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.file:focus-within {
  outline: 3px solid #42ad9a;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 6px;
  max-width: 340px;
  margin: 34px 0 20px;
}
.search input {
  border: 0;
  padding: 7px;
  min-width: 0;
  width: 100%;
}
.search span {
  font-size: 23px;
  color: var(--muted);
}
.documents {
  border-top: 2px solid var(--ink);
}
.document-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.document-row .rename {
  margin-inline: 8px;
}
.doc-card {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 100px 150px 20px;
  align-items: center;
  gap: 18px;
  padding: 23px 10px;
  text-decoration: none;
}
.doc-card:hover {
  background: #eaf0eb;
}
.doc-preview {
  height: 78px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}
.doc-card h2 {
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.doc-card p {
  margin-top: 5px;
}
.doc-meta {
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.doc-meta span,
.doc-card time {
  font-size: 12px;
  color: var(--muted);
}
.empty,
#message {
  padding: 16px;
  color: var(--muted);
}
.editing {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editing .top {
  gap: 12px;
}
.top h1 {
  font-size: 17px;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 540;
}
.crumb {
  margin-left: 10px;
  color: #c8d9da;
  text-decoration: none;
}
.slash {
  opacity: 0.4;
}
.save {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
  color: #cae4dc;
}
.save::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #80dac3;
  margin-right: 6px;
}
.save[data-state='offline']::before,
.save[data-state='conflict']::before,
.save[data-state='invalid']::before {
  background: #ff9c78;
}
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.rail {
  width: 190px;
  flex: none;
  background: #f7f8f5;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 15px 10px 10px;
  overflow: auto;
}
.rail h2,
.inspector-head small,
.view-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
}
.rail h2 {
  margin: 11px 8px 7px;
}
.toolset {
  display: grid;
  gap: 2px;
}
#collapse-rail,
.toolset button,
.secondary-wide,
.rail-end button {
  border-color: transparent;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  min-height: 30px;
  font-size: 12px;
}
.toolset button:hover,
.secondary-wide:hover,
.rail-end button:hover {
  background: #e8efea;
}
.toolset [aria-pressed='true'] {
  color: #07594e;
  border-color: #afd6ca;
  background: #dcefe6;
}
.tool-icon {
  width: 20px;
  text-align: center;
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}
.rail-end {
  margin-top: auto;
  padding-top: 14px;
}
.secondary-wide {
  color: var(--accent);
  margin-top: 4px;
}
.sheet {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sheet-bar {
  height: var(--sheet-bar-height);
  flex: none;
  justify-content: flex-start;
  padding: 3px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.view-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.view-label select {
  font-size: 13px;
  letter-spacing: 0;
  padding: 6px;
  max-width: min(44vw, 440px);
  min-width: 0;
}
.history {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.history button {
  font-size: 18px;
  padding: 3px 10px;
}
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: white;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}
#drawing,
#drawing > svg {
  display: block;
  width: 100%;
  height: 100%;
}
#stage[data-tool='pan'] {
  cursor: grab;
}
#stage:not([data-tool='select']):not([data-tool='pan']) {
  cursor: crosshair;
}
#stage[data-tool='select'] [data-id] {
  cursor: move;
}
.zoom {
  display: flex;
  position: absolute;
  bottom: 12px;
  right: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #fff;
  box-shadow: 0 3px 12px #17373b16;
}
.zoom button {
  border: 0;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fafbf8;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--muted);
}
#object-count {
  white-space: nowrap;
}
.recovery {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  background: #fff2ce;
  padding: 7px 14px;
  font-size: 12px;
}
.recovery button {
  padding: 5px 8px;
}
.edit-outline {
  fill: none;
  stroke: #087d70;
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.handle {
  fill: #fff;
  stroke: #087d70;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}
.handle[data-handle='resize'] {
  cursor: nwse-resize;
}
#inspector {
  position: absolute;
  z-index: 3;
  right: 8px;
  top: calc(var(--sheet-bar-height) + 8px);
  bottom: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: -4px 0 18px #152b3814;
  width: clamp(290px, 25vw, 385px);
  flex: none;
  background: white;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  min-height: 0;
}
.inspector-head,
.dialog-head {
  align-items: flex-start;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.inspector-head h2,
.dialog-head h2 {
  font-size: 17px;
  overflow-wrap: anywhere;
}
.inspector-head button,
.dialog-head button {
  font-size: 18px;
  border: 0;
  padding: 0 4px;
}
#fields {
  overflow: auto;
  flex: 1;
  padding: 8px 14px;
}
.inspector-foot {
  padding: 9px;
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--line);
}
.inspector-foot button {
  font-size: 11px;
}
.danger {
  color: #984029;
}
.field {
  display: grid;
  gap: 3px;
  margin: 8px 0;
}
.field > span,
.fields-group > summary {
  font-size: 12px;
}
.field > span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.field input,
.field select,
.field textarea,
dialog input,
dialog select {
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
  min-width: 0;
}
.field textarea {
  resize: vertical;
}
.field input:read-only {
  background: #f2f4f2;
  color: #657478;
}
.fields-group {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.fields-group > summary {
  cursor: pointer;
  font-weight: 650;
  padding: 3px 0;
}
.nested {
  border-left: 2px solid #dde8e1;
  padding-left: 9px;
}
.nested button,
.field button {
  font-size: 11px;
  padding: 4px 7px;
}
.row-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}
.field-issue {
  color: #9a3c2a;
  font-size: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(470px, calc(100vw - 24px));
  max-height: 80dvh;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 18px 80px #102b3644;
}
dialog::backdrop {
  background: #17303860;
}
dialog form,
#dialog-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}
dialog form h2 {
  font-size: 20px;
}
dialog label {
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.choice {
  display: block;
  text-align: left;
  width: 100%;
  margin: 3px 0;
}
.view-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-row input {
  flex: 1;
}
.view-row button {
  flex: none;
}
.thumb {
  max-width: 110px;
  max-height: 75px;
  object-fit: contain;
}
#toggle-tools {
  display: none;
}
@media (max-width: 900px) {
  .rail {
    width: 156px;
  }
  .editing .top {
    padding: 5px 10px;
  }
  .crumb,
  .slash {
    display: none;
  }
  .top h1 {
    font-size: 14px;
  }
  .doc-card {
    grid-template-columns: 90px minmax(0, 1fr) 85px 16px;
  }
  .doc-card time {
    display: none;
  }
}
@media (max-width: 650px) {
  .library-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .top {
    padding: 5px 10px;
  }
  .doc-card {
    padding-inline: 0;
    gap: 9px;
  }
  .doc-meta {
    font-size: 11px;
  }
  .doc-card h2 {
    font-size: 15px;
  }
  .editing .top {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .editing .top h1 {
    max-width: calc(100vw - 100px);
    flex: 1;
  }
  .save {
    margin-left: 0;
  }
  .layout {
    flex: 1;
  }
  .rail {
    display: none;
    position: absolute;
    top: var(--sheet-bar-height);
    left: 0;
    bottom: 0;
    width: 180px;
    z-index: 5;
    box-shadow: 4px 0 18px #152b3814;
  }
  .layout.show-tools .rail {
    display: flex;
  }
  #toggle-tools {
    display: block;
  }
  .sheet-bar {
    padding: 3px 6px;
    gap: 5px;
  }
  .view-label {
    font-size: 0;
  }
  .view-label select {
    max-width: 45vw;
  }
  .statusbar #object-count {
    display: none;
  }
  #inspector {
    width: min(340px, 94vw);
  }
  .history {
    gap: 2px;
  }
  .top .export {
    padding: 5px 8px;
  }
}

.color-field {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px;
}
.color-field input[type='color'] {
  height: 33px;
  padding: 2px;
  cursor: pointer;
}

.layout.compact-rail .rail {
  width: 52px;
  padding-inline: 5px;
  align-items: stretch;
}
.compact-rail .rail .tool-label,
.compact-rail .rail h2 {
  display: none;
}
.compact-rail .rail button {
  justify-content: center;
  padding-inline: 0;
  width: 100%;
}
.compact-rail #tools,
.compact-rail #palette {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 6px;
}
@media (max-width: 650px) {
  .layout.compact-rail .rail {
    position: static;
    display: flex;
    box-shadow: none;
  }
  .compact-rail #toggle-tools {
    display: none;
  }
  .document-row {
    flex-wrap: wrap;
  }
  .document-row .doc-card {
    flex-basis: 100%;
  }
  .document-row .rename {
    margin: 0 0 12px auto;
  }
}

.project-tabs {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.project-tabs a {
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  color: #d1e5df;
}
.project-tabs a:hover,
.project-tabs a[aria-current='page'] {
  background: #314c54;
  color: white;
}
@media (max-width: 530px) {
  .library .top > .divider,
  .library .top > .divider + span {
    display: none;
  }
}

.safety-shortcut[aria-current='page'] {
  color: var(--mint);
  font-weight: 700;
}

.versions-link{color:var(--accent);font-size:13px;font-weight:600;text-underline-offset:3px;white-space:nowrap;padding:7px}
