:root {
  --gs-font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gs-primary: #2457c5;
  --gs-primary-hover: #183f93;
  --gs-primary-focus: rgba(36, 87, 197, .16);
  --gs-radius: .35rem;
  --gs-ink: #182033;
  --gs-muted: #667085;
  --gs-paper: #fbfaf7;
  --gs-panel: #f3f1ea;
  --gs-rule: #ddd8cc;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--gs-paper);
  font-family: var(--gs-font-family);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--gs-ink);
  background: linear-gradient(180deg, #fbfaf7 0%, #f7f4ed 100%);
}

h1,
h2,
h3,
p,
ul,
ol,
fieldset { margin-top: 0; }

p,
ul,
ol { margin-bottom: 1rem; }

h1,
h2,
h3 {
  color: var(--gs-ink);
  line-height: 1.12;
  letter-spacing: -.035em;
}

h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); }

small { font-size: .875em; }

a {
  color: var(--gs-primary);
  text-underline-offset: .18em;
}

a:hover,
a:focus { color: var(--gs-primary-hover); }

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a { display: inline-flex; }

article {
  border-radius: var(--gs-radius);
  background: transparent;
}

label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 650;
}

textarea,
input,
select {
  width: 100%;
  margin-top: .35rem;
  padding: .75rem .85rem;
  border: 1px solid var(--gs-rule);
  border-radius: var(--gs-radius);
  background: #fffdf7;
  color: var(--gs-ink);
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--gs-primary);
  box-shadow: 0 0 0 .2rem var(--gs-primary-focus);
}

fieldset {
  min-width: 0;
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
}

button,
a[role="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: .55rem .9rem;
  border: 1px solid var(--gs-primary);
  border-radius: var(--gs-radius);
  background: var(--gs-primary);
  color: #f8fafc;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
button:focus,
a[role="button"]:hover,
a[role="button"]:focus {
  border-color: var(--gs-primary-hover);
  background: var(--gs-primary-hover);
  color: #f8fafc;
}

body > header,
body > main,
body > footer {
  width: min(100% - clamp(1rem, 4vw, 3rem), 1200px);
  margin-inline: auto;
}

body > header {
  margin-block: 0;
  padding-block: .5rem .25rem;
}

body > main {
  margin-block: 0;
  padding-block: clamp(1rem, 2vw, 1.75rem) clamp(2rem, 5vw, 4rem);
}

body > footer { color: var(--gs-muted); padding-block: 1rem 1.5rem; }

body > header nav {
  align-items: center;
  margin-bottom: 0;
}
body > header nav a { text-decoration: none; }
body > header nav strong a {
  color: var(--gs-ink);
  font-size: 1.1rem;
  letter-spacing: -.03em;
}

main > nav[aria-label="Breadcrumb"] {
  margin-block: 0 clamp(.75rem, 1.5vw, 1.25rem);
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
}

main > nav[aria-label="Breadcrumb"] ol {
  margin-bottom: 0;
}

.breadcrumb-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  padding-left: 0;
  list-style: none;
}

.breadcrumb-nav li:not(:last-child)::after {
  content: "/";
  margin-left: .35rem;
  color: var(--gs-muted);
}

.breadcrumb-nav a {
  color: var(--gs-primary);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb-nav a:hover,
.breadcrumb-nav a:focus {
  color: var(--gs-primary-hover);
  text-decoration: underline;
}

.breadcrumb-nav [aria-current="page"] {
  color: var(--gs-ink);
  font-weight: 700;
}

main > article {
  margin-block: 0;
  padding: 0;
}

main > section:first-child,
main > article > header:first-child {
  padding-block: clamp(.5rem, 1.5vw, 1.25rem) clamp(1rem, 2vw, 1.75rem);
  border-bottom: 1px solid var(--gs-rule);
}

main > section:first-child h1,
main > article > header:first-child h1 {
  max-width: 18ch;
  margin-bottom: clamp(.65rem, 1vw, 1rem);
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.06em;
}

main > section:first-child p,
main > article > header:first-child p {
  max-width: 68ch;
  color: var(--gs-muted);
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.5;
}

main > section:first-child p:first-child,
main > article > header:first-child p:first-child {
  margin-bottom: .75rem;
  color: var(--gs-primary);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

main > section + section,
main > article > section,
main > article > div {
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
}

main > section > header,
main > article > section > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gs-rule);
}

main > section > header h2,
main > article > section > header h2 { margin-bottom: .6rem; }

main > section > header p,
main > article > section > header p {
  max-width: 36ch;
  margin-bottom: .7rem;
  color: var(--gs-muted);
}

section#utilities {
  padding-block: clamp(1.25rem, 3vw, 2rem);
}

section#utilities > header {
  display: grid;
  grid-template-columns: minmax(16rem, .34fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: end;
  margin-bottom: 0;
  padding-bottom: 1rem;
}

section#utilities > header h2 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -.055em;
}

section#utilities > header p {
  max-width: 42ch;
  margin-bottom: .15rem;
  color: var(--gs-muted);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.45;
}

section#utilities > ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

section#utilities > ul > li {
  display: grid;
  grid-template-columns: minmax(16rem, .34fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: baseline;
  padding: clamp(.85rem, 1.5vw, 1.1rem) 0;
  border-bottom: 1px solid var(--gs-rule);
}

section#utilities > ul > li > a:first-child {
  width: fit-content;
  color: var(--gs-primary);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
}

section#utilities > ul > li > a:first-child:hover,
section#utilities > ul > li > a:first-child:focus {
  color: var(--gs-primary-hover);
}

section#utilities > ul > li > span {
  max-width: 68ch;
  color: var(--gs-muted);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.45;
}

main > article > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

main > article > div > section {
  padding: 1.25rem;
  border: 1px solid var(--gs-rule);
  background: rgba(255,255,255,.38);
}

button.secondary,
a.secondary[role="button"] {
  border-color: #d8c6a6;
  background: #f3eadb;
  color: #5d4320;
}

button.secondary:hover,
button.secondary:focus,
a.secondary[role="button"]:hover,
a.secondary[role="button"]:focus {
  border-color: #c6aa79;
  background: #ead9bb;
  color: #3f2c12;
}

button.tool-clear-button {
  width: auto;
  min-width: 5.25rem;
  margin-inline-start: .35rem;
}

.sql-tool .sql-workbench {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--gs-rule);
  background: color-mix(in srgb, var(--gs-panel) 76%, var(--gs-paper));
}

.sql-tool .sql-workbench > header {
  align-items: center;
  margin-bottom: 1rem;
}

.sql-tool .sql-workbench > header h2 {
  margin-bottom: .35rem;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -.055em;
}

.sql-tool .sql-workbench > header p {
  max-width: min(100%, 72ch);
  font-size: clamp(1rem, 1.15vw, 1.18rem);
  line-height: 1.45;
}

.sql-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sql-panel {
  display: grid;
  gap: .45rem;
  margin: 0;
  color: var(--gs-ink);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -.015em;
}

.sql-panel textarea {
  min-height: clamp(18rem, 38vw, 28rem);
  margin: 0;
  resize: vertical;
  border-color: var(--gs-rule);
  background: #fffdf7;
  color: var(--gs-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(.9rem, 1.05vw, 1.05rem);
  line-height: 1.55;
  tab-size: 2;
}

.sql-panel textarea:focus {
  border-color: var(--gs-primary);
  box-shadow: 0 0 0 .2rem var(--gs-primary-focus);
}

.sql-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: 1rem;
}

.sql-actions button {
  width: auto;
  margin: 0;
}

.sql-actions p {
  margin: 0 0 0 auto;
  color: var(--gs-muted);
  font-size: clamp(.9rem, 1vw, 1rem);
}

.tc-counts {
  display: flex;
  gap: 1.25rem;
  margin-top: .25rem;
  margin-bottom: .75rem;
  font-size: .85rem;
  color: var(--gs-muted);
}

.tc-counts .warning {
  color: #c0392b;
  font-weight: 600;
}

.tc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.tc-buttons button {
  font-size: .85rem;
  padding: .35rem .75rem;
  margin: 0;
}

.tc-output-label { margin-top: 1rem; }

#comparison-results > header {
  display: grid;
  grid-template-columns: minmax(12rem, .35fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: end;
}

#comparison-results > header p {
  justify-self: end;
  max-width: none;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
}

.comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: clamp(.25rem, .6vw, .5rem) clamp(.3rem, .7vw, .55rem);
  table-layout: fixed;
}

.comparison-table th {
  padding-inline: clamp(.35rem, .8vw, .7rem);
  color: var(--gs-ink);
  font-size: clamp(.95rem, 1.15vw, 1.1rem);
  text-align: left;
}

.comparison-table td {
  width: 50%;
  padding: 0;
  vertical-align: top;
}

ins,
del {
  display: block;
  min-height: 2.35rem;
  padding: clamp(.45rem, .9vw, .75rem) clamp(.55rem, 1vw, .85rem);
  border-radius: .25rem;
  font-size: clamp(.95rem, 1.2vw, 1.12rem);
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

ins {
  color: #0b5132;
  background: #d9f8e7;
}

del {
  color: #842029;
  background: #f8d7da;
}

@media (max-width: 820px) {
  .sql-editor-grid { grid-template-columns: 1fr; }

  .sql-actions p {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  body > header nav { align-items: flex-start; }
  section#utilities > header,
  section#utilities > ul > li,
  main > section > header,
  main > article > section > header { display: block; }

  section#utilities > header p { margin-top: .5rem; }
  section#utilities > ul > li > span { display: block; margin-top: .35rem; }

  #comparison-results > header { display: block; }
  #comparison-results > header p { justify-self: auto; }
}

/* Background Image Remover */
.bir-file-count {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: -.25rem;
  margin-bottom: 1rem;
  color: var(--gs-muted);
  font-size: .9rem;
}

.bir-clear {
  padding: .15rem .6rem;
  font-size: .8rem;
  line-height: 1.4;
  width: auto;
  margin: 0;
}

.bir-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  margin-top: .5rem;
  margin-bottom: 1.25rem;
}

.bir-radio-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
}

.bir-radio-label input[type="radio"] {
  width: auto;
  margin-top: 0;
  padding: 0;
  flex-shrink: 0;
}

.bir-badge {
  color: var(--gs-muted);
  font-size: .82rem;
}

.bir-process {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.bir-process:disabled {
  border-color: #98a2b3;
  background: #98a2b3;
  color: #f8fafc;
  cursor: not-allowed;
  opacity: 1;
}

.bir-process:disabled:hover,
.bir-process:disabled:focus {
  border-color: #98a2b3;
  background: #98a2b3;
  color: #f8fafc;
}

.bir-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bir-spin .75s linear infinite;
}

@keyframes bir-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bir-spinner { animation: none; }
}

#bir-results a[role="button"] {
  display: inline-flex;
  margin-top: .25rem;
}
