@import url(https://fonts.googleapis.com/css?family=Roboto:100);

body {
  margin-top: 10px;
  background-color: #ffffff;
  color: #000000;
  text-align: left;
  font-family: Arial, sans-serif;
}

h1 {
  font: 700 28px Arial, sans-serif;
  margin: 0;
}

p {
  font: 4em sans-serif;
  margin-bottom: 20px;
}

#loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 8px solid rgba(50, 50, 50, 0.3);
  border-radius: 50%;
  border-top-color: #444;
  animation: spin 1s ease-in-out infinite;
  -webkit-animation: spin 1s ease-in-out infinite;
}

.text-input-panel {
  max-width: 920px;
  margin: 0 0 18px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin-bottom: 12px;
}

.app-version {
  margin-top: 3px;
  color: #4b5563;
  font: 13px Arial, sans-serif;
}

.repo-link {
  flex: 0 0 auto;
  min-height: 32px;
  box-sizing: border-box;
  padding: 7px 11px;
  border: 1px solid #444;
  border-radius: 4px;
  color: #000000;
  background: #f4f4f4;
  font: 14px Arial, sans-serif;
  text-decoration: none;
}

.repo-link:hover {
  background: #e8e8e8;
  text-decoration: underline;
}

#paste-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 920px;
  min-height: 150px;
  padding: 10px;
  border: 1px solid #9a9a9a;
  border-radius: 4px;
  color: #000000;
  background: #ffffff;
  font: 16px/1.4 Arial, sans-serif;
  resize: vertical;
}

.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.input-actions button,
.lookup-row button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 4px;
  color: #000000;
  background: #f4f4f4;
  font: 14px Arial, sans-serif;
  cursor: pointer;
}

.input-actions button:hover,
.lookup-row button:hover {
  background: #e8e8e8;
}

.color-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 4px;
  color: #000000;
  font: 14px Arial, sans-serif;
  cursor: pointer;
}

.color-toggle input {
  margin: 0;
}

.text-analysis-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: #374151;
  font: 13px Arial, sans-serif;
}

.text-analysis-status::before {
  content: "";
  display: none;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid rgba(55, 65, 81, 0.25);
  border-top-color: #374151;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.text-analysis-status.is-active::before {
  display: inline-block;
}

.lookup-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  max-width: 920px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d1d5db;
}

.lookup-form {
  min-width: 0;
}

.lookup-form label {
  display: block;
  margin-bottom: 5px;
  color: #111827;
  font: 600 14px Arial, sans-serif;
}

.lookup-row {
  display: flex;
  gap: 6px;
}

.lookup-row input {
  box-sizing: border-box;
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #9a9a9a;
  border-radius: 4px;
  color: #000000;
  background: #ffffff;
  font: 15px Arial, sans-serif;
}

.lookup-status {
  min-height: 18px;
  margin-top: 10px;
  color: #374151;
  font: 13px Arial, sans-serif;
}

.lookup-results {
  max-width: 920px;
  margin-top: 8px;
}

.lookup-result-list {
  display: grid;
  gap: 4px;
  max-height: 420px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
}

.lookup-result-heading {
  margin: 0 0 6px;
  color: #111827;
  font: 600 15px Arial, sans-serif;
}

.lookup-empty {
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  background: #f9fafb;
  font: 14px Arial, sans-serif;
}

.lookup-word {
  font-weight: 600;
}

.lookup-result-list .analysis-row {
  margin: 0;
}

@media (max-width: 680px) {
  .lookup-tools {
    grid-template-columns: 1fr;
  }

  .lookup-row {
    flex-wrap: wrap;
  }

  .lookup-row input,
  .lookup-row button {
    width: 100%;
  }
}

@keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}
@-webkit-keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}

.container {
  width: 200px;
  line-height: 30px;
}

em label {
  font-size: 11px;
  font-family: "Muli", sans-serif;
  position: absolute;
  left: 0;
  bottom: -16px;
  height: 22px;
  padding: 5px;
  border-radius: 0 4px 4px 4px;
  z-index: -1;
  line-height: 19px;
  white-space: nowrap;
  width: 200%;
  margin: 0 0 0 -50%;
  color: #004e95;
}

.word-group {
  position: relative;
}

.label {
  font-size: 11px;
  font-family: sans-serif;
  position: absolute;
  left: 0;
  bottom: -23px;
  height: 21px;
  padding: 5px 0px 5px 5px;
  z-index: -1;
  line-height: 13px;
  white-space: nowrap;
  width: 100%;
  color: #9a002c;
  text-align: center;
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
}

.analyzed-word {
  --word-color: #1f2937;
  --word-bg: #f3f4f6;
  color: inherit;
  background: transparent;
  border-radius: 3px;
  padding: 0 2px;
  text-decoration: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

body.colors-enabled .analyzed-word {
  color: var(--word-color);
  background: var(--word-bg);
}

.analyzed-word:hover {
  text-decoration: underline;
}

body.colors-enabled .word-pos-substantiivi {
  --word-color: #065f46;
  --word-bg: #d1fae5;
}

body.colors-enabled .word-pos-adjektiivi {
  --word-color: #92400e;
  --word-bg: #fef3c7;
}

body.colors-enabled .word-pos-verbi {
  --word-color: #1d4ed8;
  --word-bg: #dbeafe;
}

body.colors-enabled .word-pos-pronomini {
  --word-color: #6d28d9;
  --word-bg: #ede9fe;
}

body.colors-enabled .word-pos-numeraali {
  --word-color: #9d174d;
  --word-bg: #fce7f3;
}

body.colors-enabled .word-pos-adverbi,
body.colors-enabled .word-pos-partikkeli,
body.colors-enabled .word-pos-konjunktio,
body.colors-enabled .word-pos-prepositio,
body.colors-enabled .word-pos-postpositio,
body.colors-enabled .word-pos-interjektio {
  --word-color: #374151;
  --word-bg: #e5e7eb;
}

.typo-word {
  color: #b00020;
  font-weight: 600;
}

.typo-suggestion {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #d1d5db;
}

.typo-suggestion:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: max-content;
  max-width: 360px;
  background-color: rgb(255, 255, 255);
  color: #000000;
  border: 1px solid #000000;
  text-align: left;
  line-height: 1.35;
  padding: 5px;
  border-width: 1px;
  border-radius: 6px;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

.analysis-row {
  --pos-color: #4b5563;
  --case-bg: #f9fafb;
  margin: 2px 0;
  padding: 4px 6px 4px 8px;
  border-left: 4px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
}

body.colors-enabled .analysis-row {
  border-left-color: var(--pos-color);
  background: var(--case-bg);
}

.analysis-row a {
  color: inherit;
}

body.colors-enabled .analysis-row.pos-substantiivi {
  --pos-color: #059669;
}

body.colors-enabled .analysis-row.pos-adjektiivi {
  --pos-color: #d97706;
}

body.colors-enabled .analysis-row.pos-verbi {
  --pos-color: #2563eb;
}

body.colors-enabled .analysis-row.pos-pronomini {
  --pos-color: #7c3aed;
}

body.colors-enabled .analysis-row.pos-numeraali {
  --pos-color: #db2777;
}

body.colors-enabled .analysis-row.pos-adverbi,
body.colors-enabled .analysis-row.pos-partikkeli,
body.colors-enabled .analysis-row.pos-konjunktio,
body.colors-enabled .analysis-row.pos-prepositio,
body.colors-enabled .analysis-row.pos-postpositio,
body.colors-enabled .analysis-row.pos-interjektio {
  --pos-color: #6b7280;
}

body.colors-enabled .analysis-row.case-nominatiivi {
  --case-bg: #ffffff;
}

body.colors-enabled .analysis-row.case-genetiivi {
  --case-bg: #ecfdf5;
}

body.colors-enabled .analysis-row.case-akkusatiivi {
  --case-bg: #f0fdf4;
}

body.colors-enabled .analysis-row.case-partitiivi {
  --case-bg: #fffbeb;
}

body.colors-enabled .analysis-row.case-inessiivi,
body.colors-enabled .analysis-row.case-elatiivi,
body.colors-enabled .analysis-row.case-illatiivi {
  --case-bg: #eff6ff;
}

body.colors-enabled .analysis-row.case-adessiivi,
body.colors-enabled .analysis-row.case-ablatiivi,
body.colors-enabled .analysis-row.case-allatiivi {
  --case-bg: #eef2ff;
}

body.colors-enabled .analysis-row.case-essiivi,
body.colors-enabled .analysis-row.case-translatiivi {
  --case-bg: #fdf2f8;
}

body.colors-enabled .analysis-row.case-komitatiivi,
body.colors-enabled .analysis-row.case-abessiivi,
body.colors-enabled .analysis-row.case-instruktiivi {
  --case-bg: #f5f3ff;
}

body.colors-enabled .analysis-row.number-monikko {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.22);
}

body.colors-enabled .analysis-row.form-vertailu {
  font-weight: 600;
}

body.colors-enabled .analysis-row.form-verbi {
  border-left-style: double;
}

body.colors-enabled .analysis-row.form-omistusliite {
  outline: 1px dashed rgba(17, 24, 39, 0.25);
  outline-offset: -2px;
}

.tooltip-hyphenation {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #d1d5db;
  color: #374151;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}

.mobile-annotation {
  display: none;
}
/*
a:link {
  color: rgb(99, 190, 255);
  background-color: transparent;
  text-decoration: none;
}
a:visited {
  color: rgb(198, 88, 253);
  background-color: transparent;
  text-decoration: none;
}
a:hover {
  color: rgb(255, 0, 0);
  background-color: transparent;
  text-decoration: underline;
}
a:active {
  color: rgb(255, 242, 60);
  background-color: transparent;
  text-decoration: underline;
}
*/

@media (max-width: 720px), (pointer: coarse) {
  body {
    margin: 0;
    padding: 10px 10px 120px;
    font-size: 17px;
    line-height: 1.55;
  }

  h1 {
    font-size: 26px;
  }

  .text-input-panel,
  .app-header,
  #paste-input,
  .lookup-tools,
  .lookup-results {
    max-width: none;
    width: 100%;
  }

  .app-header {
    align-items: flex-start;
    gap: 10px;
  }

  .repo-link {
    min-height: 40px;
    padding: 10px 12px;
  }

  #paste-input {
    min-height: 180px;
    font-size: 16px;
  }

  .input-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .input-actions button,
  .lookup-row button,
  .color-toggle {
    min-height: 44px;
    justify-content: center;
    font-size: 15px;
  }

  .text-analysis-status {
    grid-column: 1 / -1;
    min-height: 24px;
  }

  .lookup-tools {
    grid-template-columns: 1fr;
  }

  .lookup-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lookup-row input {
    height: 44px;
    font-size: 16px;
  }

  #results {
    font-size: 18px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  .tooltip {
    border-bottom: 0;
  }

  .tooltip .tooltiptext,
  .tooltip:hover .tooltiptext {
    display: none;
    visibility: hidden;
  }

  .analyzed-word,
  .typo-word {
    display: inline;
    min-height: 28px;
    padding: 2px 4px;
    border-bottom: 1px dotted currentColor;
    text-decoration: none;
    touch-action: manipulation;
  }

  .analyzed-word:hover {
    text-decoration: none;
  }

  .mobile-annotation {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: block;
    max-height: 62vh;
    box-sizing: border-box;
    padding: 12px 14px 16px;
    border-top: 1px solid #9ca3af;
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(17, 24, 39, 0.18);
    overflow: auto;
  }

  .mobile-annotation[hidden] {
    display: none;
  }

  .mobile-annotation-header {
    position: sticky;
    top: -12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -12px -14px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
  }

  .mobile-annotation h2 {
    margin: 0;
    color: #111827;
    font: 700 18px Arial, sans-serif;
  }

  .mobile-annotation button,
  .mobile-annotation-link {
    flex: 0 0 auto;
    min-height: 40px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    color: #000000;
    background: #f4f4f4;
    font: 15px Arial, sans-serif;
    text-decoration: none;
  }

  .mobile-annotation-body {
    font: 15px/1.45 Arial, sans-serif;
  }

  .mobile-annotation-body a {
    color: inherit;
    pointer-events: none;
    text-decoration: none;
  }

  .mobile-annotation-link {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
  }
}
