/* AWG Tools styles. Everything is scoped under .awg-tool so it cannot leak into the site.
   Palette: navy #101d30, gold #c9a55a, dark gold #8a6d2f, cream #f7f3ea, paper #fffdf8, line #e3dcc8. */

.awg-tool {
  box-sizing: border-box;
  max-width: 860px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fffdf8;
  border: 1px solid #e3dcc8;
  border-top: 4px solid #c9a55a;
  border-radius: 3px;
  color: #101d30;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  text-align: left;
}

.awg-tool *,
.awg-tool *::before,
.awg-tool *::after {
  box-sizing: border-box;
}

.awg-tool h2,
.awg-tool h3,
.awg-tool caption {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  color: #101d30;
  line-height: 1.25;
}

.awg-tool .awg-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.awg-tool h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
}

.awg-tool p {
  margin: 0 0 0.85rem;
}

.awg-tool a {
  color: #8a6d2f;
  text-decoration: underline;
}

.awg-tool a:hover,
.awg-tool a:focus {
  color: #101d30;
}

.awg-tool .awg-intro {
  margin-bottom: 1.1rem;
}

/* Form */

.awg-tool .awg-form {
  margin: 0;
  padding: 1rem;
  background: #f7f3ea;
  border: 1px solid #e3dcc8;
  border-radius: 3px;
}

.awg-tool .awg-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
}

.awg-tool .awg-field {
  flex: 1 1 170px;
  min-width: 0;
}

.awg-tool label {
  display: block;
  margin: 0 0 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #101d30;
}

.awg-tool .awg-optional {
  font-weight: normal;
  color: #8a6d2f;
}

.awg-tool input[type="text"],
.awg-tool select,
.awg-tool textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.7rem;
  background: #fffdf8;
  border: 1px solid #8a6d2f;
  border-radius: 3px;
  color: #101d30;
  font: inherit;
  line-height: 1.4;
}

.awg-tool select {
  height: 2.75rem;
}

.awg-tool textarea {
  min-height: 5.5rem;
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", Menlo, "Courier New", monospace;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.awg-tool input[type="text"]:focus,
.awg-tool select:focus,
.awg-tool textarea:focus,
.awg-tool button:focus {
  outline: 3px solid #c9a55a;
  outline-offset: 2px;
  border-color: #101d30;
}

.awg-tool .awg-hint {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #101d30;
  opacity: 0.85;
}

.awg-tool .awg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.awg-tool .awg-btn {
  display: inline-block;
  margin: 0;
  padding: 0.65rem 1.2rem;
  background: #101d30;
  border: 1px solid #101d30;
  border-radius: 3px;
  color: #fffdf8;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.awg-tool .awg-btn:hover {
  background: #c9a55a;
  border-color: #c9a55a;
  color: #101d30;
}

.awg-tool .awg-btn-quiet {
  background: transparent;
  border-color: #8a6d2f;
  color: #101d30;
  font-weight: normal;
}

.awg-tool .awg-btn-quiet:hover {
  background: #e3dcc8;
  border-color: #8a6d2f;
}

.awg-tool .awg-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.awg-tool .awg-examples-label {
  margin-right: 0.2rem;
  font-weight: 600;
}

.awg-tool .awg-example {
  margin: 0;
  padding: 0.3rem 0.65rem;
  background: #fffdf8;
  border: 1px solid #c9a55a;
  border-radius: 3px;
  color: #101d30;
  font: inherit;
  cursor: pointer;
}

.awg-tool .awg-example:hover {
  background: #c9a55a;
}

/* Results */

.awg-tool .awg-result:empty {
  display: none;
}

.awg-tool .awg-result {
  margin-top: 1.25rem;
}

.awg-tool .awg-result-title:first-child {
  margin-top: 0;
}

.awg-tool .awg-summary {
  padding: 0.9rem 1rem;
  background: #f7f3ea;
  border-left: 4px solid #c9a55a;
  border-radius: 3px;
}

.awg-tool .awg-error {
  padding: 0.8rem 1rem;
  background: #f7f3ea;
  border: 1px solid #8a6d2f;
  border-left: 4px solid #8a6d2f;
  border-radius: 3px;
  font-weight: 600;
}

.awg-tool .awg-table-wrap {
  overflow-x: auto;
}

.awg-tool .awg-table {
  width: 100%;
  margin: 0 0 1.1rem;
  border-collapse: collapse;
  border: 1px solid #e3dcc8;
  font-size: 0.95rem;
}

.awg-tool .awg-table caption {
  padding: 0.5rem 0;
  font-size: 1.1rem;
  text-align: left;
  caption-side: top;
}

.awg-tool .awg-table th,
.awg-tool .awg-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e3dcc8;
  text-align: left;
  vertical-align: top;
}

.awg-tool .awg-table thead th {
  background: #101d30;
  color: #fffdf8;
  font-weight: 600;
}

.awg-tool .awg-table .awg-code {
  width: 30%;
  font-family: Consolas, "SFMono-Regular", Menlo, "Courier New", monospace;
  font-weight: 600;
  white-space: nowrap;
  color: #101d30;
  background: #f7f3ea;
}

.awg-tool .awg-table .awg-unknown td,
.awg-tool .awg-table .awg-unknown .awg-code {
  background: #e3dcc8;
  font-style: italic;
}

.awg-tool .awg-notes {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.awg-tool .awg-notes li {
  margin-bottom: 0.4rem;
}

.awg-tool .awg-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.awg-tool .awg-figure {
  flex: 1 1 170px;
  padding: 0.8rem 0.9rem;
  background: #101d30;
  border-radius: 3px;
  color: #fffdf8;
}

.awg-tool .awg-figure-label,
.awg-tool .awg-figure-value,
.awg-tool .awg-figure-sub {
  display: block;
}

.awg-tool .awg-figure-label {
  font-size: 0.85rem;
  color: #c9a55a;
}

.awg-tool .awg-figure-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1.25;
}

.awg-tool .awg-figure-sub {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #f7f3ea;
}

.awg-tool .awg-formula,
.awg-tool .awg-note {
  font-size: 0.95rem;
}

.awg-tool .awg-note {
  padding: 0.8rem 1rem;
  border: 1px solid #e3dcc8;
  border-left: 4px solid #8a6d2f;
  border-radius: 3px;
  background: #fffdf8;
}

/* How it works and disclaimer */

.awg-tool .awg-how {
  margin-top: 1.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e3dcc8;
  font-size: 0.95rem;
}

.awg-tool .awg-how ul {
  margin: 0 0 0.85rem;
  padding-left: 1.3rem;
}

.awg-tool .awg-how li {
  margin-bottom: 0.3rem;
}

.awg-tool .awg-how code {
  padding: 0.05rem 0.3rem;
  background: #f7f3ea;
  border: 1px solid #e3dcc8;
  border-radius: 3px;
  font-family: Consolas, "SFMono-Regular", Menlo, "Courier New", monospace;
  font-size: 0.9em;
}

.awg-tool .awg-disclaimer {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1rem;
  background: #101d30;
  border-left: 4px solid #c9a55a;
  border-radius: 3px;
  color: #fffdf8;
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 560px) {
  .awg-tool {
    margin: 1rem auto;
    padding: 1rem;
  }

  .awg-tool .awg-title {
    font-size: 1.35rem;
  }

  .awg-tool .awg-table .awg-code {
    width: auto;
    white-space: normal;
    word-break: break-word;
  }

  .awg-tool .awg-btn {
    flex: 1 1 auto;
  }
}

@media print {
  .awg-tool .awg-form,
  .awg-tool .awg-how {
    display: none;
  }
}
