/* Single source of truth for der/die/das colors — reference these
   instead of hardcoding the hex values again in a page's own <style>. */
:root {
  --color-der: #2563eb;
  --color-die: #dc2626;
  --color-das: #16a34a;
}

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { background: #d5eddf; }
th.sortable .sort-icon { margin-left: 0.3rem; opacity: 0.35; font-size: 0.75rem; }
th.sortable.sort-asc .sort-icon::after { content: '▲'; opacity: 1; }
th.sortable.sort-desc .sort-icon::after { content: '▼'; opacity: 1; }
th.sortable:not(.sort-asc):not(.sort-desc) .sort-icon::after { content: '⇅'; }

.btn-select-mode {
  padding: 0.4rem 0.9rem; background: transparent; color: white;
  border: 1.5px solid rgba(255,255,255,0.5); border-radius: 6px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.btn-select-mode:hover { border-color: white; }
.col-check { display: none; width: 1px; padding-right: 0; }
body.selecting .col-check { display: table-cell; }
body.selecting main { padding-bottom: 5rem; }
.select-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1b4332; color: white; padding: 0.9rem 2rem;
  display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 -2px 10px rgba(0,0,0,.2); gap: 1rem;
}
body.selecting .select-bar { display: flex; }
.select-bar-label { font-size: 0.95rem; color: #b7e4c7; }
.btn-exercise-sel {
  padding: 0.55rem 1.3rem; background: #52b788; color: white;
  border: none; border-radius: 6px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.btn-exercise-sel:disabled { opacity: 0.45; cursor: default; }
.btn-exercise-sel:not(:disabled):hover { background: #40916c; }
.btn-cancel-sel {
  background: none; border: none; color: #b7e4c7; cursor: pointer; font-size: 0.9rem; padding: 0;
}
.btn-cancel-sel:hover { color: white; }
.move-to-select {
  padding: 0.35rem 0.55rem; border: 1.5px solid rgba(255,255,255,0.5); border-radius: 6px;
  background: transparent; color: white; font-size: 0.9rem; cursor: pointer;
}
.move-to-select:disabled { opacity: 0.45; cursor: default; }
.move-to-select option { background: #1b4332; }
.row-check { accent-color: #2d6a4f; width: 16px; height: 16px; cursor: pointer; }

.sen-badge {
  font-size: 0.72rem; color: #2d6a4f; font-weight: 700;
  border: 1px solid #52b788; border-radius: 3px; padding: 0.1rem 0.35rem;
  margin-right: 0.35rem; vertical-align: middle;
}
.sentence-row { background: #f7fdf9; }
.sentence-row.hidden { display: none; }
.sentence-row td { padding: 0; }
.edit-panel { padding: 0.75rem 1.2rem 0.9rem; display: flex; flex-direction: column; gap: 0.8rem; }
.edit-panel-section { display: flex; flex-direction: column; gap: 0.35rem; }
.edit-panel-section + .edit-panel-section { border-top: 1px solid #e9f5ee; padding-top: 0.7rem; }
.edit-panel-title { font-size: 0.72rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.edit-panel-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.2rem; }
.sentence-list { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.55rem; }
.sentence-item { display: flex; align-items: center; gap: 0.5rem; }
.sen-text { flex: 1; font-size: 0.88rem; color: #444; cursor: pointer; line-height: 1.4; }
.sen-text:hover { color: #2d6a4f; }
.sen-empty { font-size: 0.85rem; color: #bbb; font-style: italic; margin-bottom: 0.5rem; }
.sentence-add { display: flex; gap: 0.45rem; }
.sen-input { flex: 1; padding: 0.28rem 0.55rem; border: 1px solid #ddd; border-radius: 5px; font-size: 0.88rem; font-family: inherit; }
.sen-input:focus { outline: none; border-color: #93c5fd; }
.sen-add-btn { padding: 0.28rem 0.75rem; background: #2d6a4f; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 0.88rem; }
.sen-add-btn:hover { background: #1b4332; }
.save-btn { background: none; border: none; color: #2d6a4f; cursor: pointer; font-size: 1.1rem; padding: 0; }
.save-btn:hover { color: #1b4332; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0; color: #ddd; line-height: 1; }
.star-btn:hover { color: #f59e0b; }
.star-btn.starred { color: #f59e0b; }
.col-groups { display: none; }
body.view-all .col-groups { display: table-cell; }
body.view-all .add-form { display: none; }
.groups-cell { font-size: 0.82rem; color: #777; max-width: 180px; }
.word-row.multi-group { background: #fffde7; }
.col-del-word { width: 1px; padding-left: 0; }
.col-del-group { display: none; }
body.view-all .col-del-group { display: table-cell; width: 1px; padding-right: 0.5rem; }

@media (max-width: 600px) {
  .select-bar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    height: auto;
  }
  .select-bar > div {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  body.selecting main { padding-bottom: 9rem; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .row-check { width: 20px; height: 20px; }
  .star-btn { font-size: 1.15rem; padding: 0.15rem; }
}
