/*@3.REMC.1*/

/*@3.REMC.2*/
.rem-status {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  position: relative; overflow: hidden;
  margin-bottom: 1.1rem;
}
.rem-status::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px; background: var(--border-hover);
}
.rem-status[data-state="on"]::before { background: #34d399; }
.rem-status[data-state="partial"]::before { background: #fbbf24; }
.rem-status[data-state="off"]::before { background: var(--border-hover); }
.rem-status[data-state="blocked"]::before { background: #f87171; }

.rem-status-icon {
  flex: none; width: 38px; height: 38px; border-radius: var(--radius-pill);
  display: grid; place-items: center; font-size: 1rem;
  background: var(--bg-elevated); color: var(--text-secondary);
}
.rem-status[data-state="on"] .rem-status-icon { background: rgba(52,211,153,.14); color: #34d399; }
.rem-status[data-state="partial"] .rem-status-icon { background: rgba(251,191,36,.14); color: #fbbf24; }
.rem-status[data-state="blocked"] .rem-status-icon { background: rgba(248,113,113,.14); color: #f87171; }

.rem-status-body { flex: 1; min-width: 0; }
.rem-status-title {
  font-size: 0.86rem; font-weight: 800; color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.rem-status-note {
  font-size: 0.74rem; color: var(--text-muted); line-height: 1.65;
}
.rem-status-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.65rem; }

/*@3.REMC.3*/
.rem-master {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  background: var(--bg-elevated); margin-bottom: 1.1rem;
}
.rem-master-label { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); }
.rem-master-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

/*@3.REMC.4*/
:root { --rem-switch-off: #4b5563; }
[data-theme="light"] { --rem-switch-off: #cbd5e1; }
[data-theme="dim"]   { --rem-switch-off: #4b5563; }

.rem-switch {
  flex: none; position: relative; width: 42px; height: 24px; cursor: pointer;
  border: none; padding: 0; border-radius: var(--radius-pill);
  background: var(--rem-switch-off); transition: background 0.2s;
}
.rem-switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  /*@3.REMC.5*/
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
/*@3.REMC.6*/
.rem-switch[aria-checked="true"] { background: var(--st-accent, #a78bfa); }
[dir="rtl"] .rem-switch[aria-checked="true"]::after { transform: translateX(-18px); }
[dir="ltr"] .rem-switch[aria-checked="true"]::after { transform: translateX(18px); }
.rem-switch:disabled { opacity: 0.45; cursor: not-allowed; }
.rem-switch:focus-visible { outline: 2px solid var(--st-accent, #a78bfa); outline-offset: 2px; }

/*@3.REMC.7*/
.rem-help {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.85rem; margin-bottom: 0.7rem;
  border: 1px solid var(--st-warn, #f59e0b); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--st-warn, #f59e0b) 10%, transparent);
}
.rem-help[hidden] { display: none; }   /*@3.REMC.8*/
.rem-help-icon { flex: none; color: var(--st-warn, #f59e0b); font-size: 0.9rem; margin-top: 0.1rem; }
.rem-help-title { font-size: 0.78rem; font-weight: 800; color: var(--text-primary); }
.rem-help-body { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.6; margin-top: 0.2rem; }

/*@3.REMC.9*/
.rem-help-warn { border-inline-start-width: 3px; }
.rem-help-warn .rem-help-title { color: var(--st-warn, #f59e0b); }

/*@3.REMC.10*/
.rem-tshoot {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color, rgba(128,128,128,.25));
  border-radius: var(--radius-md);
  background: var(--bg-card, transparent);
  overflow: hidden;                      /*@3.REMC.11*/
}
.rem-tshoot-sum {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.8rem; cursor: pointer;
  font-size: 0.78rem; font-weight: 800; color: var(--text-primary);
  list-style: none;                      /*@3.REMC.12*/
}
.rem-tshoot-sum::-webkit-details-marker { display: none; }
.rem-tshoot-sum::marker { content: ''; }
.rem-tshoot-sum:hover { background: color-mix(in srgb, var(--st-accent, #a78bfa) 7%, transparent); }
.rem-tshoot-sum:focus-visible { outline: 2px solid var(--st-accent, #a78bfa); outline-offset: -2px; }
.rem-tshoot-icon { color: var(--st-accent, #a78bfa); font-size: 0.85rem; }
.rem-tshoot-hint {
  font-size: 0.66rem; font-weight: 600; color: var(--text-secondary);
  /*@3.REMC.13*/
  margin-inline-start: auto;
}
.rem-tshoot-caret { font-size: 0.7rem; color: var(--text-secondary); transition: transform .2s; }
.rem-tshoot[open] .rem-tshoot-caret { transform: rotate(180deg); }

.rem-tshoot-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border-color, rgba(128,128,128,.2));
}
/*@3.REMC.14*/
.rem-qa { border-bottom: 1px dashed var(--border-color, rgba(128,128,128,.2)); }
.rem-qa:last-child { border-bottom: 0; }
.rem-qa-q {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.1rem; cursor: pointer;
  font-size: 0.73rem; font-weight: 700; color: var(--text-primary);
  line-height: 1.55;
  list-style: none;
}
/*@3.REMC.15*/
.rem-qa-q::-webkit-details-marker { display: none; }
.rem-qa-q::marker { content: ''; }
.rem-qa-q:hover { color: var(--st-accent, #a78bfa); }
.rem-qa-q:focus-visible { outline: 2px solid var(--st-accent, #a78bfa); outline-offset: 2px; border-radius: 4px; }
/*@3.REMC.16*/
.rem-qa-q > span { flex: 1 1 auto; min-width: 0; }
.rem-qa-caret { flex: none; font-size: 0.65rem; color: var(--text-secondary); transition: transform .2s; }
.rem-qa[open] > .rem-qa-q { color: var(--st-accent, #a78bfa); }
.rem-qa[open] .rem-qa-caret { transform: rotate(180deg); }
.rem-qa-a { padding: 0 0 0.6rem; }

.rem-ts-p { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.75; margin: 0 0 0.35rem; }
.rem-ts-list {
  margin: 0; padding-inline-start: 1.15rem;
  font-size: 0.7rem; color: var(--text-secondary); line-height: 1.75;
}
.rem-ts-list li { margin-bottom: 0.3rem; }
.rem-ts-list li:last-child { margin-bottom: 0; }

/*@3.REMC.17*/
.rem-qa.is-yours {
  background: color-mix(in srgb, var(--st-warn, #f59e0b) 9%, transparent);
  border-inline-start: 3px solid var(--st-warn, #f59e0b);
  padding-inline: 0.55rem;
  border-radius: var(--radius-sm, 6px);
}
.rem-qa.is-yours > .rem-qa-q { color: var(--st-warn, #f59e0b); }

/*@3.REMC.18*/
.rem-chans, .rem-cards {
  display: grid; gap: 0.5rem; margin-bottom: 1.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/*@3.REMC.19*/
@media (max-width: 560px) {
  .rem-chans, .rem-cards { grid-template-columns: 1fr; }
}

.rem-chan, .rem-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.7rem 0.85rem; min-width: 0;
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-card);
}
.rem-chan-head, .rem-card-head {
  display: flex; align-items: center; gap: 0.55rem; min-width: 0;
}
.rem-chan-icon {
  flex: none; width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 0.8rem;
  background: var(--bg-elevated); color: var(--text-secondary);
}
.rem-chan-name {
  flex: 1; min-width: 0; font-size: 0.8rem; font-weight: 700;
  color: var(--text-primary);
}
.rem-card-hint { font-size: 0.66rem; color: var(--text-muted); line-height: 1.5; }
.rem-chan-lead {
  display: flex; align-items: center; gap: 0.35rem;
  flex-wrap: wrap;   /*@3.REMC.20*/
}
.rem-chan-lead label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; margin: 0; }
.rem-lead-select {
  height: 28px; padding: 0 0.45rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary);
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
}

/*@3.REMC.21*/
.rem-lead-custom { display: inline-flex; align-items: center; gap: 0.3rem; }
/*@3.REMC.22*/
.rem-lead-custom[hidden] { display: none; }
.rem-lead-pre { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.rem-lead-num {
  width: 62px; height: 28px; padding: 0 0.4rem; text-align: center;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary);
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
}
.rem-lead-unit {
  height: 28px; padding: 0 0.4rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary);
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
}
.rem-lead-num:focus-visible, .rem-lead-unit:focus-visible, .rem-lead-select:focus-visible {
  outline: 2px solid var(--st-accent, #a78bfa); outline-offset: 1px;
}
.rem-lead-hint {
  flex-basis: 100%; font-size: 0.66rem; color: var(--text-muted); margin-top: 0.15rem;
}
.rem-chan[data-off="1"] { opacity: 0.55; }

/*@3.REMC.23*/
.rem-row {
  display: flex; align-items: center; gap: 0.4rem;
  /*@3.REMC.24*/
  flex-wrap: nowrap; min-width: 0;
}
.rem-time {
  height: 32px; padding: 0 0.35rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary);
  font-family: inherit; font-size: 0.75rem;
}
/*@3.REMC.25*/
.rem-row .rem-time { flex: 1 1 0; min-width: 0; }
.rem-row .rem-sep { flex: none; }
.rem-sep { font-size: 0.75rem; color: var(--text-muted); }

/*@3.REMC.26*/
.rem-snooze-opts { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.rem-snooze-chip {
  padding: 0.3rem 0.65rem; cursor: pointer;
  border: 1px solid var(--border-color); border-radius: var(--radius-pill);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rem-snooze-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
/*@3.REMC.27*/
.rem-snooze-chip[aria-pressed="true"] {
  background: var(--st-accent, #a78bfa); border-color: var(--st-accent, #a78bfa); color: #fff;
}

/*@3.REMC.28*/
.rem-up-wrap {
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-card); margin-bottom: 0.8rem;
}
.rem-up-summary {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.65rem 0.85rem; list-style: none;
  font-size: 0.78rem; font-weight: 700; color: var(--text-primary);
}
.rem-up-summary::-webkit-details-marker { display: none; }  /*@3.REMC.29*/
.rem-up-summary:focus-visible { outline: 2px solid var(--st-accent, #a78bfa); outline-offset: -2px; }
.rem-up-count {
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg-elevated); border-radius: var(--radius-pill);
  padding: 0.1rem 0.45rem;
}
.rem-up-caret {
  margin-inline-start: auto; font-size: 0.7rem; color: var(--text-muted);
  transition: transform 0.2s;
}
.rem-up-wrap[open] .rem-up-caret { transform: rotate(180deg); }
.rem-up { display: grid; gap: 0.4rem; padding: 0 0.85rem 0.85rem; }
.rem-up-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-card);
}
.rem-up-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: #a78bfa;
}
.rem-up-item[data-kind="exams"] .rem-up-dot { background: #f87171; }
.rem-up-item[data-kind="tasks"] .rem-up-dot { background: #fbbf24; }
.rem-up-item[data-kind="notes"] .rem-up-dot { background: #38bdf8; }
.rem-up-item[data-kind="review"] .rem-up-dot { background: #34d399; }
.rem-up-main { flex: 1; min-width: 0; }
.rem-up-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rem-up-when { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.12rem; }
.rem-up-snoozed {
  flex: none; font-size: 0.65rem; font-weight: 800; color: #fbbf24;
  background: rgba(251,191,36,.12); padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}
.rem-up-empty {
  font-size: 0.75rem; color: var(--text-muted);
  padding: 0.9rem; text-align: center;
  border: 1px dashed var(--border-color); border-radius: var(--radius-md);
}
/*@3.REMC.30*/
.rem-up-preview {
  font-size: 0.7rem; color: var(--text-muted);
  padding: 0.45rem 0.6rem; margin-bottom: 0.5rem;
  border-inline-start: 3px solid var(--border-color);
  background: var(--bg-hover, rgba(127,127,127,.06));
  border-radius: var(--radius-sm, 6px);
}

/*@3.REMC.31*/
.rem-toast {
  position: fixed; bottom: 1.5rem; inset-inline-start: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 3001;
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  box-shadow: 0 8px 24px var(--shadow-base);
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
[dir="ltr"] .rem-toast { padding: 0.55rem 1.1rem 0.55rem 0.7rem; }
.rem-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rem-toast-text {
  font-size: 0.82rem; font-weight: 700; color: var(--text-primary); white-space: nowrap;
}
.rem-toast-btn {
  font-family: inherit; font-size: 0.78rem; font-weight: 800; cursor: pointer;
  border: none; border-radius: var(--radius-pill); padding: 0.35rem 0.85rem;
  background: #a78bfa; color: #fff; white-space: nowrap;
}
.rem-toast-btn:hover { background: #9167f5; }
.rem-toast-close {
  font-family: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer;
  border: none; background: none; color: var(--text-muted); padding: 0.25rem;
}
.rem-toast-close:hover { color: var(--text-primary); }

/*@3.REMC.32*/
@media (max-width: 768px) {
  .rem-toast { bottom: calc(56px + 1rem); max-width: calc(100vw - 2rem); }
  .rem-toast-text { white-space: normal; }
  .rem-chan { flex-wrap: wrap; }
  .rem-status { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .rem-toast { transition: none; transform: translateX(-50%); }
  .rem-toast.show { transform: translateX(-50%); }
  .rem-switch, .rem-switch::after { transition: none; }
}
