* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

h2.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.root {
  /* Site-wide design system mapping */
  --color-text-primary: var(--text, #000000);
  --color-text-secondary: var(--text-muted, #585859);
  --color-border-primary: var(--navy, #000000);
  --color-border-secondary: var(--border, #e2e2e3);
  --color-border-tertiary: var(--border, #e2e2e3);
  --color-background-primary: var(--white, #ffffff);
  --color-background-secondary: var(--gray-50, #f8f8f8);
  --font-sans: var(--font-body, 'Google Sans Flex', sans-serif);
  
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  
  --color-text-info: var(--white, #ffffff);
  --color-background-info: var(--navy, #000000);
  --color-border-info: var(--navy, #000000);

  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 24px;
  font-family: var(--font-sans);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
  margin-top: 10px;
  display: block;
}

.root > .section-label:first-child {
  margin-top: 0;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctrl label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}

select, input[type=text] {
  width: 100%;
}

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

.canvas-wrap {
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-text {
  transition: all .15s;
  max-width: 100%;
  word-break: break-word;
  text-align: center;
  padding: 16px;
}

.preset-row, .effect-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preset, .efbtn {
  padding: 4px 10px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--color-background-primary);
  color: var(--color-text-secondary);
  font-family: inherit;
  white-space: nowrap;
  transition: all .15s;
}

.preset {
  border-radius: 999px;
}

.preset:hover, .efbtn:hover {
  border-color: var(--color-border-primary);
  color: var(--color-text-primary);
  background: var(--color-background-secondary);
}

.preset.act, .efbtn.sel {
  background: var(--color-background-secondary);
  border-color: var(--color-border-primary);
  color: var(--color-text-primary);
}

.swatch-row, .bg-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.swatch, .bg-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  flex-shrink: 0;
}

.bg-swatch {
  border-radius: var(--border-radius-md);
}

.swatch:hover, .swatch.sel, .bg-swatch:hover, .bg-swatch.sel {
  border-color: var(--color-text-primary);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-row span {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  min-width: 38px;
  text-align: right;
}

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

button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  transition: all .15s;
  font-family: inherit;
}

button:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border-primary);
}

button:active {
  transform: scale(.98);
}

button#copy-css-btn {
  background: var(--color-background-info);
  color: var(--color-text-info);
  border-color: var(--color-border-info);
}

button#copy-css-btn:hover {
  background: var(--color-background-info);
  border-color: var(--color-border-info);
  color: var(--color-text-info);
  opacity: .9;
}

.divider {
  height: 0.5px;
  background: var(--color-border-secondary);
  margin: 10px 0;
}

.font-search {
  width: 100%;
  padding: 8px 10px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  font-family: inherit;
  outline: none;
  margin-bottom: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.font-search:focus {
  border-color: var(--color-border-primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.03);
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 2px;
}

.font-card {
  padding: 6px 8px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  background: var(--color-background-primary);
  transition: all .15s;
}

.font-card:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border-primary);
}

.font-card.sel {
  border-color: var(--color-border-primary);
  background: var(--color-background-secondary);
}

.font-card .fname {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.font-card .fsample {
  font-size: 15px;
  line-height: 1.2;
  color: var(--color-text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

input[type=text] {
  padding: 8px 10px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type=text]:focus {
  border-color: var(--color-border-primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.03);
}

input[type=color] {
  width: 36px;
  height: 28px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  background: none;
  padding: 2px;
}

select {
  padding: 7px 10px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus {
  border-color: var(--color-border-primary);
}

/* Fix content-right table responsive overflow
   Overrides the global style.scss display:block rule with higher specificity. */
.tool-content .content-right table {
  display: table;
  overflow-x: auto;
  white-space: normal;
  width: 100%;
  max-width: 100%;
}

.tool-content .content-right table th,
.tool-content .content-right table td {
  white-space: normal;
  word-break: break-word;
}