* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  background: #e9eaed;
  color: #202124;
}

body {
  min-height: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid rgba(32, 33, 36, 0.14);
  background: rgba(250, 250, 251, 0.96);
  overflow-y: auto;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.1;
}

.sidebar-copy {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #5f6368;
}

.control {
  display: grid;
  gap: 3px;
}

.radio-control {
  border: 0;
  margin: 0;
  padding: 0;
}

.radio-control legend {
  padding: 0;
  margin-bottom: 3px;
  font-size: 0.84rem;
  font-weight: 400;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 0.84rem;
}

.radio-option:last-child {
  margin-bottom: 0;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.custom-paper-fields {
  display: grid;
  gap: 8px;
}

.custom-paper-fields[hidden] {
  display: none;
}

.control-heading,
.control output {
  font-size: 0.84rem;
  font-weight: 400;
}

.control-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.control output {
  font-weight: 400;
  color: #5f6368;
}

.control input[type="range"] {
  width: 100%;
}

.control input[type="range"]:disabled {
  opacity: 0.45;
}

.control select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid rgba(32, 33, 36, 0.18);
  background: white;
  font: inherit;
}

#paperPreset {
  font-size: 0.78rem;
}

#paperPreset option {
  font-size: 0.78rem;
}

#exportSvgButton {
  position: relative;
  padding: 7px 10px;
  border: 1px solid rgba(32, 33, 36, 0.18);
  background: white;
  font: inherit;
  cursor: pointer;
}

#exportSvgButton[data-tooltip]:hover::after,
#exportSvgButton[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 220px;
  padding: 6px 8px;
  border: 1px solid rgba(32, 33, 36, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: #202124;
  box-shadow: 0 6px 14px rgba(32, 33, 36, 0.12);
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: normal;
  pointer-events: none;
  z-index: 10;
}

#exportSvgButton[data-tooltip=""]::after {
  content: none;
}

#exportSvgButton.is-disabled {
  color: #8a8f98;
  background: #f1f3f4;
  border-color: rgba(32, 33, 36, 0.12);
  cursor: default;
}

.canvas-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 28px;
  overflow: hidden;
}

#canvasWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  box-shadow: 0 8px 18px rgba(32, 33, 36, 0.12);
}
