/* =========================================================
   MOX layout: wrap, topbar, buildbar
   ========================================================= */

.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#appMain {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.app-topbar.is-hidden {
  transform: translateY(-100%);
}

.topbar-inner,
.container {
  position: relative;
  width: 100%;
  font: normal 1.3rem Arial, Helvetica, Sans-serif;
  text-align: left;
  padding: 2px;
  min-width: 200px;
  box-sizing: border-box;
}

/* Collapse the seam between topbar and main so the gap between
   pageHeader and first .section matches the original.  In the old
   single-container layout adjacent margins collapsed; sticky positioning
   prevents that, so we zero out the extra contributors. */
.topbar-inner { padding-bottom: 0; }
.topbar-inner .pageHeader { margin-bottom: 0; }
#appMain .container { padding-top: 0; }

.buildbar {
  text-align: center;
  padding: 8px 0;
  font-size: 1.1rem;
  color: #999;
  margin-top: 20px;
}

.buildbar span {
  margin: 0 8px;
}

.buildbar .dev-only { display: none; }
body.env-dev .buildbar .dev-only { display: inline; }
.buildbar a { color: #999; }

/* =========================================================
   1. Base reset & typography
   ========================================================= */

html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  font-size: 62.5%;
  scrollbar-width: none;
}

body {
  margin: 0;
  font-size: 1.5em;
  line-height: 1.6;
  font-weight: 400;
  font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #222;
}

body::-webkit-scrollbar {
  display: none;
}

a {
  background-color: transparent;
}

a:active,
a:hover {
  outline: 0;
}

b,
strong {
  font-weight: bold;
}

code,
kbd,
pre,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 2rem;
  font-weight: 300;
}

h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  letter-spacing: -.1rem;
}

h3 {
  font-size: 3.0rem;
  line-height: 1.3;
  letter-spacing: -.1rem;
}

@media (min-width: 550px) {
  h3 { font-size: 3.6rem; }
}

p {
  margin-top: 0;
}

/* =========================================================
   2. Container clearfix
   ========================================================= */

.topbar-inner:after,
.container:after {
  content: "";
  display: table;
  clear: both;
}

/* =========================================================
   3. Links
   ========================================================= */

a {
  color: #447;
}

a:hover {
  color: #66A;
}

a:visited {
  color: #777;
}

div.pageHeader a,
div.pageHeader a:hover,
div.pageHeader a:visited {
  color: #333;
  text-decoration: none;
}

/* =========================================================
   4. Page header (topbar)
   ========================================================= */

div.pageHeader {
  background: #E0E0E0;
  border-color: #D0D0D0;
  margin: 2px;
  padding: 17px 15px;
  border-radius: 5px;
  -moz-border-radius: 5px;
  border-style: solid;
  border-width: 1px;
}


div.pageHeader h1,
div.pageHeader h2,
div.pageHeader h3 {
  margin: 0;
}

/* =========================================================
   5. Buttons & form controls
   ========================================================= */

.button,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  display: inline-block;
  height: 38px;
  padding: 0 30px;
  color: #555;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 38px;
  letter-spacing: .1rem;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border-radius: 4px;
  border: 1px solid #bbb;
  cursor: pointer;
  box-sizing: border-box;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
.button:focus,
button:focus,
input[type="submit"]:focus,
input[type="reset"]:focus,
input[type="button"]:focus {
  color: #333;
  border-color: #888;
  outline: 0;
}

button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

input {
  line-height: normal;
}

input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea,
select {
  height: 38px;
  padding: 6px 10px;
  background-color: #fff;
  border: 1px solid #D1D1D1;
  border-radius: 4px;
  box-shadow: none;
  box-sizing: border-box;
}

input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border: 1px solid #33C3F0;
  outline: 0;
}

button,
.button {
  margin-bottom: 1rem;
}

input,
textarea,
select,
fieldset {
  margin-bottom: 1.5rem;
}

input.button {
  background-color: #FF6;
  height: 30px;
  line-height: 30px;
  color: #333;
  margin: 0;
}

/* =========================================================
   6. Textarea specifics
   ========================================================= */

textarea {
  overflow: auto;
  min-height: 65px;
  padding-top: 6px;
  padding-bottom: 6px;
  height: auto;
  width: 100%;
}

textarea.demangle_input {
  border-color: #AFC9E8;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

textarea.demangle_input:hover {
  border-color: #7FB0E0;
}

textarea.demangle_input:focus {
  border-color: #33C3F0;
  box-shadow: 0 0 0 1px rgba(51, 195, 240, 0.25);
}

/* =========================================================
   7. Code / pre blocks
   ========================================================= */

pre {
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, black 95%, transparent 100%);
}

#demangle_output_pre {
  -webkit-mask-image: none;
  mask-image: none;
}

code {
  padding: .2rem .5rem;
  margin: 0 .2rem;
  font-size: 90%;
  white-space: nowrap;
  background: #F1F1F1;
  border: 1px solid #E1E1E1;
  border-radius: 4px;
}

pre,
blockquote,
dl,
figure,
table,
p,
ul,
ol,
form {
  margin-bottom: 2.5rem;
}

/* =========================================================
   8. Rounded sections
   ========================================================= */

form {
  margin-bottom: 0.0rem;
}

div.rounded {
  margin: 2px;
  padding: 17px 15px;
  border-radius: 5px;
  -moz-border-radius: 5px;
  border-style: solid;
  border-width: 1px;
}

div.section {
  background: #F0F0F0;
  border-color: #D0D0D0;
}

#demangle_message_inner {
  display: inline-block;
}

/* =========================================================
   9. "I don't get it" expander
   ========================================================= */

#idontgetit_wrapper {
  margin-top: 0;
  margin-bottom: 0;
}

#idontgetit {
  background: #FFFFF0;
  border-radius: 5px;
  padding: 0 15px;
  border: 0;
  margin-top: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.18s ease-in-out,
    opacity 0.18s ease-in-out,
    padding 0.18s ease-in-out,
    border-width 0.18s ease-in-out,
    margin-top 0.18s ease-in-out;
}

#idontgetit.open {
  padding: 10px 15px;
  border-width: 1px;
  border-style: solid;
  border-color: #D0D0C0;
  margin-top: 15px;
  max-height: 99999px;
  opacity: 1;
  overflow-y: auto;
}

/* =========================================================
   10. Demangle output header & copy button
   ========================================================= */

#demangle_output {
  position: relative;
}

#copy_output_btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.button-small {
  height: 30px;
  line-height: 30px;
  padding: 0 16px;
  font-size: 10px;
  letter-spacing: .08rem;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* =========================================================
   11. Flash animation for feedback
   ========================================================= */

.flash {
  animation: flash-bg 0.3s ease-in-out;
}

@keyframes flash-bg {
  0%   { background-color: #fff8aa; }
  100% { background-color: transparent; }
}

/* =========================================================
   12. Responsive tweaks
   ========================================================= */

@media only screen and (max-device-width: 480px) {
  h1 { font-size: 1.8rem; }
}

@media only screen and (max-device-width: 480px) {
  #demangle_output_pre {
    padding-top: 44px;
  }
}

@media only screen and (max-device-width: 480px) {
  #copy_output_btn {
    top: 4px;
    right: 4px;
    padding: 0 10px;
    font-size: 9px;
  }

  #copy_output_btn .copy-icon {
    font-size: 1rem;
  }

  #copy_output_btn .copy-label {
    letter-spacing: .06rem;
  }
}

@media only screen and (max-device-height: 670px) { textarea { height: 320px; } }
@media only screen and (max-device-height: 640px) { textarea { height: 290px; } }
@media only screen and (max-device-height: 600px) { textarea { height: 250px; } }
@media only screen and (max-device-height: 570px) { textarea { height: 240px; } }
@media only screen and (max-device-height: 480px) { textarea { height: 130px; } }
