:root {
  --hh-content-width: 1120px;
  --hh-radius-large: 20px;
  --hh-radius-medium: 14px;
  --hh-radius-small: 10px;
}

* {
  box-sizing: border-box;
  font-family: "Google Sans", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

md-icon {
  font-family: var(--md-icon-font, Material Symbols Outlined) !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}

button,
textarea,
input {
  font: inherit;
}

.hh-main-container {
  width: min(var(--hh-content-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 48px;
}

.hh-hero h1 {
  margin: 0;
  letter-spacing: -0.6px;
}

.hh-note {
  margin: 28px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
}

.hh-note md-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  --md-icon-size: 18px;
}

.hh-language-hint {
  margin: -14px 0 24px;
  padding: 16px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 100px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.hh-language-hint-icon {
  display: grid;
  place-items: center;
}

.hh-language-hint-icon md-icon {
  --md-icon-size: 20px;
}

.hh-language-hint-content {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}

.hh-language-hint md-filled-tonal-button {
  --md-filled-tonal-button-container-height: 40px;
  flex: 0 0 auto;
}

.hh-workspace {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.hh-editor-section,
.hh-settings-section,
.hh-result-section {
  min-width: 0;
}

.hh-result-section {
  margin-top: 32px;
}

.hh-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.hh-section-heading h2 {
  margin: 0;
}

.hh-section-help {
  margin: 5px 0 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
}

.hh-section-actions,
.hh-indent-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hh-editor-shell {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--hh-radius-medium);
  background: var(--md-sys-color-surface-container-low);
}

.hh-editor-shell:focus-within {
  border-color: var(--md-sys-color-primary);
}

.hh-editor-shell textarea {
  width: 100%;
  min-height: 360px;
  display: block;
  padding: 18px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

.hh-editor-shell textarea::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.9;
}

.hh-drop-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  pointer-events: none;
}

.hh-drop-overlay md-icon {
  --md-icon-size: 36px;
}

.hh-setting-grid {
  display: grid;
  gap: 24px;
}

.hh-setting-block,
.hh-setting-row {
  min-width: 0;
}

.hh-setting-block {
  display: grid;
  gap: 10px;
}

.hh-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.hh-setting-help {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
}

.hh-indent-button[data-active="true"] {
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
}

.hh-action-bar {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.hh-action-status,
#result-meta,
#file-status {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.hh-result-tabs-wrap {
  margin-bottom: 12px;
}

.hh-result-tabs-wrap md-tabs {
  width: max-content;
  max-width: 100%;
  min-width: min(100%, 360px);
}

.hh-result-shell {
  min-height: 420px;
}

.hh-result-shell textarea {
  min-height: 420px;
}

.hh-sr-status {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hh-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hh-main-container {
    width: min(100% - 24px, var(--hh-content-width));
    padding-top: 56px;
  }

  .hh-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hh-section-actions {
    justify-content: flex-start;
  }

  .hh-language-hint {
    border-radius: var(--hh-radius-medium);
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .hh-language-hint md-filled-tonal-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .hh-setting-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
