/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14pt;
}

.navi {
  font-size: 11pt;
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.navi a {
  color: #999;
  text-decoration: none;
}

.navi a:hover {
  color: #900;
  text-decoration: none;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Typography */
h1 {
  font-size: 24pt;
  margin-bottom: 10px;
}

h2 {
  font-size: 14pt;
  margin-bottom: 0.5rem;
}

p {
  font-size: 10pt;
  margin: 10px 0;
}

ul {
  margin-left: 20px;
  list-style-type: disc;
}

li {
  font-size: 10pt;
  margin-bottom: 5px;
}

/* Layout */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px;
  height: 100%;
}

.feature {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.left {
  width: 100%;
  overflow: auto !important;
}

.right {
  width: 100%;
  overflow: auto !important;
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Components */
/* Forms */
textarea {
  width: 100%;
  height: 100%;
  font-size: 15px;
  line-height: 15px;
  padding: 10px;
  ime-mode: disabled;
  -webkit-ime-mode: disabled;
  -moz-ime-mode: disabled;
  -ms-ime-mode: disabled;
}

textarea#text_area {
  padding: 10px;
  border: 1px solid #ccc;
  background-color: darkgray;
  color: white;
  font-size: 14pt;
  line-height: 16pt;
}

textarea#text_area::placeholder {
  color: #666;
}

textarea#text_area:focus {
  background-color: blue;
  border: 1px solid #000;
  border: 0;
  outline: none;
  color: white;
}

.right select {
  font-size: 12pt;
  width: 100%;
  margin-bottom: 1rem;
}

details summary {
  font-size: 14pt;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 6px;
  margin-top: 16px;
}

details td {
  font-size: 12pt;
  vertical-align: top;
}

details td input[type='checkbox'],
details td input[type='radio'] {
  transform: scale(1.2);
  margin-right: 6px;
}

.left button {
  margin-bottom: 10px;
  padding: 6px 12px;
  font-size: 12pt;
}

/* Input Method UI */
#function {
  position: absolute;
  padding: 10px 0 0 10px;
  color: #000;
  visibility: hidden;
}

#composing_buffer p {
  padding: 4px;
  background-color: #fff;
  margin-top: -2px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  display: inline-block;
  font-size: 14pt;
  color: #000;
}

#candidates {
  margin-top: 5px;
  padding: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  float: left;
}

#tooltip {
  background-color: lightyellow;
  color: #000;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  float: left;
  padding: 4px 8px;
  visibility: hidden;
}

.cursor {
  color: red;
  animation: blink 0.7s infinite;
}

.keycap {
  font-weight: bold;
  font-size: 12pt;
  padding: 2px 10px 0 20px;
}

.candidate {
  padding: 2px;
  font-size: 12pt;
}

.description {
  padding: 2px 10px 0 20px;
  font-size: 10pt;
  color: #666;
}

.highlighted_candidate {
  background-color: lightcyan;
}

/* Other UI Elements */
#loading {
  position: absolute;
  top: 0;
  left: 20px;
  color: #fff;
  background-color: #000;
  padding: 10px;
  display: block;
}

.credit {
  font-size: 10pt;
  height: 20px;
}

.page_info {
  font-size: 10pt;
  text-align: right;
  color: #666;
}

.page_info td {
  padding-top: 20px;
}

#edit_area {
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  height: 100%;
  overflow: auto !important;
}

div#feature_input {
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  height: 100%;
}

div#feature_user_data {
  display: none;
}

div#feature_user_data textarea {
  font-family: monospace;
  font-size: 12pt;
  line-height: 14pt;
  height: 200px;
}

.left h2 {
  margin-top: 20px;
  margin-bottom: 10px;
}

td {
  margin: 0;
  border: 0;
}

.status_area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

#status {
  width: 100px;
  font-size: 12pt;
}

#status a {
  text-decoration: none;
  cursor: pointer;
}

#menu_visible {
  flex-grow: 1;
  font-size: 10pt;
  cursor: pointer;
  color: #666;
  text-align: right;
  white-space: nowrap;
  padding-right: 10px;
}

#menu_visible a {
  text-decoration: none;
  color: #666;
}

/* Media Queries */
@media (min-width: 768px) {
  .main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .feature {
    display: flex;
    flex-direction: row;
    min-height: 80%;
    height: 100%;
  }

  .left {
    width: 70%;
    float: left;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

  .right {
    padding: 20px;
    width: 30%;
    float: right;
    height: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #eee;
  }

  a {
    color: #9999ff;
    text-decoration: none;
  }
}
