:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #64727d;
  --line: #dbe2e8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warning: #8a5a10;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 12px;
  font-size: 14px;
  letter-spacing: 0;
}

.brand p,
.note,
#statusDetail,
.file-drop small {
  color: var(--muted);
}

.brand p {
  margin-top: 4px;
  font-size: 13px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.file-drop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed #b7c3cc;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

.file-drop:hover {
  border-color: var(--accent);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-drop span {
  font-size: 14px;
  font-weight: 650;
}

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

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  border-color: #ccd5dc;
  color: #84919b;
  background: #e8edf1;
  cursor: not-allowed;
}

.note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.toolbar div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#statusTitle {
  font-size: 15px;
}

#statusDetail {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-wrap {
  display: grid;
  min-height: 0;
  padding: 24px;
  place-items: center;
}

.preview {
  position: relative;
  display: grid;
  width: min(100%, 980px);
  height: min(76vh, 720px);
  place-items: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #edf1f4 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f4 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f4 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.preview svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 32, 38, 0.16);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

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

  .canvas-wrap {
    padding: 14px;
  }

  .preview {
    height: 58vh;
  }

  .button-row {
    grid-template-columns: 1fr;
  }
}
