/* Material Design, 2016 edition. Spec section 13. */
:root {
  color-scheme: light dark;
  --primary: #3F51B5;
  --primary-dark: #303F9F;
  --primary-hover: #3949AB;
  --primary-text: #3F51B5;
  --accent: #FF4081;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --text: rgba(0, 0, 0, .87);
  --text-2: rgba(0, 0, 0, .54);
  --hint: rgba(0, 0, 0, .38);
  --divider: rgba(0, 0, 0, .12);
  --error: #D50000;
  --gutter: #FAFAFA;
  --disabled-text: rgba(0, 0, 0, .26);
  --disabled-bg: rgba(0, 0, 0, .12);
  --snackbar-bg: #323232;
  --snackbar-text: #FFFFFF;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23757575'/%3E%3C/svg%3E");
  --shadow-2: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
  --shadow-4: 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12), 0 2px 4px -1px rgba(0, 0, 0, .2);
  --shadow-8: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12), 0 5px 5px -3px rgba(0, 0, 0, .2);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* Dark theme, following the system setting. Material dark palette. */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-text: #9FA8DA;
    --bg: #303030;
    --surface: #424242;
    --text: #FFFFFF;
    --text-2: rgba(255, 255, 255, .7);
    --hint: rgba(255, 255, 255, .5);
    --divider: rgba(255, 255, 255, .12);
    --error: #FF8A80;
    --gutter: #3A3A3A;
    --disabled-text: rgba(255, 255, 255, .3);
    --disabled-bg: rgba(255, 255, 255, .12);
    --snackbar-bg: #E0E0E0;
    --snackbar-text: rgba(0, 0, 0, .87);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23BDBDBD'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/20px Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* App bar */
.appbar { position: sticky; top: 0; z-index: 2; background: var(--primary); color: #fff; box-shadow: var(--shadow-4); }
.appbar-inner {
  max-width: 888px; height: 64px; margin: 0 auto; padding: 0 12px 0 24px;
  display: flex; align-items: center; gap: 4px;
}
.appbar-title { flex: 1; color: #fff; font-size: 20px; font-weight: 500; line-height: 28px; }
.appbar-title:hover { text-decoration: none; }
.icon-btn {
  position: relative; overflow: hidden; flex: none;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.icon-btn:focus-visible { outline: none; background: rgba(255, 255, 255, .24); }

/* Indeterminate linear progress along the bottom of the app bar */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; overflow: hidden; background: rgba(255, 64, 129, .3); }
.progress-bar { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--accent); animation: progress 1.4s var(--ease) infinite; }
@keyframes progress { from { left: -40%; } to { left: 100%; } }

/* Layout */
.page { flex: 1; width: 100%; max-width: 888px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface); border-radius: 2px; box-shadow: var(--shadow-2); padding: 24px; margin-bottom: 24px; }
.card-title { margin: 0 0 16px; font-size: 20px; font-weight: 500; line-height: 28px; }
.card-subheading { margin: 0 0 4px; font-size: 16px; font-weight: 400; line-height: 24px; }
.card-text { margin: 0 0 16px; color: var(--text-2); }
.card-caption { margin: 0 0 8px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.divider { border: 0; border-top: 1px solid var(--divider); margin: 24px -24px; }
.footnote { margin: 0 0 24px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.footer { padding: 16px 24px 24px; text-align: center; font-size: 12px; line-height: 16px; color: var(--text-2); }
.footer a { color: var(--text-2); }

/* Paste text area */
.paste-input {
  display: block; width: 100%; min-height: 288px; resize: vertical;
  padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--divider); border-radius: 0;
  background: transparent; color: var(--text); outline: none; tab-size: 4;
  font: 400 14px/20px 'Roboto Mono', monospace;
}
.paste-input:focus { border-bottom: 2px solid var(--primary-text); padding-bottom: 7px; }
.paste-input::placeholder { color: var(--hint); }
.paste-input.is-invalid { border-bottom: 2px solid var(--error); padding-bottom: 7px; }

.options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 32px; margin-top: 16px; }

/* Text field with floating label */
.field { position: relative; flex: 1 1 200px; min-width: 200px; padding-top: 16px; margin-bottom: 8px; }
.field-input {
  display: block; width: 100%; height: 32px; padding: 4px 0; margin: 0;
  border: 0; border-bottom: 1px solid var(--divider); border-radius: 0;
  background: transparent; color: var(--text); outline: none;
  font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none;
}
.field-input:focus { border-bottom: 2px solid var(--primary-text); padding-bottom: 3px; }
.field-mono { font-family: 'Roboto Mono', monospace; font-size: 14px; }
.field-label {
  position: absolute; left: 0; top: 22px; font-size: 16px; line-height: 20px; color: var(--hint);
  pointer-events: none; transform-origin: left top; transition: transform 200ms var(--ease), color 200ms var(--ease);
}
.field.is-filled .field-label,
.field-input:focus + .field-label,
.field-label.is-floating { transform: translateY(-20px) scale(.75); }
.field-input:focus + .field-label,
.field-select:focus-within .field-label { color: var(--primary-text); }
.field.is-invalid .field-input { border-bottom: 2px solid var(--error); padding-bottom: 3px; }
.field.is-invalid .field-label { color: var(--error); }
.helper { margin: 8px 0 0; font-size: 12px; line-height: 16px; color: var(--text-2); }
.helper-error, .field.is-invalid .helper { color: var(--error); }
.field-select { flex: 0 1 160px; min-width: 140px; }
.field-select .field-input {
  padding-right: 24px; cursor: pointer;
  /* The colour belongs in the shorthand: the native dropdown popup takes its
     colours from the select, and a transparent one paints white on white in dark mode. */
  background: var(--select-arrow) no-repeat right center var(--surface);
}
.field-select .field-input option { background-color: var(--surface); color: var(--text); }
.field-row { display: flex; align-items: flex-end; gap: 8px; }
.field-row .field { margin-bottom: 0; }

/* Checkbox */
.checkbox { position: relative; display: inline-flex; align-items: center; gap: 16px; min-height: 48px; font-size: 16px; cursor: pointer; }
.checkbox input { position: absolute; left: 0; width: 18px; height: 18px; margin: 0; opacity: 0; }
.checkbox-box {
  position: relative; flex: none; width: 18px; height: 18px;
  border: 2px solid var(--text-2); border-radius: 2px;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.checkbox input:checked + .checkbox-box { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + .checkbox-box::after {
  content: ''; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox input:focus-visible + .checkbox-box { box-shadow: 0 0 0 10px rgba(255, 64, 129, .16); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn {
  position: relative; overflow: hidden; display: inline-block; flex: none;
  min-width: 88px; height: 36px; padding: 0 16px; border: 0; border-radius: 2px;
  background: transparent; color: var(--primary-text); cursor: pointer; text-align: center;
  font: 500 14px/36px Roboto, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .5px; text-transform: uppercase;
  transition: box-shadow 200ms var(--ease), background 200ms var(--ease); -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(158, 158, 158, .2); text-decoration: none; }
.btn:focus-visible { outline: none; background: var(--divider); }
.btn-raised { background: var(--primary); color: #fff; box-shadow: var(--shadow-2); }
.btn-raised:hover { background: var(--primary-hover); }
.btn-raised:focus-visible { background: var(--primary-dark); }
.btn-raised:active { box-shadow: var(--shadow-8); }
.btn:disabled { cursor: default; color: var(--disabled-text); background: transparent; box-shadow: none; }
.btn-raised:disabled { background: var(--disabled-bg); }
.ripple {
  position: absolute; border-radius: 50%; background: currentColor; opacity: .25;
  transform: scale(0); pointer-events: none; animation: ripple 500ms var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Paste view */
.paste-meta { margin: 0 0 16px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.paste-content {
  margin: 0 -24px -24px; padding: 16px 24px 24px 0;
  border-top: 1px solid var(--divider);
  background: linear-gradient(to right, var(--gutter) 0, var(--gutter) 56px, var(--divider) 56px, var(--divider) 57px, transparent 57px);
  font: 400 13px/20px 'Roboto Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
  counter-reset: line;
}
.line { position: relative; display: block; min-height: 20px; padding-left: 72px; }
.line::before {
  counter-increment: line; content: counter(line);
  position: absolute; left: 0; width: 44px; text-align: right; color: var(--hint); user-select: none;
}

/* About page */
.prose h2 { margin: 24px 0 8px; font-size: 16px; font-weight: 500; line-height: 24px; }
.prose p { margin: 0 0 8px; color: var(--text-2); }

/* Snackbar */
.snackbar {
  position: fixed; left: 50%; bottom: 0; z-index: 3;
  min-width: 288px; max-width: 568px; padding: 14px 24px;
  background: var(--snackbar-bg); color: var(--snackbar-text); font-size: 14px; line-height: 20px;
  border-radius: 2px 2px 0 0; transform: translate(-50%, 100%); transition: transform 200ms var(--ease);
}
.snackbar.is-visible { transform: translate(-50%, 0); }

/* Phones */
@media (max-width: 599px) {
  .appbar-inner { height: 56px; padding: 0 4px 0 16px; }
  .page { padding: 16px; }
  .card { padding: 16px; margin-bottom: 16px; }
  .divider { margin: 16px -16px; }
  .paste-content { margin: 0 -16px -16px; }
  .options { gap: 0 24px; }
  .snackbar { left: 0; right: 0; min-width: 0; max-width: none; border-radius: 0; transform: translateY(100%); }
  .snackbar.is-visible { transform: translateY(0); }
}
