/* App shell */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(150deg, #f5f7fc 0%, #ffffff 50%, #f3f5fb 100%) fixed !important;
}

/* Ambient background glow */
.rmt-hero-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(700px 380px at 88% -6%, rgba(79, 70, 229, 0.10), transparent 55%),
    radial-gradient(580px 320px at 12% 18%, rgba(56, 189, 248, 0.07), transparent 50%),
    radial-gradient(500px 280px at 50% 108%, rgba(124, 58, 237, 0.07), transparent 48%);
}

/* Glass morphism (header) */
.glass {
  backdrop-filter: saturate(200%) blur(20px);
  -webkit-backdrop-filter: saturate(200%) blur(20px);
  background: rgba(255, 255, 255, 0.88) !important;
}

/* Primary gradient button */
.rmt-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.rmt-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.rmt-btn-primary:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

/* Form fields */
.rmt-field {
  width: 100%;
  border-radius: 0.75rem;
  border: 1.5px solid #e4e7ef;
  background: #ffffff;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.9375rem;
  color: #0f1117;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.rmt-field::placeholder {
  color: #9ba3b8;
  font-weight: 400;
}

.rmt-field:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

textarea.rmt-field-area {
  min-height: 2.75rem;
  resize: vertical;
  line-height: 1.45;
}

/* Tailwind .flex overrides [hidden]; keep banner hidden when marked hidden */
#rmt-all-done-banner[hidden] {
  display: none !important;
}

.rmt-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.rmt-delete-col-head {
  min-width: 2rem;
  text-align: right;
}

#rmt-bulk-action-wrap[hidden] {
  display: none !important;
}

#rmt-select-actions[hidden],
#rmt-normal-actions[hidden],
#rmt-complete-actions[hidden] {
  display: none !important;
}

/* Bulk select - square pick boxes (separate from round complete checkboxes) */
#rmt-item-list .rmt-pick-wrap {
  display: none;
}

#rmt-item-list.rmt-select-mode .rmt-pick-wrap {
  display: flex;
  align-items: center;
  padding-top: 0.875rem;
}

#rmt-item-list.rmt-select-mode .rmt-single-delete {
  display: none;
}

#rmt-item-list.rmt-select-mode .rmt-item-main {
  pointer-events: none;
  cursor: default;
}

#rmt-item-list.rmt-select-mode .rmt-item-check:disabled {
  cursor: not-allowed;
}

#rmt-item-list.rmt-select-mode .rmt-item-row {
  background-color: #fff;
}

#rmt-item-list.rmt-select-mode .rmt-item-row.is-picked {
  background-color: #eef2ff;
  box-shadow: inset 3px 0 0 #4f46e5;
}

.rmt-bulk-delete {
  border: 0;
  background: transparent;
  padding: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #dc2626;
  cursor: pointer;
  text-decoration: none;
}

.rmt-bulk-delete:hover:not(:disabled) {
  color: #b91c1c;
  text-decoration: underline;
}

.rmt-bulk-delete:disabled {
  color: #e11d48;
  opacity: 0.55;
  cursor: not-allowed;
  text-decoration: none;
}

.rmt-pick-check {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #64748b;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  background: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rmt-pick-check:hover {
  border-color: #4f46e5;
}

.rmt-pick-check:checked {
  background: #4f46e5;
  border-color: #4f46e5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6l2.5 2.5 4.5-5' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 75%;
}

.rmt-pick-check:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

html.rmt-dark .rmt-pick-check {
  background-color: rgba(20, 18, 36, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

html.rmt-dark .rmt-pick-check:checked {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

html.rmt-dark #rmt-item-list.rmt-select-mode .rmt-item-row {
  background-color: transparent;
}

html.rmt-dark #rmt-item-list.rmt-select-mode .rmt-item-row.is-picked {
  background-color: rgba(79, 70, 229, 0.2);
  box-shadow: inset 3px 0 0 #818cf8;
}

html.rmt-dark .rmt-bulk-delete {
  color: #f87171;
}

html.rmt-dark .rmt-bulk-delete:hover:not(:disabled) {
  color: #fca5a5;
}

html.rmt-dark .rmt-bulk-delete:disabled {
  color: #fb7185;
  opacity: 0.7;
}

/* Card hover */
.rmt-dash-card {
  position: relative;
  z-index: 1;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.rmt-dash-card:has(.rmt-card-menu-btn[aria-expanded="true"]) {
  z-index: 30;
}

.rmt-dash-card:hover {
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.13), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-color: rgba(79, 70, 229, 0.22);
  transform: translateY(-2px);
}

.rmt-dash-card--shared {
  border-color: rgba(124, 58, 237, 0.18);
}

/* List row hover */
.rmt-table-row {
  transition: background-color 0.12s ease;
}

.rmt-table-row:hover {
  background-color: rgba(79, 70, 229, 0.03);
}

/* Muted text */
.rmt-muted-subtle {
  color: #6b7280;
}

/* Custom circular checkbox */
.rmt-item-check {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rmt-item-check:hover {
  border-color: #4f46e5;
}

.rmt-item-check:checked {
  background: #4f46e5;
  border-color: #4f46e5;
}

.rmt-item-check:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}

.rmt-item-check:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.rmt-remember-check {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.3rem;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rmt-remember-check:hover {
  border-color: #4f46e5;
}

.rmt-remember-check:checked {
  background: #4f46e5;
  border-color: #4f46e5;
}

.rmt-remember-check:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}

.rmt-remember-check:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Item text */
.rmt-item-text {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  border-radius: 0.375rem;
  padding: 0.125rem 0.375rem;
  margin: -0.125rem -0.375rem;
  cursor: text;
  transition: color 0.15s ease, background-color 0.12s ease;
}

.rmt-item-text:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

.rmt-item-text:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 1px;
}

.rmt-item-text-input {
  display: block;
  width: 100%;
  min-width: 0;
  resize: vertical;
  min-height: 1.75rem;
  max-height: 8rem;
  padding: 0.375rem 0.5rem;
  border: 1.5px solid #4f46e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #0f1117;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.rmt-item-text-input[hidden] {
  display: none !important;
}

.rmt-item-row.is-editing .rmt-item-text {
  display: none;
}

.rmt-item-row.is-editing .rmt-item-text-input {
  display: block;
}

.rmt-item-row.is-done .rmt-item-text {
  text-decoration: line-through;
  color: #7a9a86;
}

.rmt-item-row.is-duplicate {
  background: #fffbeb;
}

.rmt-item-row.is-duplicate .rmt-item-text {
  color: #b45309;
}

.rmt-item-row.is-duplicate.is-done .rmt-item-text {
  color: #d97706;
}

.rmt-item-row.is-done .rmt-item-check {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.rmt-item-row.is-done .rmt-item-check::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%2316a34a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.rmt-card-menu {
  position: relative;
}

.rmt-card-menu-btn {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rmt-card-menu-btn:hover,
.rmt-card-menu-btn[aria-expanded="true"] {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

.rmt-card-menu-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.rmt-card-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  min-width: 10.5rem;
  padding: 0.375rem;
  border: 1px solid #e4e7ef;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 12, 40, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.rmt-card-menu-panel[hidden] {
  display: none !important;
}

.rmt-card-menu-item {
  display: block;
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  color: #0f1117;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.rmt-card-menu-item:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}

.rmt-card-menu-item--danger {
  color: #dc2626;
}

.rmt-card-menu-item--danger:hover {
  background: #fff1f2;
  color: #b91c1c;
}

/* Notifications */
header[role="banner"] {
  overflow: visible;
}

#rmt-notif-wrap {
  position: relative;
  z-index: 51;
}

.rmt-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
}

.rmt-notif-panel {
  position: fixed;
  z-index: 100;
  top: calc(3.75rem + env(safe-area-inset-top, 0px) + 0.5rem);
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: max(1rem, env(safe-area-inset-left, 0px));
  width: auto;
  max-width: 22rem;
  margin-left: auto;
  max-height: calc(100dvh - 5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #e4e7ef;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 17, 23, 0.12);
}

@media (min-width: 640px) {
  .rmt-notif-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
    width: 20rem;
    max-width: min(20rem, calc(100vw - 2rem));
    margin-left: 0;
    max-height: min(24rem, calc(100dvh - 6rem));
  }
}

.rmt-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e4e7ef;
  flex-shrink: 0;
}

.rmt-notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rmt-notif-enable,
.rmt-notif-clear {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #4f46e5;
  cursor: pointer;
  white-space: nowrap;
}

.rmt-notif-enable:hover,
.rmt-notif-clear:hover {
  text-decoration: underline;
}

.rmt-notif-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rmt-notif-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}

.rmt-notif-item:hover {
  background: rgba(79, 70, 229, 0.05);
}

.rmt-notif-item.is-unread {
  background: rgba(79, 70, 229, 0.04);
}

.rmt-notif-item-msg {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rmt-notif-item-meta {
  font-size: 0.6875rem;
  color: #6b7280;
}

.rmt-notif-empty {
  padding: 1rem;
  font-size: 0.8125rem;
  color: #6b7280;
  text-align: center;
}

.rmt-notif-push-status {
  padding: 0.625rem 1rem;
  border-top: 1px solid #e4e7ef;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #6b7280;
  flex-shrink: 0;
}

.rmt-notif-push-status.is-ok {
  color: #059669;
}

.rmt-notif-push-status.is-warn {
  color: #b45309;
}

.rmt-notif-push-status.is-error {
  color: #dc2626;
}

.rmt-sync-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #6b7280;
}

.rmt-sync-status.is-saving,
.rmt-sync-status.is-pending {
  color: #b45309;
}

.rmt-sync-status.is-saved {
  color: #059669;
}

.rmt-sync-status.is-error {
  color: #dc2626;
}

html.rmt-dark .rmt-sync-status {
  color: #94a3b8;
}

html.rmt-dark .rmt-sync-status.is-saving,
html.rmt-dark .rmt-sync-status.is-pending {
  color: #fbbf24;
}

html.rmt-dark .rmt-sync-status.is-saved {
  color: #34d399;
}

html.rmt-dark .rmt-sync-status.is-error {
  color: #f87171;
}

.rmt-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #e4e7ef;
  background: rgba(255, 255, 255, 0.9);
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.rmt-fav-btn .rmt-fav-star-fill {
  display: none;
}

.rmt-fav-btn:hover {
  color: #d97706;
  border-color: #fcd34d;
  background: #fffbeb;
}

.rmt-fav-btn.is-active {
  color: #d97706;
  border-color: #fbbf24;
  background: #fffbeb;
}

.rmt-fav-btn.is-active .rmt-fav-star-outline {
  display: none;
}

.rmt-fav-btn.is-active .rmt-fav-star-fill {
  display: block;
}

html.rmt-dark .rmt-fav-btn {
  background: rgba(26, 29, 39, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}

html.rmt-dark .rmt-fav-btn:hover,
html.rmt-dark .rmt-fav-btn.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.14);
}

.rmt-item-search-wrap {
  background: #fafbfe;
}

.rmt-item-search {
  position: relative;
  display: flex;
  align-items: center;
}

.rmt-item-search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.rmt-item-search-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1.5px solid #e4e7ef;
  background: #ffffff;
  padding: 0.55rem 4.25rem 0.55rem 2.35rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f1117;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rmt-item-search-input::placeholder {
  color: #9ba3b8;
  font-weight: 400;
}

.rmt-item-search-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.rmt-item-search-clear {
  position: absolute;
  right: 0.65rem;
  border: 0;
  background: transparent;
  padding: 0.2rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #4f46e5;
  cursor: pointer;
}

.rmt-item-search-clear:hover {
  text-decoration: underline;
}

.rmt-item-search-empty {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
  text-align: center;
}

.rmt-item-row.is-search-hidden {
  display: none !important;
}

html.rmt-dark .rmt-item-search-wrap {
  background: rgba(15, 17, 23, 0.35);
}

html.rmt-dark .rmt-item-search-input {
  background: #1a1d27;
  border-color: rgba(148, 163, 184, 0.22);
  color: #e5e7eb;
}

html.rmt-dark .rmt-item-search-icon {
  color: #94a3b8;
}

html.rmt-dark .rmt-item-search-clear {
  color: #a5b4fc;
}

html.rmt-dark .rmt-item-search-empty {
  color: #94a3b8;
}

/* Delete button - always visible, red */
.rmt-delete-btn {
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-flex !important;
  color: #dc2626 !important;
  border-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rmt-delete-btn:hover {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #b91c1c !important;
}

.rmt-delete-btn:active {
  background: #ffe4e6 !important;
}

/* Global focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Stat cards (index page) */
.rmt-stat-card {
  background: #ffffff;
  border: 1px solid #e4e7ef;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

/* Smooth theme transitions */
html, body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Dark mode ──────────────────────────────────────────── */

html.rmt-dark {
  color-scheme: dark;
}

html.rmt-dark body {
  background: linear-gradient(150deg, #0c0b18 0%, #120f21 50%, #0a0916 100%) fixed !important;
  color: #f1f5f9;
}

html.rmt-dark .rmt-hero-glow {
  opacity: 0.38;
}

html.rmt-dark .glass {
  background: rgba(14, 12, 26, 0.90) !important;
  border-bottom-color: rgba(79, 70, 229, 0.14) !important;
}

html.rmt-dark .rmt-muted-subtle {
  color: rgba(241, 245, 249, 0.48) !important;
}

html.rmt-dark .border-line {
  border-color: rgba(79, 70, 229, 0.14) !important;
}

html.rmt-dark .divide-line > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(79, 70, 229, 0.10);
}

html.rmt-dark .bg-white {
  background-color: rgba(20, 18, 36, 0.97) !important;
}

html.rmt-dark .bg-soft\/80,
html.rmt-dark .bg-soft {
  background-color: rgba(79, 70, 229, 0.08) !important;
}

html.rmt-dark .text-ink {
  color: #f1f5f9 !important;
}

html.rmt-dark .text-slate-500 {
  color: rgba(241, 245, 249, 0.42) !important;
}

html.rmt-dark .rmt-field {
  background: rgba(14, 12, 26, 0.90);
  border-color: rgba(79, 70, 229, 0.22);
  color: #f1f5f9;
}

html.rmt-dark .rmt-field::placeholder {
  color: rgba(241, 245, 249, 0.28);
}

html.rmt-dark .rmt-item-check {
  background: rgba(20, 18, 36, 0.90);
  border-color: rgba(255, 255, 255, 0.18);
}

html.rmt-dark .rmt-item-check:hover {
  border-color: #6366f1;
}

html.rmt-dark .rmt-remember-check {
  background: rgba(20, 18, 36, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
}

html.rmt-dark .rmt-remember-check:hover {
  border-color: #6366f1;
}

html.rmt-dark .rmt-remember-check:checked {
  background: #4f46e5;
  border-color: #4f46e5;
}

html.rmt-dark .rmt-item-check:checked {
  background: #4f46e5;
  border-color: #4f46e5;
}

html.rmt-dark .rmt-item-row.is-done .rmt-item-check {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(74, 222, 128, 0.35);
}

html.rmt-dark .rmt-item-row.is-done .rmt-item-check::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%234ade80' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

html.rmt-dark .rmt-item-row.is-done .rmt-item-text {
  color: rgba(134, 239, 172, 0.45);
}

html.rmt-dark .rmt-item-row.is-duplicate {
  background: rgba(245, 158, 11, 0.14);
}

html.rmt-dark .rmt-item-row.is-duplicate .rmt-item-text {
  color: #fbbf24;
}

html.rmt-dark .rmt-item-row.is-duplicate.is-done .rmt-item-text {
  color: #f59e0b;
}

html.rmt-dark .rmt-item-text:hover {
  background-color: rgba(79, 70, 229, 0.12);
}

html.rmt-dark .rmt-item-text-input {
  background: rgba(20, 18, 36, 0.98);
  border-color: #6366f1;
  color: #f8fafc;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html.rmt-dark .rmt-delete-btn {
  color: #f87171 !important;
}

html.rmt-dark .rmt-delete-btn:hover {
  background: rgba(220, 38, 38, 0.15) !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
  color: #fca5a5 !important;
}

html.rmt-dark .rmt-table-row:hover {
  background-color: rgba(79, 70, 229, 0.07);
}

html.rmt-dark .rmt-dash-card:hover {
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.20);
}

html.rmt-dark .rmt-stat-card {
  background: rgba(20, 18, 36, 0.97);
  border-color: rgba(79, 70, 229, 0.14);
}

html.rmt-dark .bg-slate-200,
html.rmt-dark .bg-slate-100 {
  background-color: rgba(79, 70, 229, 0.12) !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── Modal / popup ──────────────────────────────────────── */

.rmt-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rmt-modal[hidden] {
  display: none !important;
}

.rmt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 23, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rmt-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  background: #ffffff;
  border: 1px solid #e4e7ef;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.06), 0 20px 40px rgba(15, 12, 40, 0.18);
  animation: rmt-modal-in 0.18s ease;
}

@keyframes rmt-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.rmt-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  margin-bottom: 0.875rem;
}

.rmt-modal-icon--alert {
  background: #fef2f2;
  color: #dc2626;
}

.rmt-modal-icon--confirm {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.rmt-modal-title {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f1117;
  letter-spacing: -0.02em;
}

.rmt-modal-message {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
}

.rmt-modal-field-wrap {
  margin: -0.5rem 0 1.25rem;
}

.rmt-modal-input {
  width: 100%;
  border: 1px solid #e4e7ef;
  border-radius: 0.625rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  color: #0f1117;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rmt-modal-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.rmt-modal-icon--prompt {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.rmt-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.rmt-modal-btn {
  border: none;
  border-radius: 0.625rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}

.rmt-modal-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.rmt-modal-btn--cancel {
  background: #f3f5fb;
  color: #6b7280;
  border: 1px solid #e4e7ef;
}

.rmt-modal-btn--cancel:hover {
  background: #e9ecf5;
  color: #0f1117;
}

.rmt-modal-btn--primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.rmt-modal-btn--primary:hover {
  filter: brightness(1.06);
}

.rmt-modal-btn--danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.rmt-modal-btn--danger:hover {
  filter: brightness(1.06);
}

html.rmt-dark .rmt-modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

html.rmt-dark .rmt-modal-dialog {
  background: rgba(20, 18, 36, 0.98);
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

html.rmt-dark .rmt-modal-title {
  color: #f1f5f9;
}

html.rmt-dark .rmt-modal-message {
  color: rgba(241, 245, 249, 0.55);
}

html.rmt-dark .rmt-modal-icon--alert {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

html.rmt-dark .rmt-modal-icon--confirm {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

html.rmt-dark .rmt-modal-icon--prompt {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

html.rmt-dark .rmt-modal-input {
  background: rgba(14, 12, 26, 0.9);
  border-color: rgba(79, 70, 229, 0.22);
  color: #f1f5f9;
}

html.rmt-dark .rmt-card-menu-btn {
  color: rgba(241, 245, 249, 0.55);
}

html.rmt-dark .rmt-card-menu-btn:hover,
html.rmt-dark .rmt-card-menu-btn[aria-expanded="true"] {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(79, 70, 229, 0.24);
  color: #a5b4fc;
}

html.rmt-dark .rmt-card-menu-panel {
  background: rgba(20, 18, 36, 0.98);
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html.rmt-dark .rmt-card-menu-item {
  color: #f1f5f9;
}

html.rmt-dark .rmt-card-menu-item:hover {
  background: rgba(79, 70, 229, 0.16);
  color: #a5b4fc;
}

html.rmt-dark .rmt-card-menu-item--danger {
  color: #f87171;
}

html.rmt-dark .rmt-card-menu-item--danger:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}

html.rmt-dark .rmt-notif-panel {
  background: #1a1d27;
  border-color: rgba(148, 163, 184, 0.18);
}

html.rmt-dark .rmt-notif-panel-head,
html.rmt-dark .rmt-notif-item {
  border-color: rgba(148, 163, 184, 0.12);
}

html.rmt-dark .rmt-notif-item:hover,
html.rmt-dark .rmt-notif-item.is-unread {
  background: rgba(79, 70, 229, 0.12);
}

html.rmt-dark .rmt-modal-btn--cancel {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.2);
  color: rgba(241, 245, 249, 0.7);
}

html.rmt-dark .rmt-modal-btn--cancel:hover {
  background: rgba(79, 70, 229, 0.16);
  color: #f1f5f9;
}

/* Share dialog */
.rmt-modal-body {
  margin-bottom: 1.25rem;
}

.rmt-share-form {
  display: flex;
  gap: 0.5rem;
}

.rmt-share-form .rmt-modal-input {
  flex: 1;
  min-width: 0;
}

.rmt-share-error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #dc2626;
}

.rmt-share-label {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

.rmt-share-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 12rem;
  overflow-y: auto;
}

.rmt-share-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid #e4e7ef;
}

.rmt-share-row:first-child {
  border-top: none;
}

.rmt-share-who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.rmt-share-name,
.rmt-share-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rmt-share-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f1117;
}

.rmt-share-email {
  font-size: 0.75rem;
  color: #6b7280;
}

.rmt-share-remove {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}

.rmt-share-add {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.625rem;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  cursor: pointer;
}

.rmt-share-add:hover {
  background: rgba(79, 70, 229, 0.18);
}

.rmt-share-add:disabled {
  opacity: 0.4;
  cursor: default;
}

.rmt-share-row[hidden] {
  display: none;
}

.rmt-share-remove:hover {
  background: #fef2f2;
  color: #dc2626;
}

.rmt-share-remove.is-confirming {
  width: auto;
  padding: 0 0.75rem;
  background: #dc2626;
  color: #ffffff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
}

.rmt-share-remove:disabled {
  opacity: 0.4;
  cursor: default;
}

.rmt-share-empty {
  font-size: 0.875rem;
  color: #6b7280;
}

html.rmt-dark .rmt-share-row {
  border-color: rgba(79, 70, 229, 0.14);
}

html.rmt-dark .rmt-share-name {
  color: #f1f5f9;
}

html.rmt-dark .rmt-share-label,
html.rmt-dark .rmt-share-email,
html.rmt-dark .rmt-share-empty {
  color: rgba(241, 245, 249, 0.55);
}

html.rmt-dark .rmt-share-remove {
  color: rgba(241, 245, 249, 0.45);
}

html.rmt-dark .rmt-share-remove:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}

html.rmt-dark .rmt-share-add {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

html.rmt-dark .rmt-share-add:hover {
  background: rgba(79, 70, 229, 0.3);
}

html.rmt-dark .rmt-share-remove.is-confirming {
  background: #dc2626;
  color: #ffffff;
}

html.rmt-dark .rmt-share-error {
  color: #fca5a5;
}

@media (prefers-reduced-motion: reduce) {
  .rmt-modal-dialog {
    animation: none;
  }
}

/* ── Dark mode: Tailwind utility colours used in the templates ── */

html.rmt-dark {
  background: #0c0b18; /* overscroll area */
}

html.rmt-dark .bg-white\/70,
html.rmt-dark .bg-white\/60 {
  background-color: rgba(20, 18, 36, 0.7) !important;
}

html.rmt-dark .bg-soft\/50 {
  background-color: rgba(79, 70, 229, 0.06) !important;
}

html.rmt-dark .text-muted {
  color: rgba(241, 245, 249, 0.6) !important;
}

html.rmt-dark .text-brand,
html.rmt-dark .hover\:text-brand:hover {
  color: #a5b4fc !important;
}

html.rmt-dark .text-brand\/70 {
  color: rgba(165, 180, 252, 0.75) !important;
}

html.rmt-dark .bg-emerald-100,
html.rmt-dark .bg-emerald-50\/60 {
  background-color: rgba(16, 185, 129, 0.12) !important;
}

html.rmt-dark .text-emerald-600,
html.rmt-dark .text-emerald-700 {
  color: #34d399 !important;
}

html.rmt-dark .bg-violet-100 {
  background-color: rgba(139, 92, 246, 0.16) !important;
}

html.rmt-dark .text-violet-600 {
  color: #c4b5fd !important;
}

html.rmt-dark .bg-rose-50 {
  background-color: rgba(244, 63, 94, 0.12) !important;
}

html.rmt-dark .border-rose-200 {
  border-color: rgba(244, 63, 94, 0.3) !important;
}

html.rmt-dark .text-rose-700,
html.rmt-dark .text-rose-500 {
  color: #fda4af !important;
}

html.rmt-dark .rmt-item-row.is-duplicate {
  background: rgba(245, 158, 11, 0.08);
}
