:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #667085;
  --line: #d9e1ec;
  --paper: #eef3f8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #c2410c;
  --soft: #e8f5f2;
  --warm: #fff7ed;
  --shadow: 0 18px 45px rgb(31 41 55 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% -10%, rgb(15 118 110 / 10%), transparent 28%),
    radial-gradient(circle at 85% 0%, rgb(194 65 12 / 10%), transparent 25%),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 10px 14px 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #334155 52%, var(--accent-2));
  font-weight: 800;
  box-shadow: 0 10px 22px rgb(15 118 110 / 18%);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.action-group {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6f8fb;
}

button,
.import-label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 34px;
  padding: 7px 11px;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

button:hover,
.import-label:hover,
.tool.active {
  border-color: var(--accent);
  background: var(--soft);
}

button:hover,
.import-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgb(31 41 55 / 8%);
}

.primary-action {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.primary-action:hover {
  color: #fff;
  background: #115e59;
}

.import-label input {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) 280px;
  height: calc(100vh - 70px);
}

.tools,
.inspector {
  overflow: auto;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-title {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool,
.symbol {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 58px;
  padding: 6px 4px;
  text-align: center;
}

.tool span,
.symbol span {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.cursor-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.cursor-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 0;
  height: 0;
  border-left: 13px solid var(--ink);
  border-top: 4px solid transparent;
  border-bottom: 13px solid transparent;
  transform: rotate(-18deg);
}

.cursor-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  width: 8px;
  height: 3px;
  background: var(--ink);
  transform: rotate(45deg);
}

.tool small,
.symbol small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.symbol.active {
  border-color: var(--accent-2);
  background: #fff2e8;
}

.divider {
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
}

.inspector h2 {
  margin: 0;
  font-size: 16px;
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-head {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.inspector-head span {
  color: var(--muted);
  font-size: 12px;
}

.danger-action {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

.stage-wrap {
  position: relative;
  overflow: auto;
  padding-top: 54px;
  background-color: #edf3f9;
  background-image:
    linear-gradient(#dce6f0 1px, transparent 1px),
    linear-gradient(90deg, #dce6f0 1px, transparent 1px);
  background-size: 28px 28px;
}

.stage-head {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 100%;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 84%);
  backdrop-filter: blur(14px);
}

.title-input {
  width: min(320px, 35vw);
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 3px 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.title-input:focus {
  outline: 0;
  border-bottom-color: var(--accent);
}

.stage-head span {
  color: var(--muted);
  font-size: 12px;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.zoom-controls button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
}

.zoom-controls output {
  min-width: 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

canvas {
  display: block;
  width: 1600px;
  height: 1000px;
  margin: 30px 40px 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
  box-shadow: var(--shadow);
}

.status {
  position: absolute;
  left: 54px;
  bottom: 18px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgb(255 255 255 / 88%);
  font-size: 12px;
}

.note {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

dialog {
  width: min(620px, calc(100vw - 30px));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgb(31 41 55 / 22%);
}

dialog::backdrop {
  background: rgb(15 23 42 / 35%);
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .inspector {
    display: none;
  }

  .brand small {
    display: none;
  }
}
