:root {
  --bg: #e6e6e6;
  --text: #111111;
  --btn-off: #d1d1d1;
  --btn-on: #101216;
  --btn-on-text: #ffffff;
  --global-topbar-h: 60px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: block;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

.global-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--global-topbar-h);
  background: #ffffff;
  border-bottom: 1px solid #d8d8d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 10px;
  box-sizing: border-box;
  z-index: 1600;
}

.global-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.global-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font-size: 22px;
  cursor: pointer;
}

.global-product-title {
  font-size: 30px;
  color: #1d1d1d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-price-wrap {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  margin-right: 6px;
  line-height: 1.05;
}

.global-price-value {
  font-size: 30px;
  color: #111111;
  font-weight: 700;
}

.global-cta {
  height: 38px;
  border-radius: 8px;
  border: 1px solid #d0d0d0;
  padding: 0 16px;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

.global-cta.ghost {
  background: #f5f5f5;
  color: #111;
}

.global-cta.primary {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.layout {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: calc(100vw - 100px);
  max-width: 1820px;
  margin-left: 100px;
  margin-top: calc(var(--global-topbar-h) + 10px);
  padding: 24px;
  box-sizing: border-box;
}

.sidebar {
  width: 74px;
  background: #d0d0d0;
  border-radius: 0 0 8px 8px;
  padding: 10px 6px;
  position: fixed;
  left: 0;
  top: var(--global-topbar-h);
  height: calc(100vh - var(--global-topbar-h));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 1000;
}

.sidebar-bottom {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.tool-btn {
  width: 62px;
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.1;
}

.tool-btn.active {
  background: #ececec;
}

.tool-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.top-toolbar {
  width: 100%;
  max-width: 1150px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  background: #f0f0f0;
  box-sizing: border-box;
}

.tb-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #222;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  padding: 0 8px;
}

.tb-btn svg {
  width: 16px;
  height: 16px;
}

.tb-chip {
  height: 32px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
}

.workspace {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.panel {
  width: 320px;
  min-height: 640px;
  border-radius: 8px;
  background: #e9e9e9;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.panel.active {
  display: flex;
}

.panel-upload-btn {
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: #0e1116;
  color: #fff;
  font-weight: 600;
  font-size: 26px;
  cursor: pointer;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid #cfcfcf;
}

.panel-tab {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: #666;
  padding: 8px 0;
  cursor: pointer;
}

.panel-tab.active {
  color: #1a1a1a;
  border-bottom: 2px solid #232323;
  font-weight: 600;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tab-content.active {
  display: flex;
}

.section-title {
  font-size: 34px;
  font-weight: 600;
  margin-top: 4px;
}

.folder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  color: #2a2a2a;
}

.folder-plus {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px dashed #b7b7b7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.upload-drop {
  margin-top: 22px;
  border: 2px dashed #b9b9b9;
  border-radius: 12px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  color: #1f1f1f;
  font-size: 32px;
  padding: 18px;
  background: #f0f0f0;
  cursor: pointer;
}

.upload-drop small {
  color: #777;
  font-size: 26px;
}

.upload-drop.dragover {
  border-color: #222;
  background: #f5f5f5;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #f7f7f7;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px;
  cursor: pointer;
}

.history-item img {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  background: #ddd;
}

.history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
}

.panel-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
}

.panel-image-head .panel-upload-btn {
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 8px;
}

.image-library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  min-height: 180px;
}

.image-library-item {
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  cursor: pointer;
}

.image-library-item img {
  width: 100%;
  height: 110px;
  border-radius: 6px;
  object-fit: contain;
  background: #e4e4e4;
}

.image-library-item span {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirements {
  margin-top: auto;
  border-radius: 8px;
  background: #efefef;
  padding: 12px;
  color: #1c1c1c;
  font-size: 19px;
  line-height: 1.5;
}

.requirements h4 {
  margin: 0 0 6px 0;
  font-size: 30px;
}

.text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
}

.text-close {
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}

.text-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  background: #f1f1ec;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #c8c8c8;
  background: #f3f3ee;
  color: #222;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.chip.active {
  border-color: #8f8f8f;
  background: #e7e7de;
  font-weight: 600;
}

.font-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.font-section {
  border: 1px solid #d3d3cf;
  border-radius: 8px;
  background: #f4f4f1;
  padding: 8px;
}

.font-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #494949;
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}

.font-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.font-block-btn {
  border: 1px solid #d0d0cb;
  background: #ffffff;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
  color: #181818;
  cursor: pointer;
}

.font-block-btn.active {
  border-color: #111;
  background: #e8e8e2;
}

.font-accordion {
  flex: 1;
  min-height: 0;
  border: 1px solid #d5d5d0;
  border-radius: 8px;
  background: #f8f8f6;
  padding: 6px;
  overflow: auto;
  box-sizing: border-box;
}

.font-accordion-section + .font-accordion-section {
  margin-top: 8px;
}

.font-section-toggle {
  width: 100%;
  border: 1px solid #d1d1cc;
  border-radius: 6px;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
}

.font-section-arrow {
  font-size: 14px;
  color: #444;
}

.font-section-list {
  display: none;
  margin-top: 6px;
  flex-direction: column;
  gap: 2px;
}

.font-section-list.open {
  display: flex;
}

.font-option-row {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 15px;
  line-height: 1.2;
  color: #181818;
  cursor: pointer;
  text-align: left;
}

.font-option-row:hover {
  background: #eeeeea;
}

.font-option-row.active {
  background: #e3e3dd;
  font-weight: 600;
}

.curved-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.curve-card {
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #f8f8f6;
  min-height: 72px;
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.font-block-title {
  font-size: 15px;
  font-weight: 700;
  margin-top: 6px;
}

.font-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.font-item {
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
  color: #171717;
}

.font-item:hover {
  background: #ecece6;
}

.font-item.active {
  background: #e2e2da;
}

.product-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #cfcfcf;
  padding-bottom: 10px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.product-tabs span {
  color: #666;
}

.product-tabs .active {
  color: #111;
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
}

.product-name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.product-id {
  color: #7b7b7b;
  font-size: 14px;
}

.product-section-title {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.swatch.active {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.selected-color {
  align-self: flex-start;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 14px;
}

.product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  margin-top: 8px;
}

.product-ref {
  color: #666;
  font-size: 14px;
}

.product-tech-note {
  color: #666;
  font-style: italic;
  font-size: 14px;
  line-height: 1.4;
  margin-top: 4px;
}

.product-guideline-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #333;
}

.editor-wrap {
  position: relative;
  background: #d7d7d2;
  border-radius: 10px;
  padding: 14px;
  box-sizing: border-box;
}

.editor {
  display: none;
  background: #d7d7d2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.editor.active {
  display: block;
}

.toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
  background: transparent;
}

.toggle-btn {
  border: 0;
  background: var(--btn-off);
  color: #222;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 24px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.toggle-btn.active {
  background: var(--btn-on);
  color: var(--btn-on-text);
}

.toggle-btn:active {
  transform: translateY(1px);
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.attrs-panel {
  width: 320px;
  min-height: 640px;
  border-radius: 8px;
  background: #e9e9e9;
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attrs-panel h3 {
  margin: 0;
  font-size: 32px;
}

.attrs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.attrs-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.attrs-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #f2f2ef;
  padding: 6px 8px;
}

.attrs-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.attrs-input-wrap span {
  color: #666;
  font-size: 13px;
}

.layers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-item {
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #f6f6f4;
  padding: 8px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 8px;
}

.layer-item-selected {
  border-color: #8a8a8a;
  background: #ecece8;
}

.layer-thumb-wrap {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid #d3d3d3;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%),
    linear-gradient(-45deg, #ececec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececec 75%),
    linear-gradient(-45deg, transparent 75%, #ececec 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layer-title {
  font-size: 14px;
  font-weight: 600;
}

.layer-meta {
  font-size: 12px;
  color: #666;
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.layer-btn {
  border: 1px solid #cdcdcd;
  background: #ffffff;
  color: #222;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.layer-btn svg {
  width: 16px;
  height: 16px;
}

.exit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.exit-modal-overlay.open {
  display: flex;
}

.exit-modal {
  width: min(680px, calc(100vw - 24px));
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #d6d6d6;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.exit-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 12px;
  border-bottom: 1px solid #dadada;
}

.exit-modal-head h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.exit-modal-close {
  border: 0;
  background: transparent;
  color: #555;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.exit-modal-body {
  padding: 20px 22px;
  font-size: 17px;
  color: #3a3a3a;
  line-height: 1.45;
}

.exit-modal-actions {
  padding: 14px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.exit-btn {
  border-radius: 8px;
  border: 1px solid #cfcfcf;
  background: #f7f7f7;
  color: #222;
  height: 38px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.exit-btn.save {
  background: #1a1b1d;
  border-color: #1a1b1d;
  color: #fff;
}
