

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1d2547;
  font: 400 13px/1.5 "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid #1d2547; outline-offset: 2px; }

/* ---------- header */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e4e6ee;
}
/* "gap" o'rniga margin: IE11 flexbox'da gap'ni tushunmaydi */
.brand {
  display: flex;
  align-items: center;
  color: #1d2547;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.brand img { margin-right: 8px; }
.host { color: #5d6480; font-size: 12px; }

/* ---------- main */
main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.demo label { display: block; margin-bottom: 6px; color: #5d6480; }
.demo textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #e4e6ee;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: #1d2547;
  resize: vertical;
}

.primary {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: #1d2547;
  color: #fff;
  font-weight: 500;
  font-size: 14px;
}
.primary:hover:not(:disabled) { background: #2a3463; }

.status { margin: 12px 0 4px; color: #5d6480; }
.status.ok { color: #2e7d5b; }
.status.fail { color: #c62f3b; }

/* ---------- error list: the proofreader's margin */
.errors { list-style: none; margin: 0; padding: 0; }

.err {
  padding: 12px 0 12px 12px;
  border-bottom: 1px solid #e4e6ee;
  border-left: 3px solid #ffe08a;
}
.err.gone { opacity: .45; }

.err-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.err-head .word { margin-right: 8px; }

.word {
  font-size: 17px;
  font-weight: 500;
  color: #c62f3b;
  text-decoration-thickness: 2px;
  text-decoration-color: #c62f3b;
  word-break: break-word;
}

.loc {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: #5d6480;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.loc:hover { color: #1d2547; }

.sugs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}
.sugs > * { margin: 0 6px 6px 0; }
.caret {
  color: #c62f3b;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-right: 2px;
  transform: translateY(-6px);
}
.sug {
  padding: 3px 10px;
  border: 1px solid #1d2547;
  border-radius: 4px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
}
.sug:first-of-type { background: #1d2547; color: #fff; }
.sug:hover:not(:disabled) { background: #1d2547; color: #fff; }
.nosug { color: #5d6480; }

.acts { display: flex; margin-top: 2px; }
.acts button { margin-right: 14px; }
.acts button {
  padding: 0;
  border: 0;
  background: none;
  color: #5d6480;
  font-size: 12px;
}
.acts button:hover { color: #1d2547; text-decoration: underline; }

/* ---------- tools */
.tools {
  padding: 12px 16px 14px;
  border-top: 1px solid #e4e6ee;
  background: #f5f6fa;
}
.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tool-label { margin-right: 10px; }
.tool-label { font-weight: 500; }
.seg { display: flex; }
.seg button {
  padding: 5px 12px;
  border: 1px solid #1d2547;
  background: #ffffff;
}
.seg button:first-child { border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.seg button:hover:not(:disabled) { background: #1d2547; color: #fff; }
.hint { margin: 8px 0 0; color: #5d6480; font-size: 12px; }
.link {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #5d6480;
  font-size: 12px;
  text-decoration: underline;
}

@media (prefers-reduced-motion: no-preference) {
  .err { transition: opacity .2s ease; }
}

/* ---------- account */
.acct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #e4e6ee;
  background: #f5f6fa;
  font-size: 12px;
}
.acct-text { margin-right: 8px; color: #5d6480; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-text strong { color: #2e7d5b; font-weight: 500; }
.acct-btns { display: flex; flex: none; }
.acct-btns .link { margin-left: 12px; }
.acct .link { margin: 0; }

.auth { padding: 16px; flex: 1; overflow-y: auto; }
.auth h2 { margin: 0 0 14px; font-size: 17px; }
.field { display: block; margin-bottom: 12px; color: #5d6480; font-size: 12px; }
.field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #e4e6ee;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: #1d2547;
}
.field input:focus { border-color: #1d2547; outline: none; }
.form-err { min-height: 1.2em; margin: 0 0 10px; color: #c62f3b; font-size: 12px; }
.auth-alt { margin: 10px 0 0; text-align: center; }

.upsell {
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #e4e6ee;
  border-left: 3px solid #c62f3b;
  border-radius: 6px;
}
.upsell p { margin: 0 0 10px; }
