/* Auth Modals & User Profile Drawer */

/* Тут жив блок `.tc-access-restricted` — блюр усієї сторінки під модалкою
   закритої бети. Прибрано 2026-09-14 разом з самою модалкою: сайт відкритий,
   акаунт опційний (PROJECT_NOTES §5 від 2026-07-28, §45). */

.tc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tc-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.tc-modal-card {
  background: var(--bar-bg, #f4efe6);
  color: var(--bar-ink, #2b2620);
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 22%, transparent);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 480px;
  padding: 2.2rem 2rem;
  text-align: center;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tc-modal-backdrop.is-active .tc-modal-card {
  transform: scale(1) translateY(0);
}

.tc-modal-rose {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.2rem auto;
  background-color: #8b263e;
  -webkit-mask: url("brand/luthers-rose.png") no-repeat center / contain;
  mask: url("brand/luthers-rose.png") no-repeat center / contain;
}

.tc-modal-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--bar-ink, #2b2620);
  line-height: 1.25;
}

.tc-modal-subtitle {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 75%, transparent);
  margin-bottom: 1.5rem;
}

/* Правила `.tc-promo-*` (поле промокоду в модалці закритої бети) прибрано
   2026-09-14 разом з розміткою, яка одна їх і використовувала. */

.tc-btn-primary {
  font-family: Georgia, serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  border: none;
  background: #8b263e;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tc-btn-primary:hover {
  background: #aa334f;
  transform: translateY(-1px);
}

.tc-btn-secondary {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 25%, transparent);
  background: transparent;
  color: var(--bar-ink, #2b2620);
  cursor: pointer;
  transition: background 0.2s ease;
}

.tc-btn-secondary:hover {
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 10%, transparent);
}

.tc-btn-danger {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background: #c62828;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tc-btn-danger:hover {
  background: #b71c1c;
  transform: translateY(-1px);
}

.tc-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--bar-ink, #2b2620);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.tc-modal-close:hover {
  opacity: 1;
}

.tc-modal-msg {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.tc-modal-msg.is-error {
  color: #dc3545;
}

.tc-modal-msg.is-success {
  color: #28a745;
}

/* User Profile / Personal Data Drawer */
.tc-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.tc-drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.tc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--bar-bg, #f4efe6);
  color: var(--bar-ink, #2b2620);
  box-shadow: -10px 0 30px rgba(0,0,0,0.25);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tc-drawer.is-active {
  transform: translateX(0);
}

.tc-drawer-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-drawer-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.tc-drawer-tabs {
  display: flex;
  border-bottom: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 15%, transparent);
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 4%, transparent);
}

.tc-drawer-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  background: transparent;
  border: none;
  color: var(--bar-ink, #2b2620);
  opacity: 0.65;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tc-drawer-tab:hover {
  opacity: 0.9;
}

.tc-drawer-tab.is-active {
  opacity: 1;
  font-weight: 600;
  color: #8b263e;
  border-bottom-color: #8b263e;
  background: var(--bar-bg, #f4efe6);
}

.tc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem;
}

.tc-drawer-pane {
  display: none;
}

.tc-drawer-pane.is-active {
  display: block;
}

.tc-item-card {
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 12%, transparent);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.tc-item-title {
  font-family: Georgia, serif;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 0.3rem 0;
  color: var(--bar-ink, #2b2620);
}

.tc-item-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 80%, transparent);
  margin: 0 0 0.4rem 0;
}

.tc-item-meta {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 50%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-item-del {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  opacity: 0.8;
}

.tc-item-del:hover {
  opacity: 1;
  background: rgba(220, 53, 69, 0.1);
}

.tc-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 50%, transparent);
  font-family: Georgia, serif;
  font-size: 0.9rem;
}

/* Item Card Link */
.tc-item-link {
  color: #8b263e;
  text-decoration: none;
}
.tc-item-link:hover {
  text-decoration: underline;
}

/* Note Modal */
.tc-note-card {
  max-width: 520px;
  text-align: left;
}

.tc-note-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.tc-note-icon {
  font-size: 1.5rem;
}

.tc-note-ref-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #8b263e;
}

.tc-note-context {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 4%, transparent);
  border-left: 3px solid #8b263e;
  border-radius: 4px;
  margin-bottom: 1rem;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 85%, transparent);
}

.tc-note-label {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.tc-note-input {
  width: 100%;
  box-sizing: border-box;
  font-family: "Lora", Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 25%, transparent);
  background: color-mix(in srgb, var(--bar-bg, #f4efe6) 90%, white);
  color: var(--bar-ink, #2b2620);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tc-note-input:focus {
  border-color: #8b263e;
  box-shadow: 0 0 0 3px rgba(139, 38, 62, 0.2);
}

.tc-note-existing {
  margin-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 12%, transparent);
  padding-top: 0.8rem;
}

.tc-note-existing-title {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 70%, transparent);
  margin-bottom: 0.5rem;
}

.tc-note-existing-list {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tc-note-item {
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 4%, transparent);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.tc-note-item-text {
  font-family: "Lora", Georgia, serif;
  margin-bottom: 0.25rem;
  white-space: pre-wrap;
}

.tc-note-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 50%, transparent);
}

.tc-note-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

/* Concordia Headings Action Buttons */
.content h2,
.content h3 {
  position: relative;
}

.tc-concordia-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

h2:hover .tc-concordia-actions,
h3:hover .tc-concordia-actions,
.tc-concordia-actions.has-active,
.tc-concordia-actions:hover,
.tc-concordia-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .tc-concordia-actions {
    opacity: 0.35;
    pointer-events: auto;
  }
  .tc-concordia-actions.has-active {
    opacity: 1;
  }
}

.tc-action-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: var(--bar-ink, #2b2620);
  opacity: 0.6;
}

.tc-action-btn:hover {
  opacity: 1;
  background: color-mix(in srgb, #8b263e 12%, transparent);
  border-color: color-mix(in srgb, #8b263e 40%, transparent);
}

.tc-action-btn.is-active {
  opacity: 1;
  background: color-mix(in srgb, #8b263e 20%, transparent);
  border: 1px solid color-mix(in srgb, #8b263e 50%, transparent);
}

/* Persistent passage-level bookmark/note markers (survive losing the text
   highlight after SPA arrow navigation away and back — see
   AuthUIController.prototype.renderPassageMarkers). */
.tc-passage-marker {
  display: inline-flex;
  gap: 0.2rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tc-passage-badge {
  font-size: 0.8em;
  opacity: 0.9;
  display: inline-block;
}

.tc-passage-marker {
  cursor: pointer;
}

/* Marker popover — mirrors pysannia/style.css .rv-note-popover (the verse
   📝 badge popover in Scripture reading mode), using this stylesheet's own
   modal palette since Concordia pages don't load pysannia/style.css. */
.tc-pm-popover {
  position: fixed;
  z-index: 10000;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--bar-bg, #f4efe6);
  color: var(--bar-ink, #2b2620);
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 22%, transparent);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  padding: 14px 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
  pointer-events: none;
}

.tc-pm-popover.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.tc-pm-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 18%, transparent);
}

.tc-pm-popover-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #8b263e;
}

.tc-pm-popover-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0 0.2rem;
}

.tc-pm-popover-close:hover {
  opacity: 1;
}

.tc-pm-popover-content {
  max-height: 240px;
  overflow-y: auto;
}

.tc-pm-item {
  padding: 8px 0;
}

.tc-pm-item + .tc-pm-item {
  border-top: 1px dashed color-mix(in srgb, var(--bar-ink, #2b2620) 18%, transparent);
}

.tc-pm-item-text {
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tc-pm-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  opacity: 0.75;
}

.tc-pm-item-actions {
  display: flex;
  gap: 6px;
}

.tc-pm-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 30%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tc-pm-btn:hover {
  background: #8b263e;
  color: #fff;
  border-color: #8b263e;
}

.tc-pm-btn.tc-pm-del:hover {
  background: #b3261e;
  border-color: #b3261e;
}

.tc-pm-popover-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 18%, transparent);
  text-align: center;
}

.tc-pm-popover-add-btn {
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px dashed color-mix(in srgb, var(--bar-ink, #2b2620) 35%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tc-pm-popover-add-btn:hover {
  background: #8b263e;
  color: #fff;
  border-style: solid;
  border-color: #8b263e;
}

/* Profile Drawer Data Sync Box */
.tc-drawer-footer {
  margin-top: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 4%, transparent);
  border: 1px dashed color-mix(in srgb, var(--bar-ink, #2b2620) 20%, transparent);
  border-radius: 10px;
}

.tc-drawer-sync-title {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--bar-ink, #2b2620);
}

.tc-drawer-sync-status {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 6%, transparent);
}

.tc-sync-active {
  color: #8b263e;
  font-weight: 500;
}

.tc-sync-ok {
  color: #2e7d32;
  font-weight: 500;
}

.tc-sync-err {
  color: #c62828;
  font-weight: 500;
}

.tc-sync-guest {
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 65%, transparent);
}

.tc-drawer-sync-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tc-drawer-sync-btns .tc-btn-secondary {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* Selection Floating Toolbar */
.tc-selection-toolbar[hidden] {
  display: none !important;
}

.tc-selection-toolbar {
  position: absolute;
  z-index: 10040;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
  background: var(--bar-bg, #f4efe6);
  color: var(--bar-ink, #2b2620);
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 22%, transparent);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  user-select: none;
  -webkit-user-select: none;
  animation: tcSelFadeIn 0.15s ease-out;
}

@keyframes tcSelFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tc-sel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  color: var(--bar-ink, #2b2620);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tc-sel-btn:hover {
  background: color-mix(in srgb, #8b263e 12%, transparent);
  border-color: color-mix(in srgb, #8b263e 30%, transparent);
}

.tc-sel-btn:focus-visible {
  outline: 2px solid #8b263e;
  outline-offset: 1px;
}

.tc-sel-btn.is-active {
  background: color-mix(in srgb, #8b263e 20%, transparent);
  border-color: color-mix(in srgb, #8b263e 50%, transparent);
  color: #8b263e;
  font-weight: 600;
}

.tc-sel-btn .tc-action-icon {
  font-size: 0.95rem;
}

/* Saved Passage Highlight & Target on Navigation */
.tc-saved-mark {
  background-color: color-mix(in srgb, #c5a059 45%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0.05em 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  animation: tcMarkGlow 2s ease-out;
}

@keyframes tcMarkGlow {
  0% { background-color: color-mix(in srgb, #c5a059 85%, transparent); }
  100% { background-color: color-mix(in srgb, #c5a059 45%, transparent); }
}

[data-search-block].tc-saved-target,
.tc-saved-target {
  outline: 2px solid var(--gold, #c5a059);
  outline-offset: 4px;
  border-radius: 4px;
  scroll-margin-top: 5rem;
}

/* Unified Cabinet Item Styles */
.tc-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.tc-item-source {
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 8%, transparent);
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 75%, transparent);
}

.tc-item-quote {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--bar-ink, #2b2620) 85%, transparent);
  margin: 0.3rem 0 0.45rem 0;
  border-left: 2px solid color-mix(in srgb, #8b263e 50%, transparent);
  padding-left: 0.5rem;
}

.tc-item-notes-wrap {
  margin: 0.4rem 0 0.5rem 0;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bar-ink, #2b2620) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--bar-ink, #2b2620) 10%, transparent);
}

.tc-item-note-label {
  font-family: Georgia, serif;
  font-size: 0.74rem;
  font-weight: 600;
  color: #8b263e;
  margin-bottom: 0.2rem;
}

.tc-item-note-text {
  font-family: "Lora", Georgia, serif;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--bar-ink, #2b2620);
  white-space: pre-wrap;
}
