.word-choice-page {
  min-height: 0;
  margin: 0;
  background: #fff8f4;
  color: #3f2d2a;
  font-size: 16px;
}

.word-choice-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 248, 244, 0.94);
  border-bottom: 1px solid rgba(207, 75, 69, 0.16);
  backdrop-filter: blur(12px);
}

html.is-embedded .word-choice-topbar {
  display: none;
}

html.is-embedded .word-choice-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 10px;
}

.word-choice-back,
.word-choice-local-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cf4b45;
  font-size: 16px;
  text-decoration: none;
}

.word-choice-local-note {
  color: #8b6d67;
}

.word-choice-local-note span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cf4b45;
  box-shadow: 0 0 0 5px rgba(207, 75, 69, 0.12);
}

.word-choice-shell {
  width: min(1440px, calc(100% - 32px));
  min-height: 0;
  margin: 0 auto;
  padding: 24px 0 14px;
  box-sizing: border-box;
}

.word-choice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.word-choice-heading h1 {
  margin: 0;
  color: #cf4b45;
  font-size: 24px;
  font-weight: 550;
}

.word-choice-heading p,
.word-choice-card-title span,
.word-choice-preview-toolbar span,
.word-choice-status {
  color: #856b65;
  line-height: 1.65;
}

.word-choice-heading p {
  margin: 6px 0 0;
}

.word-choice-upload {
  cursor: pointer;
}

.word-choice-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

html.is-embedded .word-choice-workspace {
  min-height: 0;
  overflow: hidden;
}

.word-choice-panel {
  display: grid;
  gap: 10px;
}

.word-choice-card,
.word-choice-preview-card {
  background: #fff;
  border: 1px solid rgba(207, 75, 69, 0.16);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(207, 75, 69, 0.08);
}

.word-choice-card {
  padding: 14px;
}

.word-choice-card-title,
.word-choice-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.word-choice-card-title {
  margin-bottom: 10px;
}

.word-choice-card h2 {
  margin: 0;
  color: #4f3834;
  font-size: 18px;
  font-weight: 550;
}

.word-choice-file-name {
  min-height: 44px;
  margin-bottom: 12px;
  padding: 11px 14px;
  overflow: hidden;
  color: #59433f;
  background: #fffaf2;
  border: 1px solid rgba(207, 75, 69, 0.12);
  border-radius: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-choice-file-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.word-choice-file-actions .g_button,
.word-choice-file-actions .word-choice-upload {
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.word-choice-progress {
  height: 14px;
  overflow: hidden;
  background: #fff1eb;
  border: 1px solid rgba(207, 75, 69, 0.14);
  border-radius: 999px;
}

.word-choice-progress div {
  width: 0;
  height: 100%;
  background: #cf4b45;
  border-radius: inherit;
  transition: width 0.18s ease;
}

.word-choice-status {
  min-height: 28px;
  margin-top: 10px;
}

.word-choice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.word-choice-stats div {
  padding: 12px;
  background: #fffaf2;
  border: 1px solid rgba(207, 75, 69, 0.12);
  border-radius: 14px;
}

.word-choice-stats dt {
  color: #856b65;
}

.word-choice-stats dd {
  margin: 4px 0 0;
  color: #cf4b45;
  font-size: 22px;
  font-weight: 550;
}

.word-choice-preview-card {
  min-width: 0;
  overflow: hidden;
}

.word-choice-preview-toolbar {
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(207, 75, 69, 0.14);
}

.word-choice-preview-toolbar strong {
  display: block;
  color: #4f3834;
  font-weight: 550;
}

.word-choice-pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.word-choice-pager span {
  min-width: 96px;
  text-align: center;
}

.word-choice-table-wrap {
  overflow: visible;
}

.word-choice-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.word-choice-table th,
.word-choice-table td {
  padding: 10px 12px;
  color: #4f3834;
  border-bottom: 1px solid rgba(207, 75, 69, 0.1);
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  vertical-align: middle;
}

.word-choice-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fffaf2;
  font-weight: 550;
}

.word-choice-table td {
  height: 38px;
}

.word-choice-table th:nth-child(1),
.word-choice-table td:nth-child(1),
.word-choice-table th:nth-child(7),
.word-choice-table td:nth-child(7) {
  width: 1%;
  white-space: nowrap;
}

.word-choice-table th:nth-child(n+2):nth-child(-n+6),
.word-choice-table td:nth-child(n+2):nth-child(-n+6) {
  width: 15%;
}

.word-cloze-table th:nth-child(1),
.word-cloze-table td:nth-child(1),
.word-cloze-table th:nth-child(4),
.word-cloze-table td:nth-child(4) {
  width: 1%;
  white-space: nowrap;
}

.word-cloze-table th:nth-child(2),
.word-cloze-table td:nth-child(2),
.word-cloze-table th:nth-child(3),
.word-cloze-table td:nth-child(3) {
  width: 44%;
  white-space: normal;
}

.word-choice-cell-clip {
  display: inline-block;
  max-width: 5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.word-choice-empty {
  height: 160px;
  color: #856b65 !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.word-choice-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  color: #fff;
  background: #cf4b45;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(207, 75, 69, 0.26);
}

.word-choice-toast[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .word-choice-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .word-choice-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .word-choice-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .word-choice-topbar {
    padding: 12px 14px;
  }

  .word-choice-local-note {
    display: none;
  }

  .word-choice-stats {
    grid-template-columns: 1fr;
  }

  .word-choice-pager {
    width: 100%;
    justify-content: space-between;
  }
}
