:root {
  color-scheme: light;
  font-family: "Avenir Next", Pretendard, "Noto Sans KR", sans-serif;
  --product-blue: #246bfd;
  --product-blue-deep: #174eb7;
  --product-navy: #17223b;
  --product-muted: #66758f;
  --product-line: #dbe4f0;
  --product-line-strong: #c7d3e3;
  --product-surface: #f6f8fc;
  --product-panel: #ffffff;
  --product-focus: #ff655c;
  --main-bg-color: #ffffff;
  --text-color: #17223b;
  --border-color: #dbe4f0;
  --canvas-bg-color: #ffffff;
  --link-color: #174eb7;
  --ruler-color: #eef2f7;
  --icon-bg-color: transparent;
  --icon-bg-color-hover: #eaf1ff;
  --input-color: #f7f9fc;
  --orange-color: #246bfd;
  --global-se-spin-input-width: 92px;
  --top-toolbar-min-height: 64px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--product-surface);
  color: var(--product-navy);
}

button,
input,
select,
textarea { font: inherit; }

.product-bar {
  position: relative;
  z-index: 1000;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) minmax(7rem, auto);
  min-height: 3.5rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--product-line);
  background: #fbfcff;
}

.product-back {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--product-line);
  border-radius: 0.75rem;
  color: var(--product-navy);
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.product-back:hover {
  border-color: #9bb9ee;
  background: #eef4ff;
  color: var(--product-blue-deep);
}

.product-back:focus-visible {
  outline: 3px solid var(--product-focus);
  outline-offset: 2px;
}

.product-back svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.product-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.product-title strong {
  overflow: hidden;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-status {
  overflow: hidden;
  margin: 0;
  color: var(--product-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-status[data-state="error"] { color: #b83a31; }

#editor-shell,
#container {
  width: 100%;
  height: calc(100dvh - 3.5rem);
}

#container .svg_editor {
  grid-template-rows: 64px 18px minmax(0, 1fr) 54px;
  grid-template-columns: 56px 18px 48px minmax(0, 1fr) 18px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--product-panel);
  color: var(--product-navy);
  font-family: inherit;
  font-size: 12px;
}

#container .svg_editor.open {
  grid-template-columns: 56px 18px 48px minmax(0, 1fr) 248px;
}

#container #main_button {
  height: 64px;
  padding: 12px 8px;
  border-right: 1px solid var(--product-line);
  border-radius: 0;
  background: var(--product-panel);
  color: var(--product-navy);
}

#container #tools_top {
  min-width: 0;
  min-height: 64px;
  align-items: center;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--product-line);
  background: var(--product-panel);
  scrollbar-width: thin;
}

#container #tools_top > * {
  flex-wrap: nowrap;
  align-items: center;
  min-height: 40px;
  border-right: 1px solid var(--product-line);
  background: transparent;
}

#container #tools_top > *:empty { display: none; }

#container #title_panel > p {
  max-width: 10rem;
  margin: 0;
  padding: 0 12px 0 4px;
  overflow: hidden;
  color: var(--product-navy);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#container #tools_left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  margin: 0;
  padding: 7px 5px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--product-line);
  background: var(--product-panel);
  scrollbar-width: thin;
}

#container #tools_left::-webkit-scrollbar,
#container #tools_top::-webkit-scrollbar,
#container #tools_bottom::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

#container #tools_left::-webkit-scrollbar-thumb,
#container #tools_top::-webkit-scrollbar-thumb,
#container #tools_bottom::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c5d0df;
}

#container #ruler_corner,
#container #ruler_x,
#container #ruler_y {
  border-color: var(--product-line-strong);
  background-color: var(--ruler-color) !important;
  color: #5e6e87;
}

#container #workarea {
  border: 0;
  background: #e9eef6;
  background-image: radial-gradient(circle, rgb(116 135 164 / 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
  scrollbar-color: #aebbd0 transparent;
  scrollbar-width: thin;
}

#container #svgcanvas {
  background: #fff;
  box-shadow: 0 1px 2px rgb(23 34 59 / 0.08), 0 14px 34px rgb(23 34 59 / 0.14);
  filter: none;
}

#container #tools_bottom {
  gap: 4px;
  min-width: 0;
  padding: 6px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--product-line);
  background: var(--product-panel);
  scrollbar-width: thin;
}

#container #tools_bottom > * {
  flex: 0 0 auto;
}

#container #palette {
  display: flex;
  flex: 1 0 260px;
  max-width: 520px;
  margin-left: auto;
}

#container #tools_bottom se-list,
#container #tools_bottom se-select { margin-bottom: 0; }

#container #zoom {
  min-width: 88px;
  margin-right: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--product-line);
  background: transparent;
  color: var(--product-navy);
}

#container #sidepanels {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--product-line);
  background: var(--product-panel);
}

#container #sidepanel_handle {
  top: 50%;
  left: 1px;
  display: grid;
  width: 16px;
  min-height: 64px;
  place-items: center;
  padding: 8px 2px;
  border: 1px solid var(--product-line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
  color: var(--product-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: translateY(-50%);
}

#container .svg_editor.open #sidepanel_handle { display: none; }

#container #sidepanel_content {
  height: 100%;
  padding: 16px 14px;
  overflow: auto;
}

#container #layersLabel {
  color: var(--product-navy);
  font-size: 13px;
  font-weight: 800;
}

#container #layerpanel {
  padding: 0;
  color: var(--product-muted);
}

#container #layerbuttons {
  justify-content: flex-start;
  width: 100%;
  height: 36px;
  margin: 8px 0;
  gap: 2px;
}

#container #layerlist {
  width: 100%;
  margin: 0 0 12px;
  border: 1px solid var(--product-line);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
}

#container #layerlist tr.layer,
#container #layerlist tr.layersel { background: #fff; }

#container #layerlist tr.layersel {
  border: 0;
  background: #eaf1ff;
  color: var(--product-blue-deep);
}

#container #layerlist td {
  height: 36px;
  border-bottom: 1px solid #edf1f6;
}

#container #layerlist td.layername:hover { color: var(--product-blue-deep); }

#container #selLayerNames {
  position: static;
  display: grid;
  gap: 6px;
  line-height: 1.45;
}

#container #cur_context_panel {
  padding: 0 8px;
  overflow: auto;
  border-bottom: 1px solid var(--product-line);
  background: #f8faff;
  color: var(--product-muted);
  font-size: 11px;
  line-height: 18px;
}

#container se-button,
#container se-flyingbutton,
#container se-menu,
#container se-menu-item,
#container button,
#container input,
#container select { border-radius: 8px; }

#container se-button:focus-visible,
#container se-flyingbutton:focus-visible,
#container se-menu:focus-visible,
#container se-menu-item:focus-visible,
#container button:focus-visible,
#container input:focus-visible,
#container select:focus-visible {
  outline: 3px solid var(--product-focus);
  outline-offset: 2px;
}

#tool_export,
#tool_editor_prefs,
#tool_editor_homepage,
#tool_image,
#tool_make_link,
#tool_make_link_multi,
#tool_link_url { display: none !important; }

@media (max-width: 56rem) {
  #container .svg_editor.open {
    grid-template-columns: 52px 14px 40px minmax(0, 1fr) 210px;
  }

  #container .svg_editor {
    grid-template-columns: 52px 14px 40px minmax(0, 1fr) 14px;
  }

  #container #tools_left { width: 52px; }
}

@media (max-width: 42rem) {
  .product-bar { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .product-status { display: none; }

  #container .svg_editor,
  #container .svg_editor.open {
    grid-template-rows: 58px 16px minmax(0, 1fr) 52px;
    grid-template-columns: 48px 14px 34px minmax(0, 1fr) 14px;
  }

  #container #main_button {
    height: 58px;
    padding: 9px 5px;
  }

  #container #tools_top {
    min-height: 58px;
    padding: 6px;
  }

  #container #tools_top > * { min-height: 40px; }
  #container #tools_left { width: 48px; padding-inline: 3px; }

  #container .svg_editor.open #sidepanels {
    position: absolute;
    z-index: 20;
    top: auto;
    right: 0;
    bottom: 52px;
    left: 48px;
    width: auto;
    height: min(38vh, 18rem);
    border-top: 1px solid var(--product-line);
    box-shadow: 0 -10px 24px rgb(23 34 59 / 0.16);
  }

  #container #sidepanel_content { padding: 14px 12px; }
  #container #tools_bottom { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
