.window-content.subdraft-window-content {
  display: flex;
  flex: 1 1 0;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

[data-subdraft-root] {
  flex: 1;
  min-height: 0;
}

.subdraft-app {
  --sd-bg: #f5f7f5;
  --sd-panel: #fff;
  --sd-ink: #26332b;
  --sd-muted: #69756e;
  --sd-line: #dce3dd;
  --sd-accent: #508d5f;
  background: var(--sd-bg);
  color: var(--sd-ink);
  display: flex;
  flex-direction: column;
  font: 400 0.84rem/1.4 system-ui, sans-serif;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.subdraft-app *,
.subdraft-app *::before,
.subdraft-app *::after {
  box-sizing: border-box;
}

.subdraft-app .sd-file-menu {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.3rem 0.65rem;
}

.sd-icon-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.sd-icon-button svg {
  flex: 0 0 1.15rem;
  height: 1.15rem;
  width: 1.15rem;
}

.sd-rotation {
  align-items: center;
  display: flex;
  gap: 0.15rem;
}

.sd-rotation-input {
  background: var(--sd-panel);
  border: 1px solid var(--sd-line);
  border-radius: 0.35rem;
  color: var(--sd-ink);
  font: inherit;
  min-height: 2rem;
  padding: 0.28rem;
  width: 5rem;
}

.sd-rotation-input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sd-accent), transparent 35%);
}

.sd-toolbar {
  align-items: center;
  background: var(--sd-panel);
  border-bottom: 1px solid var(--sd-line);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-height: 54px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.45rem 0.65rem;
}

.sd-brand {
  display: grid;
  line-height: 1.2;
  margin-right: 0.35rem;
  min-width: 138px;
}

.sd-brand strong {
  color: var(--sd-accent);
  font-size: 1rem;
}

.sd-brand span {
  color: var(--sd-muted);
  font-size: 0.68rem;
}

.sd-project-name,
.sd-measurement,
.sd-units,
.sd-property-field input {
  background: var(--sd-panel);
  border: 1px solid var(--sd-line);
  border-radius: 0.35rem;
  color: var(--sd-ink);
  font: inherit;
  min-height: 2rem;
  padding: 0.28rem 0.45rem;
}

.sd-split-dialog {
  background: var(--sd-panel);
  border: 1px solid var(--sd-line);
  border-radius: 0.5rem;
  color: var(--sd-ink);
  max-width: min(32rem, 90vw);
  padding: 1rem;
}

.sd-split-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.sd-split-form {
  display: grid;
  gap: 0.65rem;
}

.sd-split-form h2,
.sd-split-form p {
  margin: 0;
}

.sd-split-form select {
  font: inherit;
  max-width: 100%;
}

.sd-split-error {
  color: #b42318;
}

.sd-split-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.sd-print-dialog {
  background: var(--sd-panel);
  border: 1px solid var(--sd-line);
  border-radius: 0.5rem;
  color: var(--sd-ink);
  max-height: 95vh;
  max-width: 95vw;
  overflow: auto;
  padding: 1rem;
  width: 900px;
}

.sd-print-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.sd-print-dialog h2,
.sd-print-dialog p {
  margin: 0 0 0.5rem;
}

.sd-print-options,
.sd-print-fields {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.5rem 0;
}

.sd-print-fields .sd-property-field {
  flex: 1 1 100px;
  min-width: 0;
}

.sd-print-fields input {
  width: 100%;
}

.sd-print-canvas {
  background: #fff;
  border: 1px solid var(--sd-line);
  display: block;
  height: auto;
  touch-action: none;
  width: min(100%, 72vh);
}

.sd-project-name {
  flex: 1 1 150px;
  max-width: 245px;
  min-width: 120px;
}

.sd-toolbar-group {
  align-items: center;
  border-right: 1px solid var(--sd-line);
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
  padding-right: 0.45rem;
}

.sd-button {
  background: var(--sd-panel);
  border: 1px solid var(--sd-line);
  border-radius: 0.35rem;
  color: var(--sd-ink);
  cursor: pointer;
  font: inherit;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0.3rem 0.55rem;
}

.sd-button:hover:not(:disabled) {
  border-color: var(--sd-accent);
}

.sd-button:focus-visible,
.sd-units:focus-visible,
.sd-project-name:focus-visible,
.sd-measurement:focus-visible,
.sd-property-field input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sd-accent), transparent 35%);
  outline-offset: 1px;
}

.sd-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.sd-button-primary {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  color: #fff;
  font-weight: 650;
}

.sd-zoom {
  color: var(--sd-muted);
  min-width: 2.8rem;
  text-align: center;
}

.sd-toggle {
  align-items: center;
  color: var(--sd-ink);
  display: flex;
  gap: 0.28rem;
  white-space: nowrap;
}

.sd-toggle input {
  accent-color: var(--sd-accent);
}

.sd-editor {
  display: grid;
  flex: 1;
  grid-template-columns: 76px minmax(0, 1fr) 200px;
  min-height: 0;
}

.sd-editor.sd-properties-hidden {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sd-properties[hidden] {
  display: none;
}

.sd-tools {
  align-items: stretch;
  background: var(--sd-panel);
  border-right: 1px solid var(--sd-line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  padding: 0.55rem;
}

.sd-tools .sd-button {
  flex-direction: column;
  font-size: 0.7rem;
  gap: 0.15rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.1rem;
}

.sd-tools .sd-button.is-active {
  background: #e8f2e9;
  border-color: var(--sd-accent);
  color: #315d3b;
  font-weight: 650;
}

.sd-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.sd-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.sd-canvas {
  cursor: crosshair;
  display: block;
  height: 100%;
  outline: none;
  touch-action: none;
  width: 100%;
}

.sd-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--sd-accent);
}

.sd-command-bar {
  align-items: center;
  background: var(--sd-panel);
  border-top: 1px solid var(--sd-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  min-height: 46px;
  padding: 0.35rem 0.65rem;
}

.sd-entry-label {
  align-items: center;
  color: var(--sd-muted);
  display: flex;
  gap: 0.4rem;
}

.sd-measurement {
  min-width: min(230px, 42vw);
}

.sd-command-hint {
  color: var(--sd-muted);
}

.sd-properties {
  background: var(--sd-panel);
  border-left: 1px solid var(--sd-line);
  min-width: 0;
  overflow: auto;
  padding: 0.85rem;
}

.sd-properties h2 {
  color: var(--sd-ink);
  font-size: 0.95rem;
  margin: 0 0 0.8rem;
}

.sd-property-content {
  display: grid;
  gap: 0.65rem;
}

.sd-property-field {
  color: var(--sd-muted);
  display: grid;
  gap: 0.25rem;
}

.sd-property-field input {
  min-width: 0;
  width: 100%;
}

.sd-muted {
  color: var(--sd-muted);
  margin: 0;
}

.sd-status {
  align-items: center;
  background: #edf1ed;
  border-top: 1px solid var(--sd-line);
  color: #536057;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: space-between;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
}

.sd-live-status {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.sd-live-status.is-error {
  background: #fff0ef;
  color: #8b241a;
  height: auto;
  padding: 0.35rem 0.65rem;
  position: static;
  width: auto;
}

.desktop.dark-theme .subdraft-app {
  --sd-bg: #111d1a;
  --sd-panel: #172722;
  --sd-ink: #dce8df;
  --sd-muted: #a6b5aa;
  --sd-line: #344840;
  --sd-accent: #70ad7b;
}

.desktop.dark-theme .sd-tools .sd-button.is-active {
  background: #24402e;
  color: #c4e6c8;
}

.desktop.dark-theme .sd-status {
  background: #1d3028;
  color: #b7c8bb;
}

@media (max-width: 850px) {
  .sd-editor {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .sd-properties {
    border-left: 0;
    border-top: 1px solid var(--sd-line);
    grid-column: 1 / -1;
    max-height: 165px;
  }

  .sd-property-content {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 560px) {
  .sd-toolbar {
    gap: 0.35rem;
  }

  .sd-brand {
    min-width: 0;
  }

  .sd-brand span {
    display: none;
  }

  .sd-toolbar-group {
    border-right: 0;
    padding-right: 0;
  }

  .sd-project-name {
    flex-basis: 110px;
    max-width: none;
  }

  .sd-editor {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .sd-tools {
    padding: 0.35rem;
  }

  .sd-status {
    font-size: 0.72rem;
    justify-content: flex-start;
  }
}
